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