author | Claus Gittinger <cg@exept.de> |
Thu, 02 Sep 1999 23:44:11 +0200 | |
changeset 4670 | 21eec331e1e9 |
parent 4668 | a4e061d91251 |
child 4685 | d145298696b7 |
permissions | -rw-r--r-- |
89 | 1 |
" |
236 | 2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
203 | 3 |
All Rights Reserved |
89 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
1 | 12 |
|
13 |
Object subclass:#Project |
|
939
ffee570b0f09
added #setProject: (does not send change notifications)
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
14 |
instanceVariableNames:'name changeSet views directoryName properties packageName |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
15 |
repositoryDirectory repositoryModule defaultNameSpace |
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
16 |
overwrittenMethods subProjects prerequisites bitmapFiles |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
17 |
documentFiles otherFiles' |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
18 |
classVariableNames:'CurrentProject SystemProject NextSequential AllProjects' |
939
ffee570b0f09
added #setProject: (does not send change notifications)
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
19 |
poolDictionaries:'' |
ffee570b0f09
added #setProject: (does not send change notifications)
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
20 |
category:'System-Support' |
1 | 21 |
! |
22 |
||
4668 | 23 |
Object subclass:#MethodInfo |
24 |
instanceVariableNames:'methodName className fileName' |
|
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
27 |
privateIn:Project |
|
28 |
! |
|
29 |
||
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
30 |
Object subclass:#ClassInfo |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
31 |
instanceVariableNames:'conditionForInclusion className classFileName' |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
32 |
classVariableNames:'' |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
33 |
poolDictionaries:'' |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
34 |
privateIn:Project |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
35 |
! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
36 |
|
1854
b44227fd2b3d
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
37 |
!Project class methodsFor:'documentation'! |
89 | 38 |
|
39 |
copyright |
|
40 |
" |
|
41 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
203 | 42 |
All Rights Reserved |
89 | 43 |
|
44 |
This software is furnished under a license and may be used |
|
45 |
only in accordance with the terms of that license and with the |
|
46 |
inclusion of the above copyright notice. This software may not |
|
47 |
be provided or otherwise made available to, or used by, any |
|
48 |
other person. No title to or ownership of the software is |
|
49 |
hereby transferred. |
|
50 |
" |
|
51 |
! |
|
52 |
||
53 |
documentation |
|
54 |
" |
|
338 | 55 |
this class is still under construction (especially the build features are unfinished). |
235 | 56 |
Currently, all it does is keep track of per-project views |
57 |
(to hide or show them), define the directory when filing-out, |
|
725
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
58 |
and define packageNames for new classes and methods. |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
59 |
|
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
60 |
instance variables: |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
61 |
name <String> the name of this project, as shown |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
62 |
in a ProjectView |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
63 |
|
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
64 |
changeSet <ChangeSet> changes done, while this was the active project |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
65 |
|
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
66 |
views <Collection> views opened while this was the active project |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
67 |
|
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
68 |
directoryName <String> directory name, where fileOuts are done |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
69 |
|
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
70 |
properties |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
71 |
|
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
72 |
packageName <String> given to classes/methods which are created while |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
73 |
this is the active project |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
74 |
|
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
75 |
repositoryDirectory (default) name of the repository, when a new source containers are |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
76 |
created. |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
77 |
|
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
78 |
repositoryModule (default) name of the module, when new source containers are |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
79 |
created. |
235 | 80 |
|
81 |
Future: |
|
725
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
82 |
- keep track of per-project changes |
4069 | 83 |
- allow speficiation of the type of the project (application or library) |
725
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
84 |
- allow building of whatever the target (as defined by the type) is |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
85 |
(this will allow build of class libs and apps by clicking a button) |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
86 |
- allow removal of project specific classes, methods etc. |
1286 | 87 |
|
88 |
[author:] |
|
89 |
Claus Gittinger |
|
89 | 90 |
" |
91 |
! ! |
|
92 |
||
1854
b44227fd2b3d
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
93 |
!Project class methodsFor:'initialization'! |
236 | 94 |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
95 |
initKnownProjects |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
96 |
"this is a temporary experimental kludge - |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
97 |
once the ProjectBrowser is finished, this info is read from |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
98 |
'.prj' files ..." |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
99 |
|
4668 | 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 |
|
176 |
||
4066 | 177 |
"/ |stx p| |
178 |
"/ |
|
179 |
"/ stx := self new name:'stx'. |
|
180 |
"/ stx packageName:'noPackage'. |
|
181 |
"/ stx changeSet:nil. |
|
182 |
"/ stx type:#smalltalk. |
|
183 |
"/ stx comment:'The ST/X project itself'. |
|
184 |
"/ |
|
185 |
"/ AllProjects add:stx. |
|
186 |
"/ |
|
187 |
"/ #( |
|
188 |
"/ ('libbasic' #'stx:libbasic' 'Basic (non-GUI) classes. Required for all applications') |
|
189 |
"/ ('libbasic2' #'stx:libbasic2' 'More basic (non-GUI) classes. Required for most applications') |
|
190 |
"/ ('libbasic3' #'stx:libbasic3' 'More basic (non-GUI) classes. Required for development') |
|
191 |
"/ ('libcomp' #'stx:libcomp' 'The bytecode compiler. Required for all applications') |
|
192 |
"/ ('libview' #'stx:libview' 'Low level GUI classes. Required for all GUI applications') |
|
193 |
"/ ('libview2' #'stx:libview2' 'Additional low level GUI classes. Required for most GUI applications') |
|
194 |
"/ ('libwidg' #'stx:libwidg' 'Basic widgets. Required for all GUI applications') |
|
195 |
"/ ('libwidg2' #'stx:libwidg2' 'More widgets. Required for most GUI applications') |
|
196 |
"/ ('libwidg3' #'stx:libwidg3' 'More (fun) widgets. Seldom required') |
|
197 |
"/ ('libtool' #'stx:libtool' 'Development applications. Required for program development') |
|
198 |
"/ ('libtool2' #'stx:libtool2' 'More development applications. Required for GUI development') |
|
199 |
"/ ('libui' #'stx:libui' 'UI spec classes. Required for UIPainter applications') |
|
200 |
"/ ('libhtml' #'stx:libhtml' 'HTML related classes. Required for Web applications and the HTML browser') |
|
201 |
"/ ('libodbc' #'stx:libodbc' 'ODBC interface classes.') |
|
202 |
"/ ('libopengl' #'stx:libopengl' 'OpenGL interface classes.') |
|
203 |
"/ ('persistency' #'stx:goodies/persistency' 'Simple DB interface') |
|
204 |
"/ ('goodies' #'stx:goodies' 'Misc goodies - not really maintained') |
|
205 |
"/ ) do:[:entry | |
|
206 |
"/ |libName package comment| |
|
207 |
"/ |
|
208 |
"/ libName := entry at:1. |
|
209 |
"/ package := entry at:2. |
|
210 |
"/ comment := entry at:3. |
|
211 |
"/ |
|
212 |
"/ p := self new name:libName. |
|
213 |
"/ p packageName:package. |
|
214 |
"/ p type:#library. |
|
215 |
"/ p comment:comment. |
|
216 |
"/ stx addSubProject:p. |
|
217 |
"/ ]. |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
218 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
219 |
" |
4668 | 220 |
AllProjects := nil. |
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
221 |
self initKnownProjects |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
222 |
" |
4069 | 223 |
|
224 |
"Modified: / 23.3.1999 / 14:20:12 / cg" |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
225 |
! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
226 |
|
236 | 227 |
initialize |
338 | 228 |
SystemProject isNil ifTrue:[ |
2028 | 229 |
NextSequential := 1. |
230 |
SystemProject := self new name:'default'. |
|
231 |
SystemProject packageName:'private'. |
|
232 |
SystemProject defaultNameSpace:Smalltalk. |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
233 |
SystemProject comment:'A default (dummy) project. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
234 |
Will be made the current project in case no real project is ever activated.'. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
235 |
|
2028 | 236 |
" |
237 |
the SystemProject does not keep a record if changes, |
|
238 |
but instead depends on the changes file - recording anything there. |
|
239 |
" |
|
240 |
SystemProject changeSet:nil. |
|
338 | 241 |
]. |
242 |
||
243 |
CurrentProject := SystemProject. |
|
4066 | 244 |
AllProjects := OrderedCollection new. |
245 |
"/ AllProjects := OrderedCollection with:SystemProject. |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
246 |
self initKnownProjects. |
236 | 247 |
|
315 | 248 |
" |
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
249 |
SystemProject := nil. |
315 | 250 |
Project initialize |
251 |
" |
|
236 | 252 |
! ! |
253 |
||
1854
b44227fd2b3d
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
254 |
!Project class methodsFor:'instance creation'! |
236 | 255 |
|
256 |
new |
|
257 |
^ self basicNew initialize |
|
258 |
! ! |
|
259 |
||
1854
b44227fd2b3d
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
260 |
!Project class methodsFor:'accessing'! |
1 | 261 |
|
4071 | 262 |
addKnownProject:aProject |
263 |
AllProjects size == 0 ifTrue:[ |
|
264 |
AllProjects := OrderedCollection new. |
|
265 |
]. |
|
266 |
AllProjects add:aProject. |
|
267 |
self changed:#allProjects |
|
268 |
! |
|
269 |
||
1 | 270 |
current |
10 | 271 |
"return the currently active project" |
272 |
||
1 | 273 |
^ CurrentProject |
274 |
||
362 | 275 |
" |
276 |
Project current |
|
277 |
" |
|
1 | 278 |
! |
279 |
||
280 |
current:aProject |
|
10 | 281 |
"set the currently active project" |
282 |
||
315 | 283 |
CurrentProject := aProject. |
284 |
self changed:#currentProject |
|
334 | 285 |
! |
286 |
||
617 | 287 |
currentPackageName |
288 |
CurrentProject notNil ifTrue:[ |
|
4112
5ee841c34b10
return nil (instead of 'no package') if no current package is defined.
Claus Gittinger <cg@exept.de>
parents:
4099
diff
changeset
|
289 |
^ CurrentProject packageName |
617 | 290 |
]. |
4112
5ee841c34b10
return nil (instead of 'no package') if no current package is defined.
Claus Gittinger <cg@exept.de>
parents:
4099
diff
changeset
|
291 |
^ nil |
617 | 292 |
|
293 |
" |
|
294 |
Project currentPackageName |
|
295 |
" |
|
296 |
! |
|
297 |
||
336 | 298 |
defaultProject |
299 |
"return the SystemDefault project" |
|
300 |
||
301 |
^ SystemProject. |
|
302 |
! |
|
303 |
||
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
304 |
knownProjects |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
305 |
^ AllProjects ? #() |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
306 |
! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
307 |
|
334 | 308 |
setDefaultProject |
309 |
"set the currently active project to be the SystemDEfault project" |
|
310 |
||
311 |
self current:SystemProject. |
|
939
ffee570b0f09
added #setProject: (does not send change notifications)
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
312 |
! |
ffee570b0f09
added #setProject: (does not send change notifications)
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
313 |
|
ffee570b0f09
added #setProject: (does not send change notifications)
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
314 |
setProject:aProjectOrNil |
ffee570b0f09
added #setProject: (does not send change notifications)
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
315 |
"set the currently active project without updating others" |
ffee570b0f09
added #setProject: (does not send change notifications)
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
316 |
|
ffee570b0f09
added #setProject: (does not send change notifications)
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
317 |
CurrentProject := aProjectOrNil. |
ffee570b0f09
added #setProject: (does not send change notifications)
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
318 |
|
ffee570b0f09
added #setProject: (does not send change notifications)
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
319 |
"Created: 7.2.1996 / 14:00:45 / cg" |
ffee570b0f09
added #setProject: (does not send change notifications)
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
320 |
"Modified: 7.2.1996 / 14:01:16 / cg" |
1 | 321 |
! ! |
322 |
||
1854
b44227fd2b3d
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
323 |
!Project class methodsFor:'changes management'! |
149 | 324 |
|
664 | 325 |
addClassDefinitionChangeFor:aClass |
1115 | 326 |
"add a class-def-change for aClass to the current project" |
327 |
||
664 | 328 |
|p c| |
329 |
||
330 |
p := CurrentProject. |
|
331 |
(p notNil |
|
332 |
and:[(c := p changeSet) notNil]) ifTrue:[ |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
333 |
c addClassDefinitionChangeFor:aClass |
664 | 334 |
] |
335 |
||
336 |
"Created: 3.12.1995 / 13:44:58 / cg" |
|
337 |
"Modified: 3.12.1995 / 13:58:04 / cg" |
|
338 |
! |
|
339 |
||
617 | 340 |
addMethodCategoryChange:aMethod category:newCategory in:aClass |
1115 | 341 |
"add a method-category-change for aMethod in aClass to the current project" |
342 |
||
617 | 343 |
|p c| |
344 |
||
345 |
p := CurrentProject. |
|
346 |
(p notNil |
|
347 |
and:[(c := p changeSet) notNil]) ifTrue:[ |
|
348 |
c addMethodCategoryChange:aMethod category:newCategory in:aClass |
|
349 |
] |
|
350 |
! |
|
351 |
||
149 | 352 |
addMethodChange:aMethod in:aClass |
1115 | 353 |
"add a method change in aClass to the current project" |
149 | 354 |
|
235 | 355 |
|p c| |
149 | 356 |
|
357 |
p := CurrentProject. |
|
358 |
(p notNil |
|
235 | 359 |
and:[(c := p changeSet) notNil]) ifTrue:[ |
360 |
c addMethodChange:aMethod in:aClass |
|
203 | 361 |
] |
362 |
! |
|
363 |
||
617 | 364 |
addMethodPrivacyChange:aMethod in:aClass |
1115 | 365 |
"add a privacy change for aMethod in aClass to the current project" |
366 |
||
617 | 367 |
|p c| |
368 |
||
369 |
p := CurrentProject. |
|
370 |
(p notNil |
|
371 |
and:[(c := p changeSet) notNil]) ifTrue:[ |
|
372 |
c addMethodPrivacyChange:aMethod in:aClass |
|
373 |
] |
|
374 |
||
375 |
"Modified: 27.8.1995 / 22:48:17 / claus" |
|
376 |
! |
|
377 |
||
705 | 378 |
addPrimitiveDefinitionsChangeFor:aClass |
1115 | 379 |
"add a primitiveDef change for aClass to the current project" |
380 |
||
705 | 381 |
|p c| |
382 |
||
383 |
p := CurrentProject. |
|
384 |
(p notNil |
|
385 |
and:[(c := p changeSet) notNil]) ifTrue:[ |
|
386 |
c addPrimitiveDefinitionsChangeFor:aClass |
|
387 |
] |
|
388 |
! |
|
389 |
||
390 |
addPrimitiveFunctionsChangeFor:aClass |
|
1115 | 391 |
"add a primitiveFuncs change for aClass to the current project" |
392 |
||
705 | 393 |
|p c| |
394 |
||
395 |
p := CurrentProject. |
|
396 |
(p notNil |
|
397 |
and:[(c := p changeSet) notNil]) ifTrue:[ |
|
398 |
c addPrimitiveFunctionsChangeFor:aClass |
|
399 |
] |
|
400 |
! |
|
401 |
||
402 |
addPrimitiveVariablesChangeFor:aClass |
|
1115 | 403 |
"add a primitiveVars change for aClass to the current project" |
404 |
||
705 | 405 |
|p c| |
406 |
||
407 |
p := CurrentProject. |
|
408 |
(p notNil |
|
409 |
and:[(c := p changeSet) notNil]) ifTrue:[ |
|
410 |
c addPrimitiveVariablesChangeFor:aClass |
|
411 |
] |
|
412 |
! |
|
413 |
||
3288
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
414 |
addRemoveSelectorChange:aSelector in:aClass |
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
415 |
"add a method-remove change in aClass to the current project" |
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
416 |
|
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
417 |
|p c| |
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
418 |
|
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
419 |
p := CurrentProject. |
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
420 |
(p notNil |
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
421 |
and:[(c := p changeSet) notNil]) ifTrue:[ |
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
422 |
c addRemoveSelectorChange:aSelector in:aClass |
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
423 |
] |
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
424 |
|
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
425 |
"Created: / 16.2.1998 / 12:45:10 / cg" |
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
426 |
! |
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
2962
diff
changeset
|
427 |
|
149 | 428 |
currentProjectDirectory |
429 |
"return the name of the directory to use for fileOut. |
|
235 | 430 |
The returned name already includes a file-separator at the end, |
431 |
so the filename can be concatenated to it." |
|
149 | 432 |
|
433 |
|p dirName| |
|
434 |
||
435 |
p := CurrentProject. |
|
436 |
p notNil ifTrue:[ |
|
2907 | 437 |
dirName := p directory |
149 | 438 |
] ifFalse:[ |
2907 | 439 |
dirName := Filename currentDirectory name |
149 | 440 |
]. |
2962 | 441 |
^ dirName |
2907 | 442 |
|
443 |
"Modified: 7.9.1997 / 23:52:25 / cg" |
|
2334
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
444 |
! |
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
445 |
|
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
446 |
rememberOverwrittenMethod:newMethod from:oldMethod |
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
447 |
"remember a method (from another package) being overwritten. |
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
448 |
This is only remembered, if the current project is not the |
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
449 |
system project (to avoid filling this remembered-table)" |
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
450 |
|
2558 | 451 |
|p| |
2334
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
452 |
|
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
453 |
p := CurrentProject. |
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
454 |
(p notNil |
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
455 |
and:[p ~~ SystemProject]) ifTrue:[ |
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
456 |
p rememberOverwrittenMethod:newMethod from:oldMethod |
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
457 |
] ifFalse:[ |
3332
8014b817988b
remove the 'does not remember ...' message.
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
458 |
"/ 'Project [info]: DefaultProject does not remember overwritten methods' infoPrintCR |
2334
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
459 |
] |
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
460 |
|
3332
8014b817988b
remove the 'does not remember ...' message.
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
461 |
"Modified: / 7.3.1998 / 13:38:39 / cg" |
13 | 462 |
! ! |
463 |
||
1 | 464 |
!Project methodsFor:'accessing'! |
465 |
||
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
466 |
addSubProject:aProject |
4097 | 467 |
"add a subproject - obsolete; we use prerequisites now" |
468 |
||
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
469 |
subProjects isNil ifTrue:[ |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
470 |
subProjects := OrderedCollection new. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
471 |
]. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
472 |
subProjects add:aProject |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
473 |
! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
474 |
|
1 | 475 |
changeSet |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
476 |
"return the set of changes made in this project" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
477 |
|
1 | 478 |
^ changeSet |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
479 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
480 |
"Modified: 27.1.1997 / 11:58:36 / cg" |
1 | 481 |
! |
482 |
||
236 | 483 |
changeSet:aChangeSet |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
484 |
"set the set of changes made in this project - dangerous, you may loose |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
485 |
the actual changeSet." |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
486 |
|
236 | 487 |
changeSet := aChangeSet |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
488 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
489 |
"Modified: 27.1.1997 / 11:59:02 / cg" |
73 | 490 |
! |
491 |
||
2028 | 492 |
defaultNameSpace |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
493 |
"return the defaultNameSpace of this project. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
494 |
New classes will (if not specified by a directive) be installed |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
495 |
in this nameSpace. Useful, when filing in ST-80 code, to avoid |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
496 |
overwriting of standard classes." |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
497 |
|
2028 | 498 |
^ defaultNameSpace |
499 |
||
500 |
"Created: 2.1.1997 / 19:54:42 / cg" |
|
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
501 |
"Modified: 27.1.1997 / 11:59:53 / cg" |
2028 | 502 |
! |
503 |
||
504 |
defaultNameSpace:aNamespace |
|
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
505 |
"set the defaultNameSpace of this project. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
506 |
New classes will (if not specified by a directive) be installed |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
507 |
in this nameSpace. Useful, when filing in ST-80 code, to avoid |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
508 |
overwriting of standard classes." |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
509 |
|
4077 | 510 |
aNamespace ~~ defaultNameSpace ifTrue:[ |
511 |
defaultNameSpace := aNamespace. |
|
512 |
self changed:#defaultNameSpace. |
|
513 |
self == CurrentProject ifTrue:[ |
|
514 |
Project changed:#defaultNameSpace |
|
515 |
] |
|
2032 | 516 |
] |
2028 | 517 |
|
518 |
"Created: 2.1.1997 / 19:54:37 / cg" |
|
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
519 |
"Modified: 27.1.1997 / 12:00:01 / cg" |
2028 | 520 |
! |
521 |
||
315 | 522 |
directory |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
523 |
"return the projects directory. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
524 |
If not specified, a fileOut will be done into that directory" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
525 |
|
315 | 526 |
directoryName isNil ifTrue:[^ '.']. |
527 |
^ directoryName |
|
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
528 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
529 |
"Modified: 27.1.1997 / 12:00:41 / cg" |
315 | 530 |
! |
531 |
||
532 |
directory:aDirectoryName |
|
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
533 |
"set the projects directory. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
534 |
If not specified, a fileOut will be done into that directory" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
535 |
|
315 | 536 |
directoryName := aDirectoryName. |
4070 | 537 |
self changed:#directory. |
315 | 538 |
self == CurrentProject ifTrue:[ |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
539 |
Project changed:#directory |
315 | 540 |
] |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
541 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
542 |
"Modified: 27.1.1997 / 12:00:47 / cg" |
617 | 543 |
! |
356 | 544 |
|
617 | 545 |
name |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
546 |
"return the projects name. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
547 |
This is for the user only - shown in the projectViews label" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
548 |
|
617 | 549 |
^ name |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
550 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
551 |
"Modified: 27.1.1997 / 12:01:16 / cg" |
617 | 552 |
! |
356 | 553 |
|
617 | 554 |
name:aString |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
555 |
"set the projects name. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
556 |
This is for the user only - shown in the projectViews label" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
557 |
|
617 | 558 |
name := aString. |
4070 | 559 |
self changed:#name. |
617 | 560 |
self == CurrentProject ifTrue:[ |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
561 |
Project changed:#name |
617 | 562 |
] |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
563 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
564 |
"Modified: 27.1.1997 / 12:01:09 / cg" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
565 |
! |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
566 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
567 |
overwrittenMethods |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
568 |
"return the set of methods which were overwritten in this project. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
569 |
This information allows uninstalling, by switching back to the |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
570 |
original methods." |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
571 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
572 |
^ overwrittenMethods |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
573 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
574 |
"Created: 27.1.1997 / 11:57:21 / cg" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
575 |
"Modified: 27.1.1997 / 12:09:14 / cg" |
356 | 576 |
! |
577 |
||
4668 | 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" |
|
586 |
! |
|
587 |
||
617 | 588 |
packageName |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
589 |
"return the projects package identifier. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
590 |
This identifier marks all methods and new classes which were created |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
591 |
in this project." |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
592 |
|
617 | 593 |
^ packageName |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
594 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
595 |
"Modified: 27.1.1997 / 12:10:00 / cg" |
10 | 596 |
! |
597 |
||
617 | 598 |
packageName:aStringOrSymbol |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
599 |
"set the projects package identifier. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
600 |
This identifier marks all methods and new classes which were created |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
601 |
in this project." |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
602 |
|
617 | 603 |
packageName := aStringOrSymbol asSymbol. |
4070 | 604 |
self changed:#package. |
617 | 605 |
self == CurrentProject ifTrue:[ |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
606 |
Project changed:#package |
617 | 607 |
] |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
608 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
609 |
"Modified: 27.1.1997 / 12:10:09 / cg" |
10 | 610 |
! |
611 |
||
4099 | 612 |
prerequisiteClasses |
613 |
"return the prerequisiteClasses of the project" |
|
614 |
||
615 |
^ (self propertyAt:#prerequisiteClasses) ? #() |
|
616 |
! |
|
617 |
||
4124 | 618 |
prerequisiteClasses:aCollectionOfClassesOrClassNames |
4099 | 619 |
"set the prerequisiteClasses of the project" |
620 |
||
4124 | 621 |
^ self propertyAt:#prerequisiteClasses put:aCollectionOfClassesOrClassNames |
622 |
||
623 |
"Modified: / 26.4.1999 / 23:33:44 / cg" |
|
624 |
! |
|
625 |
||
626 |
prerequisitePackages |
|
627 |
"return the prerequisitePackages of the project" |
|
628 |
||
629 |
^ self prerequisites |
|
630 |
||
631 |
"Created: / 26.4.1999 / 23:33:22 / cg" |
|
632 |
! |
|
633 |
||
634 |
prerequisitePackages:aCollectionOfPackagesOrPackageNames |
|
635 |
"set the prerequisitePackages of the project" |
|
636 |
||
637 |
^ self prerequisites:aCollectionOfPackagesOrPackageNames |
|
638 |
||
639 |
"Modified: / 26.4.1999 / 23:34:40 / cg" |
|
4099 | 640 |
! |
641 |
||
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
642 |
prerequisites |
4097 | 643 |
"return the prerequisites of the project" |
644 |
||
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
645 |
^ prerequisites ? #() |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
646 |
! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
647 |
|
3973 | 648 |
prerequisites:aCollectionOfProjects |
4097 | 649 |
"set the prerequisites of the project" |
650 |
||
3973 | 651 |
prerequisites := aCollectionOfProjects |
652 |
! |
|
653 |
||
654 | 654 |
repositoryDirectory |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
655 |
"return the projects default repository location. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
656 |
This is offered initially, when classes are checked into the |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
657 |
source repository initially" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
658 |
|
725
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
659 |
^ repositoryDirectory |
654 | 660 |
|
661 |
"Created: 25.11.1995 / 18:04:51 / cg" |
|
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
662 |
"Modified: 27.1.1997 / 12:13:35 / cg" |
654 | 663 |
! |
664 |
||
665 |
repositoryDirectory:aRelativePathName |
|
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
666 |
"set the projects default repository location. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
667 |
This will be offered initially, when classes are checked into the |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
668 |
source repository initially" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
669 |
|
725
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
670 |
repositoryDirectory := aRelativePathName |
654 | 671 |
|
672 |
"Created: 25.11.1995 / 18:05:06 / cg" |
|
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
673 |
"Modified: 27.1.1997 / 12:13:28 / cg" |
725
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
674 |
! |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
675 |
|
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
676 |
repositoryModule |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
677 |
"return the projects default repository module name. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
678 |
This is offered initially, when classes are checked into the |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
679 |
source repository initially" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
680 |
|
725
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
681 |
^ repositoryModule |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
682 |
|
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
683 |
"Created: 25.11.1995 / 18:04:51 / cg" |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
684 |
"Modified: 27.1.1997 / 12:13:50 / cg" |
725
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
685 |
! |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
686 |
|
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
687 |
repositoryModule:aString |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
688 |
"set the projects default repository module name. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
689 |
This is offered initially, when classes are checked into the |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
690 |
source repository initially" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
691 |
|
725
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
692 |
repositoryModule := aString |
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
693 |
|
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
694 |
"Created: 25.11.1995 / 18:05:06 / cg" |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
695 |
"Modified: 27.1.1997 / 12:13:57 / cg" |
654 | 696 |
! |
697 |
||
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
698 |
subProjects |
4097 | 699 |
"return the subprojects - obsolete; we use prerequisites now" |
700 |
||
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
701 |
^ subProjects ? #() |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
702 |
! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
703 |
|
617 | 704 |
views |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
705 |
"return a collection of views which were opened in this project" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
706 |
|
617 | 707 |
^ views asArray |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
708 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
709 |
"Modified: 27.1.1997 / 12:14:18 / cg" |
338 | 710 |
! |
711 |
||
617 | 712 |
views:aSetOfViews |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
713 |
"set the collection of views which were opened in this project" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
714 |
|
617 | 715 |
views := WeakIdentitySet withAll:aSetOfViews |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
716 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
717 |
"Modified: 27.1.1997 / 12:14:26 / cg" |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
718 |
! ! |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
719 |
|
4079 | 720 |
!Project methodsFor:'administration'! |
721 |
||
722 |
removeClassesFromSystem |
|
723 |
"remove the all of my classes & patches from the system" |
|
724 |
||
725 |
self classInfo do:[:clsInfo | |
|
726 |
|clsName cls| |
|
727 |
||
728 |
clsName := clsInfo className. |
|
729 |
clsName isSymbol ifTrue:[ |
|
730 |
cls := Smalltalk at:clsName. |
|
731 |
cls notNil ifTrue:[ |
|
732 |
cls removeFromSystem. |
|
733 |
]. |
|
734 |
] ifFalse:[ |
|
735 |
self halt |
|
736 |
]. |
|
737 |
]. |
|
738 |
||
739 |
! |
|
740 |
||
741 |
removeFromSystem |
|
742 |
"remove the project and all of its classes & patches from the |
|
743 |
system" |
|
744 |
||
745 |
self removeClassesFromSystem. |
|
746 |
AllProjects remove:self ifAbsent:nil. |
|
747 |
! ! |
|
748 |
||
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
749 |
!Project methodsFor:'changes'! |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
750 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
751 |
rememberOverwrittenMethod:newMethod from:oldMethod |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
752 |
"this is sent whenever a method is installed, which overwrites |
2334
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
753 |
an existing method from a different package. |
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
754 |
Allows previous methods to be reconstructed." |
2276
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
755 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
756 |
overwrittenMethods isNil ifTrue:[ |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
757 |
overwrittenMethods := IdentityDictionary new. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
758 |
]. |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
759 |
overwrittenMethods at:newMethod put:oldMethod |
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
760 |
|
4efec5219eef
remember overwritten methods
Claus Gittinger <cg@exept.de>
parents:
2164
diff
changeset
|
761 |
"Created: 27.1.1997 / 11:52:01 / cg" |
2334
7502902385ff
only remember overwritten methods if the current project
Claus Gittinger <cg@exept.de>
parents:
2276
diff
changeset
|
762 |
"Modified: 30.1.1997 / 21:10:51 / cg" |
10 | 763 |
! ! |
764 |
||
236 | 765 |
!Project methodsFor:'initialization'! |
766 |
||
767 |
initialize |
|
338 | 768 |
|numString| |
769 |
||
330 | 770 |
views := WeakIdentitySet new. |
338 | 771 |
numString := NextSequential printString. |
315 | 772 |
NextSequential := NextSequential + 1. |
338 | 773 |
|
774 |
name := 'new Project-' , numString. |
|
775 |
packageName := 'private-' , numString. |
|
2034
1c96469c3df8
preinit the defaultNamespace of new projects (to Smalltalk)
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
776 |
defaultNameSpace := Smalltalk. |
1c96469c3df8
preinit the defaultNamespace of new projects (to Smalltalk)
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
777 |
|
848
76a83f34c26a
moved ExtBytes & ExtFunc from libbasic2
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
778 |
"/ |
76a83f34c26a
moved ExtBytes & ExtFunc from libbasic2
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
779 |
"/ for tiny-configurations, allow ChangeSet to be absent |
76a83f34c26a
moved ExtBytes & ExtFunc from libbasic2
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
780 |
"/ |
76a83f34c26a
moved ExtBytes & ExtFunc from libbasic2
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
781 |
ChangeSet notNil ifTrue:[ |
76a83f34c26a
moved ExtBytes & ExtFunc from libbasic2
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
782 |
changeSet := ChangeSet new. |
76a83f34c26a
moved ExtBytes & ExtFunc from libbasic2
Claus Gittinger <cg@exept.de>
parents:
725
diff
changeset
|
783 |
]. |
654 | 784 |
self directory:'.'. |
725
02759b2003a8
keep module & directory separately (as defaults when creating a container)
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
785 |
self repositoryModule:(OperatingSystem getLoginName). |
654 | 786 |
self repositoryDirectory:'private' |
787 |
||
788 |
"Created: 25.11.1995 / 18:05:44 / cg" |
|
2034
1c96469c3df8
preinit the defaultNamespace of new projects (to Smalltalk)
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
789 |
"Modified: 3.1.1997 / 13:24:10 / cg" |
236 | 790 |
! ! |
791 |
||
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
792 |
!Project methodsFor:'load & save'! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
793 |
|
4079 | 794 |
loadClassesFromProjectDirectory |
795 |
"load my classes into the system. |
|
796 |
The classes are loaded from the directory as defined by my |
|
797 |
directory insTvar" |
|
798 |
||
799 |
|myDirectory| |
|
800 |
||
801 |
myDirectory := self directory asFilename. |
|
802 |
||
803 |
self classInfo do:[:clsInfo | |
|
4080 | 804 |
|clsName clsFileNameString cls clsFilename| |
4079 | 805 |
|
806 |
clsName := clsInfo className. |
|
4080 | 807 |
clsFileNameString := clsInfo classFileName. |
808 |
clsFileNameString isNil ifTrue:[clsFileNameString := clsName , '.st']. |
|
4079 | 809 |
|
810 |
clsName isSymbol ifTrue:[ |
|
4080 | 811 |
clsFilename := myDirectory construct:clsFileNameString. |
4079 | 812 |
cls := Smalltalk at:clsName. |
813 |
cls isNil ifTrue:[ |
|
814 |
"/ ok - really not yet loaded. |
|
4080 | 815 |
Transcript showCR:'loading ' , clsFilename pathName , ' ...'. |
4079 | 816 |
] ifFalse:[ |
4080 | 817 |
Transcript showCR:'reloading ' , clsFilename pathName , ' ...'. |
4079 | 818 |
]. |
4080 | 819 |
Smalltalk fileIn:clsFilename |
4079 | 820 |
] ifFalse:[ |
821 |
self halt |
|
822 |
]. |
|
823 |
]. |
|
824 |
||
825 |
"/ read again; if the load order was not correct, |
|
826 |
"/ this will fix things (i.e. nil superclasses ...) |
|
827 |
||
828 |
self classInfo do:[:clsInfo | |
|
4080 | 829 |
|clsName clsFileNameString clsFilename| |
4079 | 830 |
|
831 |
clsName := clsInfo className. |
|
4080 | 832 |
clsFileNameString := clsInfo classFileName. |
833 |
clsFileNameString isNil ifTrue:[clsFileNameString := clsName , '.st']. |
|
4079 | 834 |
|
835 |
clsName isSymbol ifTrue:[ |
|
4080 | 836 |
clsFilename := myDirectory construct:clsFileNameString. |
837 |
Transcript showCR:'reloading ' , clsFilename pathName , ' ...'. |
|
838 |
Smalltalk fileIn:clsFilename |
|
4079 | 839 |
] ifFalse:[ |
840 |
self halt |
|
841 |
]. |
|
842 |
]. |
|
843 |
||
844 |
! |
|
845 |
||
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
846 |
loadFromProjectFile:aFilename |
4097 | 847 |
"fill all of my attributes from a projects file (.prj-file)" |
848 |
||
4124 | 849 |
|f l pack targetConditions s sourcesSubDir files module| |
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
850 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
851 |
f := aFilename asFilename. |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
852 |
directoryName := f directory pathName. |
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
853 |
self directory:(f directory pathName). |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
854 |
pack := ResourcePack fromFile:f baseName directory:directoryName. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
855 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
856 |
"/ convert the resourcePack ... |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
857 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
858 |
packageName := pack at:'package' ifAbsent:packageName. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
859 |
name := pack at:'name' ifAbsent:name. |
4071 | 860 |
|
4124 | 861 |
module := pack at:'repository.module' ifAbsent:nil. |
862 |
module notNil ifTrue:[ |
|
863 |
repositoryModule := module. |
|
864 |
repositoryDirectory := pack at:'repository.directory' ifAbsent:''. |
|
865 |
]. |
|
4071 | 866 |
|
4099 | 867 |
prerequisites := pack at:'prerequisites' ifAbsent:#(). |
868 |
self prerequisiteClasses:(pack at:'prerequisiteClasses' ifAbsent:#()). |
|
869 |
||
4074 | 870 |
s := pack at:'nameSpace' ifAbsent:nil. |
871 |
s notNil ifTrue:[ |
|
872 |
defaultNameSpace := Namespace name:s. |
|
873 |
]. |
|
874 |
||
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
875 |
subProjects := pack at:'subProjects' ifAbsent:subProjects. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
876 |
(s := pack at:'comment' ifAbsent:nil) notNil ifTrue:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
877 |
self comment:s |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
878 |
]. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
879 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
880 |
"/ first, all of the conditions ... |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
881 |
targetConditions := Dictionary new. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
882 |
pack keysAndValuesDo:[:key :val | |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
883 |
|conditionKey| |
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
884 |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
885 |
(key startsWith:'target.condition.') ifTrue:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
886 |
conditionKey := key copyFrom:'target.condition.' size + 1. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
887 |
targetConditions at:conditionKey put:val. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
888 |
] |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
889 |
]. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
890 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
891 |
properties isNil ifTrue:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
892 |
properties := IdentityDictionary new |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
893 |
]. |
4124 | 894 |
properties at:#'targetconditions' put:targetConditions. |
895 |
||
896 |
sourcesSubDir := pack at:'sources' ifAbsent:nil. |
|
897 |
sourcesSubDir notNil ifTrue:[ |
|
898 |
properties at:#'sourcesDirectory' put:sourcesSubDir. |
|
899 |
]. |
|
900 |
files := pack at:'files' ifAbsent:nil. |
|
901 |
files notNil ifTrue:[ |
|
902 |
properties at:#'files' put:files. |
|
903 |
]. |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
904 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
905 |
"/ fetch class info |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
906 |
|
4071 | 907 |
(pack at:'classes' default:#()) do:[:info | |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
908 |
|condKey className optionalFileName| |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
909 |
|
4078 | 910 |
condKey := #always. |
4073 | 911 |
info isSymbol ifTrue:[ |
912 |
className := info. |
|
913 |
] ifFalse:[ |
|
4078 | 914 |
className := info at:1. |
915 |
info size > 1 ifTrue:[ |
|
916 |
optionalFileName := info at:2. |
|
917 |
info size > 2 ifTrue:[ |
|
918 |
condKey := info at:3. |
|
919 |
] |
|
4073 | 920 |
]. |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
921 |
]. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
922 |
self |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
923 |
addClass:className |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
924 |
conditionForInclusion:condKey |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
925 |
classFileName:optionalFileName |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
926 |
]. |
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
927 |
|
4069 | 928 |
self wasLoadedFromFile:true. |
929 |
||
4099 | 930 |
"/ all remaining properties |
931 |
pack keysAndValuesDo:[:key :val | |
|
932 |
(key startsWith:'property.') ifTrue:[ |
|
933 |
self propertyAt:(key copyFrom:'property.' size+1) asSymbol put:val. |
|
934 |
] |
|
935 |
]. |
|
936 |
||
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
937 |
" |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
938 |
Project current saveAsProjectFile. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
939 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
940 |
Project new loadFromProjectFile:'default.prj' |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
941 |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
942 |
Project new loadFromProjectFile:'../../libbasic/libbasic.prj' |
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
943 |
" |
4069 | 944 |
|
4124 | 945 |
"Modified: / 26.4.1999 / 23:21:33 / cg" |
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
946 |
! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
947 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
948 |
saveAsProjectFile |
4097 | 949 |
"store all of my attributes into a projects file (.prj-file) |
950 |
(in the project-directory and named as <projectName>.prj)" |
|
951 |
||
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
952 |
|fn s| |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
953 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
954 |
fn := self directory asFilename. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
955 |
fn := fn construct:self name. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
956 |
fn := fn withSuffix:'prj'. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
957 |
|
4124 | 958 |
fn exists ifTrue:[ |
959 |
fn copyTo:(fn pathName , '.bak') |
|
960 |
]. |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
961 |
s := fn writeStream. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
962 |
self saveAsProjectFileOn:s. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
963 |
s close. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
964 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
965 |
" |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
966 |
Project current saveAsProjectFile |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
967 |
" |
4124 | 968 |
|
969 |
"Modified: / 26.4.1999 / 22:53:38 / cg" |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
970 |
! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
971 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
972 |
saveAsProjectFileOn:aStream |
4074 | 973 |
"save the project info in a format which is both usable for reload |
974 |
and somehow readable for humans. |
|
975 |
Actually, the format is the same as used for resources (i.e. key - value pairs) |
|
976 |
and the code below could be much simpler - if there where no humans to read it ..." |
|
977 |
||
4124 | 978 |
|s coll first maxLen t| |
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
979 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
980 |
s := aStream. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
981 |
|
4099 | 982 |
s nextPutLine:'; $Header' , '$'; nextPutLine:';'. |
4074 | 983 |
s nextPutLine:'; Project saved ' , Smalltalk timeStamp; nextPutLine:';'. |
984 |
s nextPutLine:'; Be careful when editing - do not corrupt the files syntax.'. |
|
985 |
s nextPutLine:'; (Lines starting with a semicolon are comment lines)'. |
|
986 |
s nextPutLine:'; (Lines ending with a backslash are concatenated with the following line)'. |
|
987 |
||
988 |
s cr; nextPutLine:';'; nextPutLine:'; general:'; nextPutLine:';'. |
|
4071 | 989 |
|
990 |
s nextPutAll:'comment'. |
|
991 |
s tab. s nextPutLine:(self comment storeString). |
|
992 |
||
993 |
s nextPutAll:'name'. |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
994 |
s tab. s nextPutLine:(name storeString). |
4071 | 995 |
|
996 |
s nextPutAll:'type'. |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
997 |
s tab. s nextPutLine:(self type storeString). |
4071 | 998 |
|
999 |
s nextPutAll:'package'. |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1000 |
s tab. s nextPutLine:(self packageName storeString). |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1001 |
|
4074 | 1002 |
(defaultNameSpace notNil and:[defaultNameSpace ~~ Smalltalk]) ifTrue:[ |
1003 |
s nextPutAll:'nameSpace'. |
|
1004 |
s tab. s nextPutLine:(defaultNameSpace name storeString). |
|
1005 |
]. |
|
1006 |
||
1007 |
s cr; nextPutLine:';'; nextPutLine:'; repository:'; nextPutLine:';'. |
|
4071 | 1008 |
s nextPutAll:'repository.module'. |
4099 | 1009 |
s tab. s nextPutLine:(repositoryModule ? 'private') storeString. |
4071 | 1010 |
s nextPutAll:'repository.directory'. |
4099 | 1011 |
s tab. s nextPutLine:(repositoryDirectory ? self packageName) storeString. |
4071 | 1012 |
s cr. |
1013 |
||
4124 | 1014 |
(t := properties at:#'sourcesDirectory' ifAbsent:nil) notNil ifTrue:[ |
1015 |
s nextPutAll:'sources'. |
|
1016 |
s tab. s nextPutLine:(t storeString). |
|
1017 |
]. |
|
1018 |
||
4074 | 1019 |
first := true. |
4071 | 1020 |
properties keysAndValuesDo:[:key :val | |
1021 |
(#( |
|
1022 |
comment |
|
1023 |
wasLoadedFromFile |
|
1024 |
targetconditions |
|
4074 | 1025 |
classes |
1026 |
classInfo |
|
4099 | 1027 |
prerequisiteClasses |
4124 | 1028 |
files |
4071 | 1029 |
) includes:key) ifFalse:[ |
4074 | 1030 |
first ifTrue:[ |
1031 |
first := false. |
|
1032 |
s cr; nextPutLine:';'; nextPutLine:'; properties:'; nextPutLine:';'. |
|
1033 |
]. |
|
4071 | 1034 |
s nextPutAll:'property.'; nextPutAll:key. |
1035 |
s tab. s nextPutLine:val storeString. |
|
1036 |
] |
|
1037 |
]. |
|
1038 |
||
4074 | 1039 |
"/ coll := self subProjects. |
1040 |
"/ coll size > 0 ifTrue:[ |
|
1041 |
"/ s nextPutLine:'[subprojects]'. |
|
1042 |
"/ coll do:[:aSubProject | |
|
1043 |
"/ s tab. s nextPutLine:(aSubProject name soreString). |
|
1044 |
"/ ]. |
|
1045 |
"/ ]. |
|
1046 |
||
1047 |
s cr; nextPutLine:';'; nextPutLine:'; required packages:'; nextPutLine:';'. |
|
1048 |
s nextPutAll:'prerequisites'; tab. |
|
1049 |
coll := self prerequisites. |
|
1050 |
coll size = 0 ifTrue:[ |
|
1051 |
s nextPutLine:'#()'. |
|
1052 |
] ifFalse:[ |
|
1053 |
s nextPutLine:'#( \'. |
|
4124 | 1054 |
coll do:[:aProjectOrProjectNameList | |
1055 |
|pName pPath| |
|
1056 |
||
1057 |
aProjectOrProjectNameList isString ifTrue:[ |
|
1058 |
pName := aProjectOrProjectNameList. |
|
1059 |
] ifFalse:[ |
|
1060 |
aProjectOrProjectNameList isArray ifTrue:[ |
|
1061 |
pName := aProjectOrProjectNameList at:1. |
|
1062 |
pPath := aProjectOrProjectNameList at:2. |
|
1063 |
] ifFalse:[ |
|
1064 |
pName := aProjectOrProjectNameList name. |
|
1065 |
pPath := aProjectOrProjectNameList repositoryPath. |
|
1066 |
] |
|
1067 |
]. |
|
1068 |
||
1069 |
pPath isNil ifTrue:[ |
|
1070 |
s tab. s nextPutAll:(pName storeString); nextPutLine:' \'. |
|
1071 |
] ifFalse:[ |
|
1072 |
s tab. s nextPutAll:'( '. |
|
1073 |
s nextPutAll:(pName storeString); space; |
|
1074 |
nextPutAll:(pPath storeString); nextPutLine:') \'. |
|
1075 |
] |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1076 |
]. |
4074 | 1077 |
s nextPutLine:')'. |
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1078 |
]. |
4124 | 1079 |
|
4099 | 1080 |
s cr; nextPutLine:';'; nextPutLine:'; required classes:'; nextPutLine:';'. |
1081 |
s nextPutAll:'prerequisiteClasses'; tab. |
|
1082 |
coll := self prerequisiteClasses. |
|
4124 | 1083 |
s nextPutLine:'#( \'. |
1084 |
coll do:[:aClassOrSymbol | |className| |
|
4099 | 1085 |
|
4124 | 1086 |
(className := aClassOrSymbol) isSymbol ifFalse:[ |
1087 |
className := aClassOrSymbol name |
|
4099 | 1088 |
]. |
4124 | 1089 |
s tab. s nextPutAll:(className storeString); nextPutLine:' \'. |
4099 | 1090 |
]. |
4124 | 1091 |
s nextPutLine:')'. |
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1092 |
|
4074 | 1093 |
s cr; nextPutLine:';'; nextPutLine:'; classes:'; nextPutLine:';'. |
4078 | 1094 |
s nextPutLine:'; (for each class, one line of the form: ( #''className'' [fileName [condition]] )'. |
4315 | 1095 |
s nextPutLine:'; (where fileName and condition are optional)'. |
4078 | 1096 |
s nextPutLine:';'. |
4074 | 1097 |
|
1098 |
coll := self classInfo. |
|
4124 | 1099 |
s nextPutAll:'classes'; tab; nextPutLine:'#( \'. |
1100 |
"/ find the longest className (for layout only) |
|
1101 |
||
1102 |
maxLen := coll inject:0 into:[:maxSoFar :aClassInfo | |
|
1103 |
|clsName| |
|
4078 | 1104 |
|
4124 | 1105 |
clsName := aClassInfo className. |
1106 |
maxSoFar max:clsName storeString size |
|
1107 |
]. |
|
4078 | 1108 |
|
4124 | 1109 |
coll do:[:aClassInfo | |
1110 |
|clsName fileName cond| |
|
4074 | 1111 |
|
4124 | 1112 |
clsName := aClassInfo className. |
1113 |
fileName := aClassInfo classFileName. |
|
1114 |
fileName isNil ifTrue:[ |
|
1115 |
fileName := clsName , '.st' |
|
1116 |
]. |
|
1117 |
cond := aClassInfo conditionForInclusion. |
|
1118 |
s tab. s nextPutAll:'( '; |
|
1119 |
nextPutAll:(clsName storeString paddedTo:maxLen); |
|
1120 |
tab; nextPutAll:fileName storeString. |
|
1121 |
cond == #always ifFalse:[ |
|
1122 |
s tab; nextPutAll:cond storeString. |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1123 |
]. |
4124 | 1124 |
s nextPutLine:') \'. |
1125 |
]. |
|
1126 |
s nextPutLine:')'. |
|
1127 |
||
1128 |
s cr; nextPutLine:';'; nextPutLine:'; files (for deployment):'; nextPutLine:';'. |
|
4314 | 1129 |
"/ |
1130 |
"/ already in properties |
|
1131 |
"/ |
|
1132 |
"/ s nextPutAll:'installDirectoryUnix'; tab. |
|
1133 |
"/ s nextPutLine:self installDirectoryUnix. |
|
1134 |
"/ s nextPutAll:'installDirectoryWin32'; tab. |
|
1135 |
"/ s nextPutLine:self installDirectoryWin32. |
|
1136 |
"/ s nextPutAll:'installDirectoryVMS'; tab. |
|
1137 |
"/ s nextPutLine:self installDirectoryVMS. |
|
1138 |
"/ s nextPutAll:'installDirectoryMacOS'; tab. |
|
1139 |
"/ s nextPutLine:self installDirectoryMacOS. |
|
1140 |
||
4124 | 1141 |
s nextPutAll:'files'; tab. |
1142 |
coll := properties at:#'files' ifAbsent:#(). |
|
1143 |
s nextPutLine:'#( \'. |
|
1144 |
coll do:[:aFileEntry | |
|
1145 |
s tab. s nextPutAll:(aFileEntry storeString); nextPutLine:' \'. |
|
1146 |
]. |
|
1147 |
s nextPutLine:')'. |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1148 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1149 |
" |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1150 |
Project current saveOn:Transcript |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1151 |
" |
4124 | 1152 |
|
1153 |
"Modified: / 26.4.1999 / 23:24:12 / cg" |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1154 |
! ! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1155 |
|
2 | 1156 |
!Project methodsFor:'maintenance'! |
1157 |
||
13 | 1158 |
buildProject |
4097 | 1159 |
"invoke 'make' in the project directory" |
1160 |
||
13 | 1161 |
OperatingSystem executeCommand:('cd ' , self directory , ' ; make') |
1162 |
! |
|
1163 |
||
4097 | 1164 |
createLoadAllFile |
1165 |
"creates a 'loadAll' file, which will load all classes |
|
1166 |
of the project - this loadAll file is supposed to be located |
|
1167 |
in the projects source directory." |
|
1168 |
||
1169 |
|d f out in topName classes classInfo numBad firstBad msg| |
|
1170 |
||
1171 |
classes := self classes. |
|
1172 |
numBad := 0. |
|
1173 |
firstBad := nil. |
|
1174 |
||
1175 |
classes := classes collect:[:clsOrSymbol | |cls| |
|
1176 |
clsOrSymbol isSymbol ifTrue:[ |
|
1177 |
cls := Smalltalk at:clsOrSymbol. |
|
1178 |
cls isNil ifTrue:[ |
|
1179 |
numBad := numBad + 1. |
|
1180 |
firstBad := firstBad ? clsOrSymbol. |
|
1181 |
] ifFalse:[ |
|
1182 |
cls isLoaded ifFalse:[ |
|
1183 |
cls autoLoad. |
|
1184 |
cls isLoaded ifFalse:[ |
|
1185 |
cls := nil |
|
1186 |
] |
|
1187 |
]. |
|
1188 |
]. |
|
1189 |
cls. |
|
1190 |
] ifFalse:[ |
|
1191 |
clsOrSymbol |
|
1192 |
] |
|
1193 |
]. |
|
1194 |
numBad ~~ 0 ifTrue:[ |
|
1195 |
msg := 'Cannot generate ''loadAll''-file.\\'. |
|
1196 |
msg := msg , 'Reason: Class ''' , firstBad asText allBold |
|
1197 |
, ''' is not loaded.'. |
|
1198 |
numBad ~~ 1 ifTrue:[ |
|
1199 |
msg := msg , '\(' , (numBad-1) printString , ' more unloaded classes were found)' |
|
1200 |
]. |
|
1201 |
self warn:msg withCRs. |
|
1202 |
^ self. |
|
1203 |
]. |
|
1204 |
||
1205 |
classes := classes copy topologicalSort:[:a :b | b isSubclassOf:a]. |
|
1206 |
||
1207 |
Transcript showCR:'creating loadAll file'. |
|
1208 |
||
1209 |
d := directoryName asFilename. |
|
1210 |
f := d construct:'loadAll'. |
|
1211 |
f exists ifTrue:[ |
|
1212 |
f renameTo:(d construct:'loadAll.bak') |
|
1213 |
]. |
|
1214 |
out := f writeStream. |
|
1215 |
out isNil ifTrue:[ |
|
1216 |
self warn:'cannot create loadAll'. |
|
1217 |
(d construct:'loadAll.bak') renameTo:f. |
|
1218 |
^ self |
|
1219 |
]. |
|
1220 |
||
1221 |
out nextPutAll:' |
|
1222 |
|files| |
|
1223 |
||
1224 |
files := #( |
|
1225 |
'. |
|
1226 |
||
1227 |
classes do:[:cls | |
|
1228 |
out nextPut:$'. |
|
1229 |
cls nameWithoutNameSpacePrefix printOn:out. |
|
1230 |
out nextPutAll:'.st'''. |
|
1231 |
out cr. |
|
1232 |
]. |
|
1233 |
||
1234 |
out nextPutAll:'). |
|
1235 |
||
1236 |
files do:[:s | |
|
1237 |
''.'' print. |
|
1238 |
Smalltalk fileIn:s. |
|
1239 |
]. |
|
1240 |
'' done'' printCR. |
|
1241 |
'. |
|
1242 |
||
1243 |
out close |
|
1244 |
! |
|
1245 |
||
2 | 1246 |
createMakefile |
1247 |
"creates an initial makefile, which will recreate a correct |
|
1248 |
Makefile, then compile all" |
|
1249 |
||
362 | 1250 |
|d f out in topName| |
2 | 1251 |
|
1420 | 1252 |
Transcript showCR:'creating Makefile'. |
13 | 1253 |
|
356 | 1254 |
d := directoryName asFilename. |
2 | 1255 |
f := d construct:'Makefile'. |
13 | 1256 |
f exists ifTrue:[ |
1420 | 1257 |
f renameTo:(d construct:'Makefile.bak') |
13 | 1258 |
]. |
2 | 1259 |
out := f writeStream. |
13 | 1260 |
out isNil ifTrue:[ |
1420 | 1261 |
self warn:'cannot create Makefile'. |
1262 |
^ self |
|
13 | 1263 |
]. |
1264 |
in := Smalltalk systemFileStreamFor:'rules/stdHeader'. |
|
2 | 1265 |
out nextPutAll:in contents asString. |
1266 |
in close. |
|
362 | 1267 |
|
1268 |
topName := self findTopFrom:directoryName. |
|
1269 |
||
13 | 1270 |
out nextPutAll:'#TOP=/usr/local/lib/smalltalk'; cr. |
362 | 1271 |
out nextPutAll:'TOP=' , topName; cr. |
2 | 1272 |
out nextPutAll:'target:'; cr. |
1273 |
out tab; nextPutAll:'touch Make.proto'; cr. |
|
1274 |
out tab; nextPutAll:'$(MAKE) Makefile'; cr. |
|
1275 |
out tab; nextPutAll:'make'; cr; cr. |
|
1276 |
||
362 | 1277 |
in := Smalltalk systemFileStreamFor:'configurations/COMMON/defines'. |
1278 |
out nextPutAll:in contents asString. |
|
1279 |
in close. |
|
1280 |
||
1281 |
in := Smalltalk systemFileStreamFor:'configurations/vendorConf'. |
|
1282 |
out nextPutAll:in contents asString. |
|
1283 |
in close. |
|
1284 |
||
13 | 1285 |
in := Smalltalk systemFileStreamFor:'configurations/myConf'. |
2 | 1286 |
out nextPutAll:in contents asString. |
1287 |
in close. |
|
362 | 1288 |
|
13 | 1289 |
in := Smalltalk systemFileStreamFor:'rules/stdRules'. |
2 | 1290 |
out nextPutAll:in contents asString. |
1291 |
in close. |
|
1292 |
out close |
|
1420 | 1293 |
|
1294 |
"Modified: 18.5.1996 / 15:44:25 / cg" |
|
2 | 1295 |
! |
1296 |
||
617 | 1297 |
createProjectFiles |
1298 |
"actually, creates all files to do a make in the project directory" |
|
1299 |
||
1300 |
directoryName asFilename exists ifFalse:[ |
|
4097 | 1301 |
(self confirm:'create new projectDirectory: ' , directoryName) |
1302 |
ifFalse:[^ self]. |
|
1303 |
OperatingSystem recursiveCreateDirectory:directoryName. |
|
617 | 1304 |
]. |
1305 |
self createMakefile. |
|
1306 |
self createSourcefiles. |
|
1307 |
self createProtoMakefile. |
|
4097 | 1308 |
(self propertyAt:#deliverLoadAllFile) == true ifTrue:[ |
1309 |
self createLoadAllFile |
|
1310 |
]. |
|
617 | 1311 |
! |
1312 |
||
2 | 1313 |
createProtoMakefile |
1314 |
"creates a Make.proto file" |
|
1315 |
||
362 | 1316 |
|d f s type appName libName startUpClass startUpSelector |
1317 |
topName classes| |
|
2 | 1318 |
|
362 | 1319 |
topName := self findTopFrom:directoryName. |
2 | 1320 |
|
1420 | 1321 |
Transcript showCR:'creating Make.proto'. |
13 | 1322 |
|
356 | 1323 |
d := directoryName asFilename. |
2 | 1324 |
f := d construct:'Make.proto'. |
1325 |
f exists ifTrue:[ |
|
1420 | 1326 |
f renameTo:(d construct:'Make.proto.bak') |
2 | 1327 |
]. |
1328 |
s := f writeStream. |
|
13 | 1329 |
s isNil ifTrue:[ |
1420 | 1330 |
self warn:'cannot create prototype Makefile'. |
1331 |
^ self |
|
13 | 1332 |
]. |
2 | 1333 |
s nextPutAll:'# |
362 | 1334 |
# ' , Smalltalk timeStamp , ' |
1335 |
# |
|
235 | 1336 |
# created by Smalltalks Project support |
2 | 1337 |
# |
362 | 1338 |
|
1339 |
||
1340 |
# the next line defines the path to the TOP directory, |
|
1341 |
# (where the directories "configurations" and "include" are found) |
|
1342 |
# |
|
1343 |
#TOP=/usr/local/lib/smalltalk |
|
1344 |
TOP=' , topName ,' |
|
1345 |
||
1346 |
# |
|
1347 |
# add any subdirectories that have to be visited by make |
|
1348 |
# |
|
1349 |
SUBDIRS= |
|
1350 |
||
1351 |
# |
|
1352 |
# do not change |
|
1353 |
# |
|
2 | 1354 |
SHELL=/bin/sh |
1355 |
||
362 | 1356 |
'. |
1357 |
||
1358 |
s nextPutAll:'# |
|
1359 |
# set the stc options |
|
1360 |
# |
|
1361 |
STCOPT=$(DEFAULT_STCOPT) |
|
1362 |
# STCOPT=+optspace2 |
|
1363 |
# STCOPT=+optspace2 -warnNonStandard |
|
1364 |
||
1365 |
# |
|
1366 |
# and packageName option |
|
1367 |
# |
|
1368 |
STCLOCALOPT=''-Pprivate-classes-(libapp)'' |
|
2 | 1369 |
|
1370 |
'. |
|
1371 |
||
356 | 1372 |
type := #library. |
1373 |
appName := 'app'. |
|
1374 |
libName := 'lib'. |
|
1375 |
startUpClass := 'Smalltalk'. |
|
1376 |
startUpSelector := 'start'. |
|
13 | 1377 |
|
356 | 1378 |
properties notNil ifTrue:[ |
1420 | 1379 |
type := properties at:#projectType ifAbsent:type. |
1380 |
appName := properties at:#applicationName ifAbsent:appName. |
|
1381 |
startUpClass := properties at:#startupClass ifAbsent:startUpClass. |
|
1382 |
startUpSelector := properties at:#startupSelector ifAbsent:startUpSelector. |
|
356 | 1383 |
]. |
1384 |
||
362 | 1385 |
s nextPutAll:'# |
1386 |
# define the name of the library to create |
|
1387 |
# |
|
1388 |
'. |
|
1389 |
s nextPutAll:'LIBNAME=lib' , appName; cr; cr. |
|
1390 |
||
1391 |
s nextPutAll:'# |
|
1392 |
# the target rule: |
|
1393 |
# |
|
1394 |
all:: abbrev.stc objs genClassList $(OBJTARGET) |
|
1395 |
||
1396 |
'. |
|
2 | 1397 |
|
1398 |
type == #executable ifTrue:[ |
|
1420 | 1399 |
s nextPutAll:'PROGS = ' , appName; cr. |
1400 |
s nextPutAll:('STARTUP_CLASS=' , startUpClass); cr. |
|
1401 |
s nextPutAll:'STARTUP_SELECTOR="' , startUpSelector; nextPutAll:'"'; cr. |
|
2 | 1402 |
]. |
1403 |
||
362 | 1404 |
s nextPutAll:'# |
1405 |
# define the object files that are to be created |
|
1406 |
# |
|
1407 |
'. |
|
2 | 1408 |
s nextPutAll:'OBJS='. |
1409 |
||
362 | 1410 |
(classes := self classes) notNil ifTrue:[ |
1420 | 1411 |
classes do:[:aClass | |
1412 |
|abbrev| |
|
362 | 1413 |
|
1420 | 1414 |
s nextPutAll:' \'. s cr. |
1415 |
abbrev := Smalltalk fileNameForClass:aClass name. |
|
1416 |
s nextPutAll:' '; nextPutAll:abbrev; nextPutAll:'.o'. |
|
1417 |
]. |
|
2 | 1418 |
]. |
1419 |
s cr; cr. |
|
1420 |
||
362 | 1421 |
s nextPutAll:'# |
1422 |
# dependencies: |
|
1423 |
# |
|
1424 |
I=$(TOP)/include |
|
1425 |
RT_STUFF=$(I)/Object.H $(I)/stc.h $(I)/stcIntern.h |
|
1426 |
||
1427 |
'. |
|
1428 |
classes notNil ifTrue:[ |
|
1420 | 1429 |
classes do:[:aClass | |
1430 |
|abbrev| |
|
362 | 1431 |
|
1420 | 1432 |
abbrev := Smalltalk fileNameForClass:aClass name. |
1433 |
s nextPutAll:abbrev; nextPutAll:'.o: '. |
|
1434 |
s nextPutAll:abbrev; nextPutAll:'.st '. |
|
1435 |
aClass allSuperclassesDo:[:superClass| |
|
1436 |
s nextPutAll:'$(I)/'. |
|
1437 |
s nextPutAll:(Smalltalk fileNameForClass:superClass name) , '.H '. |
|
1438 |
]. |
|
1439 |
s nextPutAll:'$(RT_STUFF)'; cr. |
|
1440 |
]. |
|
362 | 1441 |
]. |
1442 |
s cr; cr. |
|
2 | 1443 |
|
1444 |
type == #executable ifTrue:[ |
|
1420 | 1445 |
s nextPutAll:'all:: $(PROGS)'; cr. |
2 | 1446 |
|
1420 | 1447 |
s nextPutAll:appName. |
1448 |
s nextPutAll:':: main.o classList.o $(OBJS)'; cr. |
|
1449 |
s tab; nextPutAll:'$(LD) $(ST_LDFLAG) $(LDFLAGS) -o '; |
|
1450 |
nextPutAll:appName; |
|
1451 |
nextPutAll:' \'; cr. |
|
1452 |
s tab; tab; nextPutAll:'$(CRT0) main.$(O) classList.$(O) $(OBJS) $(EXTRA_OBJ) $(LIBOBJS) \'; cr. |
|
1453 |
s tab; tab; nextPutAll:'$(LIBRUNDIR)/hidata.o $(LIBRUN) \'; cr. |
|
1454 |
s tab; tab; nextPutAll:'$(MATHLIB) $(EXTRALIBS) -lXext $(SYSLIBS) $(OTHERLIBS) $(CRTN)'; cr. |
|
2 | 1455 |
]. |
1456 |
||
1457 |
s close |
|
1420 | 1458 |
|
4069 | 1459 |
"Modified: / 23.3.1999 / 14:20:09 / cg" |
617 | 1460 |
! |
1461 |
||
1462 |
createSourcefiles |
|
1463 |
"creates all Smalltalk-source files in the project directory" |
|
1464 |
||
1465 |
|classes methods methodClasses dir stream| |
|
1466 |
||
2956
952a09bdeed1
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2907
diff
changeset
|
1467 |
dir := self directory asFilename. |
1420 | 1468 |
Transcript showCR:'creating sources in ' , dir pathName , ' ...'; endEntry. |
617 | 1469 |
|
1470 |
classes := self classes. |
|
1471 |
classes isNil ifTrue:[ |
|
1420 | 1472 |
self warn:'no classes in current project' |
617 | 1473 |
]. |
1474 |
||
1475 |
classes notNil ifTrue:[ |
|
1420 | 1476 |
classes do:[:aClass | |
1477 |
aClass isLoaded ifFalse:[ |
|
1478 |
aClass autoload. |
|
1479 |
]. |
|
1480 |
]. |
|
1481 |
classes := classes topologicalSort:[:a :b | a isSubclassOf:b]. |
|
617 | 1482 |
|
1420 | 1483 |
classes do:[:aClass | |
1484 |
Transcript show:' ... '; showCR:aClass name, '.st'; endEntry. |
|
1485 |
aClass fileOutIn:dir |
|
1486 |
] |
|
617 | 1487 |
]. |
1488 |
||
1489 |
methods := self individualMethods. |
|
1490 |
methods notNil ifTrue:[ |
|
1420 | 1491 |
methods := methods asIdentitySet. |
1492 |
" |
|
1493 |
get classes ... |
|
1494 |
" |
|
1495 |
methodClasses := IdentitySet new. |
|
1496 |
methods do:[:m | |
|
1497 |
|mCls| |
|
617 | 1498 |
|
1854
b44227fd2b3d
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
1499 |
mCls := m containingClass. |
1420 | 1500 |
mCls isMeta ifTrue:[ |
1501 |
mCls := mCls soleInstance. |
|
1502 |
]. |
|
1503 |
methodClasses add:mCls]. |
|
1504 |
" |
|
1505 |
fileOut by class |
|
1506 |
" |
|
1507 |
methodClasses do:[:cls | |
|
1508 |
stream := (self directory asFilename construct:(cls name , '.chg')) writeStream. |
|
617 | 1509 |
|
1420 | 1510 |
Transcript show:' ... '; showCR:cls name, '.chg'; endEntry. |
1511 |
methods do:[:m | |
|
1512 |
|mCls| |
|
617 | 1513 |
|
1854
b44227fd2b3d
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
1514 |
mCls := m containingClass. |
1420 | 1515 |
(mCls == cls or:[mCls == cls class]) ifTrue:[ |
1516 |
mCls fileOutMethod:m on:stream. |
|
1517 |
]. |
|
1518 |
stream cr. |
|
1519 |
]. |
|
1520 |
stream close. |
|
1521 |
]. |
|
617 | 1522 |
]. |
1420 | 1523 |
|
1854
b44227fd2b3d
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
1524 |
"Modified: 1.11.1996 / 16:37:15 / cg" |
2956
952a09bdeed1
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2907
diff
changeset
|
1525 |
"Modified: 18.9.1997 / 18:50:34 / stefan" |
617 | 1526 |
! |
1527 |
||
1528 |
findTopFrom:directoryName |
|
1529 |
"returns the relative path from directoryName to the TOP |
|
1530 |
directory." |
|
1531 |
||
1532 |
|topName relParent foundTop| |
|
1533 |
||
1534 |
"/ find TOP |
|
1535 |
relParent := '..'. |
|
1536 |
foundTop := false. |
|
1537 |
[foundTop] whileFalse:[ |
|
1538 |
topName := directoryName , '/' , relParent. |
|
1539 |
topName asFilename pathName = '/' ifTrue:[ |
|
1540 |
self warn:'could not find TOP; assume absoulte path to TOP'. |
|
1541 |
topName := '/usr/local/lib/smalltalk'. |
|
1542 |
foundTop := true. |
|
1543 |
] ifFalse:[ |
|
1544 |
(topName , '/configurations') asFilename exists ifTrue:[ |
|
1545 |
(topName , '/include') asFilename exists ifTrue:[ |
|
1546 |
foundTop := true. |
|
1547 |
topName := relParent. |
|
1548 |
] |
|
1549 |
]. |
|
1550 |
foundTop ifFalse:[ |
|
1551 |
relParent := relParent , '/..'. |
|
1552 |
] |
|
1553 |
] |
|
1554 |
]. |
|
1555 |
^ topName |
|
1556 |
! ! |
|
1557 |
||
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1558 |
!Project methodsFor:'printing & storing'! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1559 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1560 |
displayString |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1561 |
^ super displayString , '(''' , (name ? '<unnamed>') , ''')' |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1562 |
! ! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1563 |
|
617 | 1564 |
!Project methodsFor:'properties'! |
1565 |
||
4097 | 1566 |
addClass:classOrClassName classFileName:fileName |
1567 |
"add a class to the project" |
|
1568 |
||
1569 |
self |
|
1570 |
addClass:classOrClassName |
|
1571 |
conditionForInclusion:#always |
|
1572 |
classFileName:fileName |
|
1573 |
||
1574 |
! |
|
1575 |
||
1576 |
addClass:classOrClassName conditionForInclusion:conditionBlock classFileName:fileName |
|
1577 |
"add a class to the project" |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1578 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1579 |
|i| |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1580 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1581 |
i := ClassInfo new. |
4097 | 1582 |
i className:classOrClassName. |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1583 |
i classFileName:fileName. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1584 |
i conditionForInclusion:conditionBlock. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1585 |
self addClassInfo:i |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1586 |
! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1587 |
|
4089 | 1588 |
addClassInfo:newInfo |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1589 |
"add a class info to the project" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1590 |
|
4315 | 1591 |
|infoCollection index nm prefix| |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1592 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1593 |
(infoCollection := self classInfo) isNil ifTrue:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1594 |
self classInfo:(infoCollection := OrderedCollection new). |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1595 |
]. |
4315 | 1596 |
|
1597 |
index := infoCollection findFirst:[:i | |nm1 nm2| |
|
1598 |
nm1 := i className. |
|
1599 |
nm2 := newInfo className. |
|
1600 |
(nm1 includes:$:) ifFalse:[ |
|
1601 |
nm1 := self defaultNameSpace name , '::' , nm1 |
|
1602 |
]. |
|
1603 |
(nm2 includes:$:) ifFalse:[ |
|
1604 |
nm2 := self defaultNameSpace name , '::' , nm2 |
|
1605 |
]. |
|
1606 |
nm1 = nm2 |
|
1607 |
]. |
|
1608 |
"/ strip off nameSpace prefix, if its the same as |
|
1609 |
"/ the default ... |
|
1610 |
||
1611 |
nm := newInfo className. |
|
1612 |
prefix := self defaultNameSpace name , '::'. |
|
1613 |
(nm startsWith:prefix) ifTrue:[ |
|
1614 |
nm := nm copyFrom:(prefix size + 1). |
|
1615 |
newInfo className:nm asSymbol. |
|
1616 |
]. |
|
4089 | 1617 |
index ~~ 0 ifTrue:[ |
1618 |
infoCollection at:index put:newInfo |
|
1619 |
] ifFalse:[ |
|
1620 |
infoCollection add:newInfo |
|
1621 |
] |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1622 |
! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1623 |
|
4668 | 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 |
||
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1636 |
classInfo:aClassInfoCollection |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1637 |
"set the class info of the project" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1638 |
|
4071 | 1639 |
self propertyAt:#classInfo put:aClassInfoCollection |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1640 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1641 |
! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1642 |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1643 |
comment |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1644 |
"return the comment of the project" |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1645 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1646 |
properties isNil ifTrue:[^ '']. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1647 |
^ properties at:#comment ifAbsent:'' |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1648 |
! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1649 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1650 |
comment:aString |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1651 |
"set the projects comment" |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1652 |
|
4071 | 1653 |
self propertyAt:#comment put:aString |
4070 | 1654 |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1655 |
! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1656 |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1657 |
documentationURL |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1658 |
"return the documentation-URL of the project" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1659 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1660 |
properties isNil ifTrue:[^ nil]. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1661 |
^ properties at:#documentationURL ifAbsent:nil |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1662 |
! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1663 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1664 |
documentationURL:anURLString |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1665 |
"set the projects documentation-URL" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1666 |
|
4071 | 1667 |
self propertyAt:#documentationURL put:anURLString |
1668 |
||
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1669 |
! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1670 |
|
617 | 1671 |
properties |
4097 | 1672 |
"return the property dictionary" |
1673 |
||
617 | 1674 |
^ properties |
1675 |
! |
|
1676 |
||
1677 |
properties:p |
|
4097 | 1678 |
"set the property dictionary" |
1679 |
||
617 | 1680 |
properties := p |
1681 |
! |
|
1682 |
||
4071 | 1683 |
propertyAt:aKey |
4097 | 1684 |
"return a property; the key is a symbol" |
1685 |
||
4071 | 1686 |
properties isNil ifTrue:[^ nil]. |
1687 |
^ properties at:aKey ifAbsent:nil. |
|
1688 |
! |
|
1689 |
||
1690 |
propertyAt:aKey put:aValue |
|
4097 | 1691 |
"set a property; the key is a symbol" |
1692 |
||
4077 | 1693 |
|oldValue| |
1694 |
||
1695 |
oldValue := self propertyAt:aKey. |
|
1696 |
||
4071 | 1697 |
properties isNil ifTrue:[ |
1698 |
properties := IdentityDictionary new |
|
1699 |
]. |
|
1700 |
properties at:aKey put:aValue. |
|
4077 | 1701 |
|
1702 |
oldValue ~~ aValue ifTrue:[ |
|
1703 |
self changed:aKey. |
|
1704 |
]. |
|
4071 | 1705 |
|
1706 |
"Created: / 23.3.1999 / 14:21:11 / cg" |
|
1707 |
! |
|
1708 |
||
617 | 1709 |
type |
4097 | 1710 |
"return the type of project (one of #application, #library, #smalltalk)" |
617 | 1711 |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1712 |
properties isNil ifTrue:[^ #application]. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1713 |
^ properties at:#type ifAbsent:#application |
617 | 1714 |
! |
1715 |
||
1716 |
type:aSymbol |
|
4097 | 1717 |
"set the projects type (one of #application, #library, #smalltalk)" |
617 | 1718 |
|
1719 |
(#(application library smalltalk) includes:aSymbol) ifFalse:[ |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1720 |
self warn:'invalid project type'. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1721 |
^ self |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1722 |
]. |
4077 | 1723 |
self propertyAt:#type put:aSymbol |
4069 | 1724 |
! |
1725 |
||
1726 |
wasLoadedFromFile |
|
1727 |
"return true, if the project was loaded from a file" |
|
1728 |
||
1729 |
properties isNil ifTrue:[^ nil]. |
|
1730 |
^ properties at:#wasLoadedFromFile ifAbsent:false |
|
1731 |
||
1732 |
"Modified: / 23.3.1999 / 13:59:32 / cg" |
|
1733 |
"Created: / 23.3.1999 / 14:21:06 / cg" |
|
1734 |
! |
|
1735 |
||
1736 |
wasLoadedFromFile:aBoolean |
|
4097 | 1737 |
"set/clear the flag stating that the project was loaded from a file" |
1738 |
||
4071 | 1739 |
self propertyAt:#wasLoadedFromFile put:aBoolean |
617 | 1740 |
! ! |
1741 |
||
1742 |
!Project methodsFor:'queries'! |
|
1743 |
||
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1744 |
classInfo |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1745 |
"return a classInfo collection of classes belonging to that project" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1746 |
|
4073 | 1747 |
|classInfo classes| |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1748 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1749 |
properties notNil ifTrue:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1750 |
classInfo := properties at:#classInfo ifAbsent:nil. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1751 |
classInfo notNil ifTrue:[^ classInfo]. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1752 |
]. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1753 |
|
4073 | 1754 |
classes := self classes. |
1755 |
classes size == 0 ifTrue:[ |
|
1756 |
classInfo := OrderedCollection new |
|
1757 |
] ifFalse:[ |
|
1758 |
classInfo := classes asOrderedCollection |
|
1759 |
collect:[:class | |
|
1760 |
|i fn| |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1761 |
|
4073 | 1762 |
i := ClassInfo new. |
1763 |
i conditionForInclusion:#always. |
|
1764 |
i className:class name. |
|
1765 |
fn := class classFilename ? ((Smalltalk fileNameForClass:class) , '.st'). |
|
1766 |
i classFileName:fn. |
|
1767 |
i |
|
1768 |
] |
|
1769 |
]. |
|
1770 |
self propertyAt:#classInfo put:classInfo. |
|
1771 |
^ classInfo |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1772 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1773 |
"Modified: 4.1.1997 / 16:51:18 / cg" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1774 |
! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1775 |
|
617 | 1776 |
classes |
4013
f06d31702f2a
ignore private classes in classList
Claus Gittinger <cg@exept.de>
parents:
4010
diff
changeset
|
1777 |
"return a collection of classes belonging to that project. |
f06d31702f2a
ignore private classes in classList
Claus Gittinger <cg@exept.de>
parents:
4010
diff
changeset
|
1778 |
This excludes any private classes." |
617 | 1779 |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1780 |
|classes classInfo| |
617 | 1781 |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1782 |
properties notNil ifTrue:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1783 |
classInfo := properties at:#classInfo ifAbsent:nil. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1784 |
classInfo notNil ifTrue:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1785 |
classes := classInfo collect:[:i | i className] |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1786 |
] ifFalse:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1787 |
classes := properties at:#classes ifAbsent:nil |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1788 |
] |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1789 |
]. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1790 |
|
617 | 1791 |
classes isNil ifTrue:[ |
2056 | 1792 |
classes := OrderedCollection new. |
1793 |
Smalltalk |
|
4013
f06d31702f2a
ignore private classes in classList
Claus Gittinger <cg@exept.de>
parents:
4010
diff
changeset
|
1794 |
allClassesDo:[:aClass | |
4670 | 1795 |
(true "aClass owningClass isNil" |
4089 | 1796 |
and:[aClass isMeta not |
4670 | 1797 |
and:[aClass package = packageName |
1798 |
and:[aClass isNamespace not or:[aClass == Smalltalk]]]]) ifTrue:[ |
|
4089 | 1799 |
classes add:aClass |
2056 | 1800 |
] |
1801 |
]. |
|
1802 |
classes isEmpty ifTrue:[^ nil]. |
|
617 | 1803 |
]. |
1804 |
^ classes |
|
1805 |
||
2056 | 1806 |
"Modified: 4.1.1997 / 16:51:18 / cg" |
617 | 1807 |
! |
1808 |
||
1809 |
individualMethods |
|
1810 |
"return a collection of individual methods belonging to that project, |
|
1811 |
only methods are returned which are not contained in the |
|
1812 |
projects class set." |
|
1813 |
||
1814 |
|classes methods| |
|
1815 |
||
1816 |
classes := self classes. |
|
1817 |
classes notNil ifTrue:[ |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1818 |
classes := classes asIdentitySet. |
617 | 1819 |
] ifFalse:[ |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1820 |
classes := #() |
617 | 1821 |
]. |
1822 |
||
1823 |
methods := IdentitySet new. |
|
1824 |
Smalltalk allBehaviorsDo:[:cls | |
|
4119 | 1825 |
|classToCheck| |
1826 |
||
1827 |
classToCheck := cls. |
|
4670 | 1828 |
"/ cls isPrivate ifTrue:[ |
1829 |
"/ classToCheck := cls topOwningClass |
|
1830 |
"/ ]. |
|
4119 | 1831 |
(classes isNil |
1832 |
or:[((classes includes:classToCheck) |
|
1833 |
or:[classes includes:classToCheck name]) not]) ifTrue:[ |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1834 |
cls methodDictionary do:[:m | |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1835 |
m package = packageName ifTrue:[ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1836 |
methods add:m |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1837 |
] |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1838 |
]. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1839 |
cls class methodDictionary do:[:m | |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1840 |
m package = packageName ifTrue:[ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1841 |
methods add:m |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1842 |
] |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1843 |
]. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1844 |
] |
617 | 1845 |
]. |
1846 |
^ methods asArray |
|
1847 |
||
1848 |
" |
|
1849 |
Project current classes |
|
1850 |
Project current individualMethods |
|
1851 |
" |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1852 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
1853 |
"Modified: 7.6.1996 / 09:16:25 / stefan" |
2 | 1854 |
! ! |
1855 |
||
1856 |
!Project methodsFor:'specifications'! |
|
1857 |
||
1858 |
readSpec |
|
1859 |
|s chunk fileName| |
|
1860 |
||
1861 |
fileName := (properties at:#directoryName) asFilename construct:'.project'. |
|
1862 |
s := fileName readStream. |
|
1863 |
s isNil ifTrue:[^ self]. |
|
1864 |
[s atEnd] whileFalse:[ |
|
203 | 1865 |
chunk := s nextChunk. |
1866 |
Compiler evaluate:chunk receiver:properties notifying:nil |
|
2 | 1867 |
]. |
1868 |
s close. |
|
1869 |
||
1870 |
"(Project new directory:'../projects/Clock') readSpec" |
|
1871 |
! |
|
1872 |
||
1873 |
saveSpec |
|
1874 |
|f d s| |
|
1875 |
||
1876 |
d := (properties at:#directoryName) asFilename. |
|
1877 |
d exists ifFalse:[ |
|
4522
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
1878 |
self error:'directory does not exist' mayProceed:true. |
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
1879 |
^ self |
2 | 1880 |
]. |
1881 |
f := d construct:'.project'. |
|
1882 |
s := f writeStream. |
|
1883 |
s isNil ifTrue:[^ self]. |
|
1884 |
properties associationsDo:[:aProp | |
|
4522
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
1885 |
(aProp == #directoryName) ifFalse:[ |
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
1886 |
s nextChunkPut:('self at:' , aProp key storeString, |
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
1887 |
' put:' , aProp value storeString). |
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
1888 |
s cr |
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
1889 |
] |
2 | 1890 |
]. |
1891 |
s close |
|
1892 |
||
1893 |
"((Project new directory:'../projects/Clock') readSpec |
|
4522
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
1894 |
directory:'../projects/xxx') saveSpec" |
2 | 1895 |
! ! |
1896 |
||
617 | 1897 |
!Project methodsFor:'views'! |
1898 |
||
1899 |
addView:aView |
|
2164
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
1900 |
"add a view to this projects set of views" |
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
1901 |
|
617 | 1902 |
views notNil ifTrue:[views add:aView] |
2164
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
1903 |
|
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
1904 |
"Modified: 14.2.1997 / 15:36:51 / cg" |
617 | 1905 |
! |
1906 |
||
1907 |
destroyViews |
|
1908 |
"destroy all views of this project" |
|
1909 |
||
1910 |
views notNil ifTrue:[ |
|
1911 |
views do:[:aView | |
|
1912 |
aView notNil ifTrue:[aView destroy] |
|
1913 |
] |
|
1914 |
]. |
|
1915 |
! |
|
1916 |
||
1917 |
hideViews |
|
1918 |
"hide all views of this project" |
|
1919 |
||
1920 |
views notNil ifTrue:[ |
|
1332
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
1921 |
views do:[:aView | |
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
1922 |
aView notNil ifTrue:[aView unmap] |
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
1923 |
] |
617 | 1924 |
]. |
1332
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
1925 |
|
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
1926 |
"Modified: 3.5.1996 / 23:48:51 / stefan" |
617 | 1927 |
! |
1928 |
||
1929 |
removeView:aView |
|
2164
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
1930 |
"remove a view from this projects set of views" |
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
1931 |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1932 |
views notNil ifTrue:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1933 |
views remove:aView ifAbsent:nil |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1934 |
] |
2164
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
1935 |
|
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
1936 |
"Modified: 14.2.1997 / 15:37:20 / cg" |
617 | 1937 |
! |
1938 |
||
1939 |
showViews |
|
2164
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
1940 |
"show all views of this project" |
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
1941 |
|
617 | 1942 |
views notNil ifTrue:[ |
1332
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
1943 |
views do:[:aView | |
2164
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
1944 |
aView notNil ifTrue:[aView remap] |
1332
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
1945 |
] |
617 | 1946 |
]. |
1332
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
1947 |
|
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
1948 |
"Modified: 3.5.1996 / 23:59:10 / stefan" |
2164
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
1949 |
"Modified: 14.2.1997 / 15:38:47 / cg" |
617 | 1950 |
! ! |
1951 |
||
4668 | 1952 |
!Project::MethodInfo methodsFor:'accessing'! |
1953 |
||
1954 |
className |
|
1955 |
"return the value of the instance variable 'className' (automatically generated)" |
|
1956 |
||
1957 |
^ className! |
|
1958 |
||
1959 |
className:something |
|
1960 |
"set the value of the instance variable 'className' (automatically generated)" |
|
1961 |
||
1962 |
className := something.! |
|
1963 |
||
1964 |
fileName |
|
1965 |
"return the value of the instance variable 'fileName' (automatically generated)" |
|
1966 |
||
1967 |
^ fileName! |
|
1968 |
||
1969 |
fileName:something |
|
1970 |
"set the value of the instance variable 'fileName' (automatically generated)" |
|
1971 |
||
1972 |
fileName := something.! |
|
1973 |
||
1974 |
methodName |
|
1975 |
"return the value of the instance variable 'methodName' (automatically generated)" |
|
1976 |
||
1977 |
^ methodName! |
|
1978 |
||
1979 |
methodName:something |
|
1980 |
"set the value of the instance variable 'methodName' (automatically generated)" |
|
1981 |
||
1982 |
methodName := something.! ! |
|
1983 |
||
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1984 |
!Project::ClassInfo methodsFor:'accessing'! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1985 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1986 |
classFileName |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1987 |
"return the value of the instance variable 'classFileName' (automatically generated)" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1988 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1989 |
^ classFileName! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1990 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1991 |
classFileName:something |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1992 |
"set the value of the instance variable 'classFileName' (automatically generated)" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1993 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1994 |
classFileName := something.! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1995 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1996 |
className |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1997 |
"return the value of the instance variable 'className' (automatically generated)" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1998 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1999 |
^ className! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2000 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2001 |
className:something |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2002 |
"set the value of the instance variable 'className' (automatically generated)" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2003 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2004 |
className := something.! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2005 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2006 |
conditionForInclusion |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2007 |
"return the value of the instance variable 'conditionForInclusion' (automatically generated)" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2008 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2009 |
^ conditionForInclusion! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2010 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2011 |
conditionForInclusion:something |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2012 |
"set the value of the instance variable 'conditionForInclusion' (automatically generated)" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2013 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2014 |
conditionForInclusion := something.! ! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2015 |
|
1854
b44227fd2b3d
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
2016 |
!Project class methodsFor:'documentation'! |
630 | 2017 |
|
2018 |
version |
|
4670 | 2019 |
^ '$Header: /cvs/stx/stx/libbasic/Project.st,v 1.86 1999-09-02 21:44:11 cg Exp $' |
1298 | 2020 |
! ! |
1 | 2021 |
Project initialize! |