author | Claus Gittinger <cg@exept.de> |
Wed, 22 Sep 1999 10:11:02 +0200 | |
changeset 4785 | 4ced52c817e6 |
parent 4779 | 767b94dabb98 |
child 4786 | 2375c3d2bffc |
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 |
||
4785 | 1351 |
|d f out in topName classes classInfo numBad firstBad msg methodsFile| |
4097 | 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 |
]. |
|
4785 | 1376 |
|
4097 | 1377 |
numBad ~~ 0 ifTrue:[ |
1378 |
msg := 'Cannot generate ''loadAll''-file.\\'. |
|
1379 |
msg := msg , 'Reason: Class ''' , firstBad asText allBold |
|
1380 |
, ''' is not loaded.'. |
|
1381 |
numBad ~~ 1 ifTrue:[ |
|
1382 |
msg := msg , '\(' , (numBad-1) printString , ' more unloaded classes were found)' |
|
1383 |
]. |
|
1384 |
self warn:msg withCRs. |
|
1385 |
^ self. |
|
1386 |
]. |
|
1387 |
||
4785 | 1388 |
"/ to not list private classes |
1389 |
classes := classes select:[:cls | cls owningClass isNil]. |
|
4097 | 1390 |
classes := classes copy topologicalSort:[:a :b | b isSubclassOf:a]. |
1391 |
||
1392 |
Transcript showCR:'creating loadAll file'. |
|
1393 |
||
1394 |
d := directoryName asFilename. |
|
1395 |
f := d construct:'loadAll'. |
|
1396 |
f exists ifTrue:[ |
|
1397 |
f renameTo:(d construct:'loadAll.bak') |
|
1398 |
]. |
|
1399 |
out := f writeStream. |
|
1400 |
out isNil ifTrue:[ |
|
1401 |
self warn:'cannot create loadAll'. |
|
1402 |
(d construct:'loadAll.bak') renameTo:f. |
|
1403 |
^ self |
|
1404 |
]. |
|
1405 |
||
4776 | 1406 |
out nextPutAll:'"/ |
4779 | 1407 |
"/ $' , 'Header' , '$ |
4776 | 1408 |
"/ |
4785 | 1409 |
"/ loadAll-file to fileIn code for: ' , self package , ' |
4776 | 1410 |
"/ |
1411 |
"/ Automatically generated from project definition. |
|
1412 |
"/ |
|
1413 |
||
1414 |
"/ |
|
1415 |
"/ Prerequisites: |
|
1416 |
"/ |
|
4785 | 1417 |
"/ Smalltalk loadPackage:''module:directory''. |
1418 |
"/ Smalltalk loadPackage:''....''. |
|
1419 |
"/ Smalltalk loadPackage:''....''. |
|
1420 |
!! |
|
4776 | 1421 |
|
1422 |
"{ package:''' , self package , ''' }"!! |
|
1423 |
||
4097 | 1424 |
|files| |
1425 |
||
4785 | 1426 |
''loading package ' , self package , ' ...'' infoPrintCR. |
4776 | 1427 |
|
4097 | 1428 |
files := #( |
1429 |
'. |
|
1430 |
||
1431 |
classes do:[:cls | |
|
4776 | 1432 |
out nextPutAll:' '''. |
4097 | 1433 |
cls nameWithoutNameSpacePrefix printOn:out. |
1434 |
out nextPutAll:'.st'''. |
|
1435 |
out cr. |
|
1436 |
]. |
|
4785 | 1437 |
(methodsFile := self propertyAt:#methodsFile) notNil ifTrue:[ |
1438 |
out |
|
1439 |
nextPutAll:' '''; |
|
1440 |
nextPutAll:methodsFile; |
|
1441 |
nextPutAll:''''. |
|
1442 |
]. |
|
4097 | 1443 |
|
4776 | 1444 |
out nextPutAll:') asOrderedCollection. |
1445 |
||
1446 |
(Smalltalk loadClassLibraryIfAbsent:''' , self name , ''') ifTrue:[ |
|
1447 |
|handle loaded| |
|
1448 |
||
4785 | 1449 |
handle := ObjectFileLoader loadedObjectHandles |
1450 |
detect:[:h | h package = ''' , self package , '''] ifNone:nil. |
|
4776 | 1451 |
handle ifNotNil:[ |
1452 |
loaded := Set new:(handle classes size). |
|
1453 |
handle classes do:[:c| c isMeta ifFalse:[loaded add:c classFilename]]. |
|
4785 | 1454 |
'. |
1455 |
methodsFile notNil ifTrue:[ |
|
1456 |
out nextPutAll: |
|
1457 |
' loaded add:''' , methodsFile , '''.'. |
|
1458 |
]. |
|
1459 |
out nextPutAll:' |
|
4776 | 1460 |
files := files asOrderedCollection select:[:f| (loaded includes:f) not]. |
1461 |
]. |
|
1462 |
]. |
|
4097 | 1463 |
|
1464 |
files do:[:s | |
|
4785 | 1465 |
''.'' infoPrint. |
4097 | 1466 |
Smalltalk fileIn:s. |
1467 |
]. |
|
4785 | 1468 |
'' '' infoPrintCR. |
1469 |
'' done (' , self package , ').'' infoPrintCR. |
|
4097 | 1470 |
'. |
1471 |
||
1472 |
out close |
|
1473 |
! |
|
1474 |
||
2 | 1475 |
createMakefile |
4779 | 1476 |
"creates an initial Makefile from a Make.proto file. |
1477 |
Requires the stmkmf script" |
|
1478 |
||
1479 |
|d top| |
|
2 | 1480 |
|
1420 | 1481 |
Transcript showCR:'creating Makefile'. |
13 | 1482 |
|
4779 | 1483 |
d := directoryName asFilename pathName. |
1484 |
top := (d , '/' , (self findTopFrom:directoryName)) asFilename pathName. |
|
1485 |
||
1486 |
(OperatingSystem |
|
1487 |
executeCommand:('sh ' , top , '/rules/stmkmf') |
|
1488 |
inDirectory:d) ifFalse:[ |
|
1489 |
self warn:'Could not execute stmkmf - no Makefile built.' |
|
13 | 1490 |
]. |
4779 | 1491 |
|
2 | 1492 |
! |
1493 |
||
617 | 1494 |
createProjectFiles |
1495 |
"actually, creates all files to do a make in the project directory" |
|
1496 |
||
1497 |
directoryName asFilename exists ifFalse:[ |
|
4097 | 1498 |
(self confirm:'create new projectDirectory: ' , directoryName) |
1499 |
ifFalse:[^ self]. |
|
1500 |
OperatingSystem recursiveCreateDirectory:directoryName. |
|
617 | 1501 |
]. |
1502 |
self createMakefile. |
|
1503 |
self createSourcefiles. |
|
1504 |
self createProtoMakefile. |
|
4097 | 1505 |
(self propertyAt:#deliverLoadAllFile) == true ifTrue:[ |
1506 |
self createLoadAllFile |
|
1507 |
]. |
|
617 | 1508 |
! |
1509 |
||
2 | 1510 |
createProtoMakefile |
1511 |
"creates a Make.proto file" |
|
1512 |
||
362 | 1513 |
|d f s type appName libName startUpClass startUpSelector |
4785 | 1514 |
topName classes numBad firstBad msg methodsFile| |
4779 | 1515 |
|
1516 |
classes := self classes. |
|
1517 |
numBad := 0. |
|
1518 |
firstBad := nil. |
|
1519 |
||
1520 |
classes := classes collect:[:clsOrSymbol | |cls| |
|
1521 |
clsOrSymbol isSymbol ifTrue:[ |
|
1522 |
cls := Smalltalk at:clsOrSymbol. |
|
1523 |
cls isNil ifTrue:[ |
|
1524 |
numBad := numBad + 1. |
|
1525 |
firstBad := firstBad ? clsOrSymbol. |
|
1526 |
] ifFalse:[ |
|
1527 |
cls isLoaded ifFalse:[ |
|
1528 |
cls autoLoad. |
|
1529 |
cls isLoaded ifFalse:[ |
|
1530 |
cls := nil |
|
1531 |
] |
|
1532 |
]. |
|
1533 |
]. |
|
1534 |
cls. |
|
1535 |
] ifFalse:[ |
|
1536 |
clsOrSymbol |
|
1537 |
] |
|
1538 |
]. |
|
1539 |
numBad ~~ 0 ifTrue:[ |
|
1540 |
msg := 'Cannot generate ''Make.proto''-file.\\'. |
|
1541 |
msg := msg , 'Reason: Class ''' , firstBad asText allBold |
|
1542 |
, ''' is not loaded.'. |
|
1543 |
numBad ~~ 1 ifTrue:[ |
|
1544 |
msg := msg , '\(' , (numBad-1) printString , ' more unloaded classes were found)' |
|
1545 |
]. |
|
1546 |
self warn:msg withCRs. |
|
1547 |
^ self. |
|
1548 |
]. |
|
1549 |
||
4785 | 1550 |
"/ to not list private classes |
1551 |
classes := classes select:[:cls | cls owningClass isNil]. |
|
4779 | 1552 |
classes := classes copy topologicalSort:[:a :b | b isSubclassOf:a]. |
2 | 1553 |
|
362 | 1554 |
topName := self findTopFrom:directoryName. |
2 | 1555 |
|
4779 | 1556 |
|
1420 | 1557 |
Transcript showCR:'creating Make.proto'. |
13 | 1558 |
|
356 | 1559 |
d := directoryName asFilename. |
2 | 1560 |
f := d construct:'Make.proto'. |
1561 |
f exists ifTrue:[ |
|
1420 | 1562 |
f renameTo:(d construct:'Make.proto.bak') |
2 | 1563 |
]. |
1564 |
s := f writeStream. |
|
13 | 1565 |
s isNil ifTrue:[ |
1420 | 1566 |
self warn:'cannot create prototype Makefile'. |
1567 |
^ self |
|
13 | 1568 |
]. |
4779 | 1569 |
s nextPutAll:'# $' , 'Header' , '$ |
362 | 1570 |
# |
4779 | 1571 |
# -- Make.proto created from project at ' , Smalltalk timeStamp , ' |
2 | 1572 |
# |
4779 | 1573 |
# Warning: once you modify this file, do not rerun |
1574 |
# stmkmp or recreate the Make.proto again - otherwise, your changes are lost. |
|
1575 |
||
1576 |
# module and directory-in-module; |
|
1577 |
# these should correspond to the directory hierarchy |
|
1578 |
# location (otherwise, ST/X will have a hard time to |
|
1579 |
# find out the packages location from its packageID) |
|
1580 |
MODULE=' , self repositoryModule ? 'unknown' , ' |
|
1581 |
MODULE_DIR=' , self repositoryDirectory ? 'unknown' , ' |
|
1582 |
||
1583 |
# default installation directory: |
|
1584 |
# (overwrite with ''make INSTALLTOP_DIR=... install'') |
|
1585 |
# the INSTALLBASE is imported from configurations... and usually |
|
1586 |
# defaults to something like /opt/smalltalk. |
|
1587 |
# (overwrite with ''make INSTALLBASE=... install'') |
|
1588 |
INSTALLTOP_DIR=$(INSTALLBASE)/packages/$(MODULE)/$(MODULE_DIR) |
|
1589 |
INSTALLLIB_DIR=$(INSTALLTOP_DIR) |
|
1590 |
INSTALLBIN_DIR=$(INSTALLTOP_DIR) |
|
362 | 1591 |
|
1592 |
# |
|
4779 | 1593 |
# position (of this package) in directory hierarchy: |
1594 |
# (must point to ST/X top directory, for tools and includes) |
|
1595 |
TOP=' , topName ,' |
|
1596 |
||
1597 |
# subdirectories where targets are to be made: |
|
362 | 1598 |
SUBDIRS= |
1599 |
||
4779 | 1600 |
# subdirectories where Makefiles are to be made: |
1601 |
# (only define if different from SUBDIRS) |
|
1602 |
# ALLSUBDIRS= |
|
1603 |
||
1604 |
||
1605 |
# the name of your classLibrary: |
|
1606 |
# ********** REQUIRED: CHECK the next line *** |
|
1607 |
LIBNAME=' , self name , ' |
|
1608 |
||
1609 |
||
1610 |
# the next define suppresses installation of |
|
1611 |
# the classes as autoloaded (i.e. not added to abbrev.stc). |
|
1612 |
SUPPRESS_LOCAL_ABBREVS=1 |
|
1613 |
||
1614 |
# the package is stored as an ID in classes and methods |
|
1615 |
# to identify code belonging to this project. |
|
1616 |
# It also specifies the position in the source repository |
|
1617 |
# and directory tree, when packages are loaded by packageID. |
|
1618 |
# ********** REQUIRED: CHECK the next line *** |
|
1619 |
PACKAGE=$(MODULE):$(MODULE_DIR) |
|
1620 |
||
1621 |
# Argument(s) to the stc compiler. |
|
1622 |
# -H. : create header files locally |
|
1623 |
# (if removed, they will be created as common |
|
1624 |
# -Pxxx : defines the package |
|
1625 |
# -Zxxx : a prefix for variables within the classLib |
|
1626 |
# -Dxxx : defines passed to to CC for inline C-code |
|
1627 |
# -Ixxx : include path passed to CC for inline C-code |
|
1628 |
# +optspace : optimized for space |
|
1629 |
# +optspace2 : optimized more for space |
|
1630 |
# +optspace3 : optimized even more for space |
|
1631 |
# +optinline : generate inline code for some ST constructs |
|
1632 |
# +inlineNew : additionally inline new |
|
1633 |
# +inlineMath : additionally inline some floatPnt math stuff |
|
362 | 1634 |
# |
4779 | 1635 |
# ********** OPTIONAL: MODIFY the next line(s) *** |
1636 |
# STCLOCALOPTIMIZATIONS=+optinline +inlineNew |
|
1637 |
# STCLOCALOPTIMIZATIONS=+optspace3 |
|
1638 |
STCLOCALOPTIMIZATIONS=+optspace3 |
|
1639 |
||
1640 |
# Argument(s) to the stc compiler. |
|
1641 |
# -warn : no warnings |
|
1642 |
# -warnNonStandard : no warnings about ST/X extensions |
|
1643 |
# -warnEOLComments : no warnings about EOL comment extension |
|
1644 |
# -warnPrivacy : no warnings about privateClass extension |
|
362 | 1645 |
# |
4779 | 1646 |
# ********** OPTIONAL: MODIFY the next line(s) *** |
1647 |
# STCWARNINGS=-warn |
|
1648 |
# STCWARNINGS=-warnNonStandard |
|
1649 |
# STCWARNINGS=-warnEOLComments |
|
1650 |
STCWARNINGS= |
|
1651 |
||
1652 |
# if your embedded C code requires any system includes, |
|
1653 |
# add the path(es) here:, |
|
1654 |
# ********** OPTIONAL: MODIFY the next lines *** |
|
1655 |
# LOCALINCLUDES=-Ifoo -Ibar |
|
1656 |
LOCALINCLUDES= |
|
1657 |
||
1658 |
# if you need any additional defines for embedded C code, |
|
1659 |
# add them here:, |
|
1660 |
# ********** OPTIONAL: MODIFY the next lines *** |
|
1661 |
# LOCALDEFINES=-Dfoo -Dbar -DDEBUG |
|
1662 |
LOCALDEFINES= |
|
1663 |
||
1664 |
STCLOCALOPT=-I. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALINCLUDES) $(LOCALDEFINES) -H. ''-P$(PACKAGE)'' ''-Z$(LIBNAME)'' $(COMMONSYMFLAG) $(INITCODESEPFLAG) |
|
1665 |
||
1666 |
# ********** OPTIONAL: MODIFY the next line *** |
|
1667 |
# additional C-libraries that should be pre-linked with the class-objects |
|
1668 |
LD_OBJ_LIBS= |
|
1669 |
||
1670 |
# ********** OPTIONAL: MODIFY the next line *** |
|
1671 |
# additional C targets or libraries should be added below |
|
1672 |
LOCAL_EXTRA_TARGETS= |
|
1673 |
||
1674 |
all:: preMake classLibRule postMake |
|
1675 |
||
2 | 1676 |
|
1677 |
'. |
|
1678 |
||
4779 | 1679 |
"/ type := #library. |
1680 |
"/ appName := 'app'. |
|
1681 |
"/ libName := 'lib'. |
|
1682 |
"/ startUpClass := 'Smalltalk'. |
|
1683 |
"/ startUpSelector := 'start'. |
|
1684 |
"/ |
|
1685 |
"/ properties notNil ifTrue:[ |
|
1686 |
"/ type := properties at:#projectType ifAbsent:type. |
|
1687 |
"/ appName := properties at:#applicationName ifAbsent:appName. |
|
1688 |
"/ startUpClass := properties at:#startupClass ifAbsent:startUpClass. |
|
1689 |
"/ startUpSelector := properties at:#startupSelector ifAbsent:startUpSelector. |
|
1690 |
"/ ]. |
|
1691 |
"/ |
|
1692 |
"/ s nextPutAll:'# |
|
1693 |
"/# define the name of the library to create |
|
1694 |
"/# |
|
1695 |
"/'. |
|
1696 |
"/ s nextPutAll:'LIBNAME=lib' , appName; cr; cr. |
|
1697 |
"/ |
|
1698 |
"/ s nextPutAll:'# |
|
1699 |
"/# the target rule: |
|
1700 |
"/# |
|
1701 |
"/all:: abbrev.stc objs genClassList $(OBJTARGET) |
|
1702 |
"/ |
|
1703 |
"/'. |
|
1704 |
"/ |
|
1705 |
"/ type == #executable ifTrue:[ |
|
1706 |
"/ s nextPutAll:'PROGS = ' , appName; cr. |
|
1707 |
"/ s nextPutAll:('STARTUP_CLASS=' , startUpClass); cr. |
|
1708 |
"/ s nextPutAll:'STARTUP_SELECTOR="' , startUpSelector; nextPutAll:'"'; cr. |
|
1709 |
"/ ]. |
|
1710 |
"/ |
|
1711 |
"/ s nextPutAll:'# |
|
1712 |
"/# define the object files that are to be created |
|
1713 |
"/# |
|
1714 |
"/'. |
|
1715 |
s nextPutAll:'OBJS='. |
|
1716 |
||
1717 |
classes do:[:aClass | |
|
1718 |
|abbrev| |
|
1719 |
||
1720 |
s nextPutAll:' \'. s cr. |
|
1721 |
abbrev := Smalltalk fileNameForClass:aClass name. |
|
1722 |
s nextPutAll:' '; nextPutAll:abbrev; nextPutAll:'.$(O)'. |
|
2 | 1723 |
]. |
4785 | 1724 |
(methodsFile := self propertyAt:#methodsFile) notNil ifTrue:[ |
1725 |
s nextPutAll:' \'. s cr. |
|
1726 |
s nextPutAll:' '; |
|
1727 |
nextPutAll:(methodsFile asFilename withoutSuffix baseName); |
|
1728 |
nextPutAll:'.$(O)'. |
|
1729 |
]. |
|
4779 | 1730 |
s cr. |
1731 |
||
1732 |
s nextPutAll:' |
|
1733 |
# add more install actions here |
|
1734 |
install:: |
|
1735 |
||
1736 |
# add more install actions for aux-files (resources) here |
|
1737 |
installAux:: |
|
1738 |
||
1739 |
# add more preMake actions here |
|
1740 |
preMake:: |
|
1741 |
||
1742 |
# add more postMake actions here |
|
1743 |
postMake:: cleanjunk |
|
1744 |
||
1745 |
cleanjunk:: |
|
1746 |
||
1747 |
clean:: |
|
1748 |
' , Character tab , '-rm -f *.o *.H |
|
1749 |
||
1750 |
clobber:: |
|
1751 |
' , Character tab , '-rm -f *.so *.dll |
|
1752 |
||
1753 |
$(INSTALLBASE):: |
|
1754 |
' , Character tab , '@test -d $@ || mkdir $@ |
|
1755 |
||
1756 |
$(INSTALLBASE)/packages:: $(INSTALLBASE) |
|
1757 |
' , Character tab , '@test -d $@ || mkdir $@ |
|
1758 |
||
1759 |
$(INSTALLBASE)/packages/$(MODULE):: $(INSTALLBASE)/packages |
|
1760 |
' , Character tab , '@test -d $@ || mkdir $@ |
|
1761 |
||
1762 |
$(INSTALLBASE)/packages/$(MODULE)/osi:: $(INSTALLBASE)/packages/$(MODULE) |
|
1763 |
' , Character tab , '@test -d $@ || mkdir $@ |
|
1764 |
||
1765 |
$(INSTALLBASE)/packages/$(MODULE)/osi/asn1:: $(INSTALLBASE)/packages/$(MODULE)/osi |
|
1766 |
' , Character tab , '@test -d $@ || mkdir $@ |
|
1767 |
||
1768 |
$(INSTALLBASE)/packages/$(MODULE)/$(MODULE_DIR):: $(INSTALLBASE)/packages/$(MODULE) |
|
1769 |
' , Character tab , '@test -d $@ || mkdir $@ |
|
1770 |
||
1771 |
# BEGINMAKEDEPEND --- do not remove this line; make depend needs it |
|
362 | 1772 |
'. |
4779 | 1773 |
"/ classes notNil ifTrue:[ |
1774 |
"/ classes do:[:aClass | |
|
1775 |
"/ |abbrev| |
|
1776 |
"/ |
|
1777 |
"/ abbrev := Smalltalk fileNameForClass:aClass name. |
|
1778 |
"/ s nextPutAll:abbrev; nextPutAll:'.$(O): '. |
|
1779 |
"/ s nextPutAll:abbrev; nextPutAll:'.st '. |
|
1780 |
"/ aClass allSuperclassesDo:[:superClass| |
|
1781 |
"/ s nextPutAll:(Smalltalk fileNameForClass:superClass name) , '.$(H) '. |
|
1782 |
"/ ]. |
|
1783 |
"/ s nextPutAll:'$(STCHDR)'; cr. |
|
1784 |
"/ ]. |
|
1785 |
"/ ]. |
|
1786 |
s nextPutAll:'# ENDMAKEDEPEND --- do not remove this line'. |
|
362 | 1787 |
s cr; cr. |
2 | 1788 |
|
1789 |
type == #executable ifTrue:[ |
|
1420 | 1790 |
s nextPutAll:'all:: $(PROGS)'; cr. |
2 | 1791 |
|
1420 | 1792 |
s nextPutAll:appName. |
1793 |
s nextPutAll:':: main.o classList.o $(OBJS)'; cr. |
|
1794 |
s tab; nextPutAll:'$(LD) $(ST_LDFLAG) $(LDFLAGS) -o '; |
|
1795 |
nextPutAll:appName; |
|
1796 |
nextPutAll:' \'; cr. |
|
1797 |
s tab; tab; nextPutAll:'$(CRT0) main.$(O) classList.$(O) $(OBJS) $(EXTRA_OBJ) $(LIBOBJS) \'; cr. |
|
1798 |
s tab; tab; nextPutAll:'$(LIBRUNDIR)/hidata.o $(LIBRUN) \'; cr. |
|
1799 |
s tab; tab; nextPutAll:'$(MATHLIB) $(EXTRALIBS) -lXext $(SYSLIBS) $(OTHERLIBS) $(CRTN)'; cr. |
|
2 | 1800 |
]. |
1801 |
||
1802 |
s close |
|
1420 | 1803 |
|
4069 | 1804 |
"Modified: / 23.3.1999 / 14:20:09 / cg" |
617 | 1805 |
! |
1806 |
||
1807 |
createSourcefiles |
|
1808 |
"creates all Smalltalk-source files in the project directory" |
|
1809 |
||
1810 |
|classes methods methodClasses dir stream| |
|
1811 |
||
2956
952a09bdeed1
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2907
diff
changeset
|
1812 |
dir := self directory asFilename. |
1420 | 1813 |
Transcript showCR:'creating sources in ' , dir pathName , ' ...'; endEntry. |
617 | 1814 |
|
1815 |
classes := self classes. |
|
1816 |
classes isNil ifTrue:[ |
|
1420 | 1817 |
self warn:'no classes in current project' |
617 | 1818 |
]. |
1819 |
||
1820 |
classes notNil ifTrue:[ |
|
1420 | 1821 |
classes do:[:aClass | |
1822 |
aClass isLoaded ifFalse:[ |
|
1823 |
aClass autoload. |
|
1824 |
]. |
|
1825 |
]. |
|
4785 | 1826 |
"/ to not list private classes |
1827 |
classes := classes select:[:cls | cls owningClass isNil]. |
|
1420 | 1828 |
classes := classes topologicalSort:[:a :b | a isSubclassOf:b]. |
617 | 1829 |
|
1420 | 1830 |
classes do:[:aClass | |
1831 |
Transcript show:' ... '; showCR:aClass name, '.st'; endEntry. |
|
1832 |
aClass fileOutIn:dir |
|
1833 |
] |
|
617 | 1834 |
]. |
1835 |
||
1836 |
methods := self individualMethods. |
|
1837 |
methods notNil ifTrue:[ |
|
1420 | 1838 |
methods := methods asIdentitySet. |
1839 |
" |
|
1840 |
get classes ... |
|
1841 |
" |
|
1842 |
methodClasses := IdentitySet new. |
|
1843 |
methods do:[:m | |
|
1844 |
|mCls| |
|
617 | 1845 |
|
1854
b44227fd2b3d
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
1846 |
mCls := m containingClass. |
1420 | 1847 |
mCls isMeta ifTrue:[ |
1848 |
mCls := mCls soleInstance. |
|
1849 |
]. |
|
1850 |
methodClasses add:mCls]. |
|
1851 |
" |
|
1852 |
fileOut by class |
|
1853 |
" |
|
1854 |
methodClasses do:[:cls | |
|
1855 |
stream := (self directory asFilename construct:(cls name , '.chg')) writeStream. |
|
617 | 1856 |
|
1420 | 1857 |
Transcript show:' ... '; showCR:cls name, '.chg'; endEntry. |
1858 |
methods do:[:m | |
|
1859 |
|mCls| |
|
617 | 1860 |
|
1854
b44227fd2b3d
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
1861 |
mCls := m containingClass. |
1420 | 1862 |
(mCls == cls or:[mCls == cls class]) ifTrue:[ |
1863 |
mCls fileOutMethod:m on:stream. |
|
1864 |
]. |
|
1865 |
stream cr. |
|
1866 |
]. |
|
1867 |
stream close. |
|
1868 |
]. |
|
617 | 1869 |
]. |
1420 | 1870 |
|
1854
b44227fd2b3d
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
1871 |
"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
|
1872 |
"Modified: 18.9.1997 / 18:50:34 / stefan" |
617 | 1873 |
! |
1874 |
||
1875 |
findTopFrom:directoryName |
|
1876 |
"returns the relative path from directoryName to the TOP |
|
1877 |
directory." |
|
1878 |
||
1879 |
|topName relParent foundTop| |
|
1880 |
||
1881 |
"/ find TOP |
|
1882 |
relParent := '..'. |
|
1883 |
foundTop := false. |
|
1884 |
[foundTop] whileFalse:[ |
|
4779 | 1885 |
topName := directoryName asFilename construct:relParent. |
1886 |
topName isRootDirectory ifTrue:[ |
|
1887 |
self warn:'could not find TOP; assume absoulte path to TOP'. |
|
1888 |
^ nil. |
|
1889 |
"/ topName := '/usr/local/lib/smalltalk'. |
|
1890 |
"/ foundTop := true. |
|
1891 |
] ifFalse:[ |
|
1892 |
((topName construct:'stx') construct:'configurations') exists ifTrue:[ |
|
1893 |
((topName construct:'stx') construct:'include') exists ifTrue:[ |
|
1894 |
^ relParent , '/stx'. |
|
1895 |
] |
|
1896 |
]. |
|
1897 |
(topName construct:'configurations') exists ifTrue:[ |
|
1898 |
(topName construct:'include') exists ifTrue:[ |
|
1899 |
^ relParent |
|
1900 |
] |
|
1901 |
]. |
|
1902 |
relParent := relParent , '/..' |
|
1903 |
] |
|
617 | 1904 |
]. |
4779 | 1905 |
^ topName pathName |
617 | 1906 |
! ! |
1907 |
||
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1908 |
!Project methodsFor:'printing & storing'! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1909 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1910 |
displayString |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1911 |
^ super displayString , '(''' , (name ? '<unnamed>') , ''')' |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1912 |
! ! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
1913 |
|
617 | 1914 |
!Project methodsFor:'properties'! |
1915 |
||
4097 | 1916 |
addClass:classOrClassName classFileName:fileName |
1917 |
"add a class to the project" |
|
1918 |
||
1919 |
self |
|
1920 |
addClass:classOrClassName |
|
1921 |
conditionForInclusion:#always |
|
1922 |
classFileName:fileName |
|
1923 |
||
1924 |
! |
|
1925 |
||
1926 |
addClass:classOrClassName conditionForInclusion:conditionBlock classFileName:fileName |
|
1927 |
"add a class to the project" |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1928 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1929 |
|i| |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1930 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1931 |
i := ClassInfo new. |
4097 | 1932 |
i className:classOrClassName. |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1933 |
i classFileName:fileName. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1934 |
i conditionForInclusion:conditionBlock. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1935 |
self addClassInfo:i |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1936 |
! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1937 |
|
4089 | 1938 |
addClassInfo:newInfo |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1939 |
"add a class info to the project" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1940 |
|
4315 | 1941 |
|infoCollection index nm prefix| |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1942 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1943 |
(infoCollection := self classInfo) isNil ifTrue:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1944 |
self classInfo:(infoCollection := OrderedCollection new). |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1945 |
]. |
4315 | 1946 |
|
1947 |
index := infoCollection findFirst:[:i | |nm1 nm2| |
|
1948 |
nm1 := i className. |
|
1949 |
nm2 := newInfo className. |
|
4773 | 1950 |
"/ (nm1 includes:$:) ifFalse:[ |
1951 |
"/ nm1 := self defaultNameSpace name , '::' , nm1 |
|
1952 |
"/ ]. |
|
1953 |
"/ (nm2 includes:$:) ifFalse:[ |
|
1954 |
"/ nm2 := self defaultNameSpace name , '::' , nm2 |
|
1955 |
"/ ]. |
|
4315 | 1956 |
nm1 = nm2 |
1957 |
]. |
|
4773 | 1958 |
"/ "/ strip off nameSpace prefix, if its the same as |
1959 |
"/ "/ the default ... |
|
1960 |
"/ |
|
1961 |
"/ nm := newInfo className. |
|
1962 |
"/ prefix := self defaultNameSpace name , '::'. |
|
1963 |
"/ (nm startsWith:prefix) ifTrue:[ |
|
1964 |
"/ nm := nm copyFrom:(prefix size + 1). |
|
1965 |
"/ newInfo className:nm asSymbol. |
|
1966 |
"/ ]. |
|
4089 | 1967 |
index ~~ 0 ifTrue:[ |
1968 |
infoCollection at:index put:newInfo |
|
1969 |
] ifFalse:[ |
|
1970 |
infoCollection add:newInfo |
|
1971 |
] |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1972 |
! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
1973 |
|
4755
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1974 |
addMethod:methodName inClass:classOrClassName conditionForInclusion:condition fileName:optionalFileName |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1975 |
"add a method to the project" |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1976 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1977 |
|i| |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1978 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1979 |
i := MethodInfo new. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1980 |
i className:classOrClassName. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1981 |
i methodName:methodName. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1982 |
i fileName:optionalFileName. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1983 |
i conditionForInclusion:condition. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1984 |
self addMethodInfo:i |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1985 |
! |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1986 |
|
4668 | 1987 |
addMethod:methodOrSelector inClass:aClassOrClassName fileName:fileName |
1988 |
"add an individual method to the project" |
|
1989 |
||
1990 |
|i| |
|
1991 |
||
1992 |
i := MethodInfo new. |
|
1993 |
i methodName:methodOrSelector. |
|
1994 |
i className:aClassOrClassName. |
|
1995 |
i fileName:fileName. |
|
1996 |
self addMethodInfo:i |
|
1997 |
! |
|
1998 |
||
4755
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
1999 |
addMethodInfo:newInfo |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2000 |
"add a method info to the project" |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2001 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2002 |
|infoCollection index nm prefix| |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2003 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2004 |
(infoCollection := self methodInfo) isNil ifTrue:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2005 |
self methodInfo:(infoCollection := OrderedCollection new). |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2006 |
]. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2007 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2008 |
index := infoCollection findFirst:[:i | |cnm1 cnm2| |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2009 |
cnm1 := i className. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2010 |
cnm2 := newInfo className. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2011 |
(cnm1 includes:$:) ifFalse:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2012 |
cnm1 := self defaultNameSpace name , '::' , cnm1 |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2013 |
]. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2014 |
(cnm2 includes:$:) ifFalse:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2015 |
cnm2 := self defaultNameSpace name , '::' , cnm2 |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2016 |
]. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2017 |
cnm1 = cnm2 and:[i methodName = newInfo methodName] |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2018 |
]. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2019 |
"/ 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
|
2020 |
"/ the default ... |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2021 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2022 |
nm := newInfo className. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2023 |
prefix := self defaultNameSpace name , '::'. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2024 |
(nm startsWith:prefix) ifTrue:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2025 |
nm := nm copyFrom:(prefix size + 1). |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2026 |
newInfo className:nm asSymbol. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2027 |
]. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2028 |
index ~~ 0 ifTrue:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2029 |
infoCollection at:index put:newInfo |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2030 |
] ifFalse:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2031 |
infoCollection add:newInfo |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2032 |
] |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2033 |
! |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2034 |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2035 |
classInfo:aClassInfoCollection |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2036 |
"set the class info of the project" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2037 |
|
4071 | 2038 |
self propertyAt:#classInfo put:aClassInfoCollection |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2039 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2040 |
! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2041 |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2042 |
comment |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2043 |
"return the comment of the project" |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2044 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2045 |
properties isNil ifTrue:[^ '']. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2046 |
^ properties at:#comment ifAbsent:'' |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2047 |
! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2048 |
|
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2049 |
comment:aString |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2050 |
"set the projects comment" |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2051 |
|
4071 | 2052 |
self propertyAt:#comment put:aString |
4070 | 2053 |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2054 |
! |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2055 |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2056 |
documentationURL |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2057 |
"return the documentation-URL of the project" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2058 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2059 |
properties isNil ifTrue:[^ nil]. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2060 |
^ properties at:#documentationURL ifAbsent:nil |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2061 |
! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2062 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2063 |
documentationURL:anURLString |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2064 |
"set the projects documentation-URL" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2065 |
|
4071 | 2066 |
self propertyAt:#documentationURL put:anURLString |
2067 |
||
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2068 |
! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2069 |
|
4755
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2070 |
methodInfo:aMethodInfoCollection |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2071 |
"set the method info of the project" |
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 |
self propertyAt:#methodInfo put:aMethodInfoCollection |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2074 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2075 |
! |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2076 |
|
617 | 2077 |
properties |
4097 | 2078 |
"return the property dictionary" |
2079 |
||
617 | 2080 |
^ properties |
2081 |
! |
|
2082 |
||
2083 |
properties:p |
|
4097 | 2084 |
"set the property dictionary" |
2085 |
||
617 | 2086 |
properties := p |
2087 |
! |
|
2088 |
||
4071 | 2089 |
propertyAt:aKey |
4097 | 2090 |
"return a property; the key is a symbol" |
2091 |
||
4071 | 2092 |
properties isNil ifTrue:[^ nil]. |
2093 |
^ properties at:aKey ifAbsent:nil. |
|
2094 |
! |
|
2095 |
||
2096 |
propertyAt:aKey put:aValue |
|
4097 | 2097 |
"set a property; the key is a symbol" |
2098 |
||
4077 | 2099 |
|oldValue| |
2100 |
||
2101 |
oldValue := self propertyAt:aKey. |
|
2102 |
||
4071 | 2103 |
properties isNil ifTrue:[ |
2104 |
properties := IdentityDictionary new |
|
2105 |
]. |
|
2106 |
properties at:aKey put:aValue. |
|
4077 | 2107 |
|
2108 |
oldValue ~~ aValue ifTrue:[ |
|
2109 |
self changed:aKey. |
|
2110 |
]. |
|
4071 | 2111 |
|
2112 |
"Created: / 23.3.1999 / 14:21:11 / cg" |
|
2113 |
! |
|
2114 |
||
617 | 2115 |
type |
4097 | 2116 |
"return the type of project (one of #application, #library, #smalltalk)" |
617 | 2117 |
|
3972
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2118 |
properties isNil ifTrue:[^ #application]. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2119 |
^ properties at:#type ifAbsent:#application |
617 | 2120 |
! |
2121 |
||
2122 |
type:aSymbol |
|
4097 | 2123 |
"set the projects type (one of #application, #library, #smalltalk)" |
617 | 2124 |
|
4769 | 2125 |
|sym| |
2126 |
||
2127 |
(sym := aSymbol) == #classLibrary ifTrue:[ |
|
2128 |
sym := #library |
|
2129 |
]. |
|
2130 |
(#(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
|
2131 |
self warn:'invalid project type'. |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2132 |
^ self |
efc25c2863e9
more attributes; some preparations for the ProjectBrowser.
Claus Gittinger <cg@exept.de>
parents:
3332
diff
changeset
|
2133 |
]. |
4769 | 2134 |
self propertyAt:#type put:sym |
4069 | 2135 |
! |
2136 |
||
2137 |
wasLoadedFromFile |
|
2138 |
"return true, if the project was loaded from a file" |
|
2139 |
||
2140 |
properties isNil ifTrue:[^ nil]. |
|
2141 |
^ properties at:#wasLoadedFromFile ifAbsent:false |
|
2142 |
||
2143 |
"Modified: / 23.3.1999 / 13:59:32 / cg" |
|
2144 |
"Created: / 23.3.1999 / 14:21:06 / cg" |
|
2145 |
! |
|
2146 |
||
2147 |
wasLoadedFromFile:aBoolean |
|
4097 | 2148 |
"set/clear the flag stating that the project was loaded from a file" |
2149 |
||
4071 | 2150 |
self propertyAt:#wasLoadedFromFile put:aBoolean |
617 | 2151 |
! ! |
2152 |
||
2153 |
!Project methodsFor:'queries'! |
|
2154 |
||
4688 | 2155 |
areAllClassesLoaded |
2156 |
"return true, if all classes of the package are loaded |
|
2157 |
(i.e. there are no autoloaded stubs present)" |
|
2158 |
||
4690 | 2159 |
|classes| |
2160 |
||
2161 |
classes := self classes. |
|
2162 |
classes isNil ifTrue:[^ isLoaded ? false]. |
|
2163 |
classes do:[:aClass | |
|
4688 | 2164 |
aClass isLoaded ifFalse:[^ false]. |
2165 |
]. |
|
2166 |
^ true |
|
2167 |
||
2168 |
! |
|
2169 |
||
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2170 |
classInfo |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2171 |
"return a classInfo collection of classes belonging to that project" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2172 |
|
4073 | 2173 |
|classInfo classes| |
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2174 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2175 |
properties notNil ifTrue:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2176 |
classInfo := properties at:#classInfo ifAbsent:nil. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2177 |
classInfo notNil ifTrue:[^ classInfo]. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2178 |
]. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2179 |
|
4073 | 2180 |
classes := self classes. |
2181 |
classes size == 0 ifTrue:[ |
|
2182 |
classInfo := OrderedCollection new |
|
2183 |
] ifFalse:[ |
|
2184 |
classInfo := classes asOrderedCollection |
|
2185 |
collect:[:class | |
|
2186 |
|i fn| |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2187 |
|
4073 | 2188 |
i := ClassInfo new. |
2189 |
i conditionForInclusion:#always. |
|
2190 |
i className:class name. |
|
2191 |
fn := class classFilename ? ((Smalltalk fileNameForClass:class) , '.st'). |
|
2192 |
i classFileName:fn. |
|
2193 |
i |
|
2194 |
] |
|
2195 |
]. |
|
2196 |
self propertyAt:#classInfo put:classInfo. |
|
2197 |
^ classInfo |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2198 |
|
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2199 |
"Modified: 4.1.1997 / 16:51:18 / cg" |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2200 |
! |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2201 |
|
617 | 2202 |
classes |
4013
f06d31702f2a
ignore private classes in classList
Claus Gittinger <cg@exept.de>
parents:
4010
diff
changeset
|
2203 |
"return a collection of classes belonging to that project. |
f06d31702f2a
ignore private classes in classList
Claus Gittinger <cg@exept.de>
parents:
4010
diff
changeset
|
2204 |
This excludes any private classes." |
617 | 2205 |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2206 |
|classes classInfo| |
617 | 2207 |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2208 |
properties notNil ifTrue:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2209 |
classInfo := properties at:#classInfo ifAbsent:nil. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2210 |
classInfo notNil ifTrue:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2211 |
classes := classInfo collect:[:i | i className] |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2212 |
] ifFalse:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2213 |
classes := properties at:#classes ifAbsent:nil |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2214 |
] |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2215 |
]. |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2216 |
|
617 | 2217 |
classes isNil ifTrue:[ |
2056 | 2218 |
classes := OrderedCollection new. |
2219 |
Smalltalk |
|
4013
f06d31702f2a
ignore private classes in classList
Claus Gittinger <cg@exept.de>
parents:
4010
diff
changeset
|
2220 |
allClassesDo:[:aClass | |
4670 | 2221 |
(true "aClass owningClass isNil" |
4089 | 2222 |
and:[aClass isMeta not |
4670 | 2223 |
and:[aClass package = packageName |
2224 |
and:[aClass isNamespace not or:[aClass == Smalltalk]]]]) ifTrue:[ |
|
4089 | 2225 |
classes add:aClass |
2056 | 2226 |
] |
2227 |
]. |
|
2228 |
classes isEmpty ifTrue:[^ nil]. |
|
617 | 2229 |
]. |
2230 |
^ classes |
|
2231 |
||
2056 | 2232 |
"Modified: 4.1.1997 / 16:51:18 / cg" |
617 | 2233 |
! |
2234 |
||
2235 |
individualMethods |
|
2236 |
"return a collection of individual methods belonging to that project, |
|
2237 |
only methods are returned which are not contained in the |
|
2238 |
projects class set." |
|
2239 |
||
4755
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2240 |
|
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 |
"/ obsoleted by #methods ... |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2243 |
"/ |
617 | 2244 |
|classes methods| |
2245 |
||
2246 |
classes := self classes. |
|
2247 |
classes notNil ifTrue:[ |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2248 |
classes := classes asIdentitySet. |
617 | 2249 |
] ifFalse:[ |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2250 |
classes := #() |
617 | 2251 |
]. |
2252 |
||
2253 |
methods := IdentitySet new. |
|
2254 |
Smalltalk allBehaviorsDo:[:cls | |
|
4119 | 2255 |
|classToCheck| |
2256 |
||
2257 |
classToCheck := cls. |
|
4670 | 2258 |
"/ cls isPrivate ifTrue:[ |
2259 |
"/ classToCheck := cls topOwningClass |
|
2260 |
"/ ]. |
|
4119 | 2261 |
(classes isNil |
2262 |
or:[((classes includes:classToCheck) |
|
2263 |
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
|
2264 |
cls methodDictionary do:[:m | |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2265 |
m package = packageName ifTrue:[ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2266 |
methods add:m |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2267 |
] |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2268 |
]. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2269 |
cls class methodDictionary do:[:m | |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2270 |
m package = packageName ifTrue:[ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2271 |
methods add:m |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2272 |
] |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2273 |
]. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2274 |
] |
617 | 2275 |
]. |
2276 |
^ methods asArray |
|
2277 |
||
2278 |
" |
|
2279 |
Project current classes |
|
2280 |
Project current individualMethods |
|
2281 |
" |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2282 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1420
diff
changeset
|
2283 |
"Modified: 7.6.1996 / 09:16:25 / stefan" |
4685
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2284 |
! |
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2285 |
|
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2286 |
isLoaded |
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2287 |
"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
|
2288 |
into the system" |
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2289 |
|
4769 | 2290 |
|binaryModule cls| |
4685
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2291 |
|
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2292 |
isLoaded notNil ifTrue:[^ isLoaded]. |
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2293 |
|
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2294 |
"/ check for loaded class-libraries. |
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2295 |
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
|
2296 |
binaryModule notNil ifTrue:[ |
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2297 |
^ true |
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2298 |
]. |
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2299 |
|
4769 | 2300 |
"/ check for all classes ... |
2301 |
self classes do:[:aClassOrClassName | |
|
2302 |
aClassOrClassName isBehavior ifFalse:[ |
|
2303 |
aClassOrClassName isSymbol ifTrue:[ |
|
2304 |
(cls := Smalltalk at:aClassOrClassName) isNil ifTrue:[ |
|
2305 |
^ false |
|
2306 |
]. |
|
2307 |
cls isBehavior ifFalse:[^ false]. |
|
2308 |
cls isLoaded ifFalse:[^ false]. |
|
2309 |
] ifFalse:[ |
|
2310 |
self halt. |
|
2311 |
^ false |
|
2312 |
] |
|
2313 |
] |
|
2314 |
]. |
|
2315 |
||
4685
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2316 |
self halt. |
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2317 |
|
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2318 |
" |
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2319 |
(Project projectWithId:#'stx:libbasic') isLoaded |
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2320 |
(Project projectWithId:#'stx:goodies/persistency') isLoaded |
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2321 |
" |
d145298696b7
more package loading support
Claus Gittinger <cg@exept.de>
parents:
4670
diff
changeset
|
2322 |
|
4755
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2323 |
! |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2324 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2325 |
methodInfo |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2326 |
"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
|
2327 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2328 |
|methodInfo methods| |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2329 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2330 |
properties notNil ifTrue:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2331 |
methodInfo := properties at:#methodInfo ifAbsent:nil. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2332 |
methodInfo notNil ifTrue:[^ methodInfo]. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2333 |
]. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2334 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2335 |
methods := self methods. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2336 |
methods size == 0 ifTrue:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2337 |
methodInfo := OrderedCollection new |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2338 |
] ifFalse:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2339 |
methodInfo := methods asOrderedCollection |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2340 |
collect:[:mthd | |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2341 |
|i fn who className selector| |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2342 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2343 |
mthd isMethod ifTrue:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2344 |
who := mthd who. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2345 |
className := who methodClass name. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2346 |
selector := who methodSelector. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2347 |
i := MethodInfo new. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2348 |
i conditionForInclusion:#always. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2349 |
i className:className. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2350 |
i methodName:className. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2351 |
fn := mthd sourceFilename. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2352 |
i fileName:fn. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2353 |
i |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2354 |
] ifFalse:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2355 |
mthd "/ already a methodInfo |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2356 |
] |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2357 |
] |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2358 |
]. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2359 |
self propertyAt:#methodInfo put:methodInfo. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2360 |
^ methodInfo |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2361 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2362 |
"Modified: 4.1.1997 / 16:51:18 / cg" |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2363 |
! |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2364 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2365 |
methods |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2366 |
"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
|
2367 |
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
|
2368 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2369 |
|methods methodsInfo| |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2370 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2371 |
properties notNil ifTrue:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2372 |
methodsInfo := properties at:#methodsInfo ifAbsent:nil. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2373 |
methodsInfo notNil ifTrue:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2374 |
methods := methodsInfo collect:[:i | i className] |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2375 |
] ifFalse:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2376 |
methods := properties at:#methods ifAbsent:nil |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2377 |
] |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2378 |
]. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2379 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2380 |
methods isNil ifTrue:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2381 |
methods := OrderedCollection new. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2382 |
Smalltalk allClassesDo:[:aClass | |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2383 |
(true "aClass owningClass isNil" |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2384 |
and:[aClass isMeta not |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2385 |
and:[aClass package ~= packageName |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2386 |
and:[aClass isNamespace not or:[aClass == Smalltalk]]]]) ifTrue:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2387 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2388 |
aClass methodDictionary keysAndValuesDo:[:sel :mthd | |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2389 |
mthd package = packageName ifTrue:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2390 |
methods add:(MethodInfo new |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2391 |
className:aClass name; |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2392 |
methodName:sel; |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2393 |
yourself) |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2394 |
]. |
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 |
aClass class methodDictionary keysAndValuesDo:[:sel :mthd | |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2397 |
mthd package = packageName ifTrue:[ |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2398 |
methods add:(MethodInfo new |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2399 |
className:(aClass name , ' class'); |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2400 |
methodName:sel; |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2401 |
yourself) |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2402 |
]. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2403 |
] |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2404 |
] |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2405 |
]. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2406 |
methods isEmpty ifTrue:[^ #()]. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2407 |
]. |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2408 |
^ methods |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2409 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2410 |
"Modified: 4.1.1997 / 16:51:18 / cg" |
2 | 2411 |
! ! |
2412 |
||
2413 |
!Project methodsFor:'specifications'! |
|
2414 |
||
2415 |
readSpec |
|
2416 |
|s chunk fileName| |
|
2417 |
||
2418 |
fileName := (properties at:#directoryName) asFilename construct:'.project'. |
|
2419 |
s := fileName readStream. |
|
2420 |
s isNil ifTrue:[^ self]. |
|
2421 |
[s atEnd] whileFalse:[ |
|
203 | 2422 |
chunk := s nextChunk. |
2423 |
Compiler evaluate:chunk receiver:properties notifying:nil |
|
2 | 2424 |
]. |
2425 |
s close. |
|
2426 |
||
2427 |
"(Project new directory:'../projects/Clock') readSpec" |
|
2428 |
! |
|
2429 |
||
2430 |
saveSpec |
|
2431 |
|f d s| |
|
2432 |
||
2433 |
d := (properties at:#directoryName) asFilename. |
|
2434 |
d exists ifFalse:[ |
|
4522
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
2435 |
self error:'directory does not exist' mayProceed:true. |
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
2436 |
^ self |
2 | 2437 |
]. |
2438 |
f := d construct:'.project'. |
|
2439 |
s := f writeStream. |
|
2440 |
s isNil ifTrue:[^ self]. |
|
2441 |
properties associationsDo:[:aProp | |
|
4522
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
2442 |
(aProp == #directoryName) ifFalse:[ |
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
2443 |
s nextChunkPut:('self at:' , aProp key storeString, |
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
2444 |
' put:' , aProp value storeString). |
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
2445 |
s cr |
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
2446 |
] |
2 | 2447 |
]. |
2448 |
s close |
|
2449 |
||
2450 |
"((Project new directory:'../projects/Clock') readSpec |
|
4522
29a6625dc7b1
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
4315
diff
changeset
|
2451 |
directory:'../projects/xxx') saveSpec" |
2 | 2452 |
! ! |
2453 |
||
617 | 2454 |
!Project methodsFor:'views'! |
2455 |
||
2456 |
addView:aView |
|
2164
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
2457 |
"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
|
2458 |
|
617 | 2459 |
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
|
2460 |
|
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
2461 |
"Modified: 14.2.1997 / 15:36:51 / cg" |
617 | 2462 |
! |
2463 |
||
2464 |
destroyViews |
|
2465 |
"destroy all views of this project" |
|
2466 |
||
2467 |
views notNil ifTrue:[ |
|
2468 |
views do:[:aView | |
|
2469 |
aView notNil ifTrue:[aView destroy] |
|
2470 |
] |
|
2471 |
]. |
|
2472 |
! |
|
2473 |
||
2474 |
hideViews |
|
2475 |
"hide all views of this project" |
|
2476 |
||
2477 |
views notNil ifTrue:[ |
|
1332
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
2478 |
views do:[:aView | |
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
2479 |
aView notNil ifTrue:[aView unmap] |
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
2480 |
] |
617 | 2481 |
]. |
1332
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
2482 |
|
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
2483 |
"Modified: 3.5.1996 / 23:48:51 / stefan" |
617 | 2484 |
! |
2485 |
||
2486 |
removeView:aView |
|
2164
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
2487 |
"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
|
2488 |
|
3996
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2489 |
views notNil ifTrue:[ |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2490 |
views remove:aView ifAbsent:nil |
3183ccccabaa
more support for projectBrowser
Claus Gittinger <cg@exept.de>
parents:
3974
diff
changeset
|
2491 |
] |
2164
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
2492 |
|
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
2493 |
"Modified: 14.2.1997 / 15:37:20 / cg" |
617 | 2494 |
! |
2495 |
||
2496 |
showViews |
|
2164
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
2497 |
"show all views of this project" |
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
2498 |
|
617 | 2499 |
views notNil ifTrue:[ |
1332
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
2500 |
views do:[:aView | |
2164
063b0227aeda
use #remap instead of #map to show views
Claus Gittinger <cg@exept.de>
parents:
2056
diff
changeset
|
2501 |
aView notNil ifTrue:[aView remap] |
1332
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
2502 |
] |
617 | 2503 |
]. |
1332
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
2504 |
|
a1d72522f5fc
Rename unrealize-->unmap, rerealize->map.
Stefan Vogel <sv@exept.de>
parents:
1298
diff
changeset
|
2505 |
"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
|
2506 |
"Modified: 14.2.1997 / 15:38:47 / cg" |
617 | 2507 |
! ! |
2508 |
||
4769 | 2509 |
!Project::ClassInfo methodsFor:'accessing'! |
2510 |
||
2511 |
classFileName |
|
2512 |
"return the value of the instance variable 'classFileName' (automatically generated)" |
|
2513 |
||
2514 |
^ classFileName! |
|
2515 |
||
2516 |
classFileName:something |
|
2517 |
"set the value of the instance variable 'classFileName' (automatically generated)" |
|
2518 |
||
2519 |
classFileName := something.! |
|
2520 |
||
2521 |
className |
|
2522 |
"return the value of the instance variable 'className' (automatically generated)" |
|
2523 |
||
2524 |
^ className! |
|
2525 |
||
2526 |
className:something |
|
2527 |
"set the value of the instance variable 'className' (automatically generated)" |
|
2528 |
||
2529 |
className := something.! |
|
2530 |
||
2531 |
conditionForInclusion |
|
2532 |
"return the value of the instance variable 'conditionForInclusion' (automatically generated)" |
|
2533 |
||
2534 |
^ conditionForInclusion! |
|
2535 |
||
2536 |
conditionForInclusion:something |
|
2537 |
"set the value of the instance variable 'conditionForInclusion' (automatically generated)" |
|
2538 |
||
2539 |
conditionForInclusion := something.! ! |
|
2540 |
||
2541 |
!Project::ClassInfo methodsFor:'printing & storing'! |
|
2542 |
||
2543 |
displayString |
|
2544 |
^ 'ClassInfo: ' , className |
|
2545 |
! ! |
|
2546 |
||
4743 | 2547 |
!Project::MethodInfo methodsFor:'accessing'! |
2548 |
||
2549 |
className |
|
2550 |
"return the value of the instance variable 'className' (automatically generated)" |
|
2551 |
||
2552 |
^ className! |
|
2553 |
||
2554 |
className:something |
|
2555 |
"set the value of the instance variable 'className' (automatically generated)" |
|
2556 |
||
2557 |
className := something.! |
|
2558 |
||
4755
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2559 |
conditionForInclusion |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2560 |
"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
|
2561 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2562 |
^ conditionForInclusion! |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2563 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2564 |
conditionForInclusion:something |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2565 |
"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
|
2566 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2567 |
conditionForInclusion := something.! |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2568 |
|
4743 | 2569 |
fileName |
2570 |
"return the value of the instance variable 'fileName' (automatically generated)" |
|
2571 |
||
2572 |
^ fileName! |
|
2573 |
||
2574 |
fileName:something |
|
2575 |
"set the value of the instance variable 'fileName' (automatically generated)" |
|
2576 |
||
2577 |
fileName := something.! |
|
2578 |
||
2579 |
methodName |
|
2580 |
"return the value of the instance variable 'methodName' (automatically generated)" |
|
2581 |
||
2582 |
^ methodName! |
|
2583 |
||
2584 |
methodName:something |
|
2585 |
"set the value of the instance variable 'methodName' (automatically generated)" |
|
2586 |
||
2587 |
methodName := something.! ! |
|
2588 |
||
4755
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2589 |
!Project::MethodInfo methodsFor:'printing & storing'! |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2590 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2591 |
displayString |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2592 |
^ 'MethodInfo: ' , className , ' ' , methodName |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2593 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2594 |
|
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2595 |
! ! |
2d866f87d1da
preps to keep track of methods
Claus Gittinger <cg@exept.de>
parents:
4747
diff
changeset
|
2596 |
|
1854
b44227fd2b3d
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
2597 |
!Project class methodsFor:'documentation'! |
630 | 2598 |
|
2599 |
version |
|
4785 | 2600 |
^ '$Header: /cvs/stx/stx/libbasic/Project.st,v 1.100 1999-09-22 08:11:02 cg Exp $' |
1298 | 2601 |
! ! |
1 | 2602 |
Project initialize! |