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