18 classVariableNames:'CurrentProject SystemProject NextSequential AllProjects' |
18 classVariableNames:'CurrentProject SystemProject NextSequential AllProjects' |
19 poolDictionaries:'' |
19 poolDictionaries:'' |
20 category:'System-Support' |
20 category:'System-Support' |
21 ! |
21 ! |
22 |
22 |
|
23 Object subclass:#MethodInfo |
|
24 instanceVariableNames:'methodName className fileName' |
|
25 classVariableNames:'' |
|
26 poolDictionaries:'' |
|
27 privateIn:Project |
|
28 ! |
|
29 |
23 Object subclass:#ClassInfo |
30 Object subclass:#ClassInfo |
24 instanceVariableNames:'conditionForInclusion className classFileName' |
31 instanceVariableNames:'conditionForInclusion className classFileName' |
25 classVariableNames:'' |
32 classVariableNames:'' |
26 poolDictionaries:'' |
33 poolDictionaries:'' |
27 privateIn:Project |
34 privateIn:Project |
87 |
94 |
88 initKnownProjects |
95 initKnownProjects |
89 "this is a temporary experimental kludge - |
96 "this is a temporary experimental kludge - |
90 once the ProjectBrowser is finished, this info is read from |
97 once the ProjectBrowser is finished, this info is read from |
91 '.prj' files ..." |
98 '.prj' files ..." |
|
99 |
|
100 "/ collect project info while scanning all classes |
|
101 "/ and methods ... |
|
102 |
|
103 |packages| |
|
104 |
|
105 packages := IdentitySet new. |
|
106 |
|
107 AllProjects isNil ifTrue:[ |
|
108 AllProjects := OrderedCollection new. |
|
109 ] ifFalse:[ |
|
110 AllProjects do:[:p | packages add:p packageName asSymbol]. |
|
111 ]. |
|
112 Smalltalk allClassesDo:[:aClass | |
|
113 |packageID prj classFilename pkgInfo revInfo |
|
114 repositoryPath dir module lib| |
|
115 |
|
116 aClass isMeta ifFalse:[ |
|
117 (aClass isNamespace not or:[aClass == Smalltalk]) ifTrue:[ |
|
118 packageID := aClass package asSymbol. |
|
119 (packages includes:packageID) ifFalse:[ |
|
120 packages add:packageID. |
|
121 |
|
122 "/ a new one ... |
|
123 |
|
124 prj := self new. |
|
125 prj packageName:packageID. |
|
126 prj directory:'???'. |
|
127 prj repositoryModule:'unknown'. |
|
128 prj repositoryDirectory:'unknown'. |
|
129 |
|
130 pkgInfo := aClass packageSourceCodeInfo. |
|
131 pkgInfo notNil ifTrue:[ |
|
132 dir := pkgInfo at:#directory ifAbsent:nil. |
|
133 dir notNil ifTrue:[ |
|
134 prj directory:dir |
|
135 ]. |
|
136 module := pkgInfo at:#directory ifAbsent:nil. |
|
137 module notNil ifTrue:[ |
|
138 prj repositoryModule:module |
|
139 ]. |
|
140 lib := pkgInfo at:#library ifAbsent:nil. |
|
141 lib notNil ifTrue:[ |
|
142 prj type:#library. |
|
143 ]. |
|
144 prj name:module. |
|
145 ]. |
|
146 AllProjects add:prj. |
|
147 ]. |
|
148 ]. |
|
149 ]. |
|
150 ]. |
|
151 Method allSubInstancesDo:[:aMethod | |
|
152 |packageID prj who mthdClass| |
|
153 |
|
154 packageID := aMethod package asSymbol. |
|
155 who := aMethod who. |
|
156 who notNil ifTrue:[ "/ skip unbound methods ... |
|
157 mthdClass := who methodClass. |
|
158 mthdClass package ~= packageID ifTrue:[ |
|
159 (packages includes:packageID) ifFalse:[ |
|
160 packages add:packageID. |
|
161 |
|
162 "/ a new one ... |
|
163 prj := self new. |
|
164 "/ prj name:libName. |
|
165 prj package:packageID. |
|
166 prj type:#library. |
|
167 prj directory:'???'. |
|
168 prj repositoryModule:'stx'. |
|
169 prj repositoryDirectory:'???'. |
|
170 AllProjects add:prj. |
|
171 ]. |
|
172 ] |
|
173 ] |
|
174 ]. |
|
175 self changed:#allProjects |
92 |
176 |
93 "/ |stx p| |
177 "/ |stx p| |
94 "/ |
178 "/ |
95 "/ stx := self new name:'stx'. |
179 "/ stx := self new name:'stx'. |
96 "/ stx packageName:'noPackage'. |
180 "/ stx packageName:'noPackage'. |
486 |
571 |
487 ^ overwrittenMethods |
572 ^ overwrittenMethods |
488 |
573 |
489 "Created: 27.1.1997 / 11:57:21 / cg" |
574 "Created: 27.1.1997 / 11:57:21 / cg" |
490 "Modified: 27.1.1997 / 12:09:14 / cg" |
575 "Modified: 27.1.1997 / 12:09:14 / cg" |
|
576 ! |
|
577 |
|
578 package |
|
579 "return the projects package identifier. |
|
580 This identifier marks all methods and new classes which were created |
|
581 in this project." |
|
582 |
|
583 ^ packageName |
|
584 |
|
585 "Modified: 27.1.1997 / 12:10:00 / cg" |
491 ! |
586 ! |
492 |
587 |
493 packageName |
588 packageName |
494 "return the projects package identifier. |
589 "return the projects package identifier. |
495 This identifier marks all methods and new classes which were created |
590 This identifier marks all methods and new classes which were created |
1524 ] ifFalse:[ |
1619 ] ifFalse:[ |
1525 infoCollection add:newInfo |
1620 infoCollection add:newInfo |
1526 ] |
1621 ] |
1527 ! |
1622 ! |
1528 |
1623 |
|
1624 addMethod:methodOrSelector inClass:aClassOrClassName fileName:fileName |
|
1625 "add an individual method to the project" |
|
1626 |
|
1627 |i| |
|
1628 |
|
1629 i := MethodInfo new. |
|
1630 i methodName:methodOrSelector. |
|
1631 i className:aClassOrClassName. |
|
1632 i fileName:fileName. |
|
1633 self addMethodInfo:i |
|
1634 ! |
|
1635 |
1529 classInfo:aClassInfoCollection |
1636 classInfo:aClassInfoCollection |
1530 "set the class info of the project" |
1637 "set the class info of the project" |
1531 |
1638 |
1532 self propertyAt:#classInfo put:aClassInfoCollection |
1639 self propertyAt:#classInfo put:aClassInfoCollection |
1533 |
1640 |
1839 |
1946 |
1840 "Modified: 3.5.1996 / 23:59:10 / stefan" |
1947 "Modified: 3.5.1996 / 23:59:10 / stefan" |
1841 "Modified: 14.2.1997 / 15:38:47 / cg" |
1948 "Modified: 14.2.1997 / 15:38:47 / cg" |
1842 ! ! |
1949 ! ! |
1843 |
1950 |
|
1951 !Project::MethodInfo methodsFor:'accessing'! |
|
1952 |
|
1953 className |
|
1954 "return the value of the instance variable 'className' (automatically generated)" |
|
1955 |
|
1956 ^ className! |
|
1957 |
|
1958 className:something |
|
1959 "set the value of the instance variable 'className' (automatically generated)" |
|
1960 |
|
1961 className := something.! |
|
1962 |
|
1963 fileName |
|
1964 "return the value of the instance variable 'fileName' (automatically generated)" |
|
1965 |
|
1966 ^ fileName! |
|
1967 |
|
1968 fileName:something |
|
1969 "set the value of the instance variable 'fileName' (automatically generated)" |
|
1970 |
|
1971 fileName := something.! |
|
1972 |
|
1973 methodName |
|
1974 "return the value of the instance variable 'methodName' (automatically generated)" |
|
1975 |
|
1976 ^ methodName! |
|
1977 |
|
1978 methodName:something |
|
1979 "set the value of the instance variable 'methodName' (automatically generated)" |
|
1980 |
|
1981 methodName := something.! ! |
|
1982 |
1844 !Project::ClassInfo methodsFor:'accessing'! |
1983 !Project::ClassInfo methodsFor:'accessing'! |
1845 |
1984 |
1846 classFileName |
1985 classFileName |
1847 "return the value of the instance variable 'classFileName' (automatically generated)" |
1986 "return the value of the instance variable 'classFileName' (automatically generated)" |
1848 |
1987 |