author | Claus Gittinger <cg@exept.de> |
Sat, 10 Nov 2018 10:17:17 +0100 | |
changeset 23527 | 53033bc58a00 |
parent 23517 | a28496b2a7a3 |
child 23558 | 0fd6bf3b0c29 |
permissions | -rw-r--r-- |
9553 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
23124 | 3 |
All Rights Reserved |
9553 | 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 |
" |
|
9671 | 12 |
"{ Package: 'stx:libbasic' }" |
9536 | 13 |
|
17289 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
9569 | 16 |
Object subclass:#ProjectDefinition |
17289 | 17 |
instanceVariableNames:'' |
20546 | 18 |
classVariableNames:'AbbrevDictionary AccessLock FolderForSubApplicationsType |
19 |
GUIApplicationType LibraryType NonGUIApplicationType |
|
20 |
PackagesBeingLoaded Verbose' |
|
17289 | 21 |
poolDictionaries:'' |
22 |
category:'System-Support-Projects' |
|
9536 | 23 |
! |
24 |
||
14580 | 25 |
ProjectDefinition class instanceVariableNames:'safeForOverwrittenMethods extensionOverwriteInfo projectIsLoaded' |
9607 | 26 |
|
27 |
" |
|
28 |
No other class instance variables are inherited by this class. |
|
29 |
" |
|
30 |
! |
|
31 |
||
13592 | 32 |
Object subclass:#AbbrevEntry |
17289 | 33 |
instanceVariableNames:'className fileName category numClassInstVars' |
34 |
classVariableNames:'' |
|
35 |
poolDictionaries:'' |
|
36 |
privateIn:ProjectDefinition |
|
13592 | 37 |
! |
38 |
||
20567 | 39 |
Object subclass:#ApplicationDocumentTypeDescription |
40 |
instanceVariableNames:'extension iconFileOSX mimeType typeName iconFileWindows |
|
41 |
iconFileLinux roleOSX' |
|
42 |
classVariableNames:'' |
|
43 |
poolDictionaries:'' |
|
44 |
privateIn:ProjectDefinition |
|
45 |
! |
|
46 |
||
9569 | 47 |
!ProjectDefinition class methodsFor:'documentation'! |
9553 | 48 |
|
12210 | 49 |
buildingMakefiles |
50 |
" |
|
51 |
You can define additional rules and flag settings for use in the makeFile generation: |
|
52 |
||
53 |
redefinable build-file attributes: |
|
23124 | 54 |
stcOptimizationOptions -> STCLOCALOPT |
55 |
stcWarningOptions -> STCLOCALOPT |
|
56 |
localIncludes_unix -> LOCALINCLUDES (Make.proto) |
|
57 |
localIncludes_win32 -> LOCALINCLUDES (bc.mak) |
|
13419 | 58 |
|
59 |
for applications: |
|
23124 | 60 |
startupClassName |
61 |
startupSelector |
|
13419 | 62 |
|
63 |
for libraries: |
|
12210 | 64 |
|
65 |
" |
|
66 |
! |
|
67 |
||
9553 | 68 |
copyright |
69 |
" |
|
70 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
23124 | 71 |
All Rights Reserved |
9553 | 72 |
|
73 |
This software is furnished under a license and may be used |
|
74 |
only in accordance with the terms of that license and with the |
|
75 |
inclusion of the above copyright notice. This software may not |
|
76 |
be provided or otherwise made available to, or used by, any |
|
77 |
other person. No title to or ownership of the software is |
|
78 |
hereby transferred. |
|
79 |
" |
|
9714 | 80 |
! |
81 |
||
82 |
documentation |
|
83 |
" |
|
12210 | 84 |
As ST/X is (still) very tightly bound with stc, we keep the package and project information |
23124 | 85 |
in a class-object (instead of some project object) and all queries about package contents and |
86 |
attributes are implemented as class methods. |
|
21562 | 87 |
(after all: a class is an object, which can be asked by sending it messages... |
88 |
... so why would one want extra meta-descriptions with extra syntax?) |
|
23124 | 89 |
|
17025 | 90 |
This has the advantage, that it can be compiled and included in a compiled class library just like any other class. |
21562 | 91 |
|
17025 | 92 |
Every package includes a subclass of me (an instance of my meta), which provides useful |
23124 | 93 |
information about the versioning and packaging. |
94 |
Me myself, I know how to generate dependency information and can generate makefiles and other build-support |
|
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
95 |
files for compilation (see the browser's 'Checkin Build Support File' menu item. For more details, see |
21562 | 96 |
section 'Build Support Files' below). |
17025 | 97 |
|
98 |
When a package is loaded from a binary shared class lib (i.e. a compiled class library is loaded |
|
99 |
via 'Smalltalk loadPackage:'), the loading is done in multiple phases: |
|
23124 | 100 |
1) the shared object is loaded, but not installed (registered) in Smalltalk |
101 |
2) the ProjectDefinition class is registered and initialized. |
|
102 |
3) the ProjectDefinition class is asked to load its prerequisites. |
|
103 |
This may recursively lead to other packages to be loaded |
|
104 |
- either as binary class libraries, as bytecode or from source; whichever is found. |
|
105 |
4) the remaining classes and extensions of the package are registered |
|
12210 | 106 |
|
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
107 |
## Some special notes about extension methods: |
17025 | 108 |
if a package is loaded (Smalltalk loadPackage:'foo:bar/baz'), any already loaded package of which |
109 |
methods are overwritten by an extension method of the loaded package, the other package is asked to safe those |
|
23124 | 110 |
methods in its safe(ForOverwrittenMethods). |
17025 | 111 |
Thus, if the other package or any of its classes is asked |
112 |
to file itself out, it can do so using the safe (otherwise, you'd not be able to check the original class into |
|
113 |
its repository while it has an overriding extension loaded). |
|
114 |
||
115 |
Also, the information about which other package was in charge when a method is overwritten is recorded in |
|
23124 | 116 |
extensionOverwriteInfo. |
21562 | 117 |
This is used to correctly reinstall any overwritten method, whenever a package is unloaded. |
9714 | 118 |
|
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
119 |
## Build Support Files |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
120 |
|
21562 | 121 |
To support compilation of a package, ProjectDefinition can generate a set of makefiles and other |
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
122 |
support files to allow that. To see the set of files that should be generated, see #fileNamesToGenerate. |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
123 |
These files are usually generated and saved to the repository upon a commit - the source code management |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
124 |
does (should) care for this. |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
125 |
|
21562 | 126 |
Packages may add more files to this list by defining an (extension) method in project definition class |
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
127 |
and by annotating the method by <file:overwrite:> annotation: |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
128 |
|
23124 | 129 |
* the first parameter is the file name to generate as String, relative to the package root. As directory |
130 |
separator, use slash (as on UNIX), it will be automagically converted to platform's separator. |
|
131 |
* The second parametrer (true or false) tells the SCM whether the file should be generated (and thus |
|
132 |
overwritten) upon each commit (when true) or only the first time (when false). Important: see the |
|
133 |
remark below. |
|
134 |
* The method itself should return file's contents a string. If it returns nil, then the file is *not* |
|
135 |
generated at all. |
|
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
136 |
|
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
137 |
For examples, see #generate_java_build_auto_dot_xml and #generate_java_build_dot_xml defined by STX:LIBJAVA. |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
138 |
|
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
139 |
REMARK: CAUTION: |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
140 |
The overwrite: boolean is currently *not* supported by old SCM managers, more specifically |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
141 |
CVSSourceCodeManager does not support it. CVSSourceCodeManager will always overwrite the file!! |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
142 |
It *is* supported by all SCMs based on new stx:libscm. More specifically, *it is supported* by |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
143 |
Mercurial. |
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
144 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
145 |
## Adding additional rules to generated makefiles |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
146 |
|
20986 | 147 |
There are two ways to add additional rules to generated makefiles (Make.proto and bc.mak): |
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
148 |
1) overriding #additionalRules_make_dot_proto and/or #additionalRules_bc_dot_mak |
23124 | 149 |
2) adding a method annotated by <file:target:> or <file:target:extends:> |
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
150 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
151 |
### Overriding #additionalRules* methods |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
152 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
153 |
You may override #additionalRules_make_dot_proto and/or #additionalRules_bc_dot_mak and return |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
154 |
string containing the code of the rules. This string is inserted to the resulting makefile |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
155 |
as-is. This is the traditional way of doing this. |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
156 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
157 |
If you any of the targets defined there to be called as part of standard build, you may |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
158 |
also want to list these targets in #additionalTargets_make_dot_proto and/or |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
159 |
#additionalTargets_bc_dot_mak |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
160 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
161 |
### Adding annotatated method |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
162 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
163 |
Alternatively, you may add one method per rule and annotate it by |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
164 |
<file:target:> or <file:target:extends:> annotation. For example, |
20624 | 165 |
to call 'ant' whenever a package is built, add a method like: |
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
166 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
167 |
additionalRuleAnt_make_dot_proto |
23124 | 168 |
<file: 'Make.proto' target: 'ant' extends: 'pre_objs' > |
169 |
||
170 |
^ ' |
|
171 |
java: |
|
172 |
ant -f java/build.xml |
|
173 |
' |
|
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
174 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
175 |
The meaning annotation parameters is the following: |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
176 |
|
23124 | 177 |
* file: <String> - name of the file in which to include |
178 |
the rule. Currently only two values are valid: |
|
179 |
'Make.proto' and 'bc.mak'. |
|
180 |
* target: <String> - name of the target' |
|
181 |
* extends: <String> - optional name of the target that this additional |
|
182 |
rule extends. This means that the extending target (specified by target: |
|
183 |
annotation parameter) is called as part of building of the extended target |
|
184 |
(i.e., the target specified by extends: annotation parameter). Not all targets |
|
185 |
are extendible, see below. |
|
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
186 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
187 |
Method annotated by these annotations should return - when executed - a string |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
188 |
with exactly one rule. The rule name SHOULD match with the name in target: annotation |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
189 |
parameter, otherwise the extends: parameter will not work correctly. |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
190 |
If the methor returns nil, the rule is not included in resulting makefile. |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
191 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
192 |
The advantage of this approach is that it allows for additional, non-basic packages to hook in |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
193 |
and add their own targets if they want to. The disadvantage is that if package makefiles |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
194 |
are regenerated without this extending package loaded, targets are lost. To avid this, |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
195 |
you may want to add this non-basic package to prerequsites. |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
196 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
197 |
Currently, this mechanism is used by STX:LIBJAVA to call ant to compile package's java classes. |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
198 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
199 |
#### Extendable targets |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
200 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
201 |
Make.proto: |
23124 | 202 |
all |
203 |
clean |
|
204 |
...more to be added... |
|
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
205 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
206 |
bc.mak |
23124 | 207 |
ALL |
208 |
clean |
|
209 |
...more to be added... |
|
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
210 |
|
9714 | 211 |
" |
9553 | 212 |
! ! |
9536 | 213 |
|
9569 | 214 |
!ProjectDefinition class methodsFor:'instance creation'! |
9559 | 215 |
|
12371 | 216 |
definitionClassForPackage:aPackageID |
17025 | 217 |
"given a packageID (such as 'stx:libfoo/bar'), lookup the corresponding peoject definition class. |
218 |
Return it, or nil if not present" |
|
219 |
||
12371 | 220 |
^ self definitionClassForPackage:aPackageID createIfAbsent:false |
221 |
||
17025 | 222 |
" |
223 |
ProjectDefinition definitionClassForPackage:'stx:libbasic' |
|
224 |
ProjectDefinition definitionClassForPackage:'stx:libfoobarBaz' |
|
225 |
" |
|
226 |
||
12371 | 227 |
"Modified: / 17-08-2006 / 14:33:35 / cg" |
228 |
! |
|
229 |
||
230 |
definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent |
|
231 |
^ self definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent projectType:nil |
|
232 |
||
233 |
"Modified: / 23-08-2006 / 14:29:15 / cg" |
|
234 |
! |
|
235 |
||
236 |
definitionClassForPackage: aPackageID createIfAbsent: doCreateIfAbsent projectType:typeOrNil |
|
237 |
|packageDefinitionClassName class| |
|
238 |
||
17344 | 239 |
packageDefinitionClassName := self projectDefinitionClassNameForDefinitionOf:aPackageID. |
12371 | 240 |
class := Smalltalk classNamed:packageDefinitionClassName. |
241 |
class isNil ifTrue:[ |
|
23124 | 242 |
doCreateIfAbsent ifTrue:[ |
243 |
typeOrNil = GUIApplicationType ifTrue:[ |
|
244 |
class := ApplicationDefinition newForPackage:aPackageID. |
|
245 |
] ifFalse:[ |
|
246 |
typeOrNil = NonGUIApplicationType ifTrue:[ |
|
247 |
class := ApplicationDefinition newForPackage:aPackageID. |
|
248 |
] ifFalse:[ |
|
249 |
typeOrNil = FolderForSubApplicationsType ifTrue:[ |
|
250 |
class := FolderForProjectsDefinition newForPackage:aPackageID. |
|
251 |
] ifFalse:[ |
|
252 |
class := LibraryDefinition newForPackage:aPackageID. |
|
253 |
] |
|
254 |
] |
|
255 |
]. |
|
256 |
"setup before prerequisites are defined" |
|
257 |
class setupForType:typeOrNil. |
|
258 |
"/ look what is there and include it; is this ok ? |
|
259 |
class compileDescriptionMethods |
|
260 |
]. |
|
12371 | 261 |
] ifFalse:[ |
23124 | 262 |
typeOrNil notNil ifTrue:[ |
263 |
doCreateIfAbsent ifTrue:[ |
|
264 |
class projectType == typeOrNil ifFalse: [ |
|
265 |
class setupForType:typeOrNil. |
|
266 |
] |
|
267 |
]. |
|
268 |
]. |
|
12371 | 269 |
]. |
270 |
^ class |
|
271 |
||
272 |
"Created: / 23-08-2006 / 14:29:21 / cg" |
|
273 |
"Modified: / 23-08-2006 / 15:35:26 / cg" |
|
274 |
! |
|
275 |
||
276 |
definitionClassForPackage:newProjectID projectType:typeOrNil createIfAbsent:createIfAbsent |
|
277 |
^ (self definitionClassForType:typeOrNil) |
|
23124 | 278 |
definitionClassForPackage:newProjectID |
279 |
createIfAbsent:createIfAbsent |
|
280 |
projectType:typeOrNil |
|
12371 | 281 |
|
282 |
"Created: / 23-08-2006 / 14:28:53 / cg" |
|
283 |
! |
|
284 |
||
285 |
definitionClassForType: type |
|
286 |
"answer the class that describes a give project type" |
|
287 |
||
288 |
(type = LibraryType) ifTrue:[ ^ LibraryDefinition ]. |
|
289 |
(type = GUIApplicationType) ifTrue:[ ^ ApplicationDefinition ]. |
|
290 |
(type = NonGUIApplicationType) ifTrue:[ ^ ApplicationDefinition ]. |
|
16682 | 291 |
(type = FolderForSubApplicationsType) ifTrue:[ ^ FolderForProjectsDefinition ]. |
12371 | 292 |
(type = 'Application') ifTrue:[ ^ ApplicationDefinition ]. "/ temporary - for backward compat. |
293 |
self error:'unknown project type'. |
|
294 |
||
295 |
"Created: / 17-08-2006 / 14:46:28 / cg" |
|
296 |
"Modified: / 23-08-2006 / 13:49:27 / cg" |
|
297 |
! |
|
298 |
||
9559 | 299 |
newForPackage:packageID |
13419 | 300 |
^ self |
23124 | 301 |
newNamed:(self projectDefinitionClassNameForDefinitionOf:packageID) |
302 |
package:packageID. |
|
9559 | 303 |
|
304 |
"Created: / 11-08-2006 / 14:27:19 / cg" |
|
305 |
! |
|
306 |
||
307 |
newNamed:newName package:packageID |
|
308 |
|newClass| |
|
309 |
||
310 |
"/ for now, we are strict. |
|
17344 | 311 |
self assert:(self projectDefinitionClassNameForDefinitionOf:packageID) = newName. |
9569 | 312 |
self assert:(self ~~ ProjectDefinition). "ProjectDefinition is abstract" |
9559 | 313 |
|
314 |
newClass := self |
|
23124 | 315 |
subclass:(newName asSymbol) |
316 |
instanceVariableNames:'' |
|
317 |
classVariableNames:'' |
|
318 |
poolDictionaries:'' |
|
319 |
category:(self defaultCategory). |
|
9559 | 320 |
|
321 |
newClass package:packageID asSymbol. |
|
322 |
^ newClass |
|
323 |
||
324 |
"Created: / 09-08-2006 / 17:57:37 / fm" |
|
325 |
"Modified: / 09-08-2006 / 19:27:53 / fm" |
|
9569 | 326 |
"Modified: / 17-08-2006 / 17:24:23 / cg" |
9559 | 327 |
! ! |
328 |
||
9569 | 329 |
!ProjectDefinition class methodsFor:'accessing'! |
9536 | 330 |
|
23452 | 331 |
additionalClassResources |
332 |
"for projects which need additional resources from some other |
|
333 |
package (i.e. plugins), redefine this to return a collection |
|
334 |
of inherited definitions. |
|
335 |
i.e. change to ^ { foo_package classResources }" |
|
336 |
||
337 |
^ #() |
|
338 |
! |
|
339 |
||
12575 | 340 |
directory |
341 |
"for packageId compatibility" |
|
342 |
||
343 |
^ self moduleDirectory |
|
344 |
||
345 |
" |
|
346 |
bosch_dapasx_datenbasis_Definition moduleDirectory |
|
347 |
bosch_dapasx_parameter_system_Definition moduleDirectory |
|
13419 | 348 |
stx_libbasic3 moduleDirectory |
349 |
cg_croquet moduleDirectory |
|
350 |
cg_croquet package asPackageId module |
|
351 |
cg_croquet moduleDirectory |
|
352 |
stx_goodies_xml_vw moduleDirectory |
|
12575 | 353 |
" |
354 |
||
355 |
"Created: / 08-08-2006 / 20:25:39 / fm" |
|
356 |
"Modified: / 18-08-2006 / 12:18:33 / cg" |
|
357 |
! |
|
358 |
||
13823 | 359 |
extensionsRevisionInfoForManager:managerOrNil |
360 |
"return the revisionInfo object for my extensions for a particular source code manager. |
|
361 |
Return nil, if there is either no manager, or I have no extensions" |
|
362 |
||
363 |
|mgr versionMethod revString| |
|
364 |
||
365 |
(mgr := managerOrNil) isNil ifTrue:[ |
|
23124 | 366 |
mgr := SourceCodeManagerUtilities sourceCodeManagerFor:self. |
367 |
mgr isNil ifTrue:[ |
|
368 |
^ nil |
|
369 |
]. |
|
13823 | 370 |
]. |
371 |
||
372 |
versionMethod := mgr nameOfVersionMethodForExtensions. |
|
373 |
(self class implements:versionMethod) ifFalse:[^ nil]. |
|
374 |
||
375 |
revString := self perform:(mgr nameOfVersionMethodForExtensions) ifNotUnderstood:nil. |
|
376 |
revString isNil ifTrue:[ |
|
23124 | 377 |
^ nil. |
13823 | 378 |
]. |
379 |
^ mgr revisionInfoFromString:revString. |
|
380 |
||
381 |
" |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
382 |
(stx_libcomp extensionsRevisionInfoForManager:nil) revision |
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
383 |
(stx_libbasic extensionsRevisionInfoForManager:nil) |
13823 | 384 |
" |
385 |
||
386 |
"Created: / 25-11-2011 / 14:34:01 / cg" |
|
387 |
! |
|
388 |
||
19996 | 389 |
fullPackageName |
390 |
"all components with underlines" |
|
391 |
||
392 |
^ self fullPackageNameFor: self package |
|
393 |
||
394 |
" |
|
395 |
stx_libwidg2 packageName |
|
396 |
stx_libwidg2 fullPackageName |
|
397 |
stx_goodies_refactoryBrowser_browser packageName |
|
398 |
stx_goodies_refactoryBrowser_browser fullPackageName |
|
399 |
" |
|
400 |
! |
|
401 |
||
402 |
fullPackageNameFor: aProjectID |
|
403 |
^ (aProjectID copyReplaceAny:':/' with:$_) |
|
404 |
||
405 |
" |
|
23124 | 406 |
stx_goodies_refactoryBrowser_lint fullPackageNameFor:#stx_goodies_refactoryBrowser_lint |
19996 | 407 |
" |
408 |
! |
|
409 |
||
9536 | 410 |
initialClassNameForDefinitionOf:aPackageId |
17344 | 411 |
<resource: #obsolete> |
412 |
||
413 |
"now obsolete - left here for backward compatibility |
|
414 |
given a package-ID, return an appropriate class name for this package" |
|
415 |
||
416 |
^ self projectDefinitionClassNameForDefinitionOf:aPackageId |
|
417 |
||
418 |
" |
|
419 |
ProjectDefinition projectDefinitionClassNameForDefinitionOf:'bosch:dapasx/interactiver_editor' |
|
420 |
ProjectDefinition projectDefinitionClassNameForDefinitionOf:'stx:libbasic' |
|
421 |
ProjectDefinition projectDefinitionClassNameForDefinitionOf:'stx:goodies/xml' |
|
422 |
ProjectDefinition projectDefinitionClassNameForDefinitionOf:'stx/goodies/xml' |
|
423 |
ProjectDefinition projectDefinitionClassNameForDefinitionOf:'stx_goodies_xml' |
|
424 |
" |
|
9536 | 425 |
! |
426 |
||
427 |
libraryName |
|
9575 | 428 |
^ self package asPackageId libraryName |
9536 | 429 |
|
9559 | 430 |
" |
9688 | 431 |
bosch_dapasx_datenbasis libraryName |
9575 | 432 |
stx_libbasic3 libraryName |
9559 | 433 |
" |
9536 | 434 |
|
435 |
"Modified: / 09-08-2006 / 18:20:29 / fm" |
|
9575 | 436 |
"Modified: / 18-08-2006 / 12:36:45 / cg" |
9536 | 437 |
! |
438 |
||
13419 | 439 |
libraryNameFor:aProjectID |
9575 | 440 |
^ aProjectID asPackageId libraryName |
9536 | 441 |
|
9559 | 442 |
" |
9575 | 443 |
bosch_dapasx_datenbasis libraryName |
444 |
stx_libbasic3 libraryNameFor:'stx:libbasic' |
|
13419 | 445 |
stx_libbasic3 libraryNameFor:'bosch:dapasx/datenbasis' |
9559 | 446 |
" |
9536 | 447 |
|
448 |
"Modified: / 09-08-2006 / 18:20:29 / fm" |
|
9575 | 449 |
"Modified: / 18-08-2006 / 12:37:02 / cg" |
9536 | 450 |
! |
451 |
||
14577 | 452 |
loadDirectory |
19731 | 453 |
"if I was loaded from a directory (as opposed to loaded via a dll or from a source code manager), |
14577 | 454 |
return that directory. Otherwise return nil." |
455 |
||
14583 | 456 |
^ self getAttribute:#projectDirectory |
14577 | 457 |
! |
458 |
||
459 |
loadDirectory:aDirectory |
|
460 |
"remember the directory from which I was loaded from" |
|
461 |
||
14583 | 462 |
self setAttribute:#projectDirectory to:aDirectory |
14577 | 463 |
! |
464 |
||
9536 | 465 |
module |
9559 | 466 |
^ self moduleOfClass:self |
9536 | 467 |
|
9559 | 468 |
" |
469 |
bosch_dapasx_datenbasis_Definition module |
|
470 |
DapasX_Datenbasis module |
|
13419 | 471 |
stx_libbasic3 module |
472 |
stx_libbasic3 directory |
|
9559 | 473 |
" |
9536 | 474 |
|
475 |
"Created: / 08-08-2006 / 20:24:53 / fm" |
|
476 |
"Modified: / 09-08-2006 / 16:16:37 / fm" |
|
9575 | 477 |
"Modified: / 17-08-2006 / 20:50:46 / cg" |
9536 | 478 |
! |
479 |
||
480 |
moduleDirectory |
|
9575 | 481 |
^ (PackageId from:self package) directory |
9536 | 482 |
|
9559 | 483 |
" |
9575 | 484 |
bosch_dapasx_datenbasis_Definition moduleDirectory |
485 |
bosch_dapasx_parameter_system_Definition moduleDirectory |
|
13419 | 486 |
stx_libbasic3 moduleDirectory |
487 |
cg_croquet moduleDirectory |
|
488 |
cg_croquet package asPackageId module |
|
489 |
cg_croquet moduleDirectory |
|
490 |
stx_goodies_xml_vw moduleDirectory |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
491 |
cg_demos_demo1 moduleDirectory |
9559 | 492 |
" |
9536 | 493 |
|
494 |
"Created: / 08-08-2006 / 20:25:39 / fm" |
|
14339 | 495 |
"Modified (comment): / 05-09-2012 / 10:07:18 / cg" |
9536 | 496 |
! |
497 |
||
13419 | 498 |
moduleDirectoryFor:aProjectID |
9559 | 499 |
^ (aProjectID subStrings:$:) last |
9536 | 500 |
|
9559 | 501 |
" |
23124 | 502 |
bosch_dapasx_datenbasis_Definition moduleDirectory |
503 |
bosch_dapasx_parameter_system_Definition moduleDirectory |
|
9559 | 504 |
" |
9536 | 505 |
|
506 |
"Created: / 08-08-2006 / 20:25:39 / fm" |
|
9559 | 507 |
"Modified: / 17-08-2006 / 14:13:41 / cg" |
9536 | 508 |
! |
509 |
||
9891 | 510 |
moduleDirectory_win32 |
15528 | 511 |
^ (PackageId from:self package) directory copyReplaceAll:$/ with:$\ |
9891 | 512 |
|
513 |
" |
|
514 |
bosch_dapasx_datenbasis moduleDirectory_win32 |
|
515 |
bosch_dapasx_parameter_system moduleDirectory_win32 |
|
13419 | 516 |
stx_libbasic3 moduleDirectory_win32 |
9891 | 517 |
" |
518 |
||
519 |
"Created: / 14-09-2006 / 20:19:17 / cg" |
|
520 |
! |
|
521 |
||
10562 | 522 |
moduleDirectory_win32For: projectID |
523 |
||
15528 | 524 |
^(self moduleDirectoryFor:projectID) copyReplaceAll:$/ with:$\ |
10562 | 525 |
|
526 |
" |
|
527 |
self moduleDirectory_win32For: #'bosch:dapasx/pav_vergleich' |
|
528 |
self moduleDirectory_win32For: #'stx:goodies/xml/stx' |
|
529 |
self moduleDirectory_win32For: #'stx:libbasic2' |
|
530 |
" |
|
15528 | 531 |
|
532 |
"Modified: / 16-07-2013 / 19:47:24 / cg" |
|
10562 | 533 |
! |
534 |
||
13419 | 535 |
moduleFor:aProjectID |
9559 | 536 |
^ (aProjectID subStrings:$:) first |
9536 | 537 |
|
9559 | 538 |
" |
539 |
DapasXProject module |
|
540 |
DapasX_Datenbasis module |
|
541 |
" |
|
9536 | 542 |
|
543 |
"Created: / 09-08-2006 / 16:16:16 / fm" |
|
9559 | 544 |
"Modified: / 17-08-2006 / 14:13:46 / cg" |
9536 | 545 |
! |
546 |
||
13419 | 547 |
moduleOfClass:aClass |
9559 | 548 |
^ self moduleFor:aClass package |
9536 | 549 |
|
9559 | 550 |
" |
551 |
DapasXProject module |
|
552 |
DapasX_Datenbasis module |
|
553 |
" |
|
9536 | 554 |
|
555 |
"Created: / 09-08-2006 / 16:16:16 / fm" |
|
9559 | 556 |
"Modified: / 17-08-2006 / 14:13:51 / cg" |
9536 | 557 |
! |
558 |
||
12360
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
559 |
monticelloPackageName |
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
560 |
"hook for packages which have been loaded from monticello" |
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
561 |
|
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
562 |
^ nil |
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
563 |
! |
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
564 |
|
9559 | 565 |
msdosPathToPackage:toPackageID from:fromPackageID |
566 |
"Returns the path to the package defined by aPackageID relative to my path" |
|
13419 | 567 |
|
10976
5696faf1af02
fix #msdosPathToPackage:from: (do not use , since it is relative to the current directory)
Stefan Vogel <sv@exept.de>
parents:
10974
diff
changeset
|
568 |
|parts1 parts2 common up down| |
9852 | 569 |
|
570 |
parts1 := fromPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
571 |
parts2 := toPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
572 |
common := parts1 commonPrefixWith:parts2. |
|
10976
5696faf1af02
fix #msdosPathToPackage:from: (do not use , since it is relative to the current directory)
Stefan Vogel <sv@exept.de>
parents:
10974
diff
changeset
|
573 |
up := ((1 to:parts1 size - common size) collect:[:p | '..']) asStringWith:'\'. |
5696faf1af02
fix #msdosPathToPackage:from: (do not use , since it is relative to the current directory)
Stefan Vogel <sv@exept.de>
parents:
10974
diff
changeset
|
574 |
down := (parts2 copyFrom:common size+1) asStringWith:'\'. |
5696faf1af02
fix #msdosPathToPackage:from: (do not use , since it is relative to the current directory)
Stefan Vogel <sv@exept.de>
parents:
10974
diff
changeset
|
575 |
up isEmpty ifTrue:[ |
5696faf1af02
fix #msdosPathToPackage:from: (do not use , since it is relative to the current directory)
Stefan Vogel <sv@exept.de>
parents:
10974
diff
changeset
|
576 |
down isEmpty ifTrue:[^ '.']. |
23124 | 577 |
^ down. |
9852 | 578 |
]. |
10976
5696faf1af02
fix #msdosPathToPackage:from: (do not use , since it is relative to the current directory)
Stefan Vogel <sv@exept.de>
parents:
10974
diff
changeset
|
579 |
down isEmpty ifTrue:[ |
23124 | 580 |
^ up. |
9714 | 581 |
]. |
13419 | 582 |
^ up, '\', down |
9901 | 583 |
|
9559 | 584 |
" |
585 |
self msdosPathToPackage:'bosch:dapasx/kernel' from:'bosch:dapasx/application' |
|
13419 | 586 |
self msdosPathToPackage:'stx:libbasic' from:'bosch:dapasx/application' |
587 |
self msdosPathToPackage:'bosch:dapasx/application' from:'stx:libbasic' |
|
588 |
self msdosPathToPackage:'exept:expecco' from:'exept:expecco/application' |
|
589 |
self msdosPathToPackage:'exept:expecco/application' from:'exept:expecco' |
|
9559 | 590 |
" |
9536 | 591 |
|
9559 | 592 |
"Created: / 17-08-2006 / 14:26:39 / cg" |
9901 | 593 |
"Modified: / 14-09-2006 / 22:04:56 / cg" |
9536 | 594 |
! |
595 |
||
12028 | 596 |
packageDirectory |
19731 | 597 |
"if I was loaded from a directory (as opposed to loaded via a dll or from a source code manager), |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
598 |
return that directory. |
14577 | 599 |
Otherwise ask Smalltalk for my package directory a long the package path." |
600 |
||
14580 | 601 |
|loadDirectory| |
602 |
||
14586 | 603 |
(loadDirectory := self loadDirectory) ifNotNil:[ ^ loadDirectory ]. |
12315
71599fb91dcf
comment/format in: #packageDirectory
Claus Gittinger <cg@exept.de>
parents:
12314
diff
changeset
|
604 |
^ Smalltalk packageDirectoryForPackageId: self package |
12028 | 605 |
|
606 |
"Created: / 15-06-2009 / 12:01:18 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
607 |
! |
|
608 |
||
9536 | 609 |
packageName |
9688 | 610 |
"the last component" |
9536 | 611 |
|
9688 | 612 |
^ self packageNameFor: self package |
9536 | 613 |
|
9688 | 614 |
" |
10810 | 615 |
stx_libwidg2 packageName |
16812 | 616 |
stx_goodies_refactoryBrowser_browser packageName |
9688 | 617 |
bosch_dapasx_hw_schnittstellen packageName |
618 |
bosch_dapasx_datenbasis packageName |
|
13419 | 619 |
bosch_dapasx_parameter_system packageName |
9688 | 620 |
" |
9536 | 621 |
|
622 |
"Created: / 08-08-2006 / 20:24:53 / fm" |
|
623 |
"Modified: / 09-08-2006 / 16:16:37 / fm" |
|
624 |
! |
|
625 |
||
626 |
packageNameFor: aProjectID |
|
9688 | 627 |
^ (aProjectID asCollectionOfSubstringsSeparatedByAny:':/') last. |
9536 | 628 |
|
9688 | 629 |
" |
630 |
bosch_dapasx_hw_schnittstellen packageName |
|
631 |
bosch_dapasx_datenbasis packageName |
|
13419 | 632 |
bosch_dapasx_parameter_system packageName |
633 |
cg_croquet packageName |
|
634 |
stx_goodies_xml_vw packageName |
|
635 |
stx_goodies_xml_vw packageDirectory |
|
9688 | 636 |
" |
9536 | 637 |
|
638 |
"Created: / 08-08-2006 / 20:24:53 / fm" |
|
639 |
"Modified: / 09-08-2006 / 16:16:37 / fm" |
|
640 |
"Modified: / 11-08-2006 / 14:02:32 / cg" |
|
641 |
! |
|
642 |
||
643 |
parentProject |
|
23124 | 644 |
"return the packageID of the parent project. |
17236 | 645 |
That is the projectID of the package above in the folder hierarchy" |
646 |
||
10306 | 647 |
^ (self parentProjectFor: self package) |
9536 | 648 |
|
17236 | 649 |
" |
650 |
bosch_dapasx_hw_schnittstellen_Definition parentProject |
|
651 |
DapasX_Datenbasis parentProject |
|
652 |
||
23124 | 653 |
stx_libbasic parentProject |
654 |
stx_goodies_refactoryBrowser_lint parentProject |
|
17236 | 655 |
" |
9536 | 656 |
! |
657 |
||
658 |
parentProjectFor: aProjectID |
|
17236 | 659 |
"given a packageID symbol or string, return the packageID of the |
23124 | 660 |
parent project. |
17236 | 661 |
That is the projectID of the package above in the folder hierarchy" |
662 |
||
663 |
|path| |
|
664 |
||
665 |
path := aProjectID splitByAny:':/'. |
|
666 |
path size == 1 ifTrue:[^ nil]. |
|
667 |
path size == 2 ifTrue:[^ path first]. |
|
668 |
^ path first , ':' , ((path copyFrom:2 to:path size - 1) asStringWith:'/') |
|
669 |
||
670 |
" |
|
671 |
bosch_dapasx_hw_schnittstellen parentProject |
|
672 |
||
23124 | 673 |
self parentProjectFor:'bosch:dapasx' |
674 |
self parentProjectFor:'bosch:dapasx/hw_schnittstellen' |
|
675 |
self parentProjectFor:'stx:goodies/refactoryBrowser/lint' |
|
676 |
self parentProjectFor:'stx:goodies/svg' |
|
677 |
self parentProjectFor:'stx:libbasic' |
|
678 |
self parentProjectFor:'exept:expecco/application' |
|
679 |
||
680 |
self parentProjectFor:'stx' |
|
681 |
self parentProjectFor:'exept' |
|
17236 | 682 |
" |
9536 | 683 |
! |
684 |
||
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
685 |
pathSeparator:platformName |
16328 | 686 |
^ platformName == #unix ifTrue:['/'] ifFalse:['\']. |
9850 | 687 |
! |
688 |
||
689 |
pathTo:aBaseFilename inPackage:aPackageID architecture:arch |
|
690 |
"Returns the path to stx counting the number of $/ and $: in the package name and adding for each one '../' to get the ST/X top directory" |
|
691 |
||
16328 | 692 |
|p separator| |
693 |
||
694 |
separator := self pathSeparator:arch. |
|
695 |
p := self pathToPackage:aPackageID withSeparator:separator. |
|
696 |
aBaseFilename isNil ifTrue:[^ p]. |
|
697 |
^ p , separator, aBaseFilename |
|
698 |
! |
|
699 |
||
700 |
pathToPackage:toPackageID from:fromPackageID withSeparator:pathSeparator |
|
701 |
"Returns the path to the package defined by aPackageID relative to my path" |
|
702 |
||
703 |
|parts1 parts2 common up down rel oneUp| |
|
704 |
||
705 |
oneUp := '..', pathSeparator. |
|
706 |
||
707 |
parts1 := fromPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
708 |
parts2 := toPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
709 |
common := parts1 commonPrefixWith:parts2. |
|
710 |
common notEmpty ifTrue:[ |
|
23516 | 711 |
up := ((1 to:parts1 size - common size) collect:[:p | oneUp]) asStringWith:''. |
712 |
down := (parts2 copyFrom:common size+1) asStringWith:pathSeparator. |
|
713 |
(up isEmpty and:[down isEmpty]) ifTrue:[^ '.']. |
|
714 |
(up endsWith:'/') ifTrue:[ |
|
715 |
down isEmpty ifTrue:[^ up copyButLast] |
|
716 |
]. |
|
717 |
(up isEmpty) ifTrue:[ |
|
718 |
(down startsWith:'/') ifTrue:[^ down copyButFirst] |
|
719 |
]. |
|
720 |
^ up , down |
|
9850 | 721 |
]. |
16328 | 722 |
|
723 |
rel := (self topRelativePathToPackage:toPackageID withSeparator:pathSeparator). |
|
724 |
(rel startsWith:('stx', pathSeparator)) ifTrue:[ |
|
23516 | 725 |
^ '$(TOP)', (rel copyFrom:'stx/' size) "/ notice: the separator remains |
9850 | 726 |
]. |
16328 | 727 |
|
728 |
^ '$(TOP)', pathSeparator, oneUp, rel. |
|
729 |
||
730 |
" |
|
731 |
self pathToPackage:'bosch:dapasx/kernel' from:'bosch:dapasx/application' withSeparator:'\' |
|
732 |
self pathToPackage:'stx:libbasic' from:'bosch:dapasx/application' withSeparator:'\' |
|
733 |
self pathToPackage:'bosch:dapasx/application' from:'stx:libbasic' withSeparator:'\' |
|
23516 | 734 |
exept_expecco_application pathToPackage:'exept:expecco' from:'exept:expecco/application' withSeparator:'/' |
735 |
exept_expecco_application pathToPackage:'exept:expecco/plugins/guiBrowser' from:'exept:expecco/application' withSeparator:'/' |
|
16328 | 736 |
" |
737 |
||
738 |
"Created: / 14-09-2006 / 15:21:10 / cg" |
|
23516 | 739 |
"Modified: / 07-11-2018 / 17:24:26 / Claus Gittinger" |
16328 | 740 |
! |
741 |
||
742 |
pathToPackage:aPackageID withSeparator:pathSeparator |
|
9850 | 743 |
"Returns the path to stx counting the number of $/ and $: in the package name and adding for each one '../' to get the ST/X top directory" |
744 |
||
10875
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
745 |
|rel| |
9850 | 746 |
|
9880 | 747 |
aPackageID asPackageId module = self package asPackageId module ifTrue:[ |
23474 | 748 |
^ self pathToPackage:aPackageID from:self package withSeparator:pathSeparator. |
9880 | 749 |
]. |
16328 | 750 |
rel := self topRelativePathToPackage:aPackageID withSeparator:pathSeparator. |
751 |
(rel startsWith:('stx', pathSeparator)) ifTrue:[ |
|
23474 | 752 |
^ '$(TOP)', (rel copyFrom:'stx/' size). "keep the separator" |
9850 | 753 |
] ifFalse:[ |
23474 | 754 |
^ '$(TOP)', pathSeparator, '..', pathSeparator, rel |
9850 | 755 |
] |
756 |
||
757 |
" |
|
16328 | 758 |
exept_expecco_application pathToPackage:'exept:expecco/application' withSeparator:'\' |
759 |
exept_expecco_application pathToPackage:'exept:expecco/report' withSeparator:'\' |
|
23474 | 760 |
exept_expecco_application make_dot_proto_resource_rules |
16328 | 761 |
stx_libbasic pathToPackage:'exept:expecco/application' withSeparator:'\' |
9850 | 762 |
" |
763 |
||
764 |
"Modified: / 16-08-2006 / 18:55:41 / User" |
|
765 |
"Created: / 14-09-2006 / 13:21:23 / cg" |
|
9880 | 766 |
"Modified: / 14-09-2006 / 15:23:59 / cg" |
23474 | 767 |
"Modified (comment): / 26-10-2018 / 21:06:56 / Claus Gittinger" |
9850 | 768 |
! |
769 |
||
16328 | 770 |
pathToTopFor:aProjectID withSeparator:aPathSeparator |
771 |
"Returns the path to stx counting the number of $/ and $: in the package name and adding for each one '../' to get the ST/X top directory" |
|
772 |
||
773 |
|parts oneUp| |
|
774 |
||
775 |
oneUp := '..', aPathSeparator. |
|
776 |
||
777 |
parts := aProjectID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
778 |
||
779 |
parts first = 'stx' ifTrue:[ |
|
23124 | 780 |
parts size == 1 ifTrue:[^ '']. |
781 |
^ (((2 to:parts size-1) collect:[:p | oneUp]) asStringWith:'') , '..' |
|
9880 | 782 |
]. |
783 |
||
16328 | 784 |
^ ((parts collect:[:p | oneUp]) asStringWith:'') , 'stx' |
785 |
||
786 |
" |
|
787 |
self pathToTopFor: #'exept' with:'/' |
|
788 |
self pathToTopFor: #'exept:expecco' with:'/' |
|
789 |
self pathToTopFor: #'exept:expecco/application' with:'/' |
|
790 |
self pathToTopFor: #'stx' with:'/' |
|
791 |
self pathToTopFor: #'stx:libview' with:'/' |
|
792 |
self pathToTopFor: #'stx:goodies/foo' with:'/' |
|
793 |
" |
|
794 |
||
795 |
"Created: / 14-09-2006 / 14:59:53 / cg" |
|
796 |
! |
|
797 |
||
798 |
pathToTopWithSeparator:aPathSeparator |
|
9714 | 799 |
"Returns the path to stx counting the number of $/ and $: in the package name and adding for each one '../' to get the ST/X top directory" |
800 |
||
16328 | 801 |
^ self pathToTopFor:self package withSeparator:aPathSeparator |
802 |
||
803 |
" |
|
804 |
exept_expecco_application pathToTopWithSeparator:'\' |
|
805 |
stx_libbasic pathToTopWithSeparator:'\' |
|
806 |
stx_goodies_xml pathToTopWithSeparator:'\' |
|
807 |
stx_libhtml pathToTopWithSeparator:'\' |
|
808 |
stx_goodies_refactoryBrowser_changes pathToTopWithSeparator:'\' |
|
9714 | 809 |
" |
810 |
||
811 |
"Created: / 09-08-2006 / 15:45:54 / fm" |
|
9852 | 812 |
"Modified: / 14-09-2006 / 15:01:47 / cg" |
9714 | 813 |
! |
814 |
||
17344 | 815 |
projectDefinitionClassNameForDefinitionOf:aPackageId |
816 |
"given a package-ID, return an appropriate class name for this package" |
|
817 |
||
818 |
|s| |
|
819 |
||
18503 | 820 |
s := aPackageId asString copy replaceAny:' :/-' with:$_. |
17344 | 821 |
(s endsWith:$_) ifTrue:[ |
23124 | 822 |
s := s copyButLast:1 |
17344 | 823 |
]. |
824 |
^ s |
|
825 |
||
826 |
" |
|
827 |
ProjectDefinition initialClassNameForDefinitionOf:'bosch:dapasx/interactiver_editor' |
|
828 |
ProjectDefinition initialClassNameForDefinitionOf:'stx:libbasic' |
|
829 |
ProjectDefinition initialClassNameForDefinitionOf:'stx:goodies/xml' |
|
830 |
ProjectDefinition initialClassNameForDefinitionOf:'stx/goodies/xml' |
|
831 |
ProjectDefinition initialClassNameForDefinitionOf:'stx_goodies_xml' |
|
832 |
" |
|
833 |
! |
|
834 |
||
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
835 |
projectIsLoaded |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
836 |
"answer true, if this project is completely loaded into the image" |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
837 |
|
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
838 |
projectIsLoaded isNil ifTrue:[ |
23124 | 839 |
projectIsLoaded := false. |
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
840 |
]. |
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
841 |
^ projectIsLoaded |
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
842 |
|
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
843 |
" |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
844 |
stx_libbasic projectIsLoaded |
13251 | 845 |
(ProjectDefinition definitionClassForPackage:#'stx:libbasic') projectIsLoaded |
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
846 |
" |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
847 |
! |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
848 |
|
15760 | 849 |
projectIsLoaded:aBoolean |
850 |
projectIsLoaded := aBoolean. |
|
851 |
aBoolean ifTrue:[ |
|
23124 | 852 |
"register myself as dependent - I want to get notified on method changes" |
853 |
self class addDependent:self. |
|
854 |
self postLoadAction. |
|
855 |
self executeHooks: #postLoad. |
|
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
856 |
]. |
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
857 |
! |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
858 |
|
21449 | 859 |
projectTags |
860 |
"a list of resource-tags used in the project. |
|
861 |
These are offered in the browser's methodList menu as 'Tag as' items. |
|
862 |
Allowing convenient tagging for things like '<resource: EXPECCO_API>'. |
|
863 |
When redefined, a collection of useful tag-strings should be returned." |
|
23124 | 864 |
|
21449 | 865 |
^ #() |
866 |
||
867 |
"Created: / 15-02-2017 / 16:42:48 / cg" |
|
868 |
! |
|
869 |
||
9850 | 870 |
topRelativePathTo:aBaseFilename inPackage:aPackageID architecture:arch |
13419 | 871 |
"Returns the path to stx counting the number of $/ and $: in the package name |
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
872 |
and adding for each one '../' to get the ST/X top directory" |
9850 | 873 |
|
16328 | 874 |
|p separator| |
875 |
||
876 |
separator := self pathSeparator:arch. |
|
877 |
p := self topRelativePathToPackage:aPackageID withSeparator:separator. |
|
878 |
aBaseFilename isNil ifTrue:[^ p]. |
|
879 |
^ p , separator, aBaseFilename |
|
880 |
! |
|
881 |
||
882 |
topRelativePathToPackage:aPackageID withSeparator:aDirectorySeparator |
|
18503 | 883 |
"Returns the path to the package as specified by aPackageID relative to the top directory. |
884 |
Basically this simply replaces colons and slashes by the OS's path separator." |
|
13419 | 885 |
|
16328 | 886 |
^ aPackageID asString copyReplaceAny:':/' with:aDirectorySeparator first |
887 |
||
888 |
" |
|
889 |
self topRelativePathToPackage:'stx:goodies/xml' withSeparator:'\' |
|
890 |
self topRelativePathToPackage:'bosch:dapasx/kernel' withSeparator:'\' |
|
9850 | 891 |
" |
892 |
||
893 |
"Created: / 14-09-2006 / 13:20:40 / cg" |
|
9536 | 894 |
! ! |
895 |
||
15950 | 896 |
!ProjectDefinition class methodsFor:'accessing - coverage'! |
897 |
||
898 |
excludedFromCoverage |
|
899 |
"List of classes and/or methods excluded from coverage report. |
|
900 |
Entries maybe ClassName or #(ClassName selector) |
|
901 |
||
902 |
Please note that certain classes and methods are excluded |
|
903 |
in #Builder::CoverageReport>>excludedFromCoverage:. |
|
904 |
" |
|
905 |
^ #() |
|
906 |
||
907 |
"Created: / 28-06-2013 / 02:11:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
908 |
"Modified (comment): / 28-06-2013 / 11:25:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
909 |
! |
|
910 |
||
911 |
excludedFromCoverage: aMethod |
|
912 |
"Return true if given method should be excluded from coverage |
|
18224 | 913 |
info. This method may be redefined in subclasses to automagically omit methods |
15950 | 914 |
matching some criteria. |
915 |
||
916 |
Please note that certain classes and methods are excluded |
|
917 |
in Builder::CoverageReport>>excludedFromCoverage:. |
|
918 |
" |
|
919 |
||
18224 | 920 |
|excluded mclass mselector| |
921 |
||
922 |
excluded := self excludedFromCoverage. |
|
923 |
excluded notEmptyOrNil ifTrue:[ |
|
23124 | 924 |
mclass := aMethod mclass. |
925 |
mselector := aMethod selector. |
|
926 |
excluded do:[:eachSpecLine| |
|
927 |
eachSpecLine isArray ifTrue:[ |
|
928 |
(eachSpecLine first = mclass name and:[eachSpecLine second == mselector]) ifTrue:[ ^ true ]. |
|
929 |
]. |
|
930 |
eachSpecLine = mclass name ifTrue:[ ^ true ]. |
|
931 |
]. |
|
18224 | 932 |
]. |
933 |
||
934 |
^ false |
|
15950 | 935 |
|
936 |
"Created: / 28-06-2013 / 02:14:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
937 |
"Modified (comment): / 28-06-2013 / 11:25:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
938 |
! ! |
|
939 |
||
17289 | 940 |
|
17228 | 941 |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
942 |
!ProjectDefinition class methodsFor:'accessing - packaging'! |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
943 |
|
12371 | 944 |
classNames:aCollectionOfClassNames |
945 |
"set the set of classes" |
|
946 |
||
947 |
self classNamesAndAttributes:aCollectionOfClassNames usingCompiler:nil |
|
948 |
! |
|
949 |
||
950 |
classNamesAndAttributes:newSpec usingCompiler:compilerOrNil |
|
13419 | 951 |
"set the set of classes. and attributes |
952 |
Because this requires compilation of my classList-method, a compiler can be passed in, |
|
12371 | 953 |
which has to do the job. |
954 |
(this is used by the systembrowser to pass in a CodeGeneratorTool with undo support)" |
|
955 |
||
956 |
|oldSpec newCode| |
|
957 |
||
958 |
oldSpec := self classNamesAndAttributes. |
|
959 |
newSpec = oldSpec ifTrue: [^ self]. |
|
960 |
||
961 |
newCode := self classNamesAndAttributes_codeFor:newSpec. |
|
962 |
||
15006 | 963 |
self compile:newCode categorized:'description - contents' using:compilerOrNil |
12371 | 964 |
! |
965 |
||
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
966 |
excludeClasses:toExclude usingCompiler:compilerOrNil |
13419 | 967 |
"exclude (remove from classList) a number of classes. |
968 |
Because this requires compilation of my classList-method, a compiler can be passed in, |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
969 |
which has to do the job. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
970 |
(this is used by the systembrowser to pass in a CodeGeneratorTool with undo support)" |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
971 |
|
12371 | 972 |
|newSpec| |
973 |
||
974 |
newSpec := self classNamesAndAttributes copy. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
975 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
976 |
toExclude do:[:eachClassToExclude | |
23124 | 977 |
|className| |
978 |
className := eachClassToExclude theNonMetaclass name. |
|
979 |
(self allClassNames includes:className) ifTrue:[ |
|
980 |
|idx| |
|
981 |
||
982 |
idx := newSpec findFirst:[:entry | entry = className or:[entry first = className]]. |
|
983 |
idx ~~ 0 ifTrue:[ |
|
984 |
newSpec := newSpec copyWithoutIndex:idx. |
|
985 |
]. |
|
986 |
]. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
987 |
]. |
12371 | 988 |
self classNamesAndAttributes:newSpec usingCompiler:compilerOrNil |
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
989 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
990 |
"Created: / 30-08-2007 / 18:28:28 / cg" |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
991 |
! |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
992 |
|
15069 | 993 |
excludeMethodFor:selector inClassNamed:className usingCompiler:compilerOrNil |
994 |
"exclude (remove from extensionList) a method by name. |
|
995 |
Because this requires compilation of my extensionMethodNames-method, a compiler can be passed in, |
|
996 |
which has to do the job. |
|
997 |
This is used by the systembrowser to pass in a CodeGeneratorTool with undo support. |
|
998 |
If nil is passed in, the recurlar compiler is used (no undo support)" |
|
999 |
||
15764 | 1000 |
|oldSpec newSpec newCode idx| |
15069 | 1001 |
|
1002 |
oldSpec := self extensionMethodNames. |
|
15764 | 1003 |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
1004 |
idx := (1 to:oldSpec size-1 by:2) |
23124 | 1005 |
detect:[:i | |
1006 |
((oldSpec at:i) = className) |
|
1007 |
and:[ (oldSpec at:i+1) = selector ]] |
|
1008 |
ifNone:[ ^ self ]. |
|
15069 | 1009 |
|
1010 |
"/ attention: there are two spec-elements per method |
|
15764 | 1011 |
newSpec := oldSpec copyWithoutIndex:idx toIndex:idx+1. |
15069 | 1012 |
|
1013 |
newCode := self extensionMethodNames_code_For:newSpec. |
|
1014 |
self compile:newCode categorized:'description - contents' using:compilerOrNil |
|
1015 |
! |
|
1016 |
||
15005 | 1017 |
excludeMethods:toRemove usingCompiler:compilerOrNil |
1018 |
"exclude (remove from extensionList) a number of methods. |
|
1019 |
Because this requires compilation of my extensionMethodNames-method, a compiler can be passed in, |
|
1020 |
which has to do the job. |
|
1021 |
This is used by the systembrowser to pass in a CodeGeneratorTool with undo support. |
|
1022 |
If nil is passed in, the recurlar compiler is used (no undo support)" |
|
1023 |
||
1024 |
|oldSpec newSpec newCode extensionMethods| |
|
1025 |
||
1026 |
oldSpec := self extensionMethodNames. |
|
1027 |
newSpec := oldSpec copy. |
|
1028 |
extensionMethods := self extensionMethods. |
|
1029 |
||
1030 |
toRemove do:[:eachMethodToRemove | |
|
23124 | 1031 |
|className selector idx| |
1032 |
||
1033 |
(extensionMethods includes:eachMethodToRemove) ifTrue:[ |
|
1034 |
className := eachMethodToRemove mclass name. |
|
1035 |
selector := eachMethodToRemove selector. |
|
1036 |
idx := (1 to:newSpec size-1 by:2) |
|
1037 |
detect:[:i | |
|
1038 |
((newSpec at:i) = className) |
|
1039 |
and:[ (newSpec at:i+1) = selector ]] |
|
1040 |
ifNone:nil. |
|
1041 |
idx notNil ifTrue:[ |
|
1042 |
"/ attention: there are two spec-elements per method |
|
1043 |
newSpec := newSpec removeFromIndex:idx toIndex:idx+1 |
|
1044 |
] |
|
1045 |
]. |
|
15005 | 1046 |
]. |
1047 |
||
1048 |
newCode := self extensionMethodNames_code_For:newSpec. |
|
15006 | 1049 |
self compile:newCode categorized:'description - contents' using:compilerOrNil |
15005 | 1050 |
! |
1051 |
||
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1052 |
includeClasses:toInclude usingCompiler:compilerOrNil |
13419 | 1053 |
"include (add to classList) a number of classes. |
1054 |
Because this requires compilation of my classList-method, a compiler can be passed in, |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1055 |
which has to do the job. |
15005 | 1056 |
This is used by the systembrowser to pass in a CodeGeneratorTool with undo support. |
1057 |
If nil is passed in, the recurlar compiler is used (no undo support)" |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1058 |
|
12371 | 1059 |
|oldSpec newSpec| |
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1060 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1061 |
oldSpec := self classNamesAndAttributes. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1062 |
newSpec := oldSpec copy. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1063 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1064 |
toInclude do:[:eachClassToInclude | |
23124 | 1065 |
|className| |
1066 |
||
1067 |
className := eachClassToInclude theNonMetaclass name. |
|
1068 |
(self compiled_classNames includes:className) ifFalse:[ |
|
1069 |
| idx entry| |
|
1070 |
||
1071 |
idx := oldSpec findFirst:[:entry | entry = className or:[entry first = className]]. |
|
1072 |
idx == 0 ifTrue:[ |
|
1073 |
newSpec := newSpec copyWith:(Array with:className) |
|
1074 |
] ifFalse:[ |
|
1075 |
entry := newSpec at:idx. |
|
1076 |
entry isArray ifTrue:[ |
|
1077 |
entry := entry copyWithout:#autoload |
|
1078 |
]. |
|
1079 |
newSpec at:idx put:entry |
|
1080 |
]. |
|
1081 |
]. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1082 |
]. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1083 |
|
12371 | 1084 |
self classNamesAndAttributes:newSpec usingCompiler:compilerOrNil |
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1085 |
! |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1086 |
|
15005 | 1087 |
includeMethods:toInclude usingCompiler:compilerOrNil |
1088 |
"include (add to extensionList) a number of methods. |
|
1089 |
Because this requires compilation of my extensionMethodNames-method, a compiler can be passed in, |
|
1090 |
which has to do the job. |
|
1091 |
This is used by the systembrowser to pass in a CodeGeneratorTool with undo support. |
|
1092 |
If nil is passed in, the recurlar compiler is used (no undo support)" |
|
1093 |
||
1094 |
|oldSpec newSpec newCode extensionMethods| |
|
1095 |
||
1096 |
oldSpec := self extensionMethodNames. |
|
1097 |
newSpec := oldSpec copy. |
|
1098 |
extensionMethods := self extensionMethods. |
|
1099 |
||
1100 |
toInclude do:[:eachMethodToInclude | |
|
23124 | 1101 |
(extensionMethods includes:eachMethodToInclude) ifFalse:[ |
1102 |
newSpec := newSpec copyWith:eachMethodToInclude mclass name. |
|
1103 |
newSpec := newSpec copyWith:eachMethodToInclude selector. |
|
1104 |
]. |
|
15005 | 1105 |
]. |
1106 |
||
1107 |
newCode := self extensionMethodNames_code_For:newSpec. |
|
15006 | 1108 |
self compile:newCode categorized:'description - contents' using:compilerOrNil |
15005 | 1109 |
! |
1110 |
||
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1111 |
makeClassesAutoloaded:toMakeAutoloaded usingCompiler:compilerOrNil |
13419 | 1112 |
"include as autoloaded (add to classList) a number of classes. |
1113 |
Because this requires compilation of my classList-method, a compiler can be passed in, |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1114 |
which has to do the job. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1115 |
(this is used by the systembrowser to pass in a CodeGeneratorTool with undo support)" |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1116 |
|
12371 | 1117 |
|newSpec| |
1118 |
||
1119 |
newSpec := self classNamesAndAttributes copy. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1120 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1121 |
toMakeAutoloaded do:[:eachClassToMakeAutoloaded | |
23124 | 1122 |
|className| |
1123 |
||
1124 |
className := eachClassToMakeAutoloaded theNonMetaclass name. |
|
1125 |
(self autoloaded_classNames includes:className) ifFalse:[ |
|
1126 |
|idx entry| |
|
1127 |
||
1128 |
idx := newSpec findFirst:[:entry | entry = className or:[entry first = className]]. |
|
1129 |
idx == 0 ifTrue:[ |
|
1130 |
newSpec := newSpec copyWith:(Array with:className with:#autoload) |
|
1131 |
] ifFalse:[ |
|
1132 |
entry := newSpec at:idx. |
|
1133 |
entry isArray ifTrue:[ |
|
1134 |
entry := (entry copyWithout:#autoload) copyWith:#autoload. |
|
1135 |
] ifFalse:[ |
|
1136 |
entry := Array with:entry with:#autoload |
|
1137 |
]. |
|
1138 |
newSpec at:idx put:entry. |
|
1139 |
]. |
|
1140 |
]. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1141 |
]. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1142 |
|
12371 | 1143 |
self classNamesAndAttributes:newSpec usingCompiler:compilerOrNil |
14982 | 1144 |
! |
1145 |
||
15052 | 1146 |
updateContentsMethodsCodeUsingCompiler:compilerOrNil ignoreOldDefinition:doRegenerate |
1147 |
"regenerate the contents-describing methods. |
|
1148 |
This searches through the system and picks classes and extension methods |
|
1149 |
which have me as package and lists them in the generated class- |
|
1150 |
and extensionMethods methods. |
|
1151 |
If doRegenerate is true, forget any any previous contents info; |
|
1152 |
otherwise, merge new items into the existing lists." |
|
1153 |
||
1154 |
Class packageQuerySignal |
|
23124 | 1155 |
answer:self package |
1156 |
do:[ |
|
1157 |
self |
|
1158 |
forEachContentsMethodsCodeToCompileDo: |
|
1159 |
[:code :category | |
|
1160 |
(compilerOrNil ? self theMetaclass compilerClass) |
|
1161 |
compile:code |
|
1162 |
forClass:self theMetaclass |
|
1163 |
inCategory:category. |
|
1164 |
] |
|
1165 |
ignoreOldDefinition:doRegenerate |
|
1166 |
]. |
|
15052 | 1167 |
! |
1168 |
||
14982 | 1169 |
updateExtensionMethodNamesUsingCompiler:compilerOrNil |
1170 |
"set the set of extension methods |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
1171 |
Because this requires compilation of my extensionMethodNames-method, |
14982 | 1172 |
a compiler can be passed in, which has to do the job. |
1173 |
(this is used by the systembrowser to pass in a CodeGeneratorTool with undo support)" |
|
1174 |
||
1175 |
|newCode| |
|
1176 |
||
1177 |
newCode := self extensionMethodNames_code. |
|
15006 | 1178 |
self compile:newCode categorized:'description - contents' using:compilerOrNil |
15052 | 1179 |
! |
1180 |
||
1181 |
updateMethodsCodeUsingCompiler:compilerOrNil ignoreOldDefinition:doRegenerate |
|
1182 |
"regenerate the all contents- plus version describing methods. |
|
1183 |
This searches through the system and picks classes and extension methods |
|
1184 |
which have me as package and lists them in the generated class- |
|
1185 |
and extensionMethods methods. |
|
1186 |
If doRegenerate is true, forget any any previous contents info; |
|
1187 |
otherwise, merge new items into the existing lists." |
|
1188 |
||
1189 |
Class packageQuerySignal |
|
23124 | 1190 |
answer:self package |
1191 |
do:[ |
|
1192 |
self |
|
1193 |
forEachMethodsCodeToCompileDo: |
|
1194 |
[:code :category | |
|
1195 |
(compilerOrNil ? self theMetaclass compilerClass) |
|
1196 |
compile:code |
|
1197 |
forClass:self theMetaclass |
|
1198 |
inCategory:category. |
|
1199 |
] |
|
1200 |
ignoreOldDefinition:doRegenerate |
|
1201 |
]. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1202 |
! ! |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1203 |
|
13411 | 1204 |
!ProjectDefinition class methodsFor:'accessing - tests'! |
1205 |
||
13419 | 1206 |
excludedFromTestSuite |
13411 | 1207 |
"List of testcases and/or tests excluded from testsuite. |
1208 |
Entries maybe ClassName or #(ClassName testName) |
|
1209 |
" |
|
1210 |
^ #() |
|
1211 |
||
1212 |
"Created: / 03-06-2011 / 16:56:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1213 |
! |
|
1214 |
||
1215 |
testSuite |
|
13544 | 1216 |
"generate and return a testSuite containing all of my test-classes" |
13411 | 1217 |
|
1218 |
|suite classes| |
|
1219 |
||
1220 |
suite := TestSuite named:self package. |
|
13695 | 1221 |
classes := self classes |
23124 | 1222 |
select:[:each | |
1223 |
[ |
|
1224 |
each isLoaded ifFalse:[each autoload]. |
|
1225 |
(each isTestCaseLike) and:[ each isAbstract not ] |
|
1226 |
] on: Autoload autoloadFailedSignal do:[ |
|
1227 |
'FAILED TO LOAD: ' infoPrint. |
|
1228 |
each name infoPrintCR. |
|
1229 |
false |
|
1230 |
] |
|
1231 |
]. |
|
13544 | 1232 |
|
13411 | 1233 |
classes := classes asSortedCollection:[:a :b | a name <= b name ]. |
13695 | 1234 |
classes do: [:eachClass | |
23124 | 1235 |
| tests | |
1236 |
||
1237 |
eachClass name infoPrintCR. |
|
1238 |
tests := eachClass suite tests. |
|
1239 |
tests := tests reject:[:test|self shouldExcludeTest: test]. |
|
1240 |
suite addTests: tests |
|
13544 | 1241 |
]. |
1242 |
^ suite |
|
13411 | 1243 |
|
1244 |
"Created: / 01-04-2011 / 15:20:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1245 |
"Modified: / 03-06-2011 / 17:07:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13568 | 1246 |
"Modified: / 08-08-2011 / 14:59:45 / cg" |
12028 | 1247 |
! ! |
1248 |
||
9714 | 1249 |
!ProjectDefinition class methodsFor:'class initialization'! |
1250 |
||
1251 |
initialize |
|
14776
28a1f265cd65
add user friendly name to semaphores
Stefan Vogel <sv@exept.de>
parents:
14764
diff
changeset
|
1252 |
AccessLock isNil ifTrue:[ |
23124 | 1253 |
LibraryType := #Library. |
1254 |
GUIApplicationType := #'GUI-Application'. |
|
1255 |
NonGUIApplicationType := #'NonGUI-Application'. |
|
1256 |
FolderForSubApplicationsType := #'Folder for Subapplications'. |
|
1257 |
AccessLock := Semaphore forMutualExclusion name:'ProjectDefinition Lock'. |
|
1258 |
Verbose := false. |
|
1259 |
PackagesBeingLoaded := Set new. |
|
14776
28a1f265cd65
add user friendly name to semaphores
Stefan Vogel <sv@exept.de>
parents:
14764
diff
changeset
|
1260 |
]. |
9714 | 1261 |
|
10121 | 1262 |
" |
1263 |
self initialize |
|
1264 |
" |
|
1265 |
||
13592 | 1266 |
"Modified: / 18-08-2011 / 13:48:31 / cg" |
10121 | 1267 |
! |
1268 |
||
1269 |
initializeAllProjectDefinitions |
|
16179 | 1270 |
"tells all already loaded project definition classes that they are loaded |
15761 | 1271 |
(i.e. calls postLoadAction). |
1272 |
This needs everything else (especially the compiler etc.) to be initialized. |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
1273 |
Therefore, it's not invoked by the projDef's #initialize, |
15761 | 1274 |
but instead explicitely, by Smalltalk as a late step in the startup." |
13695 | 1275 |
|
13609 | 1276 |
|isStandAloneApp| |
1277 |
||
1278 |
isStandAloneApp := Smalltalk isStandAloneApp. |
|
1279 |
||
1280 |
self allSubclassesDo:[:eachProjectDefinitionClass | |
|
23124 | 1281 |
eachProjectDefinitionClass isAbstract ifFalse:[ |
1282 |
isStandAloneApp ifFalse:[ |
|
1283 |
eachProjectDefinitionClass installAutoloadedClasses. |
|
1284 |
]. |
|
1285 |
eachProjectDefinitionClass projectIsLoaded:true. |
|
1286 |
] |
|
13609 | 1287 |
]. |
10115 | 1288 |
|
9714 | 1289 |
" |
1290 |
self initialize |
|
1291 |
" |
|
10113
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1292 |
|
10121 | 1293 |
"Created: / 23-10-2006 / 16:40:53 / cg" |
10113
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1294 |
! |
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1295 |
|
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1296 |
installAutoloadedClasses |
12372 | 1297 |
"install all of my autoloaded classes (if any)" |
1298 |
||
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1299 |
|classesToFixClassFileName| |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1300 |
|
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1301 |
classesToFixClassFileName := OrderedCollection new. |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1302 |
|
13592 | 1303 |
self autoloaded_classNames do:[:className | |
23124 | 1304 |
|cls| |
1305 |
||
1306 |
"/ 'install as autoloaded: ' errorPrint. className errorPrintCR. |
|
1307 |
(cls := Smalltalk classNamed:className) isNil ifTrue:[ |
|
1308 |
Error handle:[:ex | |
|
1309 |
(self name,' [warning]: failed to install autoloaded: ',className) errorPrintCR. |
|
1310 |
(self name,' [info]: reason: ',ex description) errorPrintCR. |
|
1311 |
"/ thisContext fullPrintAll. |
|
1312 |
] do:[ |
|
1313 |
cls := Smalltalk |
|
1314 |
installAutoloadedClassNamed:className |
|
1315 |
category:'* as yet unknown category *' |
|
1316 |
package:self package |
|
1317 |
revision:nil |
|
1318 |
]. |
|
1319 |
cls notNil ifTrue:[ |
|
1320 |
classesToFixClassFileName add:cls. |
|
1321 |
]. |
|
1322 |
]. |
|
13592 | 1323 |
]. |
10113
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1324 |
|
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1325 |
Smalltalk addStartBlock:[ |
23124 | 1326 |
|abbrevs| |
1327 |
||
1328 |
abbrevs := self abbrevs. |
|
1329 |
"/ patch the classFileNames |
|
1330 |
classesToFixClassFileName do:[:cls | |
|
1331 |
|entry classFilenameFromAbbreviations| |
|
1332 |
||
1333 |
entry := abbrevs at:cls name ifAbsent:nil. |
|
1334 |
entry notNil ifTrue:[ |
|
1335 |
classFilenameFromAbbreviations := entry fileName. |
|
1336 |
classFilenameFromAbbreviations notNil ifTrue:[ |
|
1337 |
classFilenameFromAbbreviations := classFilenameFromAbbreviations,'.st'. |
|
1338 |
(classFilenameFromAbbreviations ~= cls getClassFilename) ifTrue:[ |
|
1339 |
cls setClassFilename:classFilenameFromAbbreviations |
|
1340 |
]. |
|
1341 |
]. |
|
1342 |
] |
|
1343 |
]. |
|
1344 |
||
1345 |
"/ patch the categories |
|
1346 |
Class withoutUpdatingChangesDo:[ |
|
1347 |
|entry| |
|
1348 |
||
1349 |
self classNames do:[:nm | |
|
1350 |
|cls| |
|
1351 |
||
1352 |
((cls := Smalltalk at: nm) notNil |
|
1353 |
and:[ cls isLoaded not |
|
1354 |
and:[ (entry := abbrevs at:cls name ifAbsent:[nil]) notNil |
|
1355 |
]]) ifTrue:[ |
|
1356 |
cls category: (entry category) |
|
1357 |
] |
|
1358 |
] |
|
1359 |
] |
|
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1360 |
]. |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1361 |
|
13411 | 1362 |
|
10113
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1363 |
" |
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1364 |
stx_libbasic installAutoloadedClasses |
12268
b3cd2af642f2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
12264
diff
changeset
|
1365 |
stx_libhtml installAutoloadedClasses |
13592 | 1366 |
stx_libtool2 installAutoloadedClasses |
10113
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1367 |
" |
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1368 |
|
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1369 |
"Created: / 23-10-2006 / 16:02:12 / cg" |
13411 | 1370 |
"Modified: / 06-03-2011 / 18:26:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1371 |
"Modified: / 20-08-2011 / 23:32:32 / cg" |
9714 | 1372 |
! ! |
1373 |
||
9998 | 1374 |
!ProjectDefinition class methodsFor:'code generation'! |
1375 |
||
20567 | 1376 |
applicationIconFileNameLinux_code |
1377 |
^ String streamContents:[:s | |
|
23124 | 1378 |
s nextPutLine:'applicationIconFileNameLinux'. |
1379 |
s nextPutLine:' "Return the name (without suffix) of an icon-file (the app''s icon).'. |
|
1380 |
s nextPutLine:' This is currently unused (will be for desktop definitions)"'. |
|
1381 |
s cr; |
|
1382 |
nextPutLine:' ^ nil'; |
|
1383 |
nextPutLine:' " ^ self applicationName "'. |
|
20567 | 1384 |
]. |
1385 |
||
1386 |
" |
|
1387 |
self applicationIconFileNameLinux_code |
|
1388 |
stx_libbasic3 applicationIconFileNameLinux_code |
|
1389 |
" |
|
1390 |
||
1391 |
"Created: / 18-08-2006 / 16:21:01 / cg" |
|
1392 |
! |
|
1393 |
||
1394 |
applicationIconFileNameOSX_code |
|
1395 |
^ String streamContents:[:s | |
|
23124 | 1396 |
s nextPutLine:'applicationIconFileNameOSX'. |
1397 |
s nextPutLine:' "Return the name (without suffix) of an icon-file (the app''s icon).'. |
|
1398 |
s nextPutLine:' This is used to create the osx/Info.plist file"'. |
|
1399 |
s cr; |
|
1400 |
nextPutLine:' ^ nil'; |
|
1401 |
nextPutLine:' " ^ self applicationName "'. |
|
20567 | 1402 |
]. |
1403 |
||
1404 |
" |
|
1405 |
self applicationIconFileNameOSX_code |
|
1406 |
stx_libbasic3 applicationIconFileNameOSX_code |
|
1407 |
" |
|
1408 |
||
1409 |
"Created: / 18-08-2006 / 16:21:01 / cg" |
|
21569 | 1410 |
"Modified: / 24-02-2017 / 11:55:32 / cg" |
20567 | 1411 |
! |
1412 |
||
1413 |
applicationIconFileNameWindows_code |
|
1414 |
^ String streamContents:[:s | |
|
23124 | 1415 |
s nextPutLine:'applicationIconFileNameWindows'. |
1416 |
s nextPutLine:' "Return the name (without suffix) of an icon-file (the app''s icon).'. |
|
1417 |
s nextPutLine:' This will be included in the rc-resource file for Windowsdeployment"'. |
|
1418 |
s cr; |
|
1419 |
nextPutLine:' ^ nil'; |
|
1420 |
nextPutLine:' " ^ self applicationName "'. |
|
20567 | 1421 |
]. |
1422 |
||
1423 |
" |
|
1424 |
self applicationIconFileNameWindows_code |
|
1425 |
stx_libbasic3 applicationIconFileNameWindows_code |
|
1426 |
" |
|
1427 |
||
1428 |
"Created: / 18-08-2006 / 16:21:01 / cg" |
|
1429 |
! |
|
1430 |
||
11072 | 1431 |
applicationIconFileName_code |
20567 | 1432 |
"obsolete - replaced by three separate methods as-per-OS" |
23124 | 1433 |
|
11072 | 1434 |
^ String streamContents:[:s | |
23124 | 1435 |
s nextPutLine:'applicationIconFileName'. |
1436 |
s nextPutLine:' "Return the name (without suffix) of an icon-file (the app''s icon);'. |
|
1437 |
s nextPutLine:' "will be included in the rc-resource file"'. |
|
1438 |
s cr; |
|
1439 |
nextPutLine:' ^ nil'; |
|
1440 |
nextPutLine:' " ^ self applicationName "'. |
|
11072 | 1441 |
]. |
1442 |
||
1443 |
" |
|
13873 | 1444 |
self applicationIconFileName_code |
1445 |
stx_libbasic3 applicationIconFileName_code |
|
11072 | 1446 |
" |
1447 |
||
1448 |
"Created: / 18-08-2006 / 16:21:01 / cg" |
|
1449 |
! |
|
1450 |
||
23179 | 1451 |
checkForBadReferences:prerequisiteList |
23125 | 1452 |
"check, that there are no 'illegal' references to prerequisites. |
1453 |
If there is a bad prrequisite, ask the user whether to abort." |
|
1454 |
||
23179 | 1455 |
prerequisiteList keysDo:[:eachPackageSymbol| |
23125 | 1456 |
|defClass| |
1457 |
||
1458 |
defClass := self definitionClassForPackage:eachPackageSymbol. |
|
1459 |
(defClass isProjectDefinition and:[defClass isPluginDefinition]) ifTrue:[ |
|
1460 |
(self confirm:('Bad cross-plugin requirement to: %1%<cr>%<cr>Proceed?' bindWith:eachPackageSymbol)) ifFalse:[ |
|
1461 |
AbortOperationRequest raiseRequest. |
|
1462 |
]. |
|
1463 |
]. |
|
1464 |
] |
|
23179 | 1465 |
|
1466 |
"Modified (format): / 02-07-2018 / 18:56:29 / cg" |
|
23125 | 1467 |
! |
1468 |
||
10393 | 1469 |
classNamesAndAttributes_codeFor:aSpecArray |
1470 |
"generate method code returning all classes of the project from the given spec." |
|
1471 |
||
1472 |
^ String streamContents:[:s | |
|
23124 | 1473 |
s nextPutLine:'classNamesAndAttributes'. |
1474 |
s nextPutLine:' "lists the classes which are to be included in the project.'. |
|
1475 |
s nextPutLine:' Each entry in the list may be: a single class-name (symbol),'. |
|
1476 |
s nextPutLine:' or an array-literal consisting of class name and attributes.'. |
|
1477 |
s nextPutLine:' Attributes are: #autoload or #<os> where os is one of win32, unix,..."'. |
|
1478 |
s nextPutLine:''. |
|
1479 |
s nextPutLine:' ^ #('. |
|
1480 |
s nextPutLine:' "<className> or (<className> attributes...) in load order"'. |
|
1481 |
||
1482 |
(self classNamesAndAttributesFromSpecArray:aSpecArray) do:[:entry | |
|
1483 |
s spaces:8. |
|
1484 |
entry storeArrayElementOn:s. |
|
1485 |
s cr. |
|
1486 |
]. |
|
1487 |
s nextPutLine:' )' |
|
10393 | 1488 |
]. |
1489 |
||
1490 |
" |
|
1491 |
stx_libbasic3 classNamesAndAttributes_codeFor:(stx_libbasic3 classNamesAndAttributes) |
|
1492 |
exept_expecco classNamesAndAttributes_codeFor:(exept_expecco classNamesAndAttributes) |
|
1493 |
" |
|
1494 |
||
1495 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
1496 |
"Created: / 19-02-2007 / 15:43:27 / cg" |
|
1497 |
! |
|
1498 |
||
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1499 |
classNamesAndAttributes_code_ignoreOldEntries:ignoreOldEntries ignoreOldDefinition:ignoreOldDefinition |
10010 | 1500 |
"generate method code returning all classes of the project. |
1501 |
Platform attributes are kept from the old definition. |
|
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1502 |
If ignoreOldEntries is true, the list is completely recreated; |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1503 |
if false, existing entries are preserved. |
10010 | 1504 |
If ignoreOldDefinition is true, the autoload attribute is set/reset if |
13419 | 1505 |
the class is installed as autoloaded in the image (i.e. the state in the image is taken). |
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1506 |
If false, it is taken from an existing definition in #classNamesAndAttributes" |
10010 | 1507 |
|
20673 | 1508 |
|newSpec oldSpec ignored| |
10393 | 1509 |
|
1510 |
oldSpec := self classNamesAndAttributesAsSpecArray. |
|
1511 |
ignored := self ignoredClassNames asSet. |
|
1512 |
newSpec := OrderedCollection new. |
|
1513 |
||
1514 |
ignoreOldEntries ifFalse:[ |
|
23124 | 1515 |
oldSpec do:[:oldEntry | |
1516 |
|newEntry className cls | |
|
1517 |
||
1518 |
newEntry := oldEntry copy. |
|
1519 |
className := newEntry first. |
|
1520 |
||
1521 |
(ignored includes:className) ifFalse:[ |
|
1522 |
cls := Smalltalk classNamed:className. |
|
1523 |
cls notNil ifTrue:[ |
|
1524 |
ignoreOldDefinition ifTrue:[ |
|
1525 |
cls isLoaded ifFalse:[ |
|
1526 |
(newEntry includes:#autoload) ifFalse:[ |
|
1527 |
newEntry := newEntry copyWith:#autoload. |
|
1528 |
]. |
|
1529 |
]. |
|
1530 |
]. |
|
1531 |
"JV @ 2010-06-19 |
|
1532 |
Force merge default class attributes with existing ones" |
|
1533 |
newEntry := self mergeDefaultClassAttributesFor: cls with: newEntry. |
|
1534 |
newSpec add:newEntry. |
|
1535 |
] |
|
1536 |
]. |
|
1537 |
]. |
|
10393 | 1538 |
]. |
1539 |
self searchForClasses do:[:eachClass | |
|
23124 | 1540 |
|className attributes oldSpecEntry oldAttributes newEntry| |
1541 |
||
1542 |
eachClass isJavaClass ifFalse:[ |
|
1543 |
className := eachClass name. |
|
1544 |
(ignored includes:className) ifFalse:[ |
|
1545 |
oldSpecEntry := oldSpec detect:[:entry | entry first = className] ifNone:nil. |
|
1546 |
||
1547 |
(ignoreOldEntries or:[oldSpecEntry isNil]) ifTrue:[ |
|
1548 |
(eachClass isLoaded not or:[eachClass isPrivate not]) ifTrue:[ |
|
1549 |
(self additionalClassNamesAndAttributes includes:className) ifFalse:[ |
|
1550 |
(oldSpecEntry size > 1) ifTrue:[ |
|
1551 |
oldAttributes := oldSpecEntry copyFrom:2. |
|
1552 |
]. |
|
1553 |
||
1554 |
ignoreOldDefinition ifTrue:[ |
|
1555 |
"take autoload attribute from classes state in the image" |
|
1556 |
oldAttributes notNil ifTrue:[ |
|
1557 |
attributes := oldAttributes copyWithout:#autoload. |
|
1558 |
] ifFalse:[ |
|
1559 |
attributes := #() |
|
1560 |
]. |
|
1561 |
eachClass isLoaded ifFalse:[ |
|
1562 |
attributes := attributes copyWith:#autoload. |
|
1563 |
]. |
|
1564 |
] ifFalse:[ |
|
1565 |
"keep any existing attribute" |
|
1566 |
oldAttributes notNil ifTrue:[ |
|
1567 |
attributes := oldAttributes. |
|
1568 |
] ifFalse:[ |
|
1569 |
attributes := eachClass isLoaded ifTrue:[ #() ] ifFalse:[ #(autoload) ]. |
|
1570 |
]. |
|
1571 |
]. |
|
1572 |
"JV @ 2010-06-19 |
|
1573 |
Support for additional class attributes and programming language attribute" |
|
1574 |
attributes := self mergeDefaultClassAttributesFor: eachClass with: attributes. |
|
1575 |
||
1576 |
newEntry := Array with:className. |
|
1577 |
attributes notEmptyOrNil ifTrue:[ |
|
1578 |
newEntry := newEntry , attributes. |
|
1579 |
]. |
|
1580 |
newSpec add:newEntry. |
|
1581 |
] |
|
1582 |
] |
|
1583 |
] |
|
1584 |
] |
|
1585 |
] |
|
9998 | 1586 |
]. |
17109 | 1587 |
^ self classNamesAndAttributes_codeFor:newSpec |
10393 | 1588 |
|
13419 | 1589 |
" |
10393 | 1590 |
stx_libbasic3 classNamesAndAttributes_code_ignoreOldEntries:false ignoreOldDefinition:true |
1591 |
exept_expecco classNamesAndAttributes_code_ignoreOldEntries:false ignoreOldDefinition:true |
|
1592 |
" |
|
9998 | 1593 |
|
1594 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1595 |
"Created: / 10-10-2006 / 22:00:50 / cg" |
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
1596 |
"Modified: / 06-09-2011 / 07:48:52 / cg" |
16802
0875f5d7c9ce
Care for Java classes that are part of a Smalltalk/X package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16786
diff
changeset
|
1597 |
"Modified: / 30-07-2014 / 20:40:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
22333 | 1598 |
"Modified (comment): / 08-11-2017 / 17:59:04 / mawalch" |
9998 | 1599 |
! |
1600 |
||
1601 |
companyName_code |
|
20567 | 1602 |
"generate code that answers the company name." |
1603 |
||
12541 | 1604 |
^ self companyName_codeFor:self companyName |
1605 |
||
1606 |
" |
|
1607 |
self companyName_code |
|
1608 |
stx_libbasic3 companyName_code |
|
1609 |
" |
|
1610 |
||
1611 |
"Created: / 18-08-2006 / 16:20:42 / cg" |
|
1612 |
! |
|
1613 |
||
1614 |
companyName_codeFor:aString |
|
20567 | 1615 |
"generate code that answers aString as the company name." |
1616 |
||
9998 | 1617 |
^ String streamContents:[:s | |
23124 | 1618 |
s nextPutLine:'companyName'. |
1619 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #companyName) comment; nextPutLine:'"'. |
|
1620 |
s cr; nextPutLine:' ^ ',aString storeString. |
|
9998 | 1621 |
]. |
1622 |
||
1623 |
" |
|
1624 |
self companyName_code |
|
1625 |
stx_libbasic3 companyName_code |
|
1626 |
" |
|
1627 |
||
1628 |
"Created: / 18-08-2006 / 16:20:42 / cg" |
|
16222
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
1629 |
"Modified: / 05-03-2014 / 17:00:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9998 | 1630 |
! |
1631 |
||
1632 |
compileDescriptionMethods |
|
16682 | 1633 |
(self isAbstract) ifTrue:[ |
23124 | 1634 |
self error:'I am abstract - must be a subclass of Libray- or ApplicationDefinition.' |
9998 | 1635 |
]. |
1636 |
||
13419 | 1637 |
self |
23124 | 1638 |
forEachMethodsCodeToCompileDo:[:code :category | |
1639 |
self compile:code categorized:category |
|
1640 |
]. |
|
9998 | 1641 |
|
1642 |
"/ self instAndClassMethodsDo:[:m | m package:self package]. |
|
1643 |
||
1644 |
" |
|
1645 |
DapasXProject compileDescriptionMethods |
|
1646 |
DapasX_Datenbasis compileDescriptionMethods |
|
1647 |
bosch_dapasx_interactiver_editor compileDescriptionMethods |
|
1648 |
stx_libbasic compileDescriptionMethods |
|
1649 |
" |
|
1650 |
||
1651 |
"Created: / 09-08-2006 / 18:00:31 / fm" |
|
1652 |
"Modified: / 05-09-2006 / 13:46:29 / cg" |
|
1653 |
! |
|
1654 |
||
1655 |
description_code |
|
1656 |
^ String streamContents:[:s | |
|
23124 | 1657 |
s nextPutLine:'description'. |
1658 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #description) comment; nextPutLine:'"'. |
|
1659 |
s cr; nextPutLine:' ^ ',self description asString storeString. |
|
9998 | 1660 |
]. |
1661 |
||
1662 |
" |
|
13419 | 1663 |
self description_code |
1664 |
stx_libbasic3 description_code |
|
9998 | 1665 |
" |
1666 |
||
1667 |
"Created: / 17-08-2006 / 21:24:01 / cg" |
|
1668 |
"Modified: / 18-08-2006 / 16:16:24 / cg" |
|
16222
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
1669 |
"Modified: / 05-03-2014 / 17:00:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9998 | 1670 |
! |
1671 |
||
11386
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1672 |
effectiveSubProjects |
21259 | 1673 |
"get the subProjects for the current OS platform, that are not excluded" |
1674 |
||
1675 |
^ self effectiveSubProjects:OperatingSystem platformName |
|
1676 |
||
1677 |
"Modified: / 17-01-2017 / 16:31:42 / stefan" |
|
1678 |
! |
|
1679 |
||
1680 |
effectiveSubProjects:osSymbol |
|
1681 |
"get the subProjects, that are not excluded. |
|
1682 |
osSymbol can be #win32 or #unix (for now)." |
|
11386
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1683 |
|
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1684 |
|subProjects| |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1685 |
|
21259 | 1686 |
subProjects := (self subProjects, self includedInSubProjects) collect:[:eachLine| |
23124 | 1687 |
eachLine isString ifTrue:[ |
1688 |
eachLine |
|
1689 |
] ifFalse:[eachLine second = osSymbol ifTrue:[ |
|
1690 |
eachLine first. |
|
1691 |
] ifFalse:[ |
|
1692 |
nil. |
|
1693 |
]]. |
|
1694 |
] as:OrderedSet. |
|
21259 | 1695 |
|
1696 |
subProjects remove:self package ifAbsent:[]. |
|
1697 |
subProjects remove:nil ifAbsent:[]. |
|
1698 |
||
1699 |
self excludedFromSubProjects do:[:eachLine| |
|
23124 | 1700 |
eachLine isString ifTrue:[ |
1701 |
subProjects remove:eachLine ifAbsent:[]. |
|
1702 |
] ifFalse:[eachLine second = osSymbol ifTrue:[ |
|
1703 |
subProjects remove:eachLine first ifAbsent:[]. |
|
1704 |
]]. |
|
21259 | 1705 |
]. |
11386
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1706 |
|
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1707 |
^ subProjects |
21259 | 1708 |
|
1709 |
"Created: / 17-01-2017 / 16:16:03 / stefan" |
|
11386
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1710 |
! |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1711 |
|
12425 | 1712 |
excludedFromPreRequisites_code |
1713 |
"generate the code of the #excludedFromPreRequisites method" |
|
1714 |
||
1715 |
^ String streamContents:[:s | |
|
23124 | 1716 |
s nextPutLine:'excludedFromPreRequisites'. |
1717 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #excludedFromPreRequisites) comment; nextPutLine:'"'. |
|
1718 |
s nextPutLine:''. |
|
1719 |
s nextPutLine:' ^ #('. |
|
1720 |
s nextPutLine:' )' |
|
12425 | 1721 |
]. |
16222
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
1722 |
|
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
1723 |
"Modified: / 05-03-2014 / 17:00:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12425 | 1724 |
! |
1725 |
||
9998 | 1726 |
extensionMethodNames_code |
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1727 |
^ self extensionMethodNames_code_ignoreOldEntries:true |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1728 |
|
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1729 |
" |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1730 |
self extensionMethodNames_code |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1731 |
" |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1732 |
|
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1733 |
"Created: / 17-08-2006 / 21:21:48 / cg" |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1734 |
"Modified: / 10-10-2006 / 22:02:42 / cg" |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1735 |
! |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1736 |
|
15005 | 1737 |
extensionMethodNames_code_For:extensionMethodNames |
1738 |
^ String streamContents:[:s | |
|
23124 | 1739 |
|spec| |
1740 |
||
1741 |
s nextPutLine:'extensionMethodNames'. |
|
1742 |
s nextPutLine:' "lists the extension methods which are to be included in the project.'. |
|
1743 |
s nextPutLine:' Entries are pairwise elements, consisting of class-name and selector."'. |
|
1744 |
s nextPutLine:''. |
|
1745 |
s nextPutLine:' ^ #('. |
|
1746 |
||
1747 |
spec := extensionMethodNames pairWiseCollect:[:className :selector | className -> selector ]. |
|
1748 |
spec do:[:entry | |
|
1749 |
|mclassName mselector| |
|
1750 |
||
1751 |
mclassName := entry key asSymbol. |
|
1752 |
(mclassName endsWith:' class') ifTrue:[ |
|
1753 |
mclassName := mclassName asString. |
|
1754 |
]. |
|
1755 |
mselector := entry value asSymbol. |
|
1756 |
||
1757 |
s spaces:8. |
|
1758 |
mclassName storeArrayElementOn:s. |
|
1759 |
s space. |
|
1760 |
mselector storeArrayElementOn:s. |
|
1761 |
s cr. |
|
1762 |
]. |
|
1763 |
s nextPutLine:' )' |
|
15005 | 1764 |
]. |
1765 |
! |
|
1766 |
||
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1767 |
extensionMethodNames_code_ignoreOldEntries:ignoreOldEntries |
9998 | 1768 |
^ String streamContents:[:s | |
23124 | 1769 |
|oldSpec| |
1770 |
||
1771 |
s nextPutLine:'extensionMethodNames'. |
|
1772 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #extensionMethodNames) comment; nextPutLine:'"'. |
|
1773 |
s nextPutLine:''. |
|
1774 |
s nextPutLine:' ^ #('. |
|
1775 |
||
1776 |
oldSpec := self extensionMethodNames pairWiseCollect:[:className :selector | className -> selector ]. |
|
1777 |
||
1778 |
ignoreOldEntries ifFalse:[ |
|
1779 |
oldSpec do:[:entry | |
|
1780 |
|mclassName mselector| |
|
1781 |
||
1782 |
mclassName := entry key asSymbol. |
|
1783 |
(mclassName endsWith:' class') ifTrue:[ |
|
1784 |
mclassName := mclassName asString. |
|
1785 |
]. |
|
1786 |
mselector := entry value asSymbol. |
|
1787 |
||
1788 |
s spaces:8. |
|
1789 |
mclassName storeArrayElementOn:s. |
|
1790 |
s space. |
|
1791 |
mselector storeArrayElementOn:s. |
|
1792 |
s cr. |
|
1793 |
]. |
|
1794 |
]. |
|
1795 |
||
1796 |
self searchForExtensions do:[:eachMethod | |
|
1797 |
|attributes oldSpecEntry mclassName mselector| |
|
1798 |
||
1799 |
mclassName := eachMethod mclass name. |
|
1800 |
mselector := eachMethod selector. |
|
1801 |
"JV@2012-09-07: Do not list Java methods in extensionMethodNames. |
|
1802 |
They are loaded lazily by JavaClassReader and if listed here, |
|
1803 |
they would cause an error if the package is loaded from source. |
|
1804 |
Sort of a HACK, indeed" |
|
1805 |
eachMethod mclass theNonMetaclass isJavaClass ifFalse:[ |
|
1806 |
oldSpecEntry := oldSpec detect:[:entry | entry key = mclassName and:[ entry value = mselector]] ifNone:nil. |
|
1807 |
(ignoreOldEntries or:[ oldSpecEntry isNil]) ifTrue:[ |
|
1808 |
s spaces:8. |
|
1809 |
mclassName storeArrayElementOn:s. |
|
1810 |
s space. |
|
1811 |
mselector storeArrayElementOn:s. |
|
1812 |
s cr. |
|
1813 |
] |
|
1814 |
]. |
|
1815 |
]. |
|
1816 |
||
1817 |
s nextPutLine:' )' |
|
9998 | 1818 |
]. |
1819 |
||
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1820 |
" |
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1821 |
self extensionMethodNames_code_ignoreOldEntries:false |
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
1822 |
stx_libjava extensionMethodNames_code_ignoreOldEntries:false |
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1823 |
stx_libtool extensionMethodNames_code_ignoreOldEntries:true |
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1824 |
" |
9998 | 1825 |
|
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1826 |
"Created: / 10-10-2006 / 22:02:36 / cg" |
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1827 |
"Modified: / 23-10-2006 / 11:07:29 / cg" |
16222
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
1828 |
"Modified: / 05-03-2014 / 17:00:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9998 | 1829 |
! |
1830 |
||
1831 |
forEachContentsMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition |
|
15052 | 1832 |
"generate code for each contents-specifying method |
1833 |
(classesAndAttributes, extensionMethodNames, etc.), |
|
1834 |
and evaluate aTwoArgBlock on it, passing in the code and the method's category. |
|
1835 |
If ignoreOldDefinition is true, new code is generated (class/method scan); |
|
1836 |
otherwise, new items are added to the existing lists" |
|
1837 |
||
13419 | 1838 |
aTwoArgBlock |
23124 | 1839 |
value:(self classNamesAndAttributes_code_ignoreOldEntries:ignoreOldDefinition ignoreOldDefinition:ignoreOldDefinition) |
1840 |
value:'description - contents'. |
|
13419 | 1841 |
|
1842 |
aTwoArgBlock |
|
23124 | 1843 |
value: (self extensionMethodNames_code_ignoreOldEntries:ignoreOldDefinition) |
1844 |
value: 'description - contents'. |
|
13419 | 1845 |
|
1846 |
aTwoArgBlock |
|
23124 | 1847 |
value: self mandatoryPreRequisites_code |
1848 |
value: 'description'. |
|
14843 | 1849 |
|
1850 |
aTwoArgBlock |
|
23124 | 1851 |
value: self referencedPreRequisites_code |
1852 |
value: 'description'. |
|
13419 | 1853 |
|
16571 | 1854 |
(self class includesSelector:#excludedFromPreRequisites) ifFalse:[ |
23124 | 1855 |
aTwoArgBlock |
1856 |
value: self excludedFromPreRequisites_code |
|
1857 |
value: 'description'. |
|
14812 | 1858 |
]. |
13411 | 1859 |
|
15950 | 1860 |
"/ JV: No, subProjects **should not** be automatically generated. |
1861 |
"/ Remember, they are not required to be loaded!! So, generate |
|
1862 |
"/ subProjects only if there's no such method yet. |
|
1863 |
(self class methodDictionary includesKey: #subProjects) ifFalse:[ |
|
23124 | 1864 |
aTwoArgBlock |
1865 |
value: self subProjects_code |
|
1866 |
value: 'description'. |
|
15950 | 1867 |
]. |
14988 | 1868 |
|
13411 | 1869 |
(self monticelloPackageName notNil and:[self respondsTo:#monticelloTimestamps_code]) ifTrue:[ |
23124 | 1870 |
aTwoArgBlock |
1871 |
value: self monticelloTimestamps_code |
|
1872 |
value: 'description - monticello'. |
|
13411 | 1873 |
]. |
1874 |
||
15950 | 1875 |
"Modified: / 25-11-2013 / 13:56:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13411 | 1876 |
! |
1877 |
||
16682 | 1878 |
forEachDescriptionMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition |
1879 |
"generate code for descriptive methods, |
|
15052 | 1880 |
and evaluate aTwoArgBlock on it, passing in the code and the method's category. |
1881 |
If ignoreOldDefinition is true, new code is generated (class/method scan); |
|
1882 |
otherwise, new items are added to the existing lists" |
|
1883 |
||
13873 | 1884 |
"/ code like: |
1885 |
"/ |
|
1886 |
"/ (self class includesSelector:#productName) ifFalse:[ |
|
1887 |
"/ aTwoArgBlock |
|
1888 |
"/ value: self productName_code |
|
1889 |
"/ value: 'description - project information'. |
|
1890 |
"/ ]. |
|
1891 |
||
1892 |
#( |
|
23124 | 1893 |
(productName productName_code) |
1894 |
(description description_code) |
|
1895 |
(companyName companyName_code) |
|
1896 |
(legalCopyright legalCopyright_code) |
|
13873 | 1897 |
) pairsDo:[:selector :codeMethodSelector | |
23124 | 1898 |
(self class includesSelector:selector) ifFalse:[ |
1899 |
aTwoArgBlock |
|
1900 |
value: (self perform:codeMethodSelector) |
|
1901 |
value: 'description - project information'. |
|
1902 |
]. |
|
11072 | 1903 |
]. |
16682 | 1904 |
! |
1905 |
||
1906 |
forEachMethodsCodeToCompileDo:aTwoArgBlock |
|
1907 |
"update code for each method (contents plus version info), |
|
1908 |
and evaluate aTwoArgBlock on it, passing in the code and the method's category. |
|
1909 |
New items are added to the existing lists" |
|
1910 |
||
1911 |
self forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:false |
|
1912 |
! |
|
1913 |
||
1914 |
forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition |
|
1915 |
"generate code for each method (contents plus version info), |
|
1916 |
and evaluate aTwoArgBlock on it, passing in the code and the method's category. |
|
1917 |
If ignoreOldDefinition is true, new code is generated (class/method scan); |
|
1918 |
otherwise, new items are added to the existing lists" |
|
1919 |
||
1920 |
self |
|
23124 | 1921 |
forEachContentsMethodsCodeToCompileDo:aTwoArgBlock |
1922 |
ignoreOldDefinition:ignoreOldDefinition. |
|
16682 | 1923 |
|
1924 |
self |
|
23124 | 1925 |
forEachDescriptionMethodsCodeToCompileDo:aTwoArgBlock |
1926 |
ignoreOldDefinition:ignoreOldDefinition. |
|
9998 | 1927 |
|
13411 | 1928 |
(self monticelloPackageName notNil and:[self respondsTo:#monticelloTimestamps_code]) ifTrue:[ |
23124 | 1929 |
aTwoArgBlock |
1930 |
value: self monticelloTimestamps_code |
|
1931 |
value: 'description - monticello'. |
|
13411 | 1932 |
]. |
1933 |
||
9998 | 1934 |
"Created: / 18-08-2006 / 16:22:37 / cg" |
13411 | 1935 |
"Modified: / 09-11-2010 / 18:41:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13873 | 1936 |
"Modified: / 21-12-2011 / 16:42:41 / cg" |
9998 | 1937 |
! |
1938 |
||
1939 |
legalCopyright_code |
|
1940 |
^ String streamContents:[:s | |
|
23124 | 1941 |
s nextPutLine:'legalCopyright'. |
1942 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #legalCopyright) comment; nextPutLine:'"'. |
|
1943 |
s cr; nextPutLine:' ^ ', self legalCopyright storeString. |
|
9998 | 1944 |
]. |
1945 |
||
1946 |
" |
|
13419 | 1947 |
self legalCopyright_code |
1948 |
stx_libbasic3 legalCopyright_code |
|
9998 | 1949 |
" |
1950 |
||
1951 |
"Created: / 18-08-2006 / 16:21:01 / cg" |
|
16222
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
1952 |
"Modified: / 05-03-2014 / 17:00:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9998 | 1953 |
! |
1954 |
||
14843 | 1955 |
mandatoryPreRequisites_code |
1956 |
"generate the code of the #mandatoryPreRequisites method" |
|
1957 |
||
1958 |
|preRequisites| |
|
1959 |
||
1960 |
preRequisites := self searchForPreRequisites first. |
|
23125 | 1961 |
preRequisites |
1962 |
removeAllKeys:self excludedFromMandatoryPreRequisites ifAbsent:[]; |
|
1963 |
removeAllKeys:self excludedFromPreRequisites ifAbsent:[]. |
|
1964 |
||
1965 |
self checkForBadReferences:preRequisites. |
|
14843 | 1966 |
|
1967 |
^ String streamContents:[:s | |
|
23125 | 1968 |
s nextPutLine:'mandatoryPreRequisites'. |
1969 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #mandatoryPreRequisites) comment; nextPutLine:'"'. |
|
1970 |
s nextPutLine:''. |
|
1971 |
s nextPutLine:' ^ #('. |
|
1972 |
preRequisites keys asSortedCollection do:[:eachPackageID | |
|
1973 |
|reason| |
|
1974 |
||
1975 |
s spaces:8. |
|
1976 |
eachPackageID asSymbol storeOn:s. |
|
1977 |
reason := preRequisites at:eachPackageID ifAbsent:[nil]. |
|
1978 |
reason notEmptyOrNil ifTrue:[ |
|
1979 |
s nextPutAll:' "'; nextPutAll:reason anElement; nextPut:$". |
|
1980 |
]. |
|
1981 |
s cr. |
|
1982 |
]. |
|
1983 |
s nextPutLine:' )' |
|
14843 | 1984 |
]. |
1985 |
||
1986 |
" |
|
1987 |
demo_demoApp1 mandatoryPreRequisites_code |
|
1988 |
stx_libbasic3 mandatoryPreRequisites_code |
|
1989 |
stx_libtool2 mandatoryPreRequisites_code |
|
1990 |
" |
|
1991 |
||
1992 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
1993 |
"Created: / 17-08-2006 / 21:28:09 / cg" |
|
1994 |
"Modified: / 09-10-2006 / 14:27:20 / cg" |
|
16222
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
1995 |
"Modified: / 05-03-2014 / 17:00:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14843 | 1996 |
! |
1997 |
||
13873 | 1998 |
productInstallDirBaseName_code |
1999 |
^ String streamContents:[:s | |
|
23124 | 2000 |
s nextPutLine:'productInstallDirBaseName'. |
2001 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #productInstallDirBaseName) comment; nextPutLine:'"'. |
|
2002 |
s cr; |
|
2003 |
nextPutLine:' ^ (self package asCollectionOfSubstringsSeparatedByAny:'':/'') last'. |
|
13873 | 2004 |
]. |
2005 |
||
2006 |
" |
|
20567 | 2007 |
ApplicationDefinition productInstallDirBaseName_code |
13873 | 2008 |
stx_libbasic3 productInstallDirBaseName_code |
2009 |
stx_clients_Clock_QlockTwoWatchApplication productInstallDirBaseName_code |
|
2010 |
" |
|
2011 |
||
2012 |
"Created: / 21-12-2011 / 16:38:11 / cg" |
|
16222
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
2013 |
"Modified: / 05-03-2014 / 17:00:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13873 | 2014 |
! |
2015 |
||
9998 | 2016 |
productName_code |
20567 | 2017 |
"generate code that answers the product name." |
2018 |
||
12541 | 2019 |
^ self productName_codeFor:(self productName) |
2020 |
||
2021 |
" |
|
2022 |
self productName_code |
|
2023 |
stx_libbasic3 productName_code |
|
2024 |
" |
|
2025 |
||
2026 |
"Created: / 18-08-2006 / 16:14:19 / cg" |
|
2027 |
! |
|
2028 |
||
2029 |
productName_codeFor:aString |
|
20567 | 2030 |
"generate code that answers aString as the product name." |
2031 |
||
9998 | 2032 |
^ String streamContents:[:s | |
23124 | 2033 |
s nextPutLine:'productName'. |
2034 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #productName) comment; nextPutLine:'"'. |
|
2035 |
s cr; nextPutLine:' ^ ',aString storeString. |
|
9998 | 2036 |
]. |
2037 |
||
2038 |
" |
|
2039 |
self productName_code |
|
2040 |
stx_libbasic3 productName_code |
|
2041 |
" |
|
2042 |
||
2043 |
"Created: / 18-08-2006 / 16:14:19 / cg" |
|
16222
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
2044 |
"Modified: / 05-03-2014 / 17:00:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12028 | 2045 |
! |
2046 |
||
14843 | 2047 |
referencedPreRequisites_code |
2048 |
"generate the code of the #referencedPreRequisites method" |
|
2049 |
||
2050 |
|preRequisitesColl preRequisites| |
|
2051 |
||
2052 |
preRequisitesColl := self searchForPreRequisites. |
|
14885 | 2053 |
preRequisites := preRequisitesColl second. |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
2054 |
preRequisites |
23125 | 2055 |
removeAllKeys:self excludedFromPreRequisites ifAbsent:[]; |
2056 |
removeAllKeys:self excludedFromRequiredPreRequisites ifAbsent:[]; |
|
2057 |
removeAllKeys:preRequisitesColl first keys ifAbsent:[]. "remove the mandatory prerequisites" |
|
2058 |
||
2059 |
self checkForBadReferences:preRequisites. |
|
14843 | 2060 |
|
2061 |
^ String streamContents:[:s | |
|
23125 | 2062 |
s nextPutLine:'referencedPreRequisites'. |
2063 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #referencedPreRequisites) comment; nextPutLine:'"'. |
|
2064 |
s nextPutLine:''. |
|
2065 |
s nextPutLine:' ^ #('. |
|
2066 |
preRequisites keys asSortedCollection do:[:eachPackageID | |
|
2067 |
|reason| |
|
2068 |
||
2069 |
s spaces:8. |
|
2070 |
eachPackageID asSymbol storeOn:s. |
|
2071 |
reason := preRequisites at:eachPackageID ifAbsent:[nil]. |
|
2072 |
reason notEmptyOrNil ifTrue:[ |
|
2073 |
s nextPutAll:' "'; nextPutAll:reason anElement; nextPut:$". |
|
2074 |
]. |
|
2075 |
s cr. |
|
2076 |
]. |
|
2077 |
s nextPutLine:' )' |
|
14843 | 2078 |
]. |
2079 |
||
2080 |
" |
|
2081 |
demo_demoApp1 referencedPreRequisites_code |
|
2082 |
stx_libbasic3 referencedPreRequisites_code |
|
2083 |
stx_libtool2 referencedPreRequisites_code |
|
2084 |
" |
|
2085 |
||
2086 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
2087 |
"Created: / 17-08-2006 / 21:28:09 / cg" |
|
2088 |
"Modified: / 09-10-2006 / 14:27:20 / cg" |
|
16222
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
2089 |
"Modified: / 05-03-2014 / 17:00:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14843 | 2090 |
! |
2091 |
||
14988 | 2092 |
subProjects_code |
2093 |
"generate the code of the #subProjects method. |
|
2094 |
Returns nil if no such code is needed (because there are none)" |
|
2095 |
||
2096 |
^ String streamContents:[:s | |
|
23124 | 2097 |
s nextPutLine:'subProjects'. |
2098 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #subProjects) comment; nextPutLine:'"'. |
|
2099 |
s nextPutLine:''. |
|
2100 |
s nextPutLine:' ^ #('. |
|
2101 |
ProjectDefinition allSubclassesDo:[:each | |
|
2102 |
(each package startsWith:(self package,'/')) ifTrue:[ |
|
2103 |
s nextPutLine:' #''',each package,''''. |
|
2104 |
] |
|
2105 |
]. |
|
2106 |
s nextPutLine:' )' |
|
14988 | 2107 |
]. |
16222
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
2108 |
|
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
2109 |
"Modified: / 05-03-2014 / 17:00:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14988 | 2110 |
! |
2111 |
||
12028 | 2112 |
svnRevisionNr_code: revisionNrOrNil |
2113 |
^ String streamContents:[:s | |
|
23124 | 2114 |
s nextPutLine:'svnRevisionNr'. |
2115 |
s nextPutLine:' "Return a SVN revision number of myself.'. |
|
2116 |
s nextPutLine:' This number is updated after a commit"'. |
|
2117 |
s cr; |
|
2118 |
nextPutLine:' ^ "$SVN-Revision:"''', ('%-16s' printf: (Array with: revisionNrOrNil printString)) , '''"$"'. |
|
12028 | 2119 |
]. |
2120 |
||
2121 |
" |
|
2122 |
self svnRevisionNr_code |
|
2123 |
stx_libbasic3 svnRevisionNr_code |
|
2124 |
" |
|
2125 |
||
2126 |
"Created: / 16-06-2009 / 12:12:37 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
2127 |
"Modified: / 22-08-2009 / 09:05:05 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2128 |
"Modified: / 29-03-2012 / 18:43:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9998 | 2129 |
! ! |
2130 |
||
9569 | 2131 |
!ProjectDefinition class methodsFor:'defaults'! |
9536 | 2132 |
|
9664 | 2133 |
applicationTypes |
9714 | 2134 |
GUIApplicationType isNil ifTrue:[self initialize]. |
2135 |
^ Array with:GUIApplicationType with:NonGUIApplicationType |
|
9664 | 2136 |
|
9714 | 2137 |
" |
13419 | 2138 |
self applicationTypes |
9714 | 2139 |
" |
9664 | 2140 |
! |
2141 |
||
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
2142 |
defaultCategory |
10466 | 2143 |
^'* Projects & Packages *' |
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
2144 |
|
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
2145 |
"Created: / 11-08-2006 / 14:16:49 / cg" |
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
2146 |
! |
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
2147 |
|
9714 | 2148 |
defaultProjectType |
9745 | 2149 |
^ self libraryTypes first |
2150 |
"/ ^ self applicationTypes first |
|
9714 | 2151 |
|
2152 |
"Created: / 23-08-2006 / 14:27:32 / cg" |
|
2153 |
! |
|
2154 |
||
2155 |
defaultProjectTypeForGUIApplication |
|
2156 |
^ GUIApplicationType |
|
2157 |
! |
|
2158 |
||
2159 |
defaultProjectTypeForNonGUIApplication |
|
2160 |
^ NonGUIApplicationType |
|
2161 |
! |
|
9664 | 2162 |
|
16541 | 2163 |
folderForSubApplicationsType |
2164 |
^ FolderForSubApplicationsType |
|
2165 |
! |
|
2166 |
||
9714 | 2167 |
guiApplicationType |
2168 |
^ GUIApplicationType |
|
2169 |
! |
|
2170 |
||
2171 |
libraryType |
|
2172 |
^ LibraryType |
|
2173 |
! |
|
2174 |
||
13419 | 2175 |
libraryTypes |
9714 | 2176 |
LibraryType isNil ifTrue:[self initialize]. |
2177 |
^ Array with:LibraryType |
|
2178 |
||
2179 |
" |
|
13419 | 2180 |
self libraryTypes |
9714 | 2181 |
" |
2182 |
! |
|
2183 |
||
2184 |
nonGuiApplicationType |
|
2185 |
^ NonGUIApplicationType |
|
9664 | 2186 |
! |
2187 |
||
12331 | 2188 |
projectTypeSelectors |
2189 |
"a list of possible project type selectors" |
|
2190 |
||
16541 | 2191 |
^ #( libraryType guiApplicationType nonGuiApplicationType folderForSubApplicationsType ) |
12331 | 2192 |
|
2193 |
" |
|
2194 |
self libraryType |
|
2195 |
self guiApplicationType |
|
2196 |
self nonGuiApplicationType |
|
2197 |
" |
|
2198 |
||
2199 |
"Created: / 23-08-2006 / 14:27:32 / cg" |
|
2200 |
! |
|
2201 |
||
9664 | 2202 |
projectTypes |
16541 | 2203 |
"a list of possible project types (shown in the new-package dialog's combo list)" |
2204 |
||
2205 |
^ self libraryTypes , self applicationTypes , { FolderForSubApplicationsType } |
|
9664 | 2206 |
|
12331 | 2207 |
" |
2208 |
self projectTypes |
|
2209 |
" |
|
2210 |
||
9664 | 2211 |
"Created: / 23-08-2006 / 14:27:32 / cg" |
9536 | 2212 |
! ! |
2213 |
||
9569 | 2214 |
!ProjectDefinition class methodsFor:'description'! |
9536 | 2215 |
|
20527 | 2216 |
excludedFromMandatoryPreRequisites |
9983 | 2217 |
"list packages which are to be explicitely excluded from the automatic constructed |
23124 | 2218 |
mandatory prerequisites list. |
20527 | 2219 |
If empty, everything that is found along the inheritance of any of |
2220 |
my classes is considered to be a prerequisite package." |
|
2221 |
||
2222 |
^ #() |
|
2223 |
! |
|
2224 |
||
2225 |
excludedFromPreRequisites |
|
2226 |
"obsolete; temporarily, this is still called for, but will eventually vanish. |
|
23124 | 2227 |
|
20527 | 2228 |
List packages which are to be explicitely excluded from the automatic constructed |
23124 | 2229 |
prerequisites lists (both). |
20527 | 2230 |
If empty, everything that is found along the inheritance of any of |
2231 |
my classes is considered to be a prerequisite package." |
|
2232 |
||
2233 |
^ #() |
|
2234 |
||
2235 |
"Modified: / 17-08-2006 / 19:48:59 / cg" |
|
2236 |
! |
|
2237 |
||
2238 |
excludedFromRequiredPreRequisites |
|
2239 |
"list packages which are to be explicitely excluded from the automatic constructed |
|
23124 | 2240 |
required prerequisites list. |
20527 | 2241 |
If empty, everything that is found along the inheritance of any of |
9983 | 2242 |
my classes is considered to be a prerequisite package." |
2243 |
||
2244 |
^ #() |
|
2245 |
||
2246 |
"Modified: / 17-08-2006 / 19:48:59 / cg" |
|
2247 |
! |
|
2248 |
||
10380
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
2249 |
excludedFromSubProjects |
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
2250 |
"list packages which are to be explicitely excluded from the automatic constructed |
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
2251 |
subProjects list. If empty, every sub-package is included as a prerequisite." |
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
2252 |
|
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
2253 |
^ #() |
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
2254 |
|
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
2255 |
"Modified: / 17-08-2006 / 19:49:40 / cg" |
10039 | 2256 |
! |
2257 |
||
14808 | 2258 |
includedInPreRequisites |
17577 | 2259 |
"list packages which are to be implicitely included in the prerequisites list, |
14808 | 2260 |
even if not found by the automatic search. |
2261 |
Redefine this, if classes from other packages are referred to via reflection |
|
2262 |
or by constructing names dynamically (i.e. the search cannot find it)" |
|
2263 |
||
2264 |
^ #() |
|
2265 |
! |
|
2266 |
||
15395 | 2267 |
includedInSubProjects |
2268 |
"list packages which are to be explicitely included in the subproject list, |
|
2269 |
even if not found by the automatic search. |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
2270 |
However: they are not forced to be loaded when a package is loaded; |
15395 | 2271 |
for those, redefine #includedInPreRequisites." |
2272 |
||
2273 |
^ #() |
|
2274 |
||
2275 |
"Modified: / 17-08-2006 / 19:57:46 / cg" |
|
2276 |
! |
|
2277 |
||
14843 | 2278 |
mandatoryPreRequisites |
2279 |
"list packages which are mandatory as a prerequisite. |
|
2280 |
This are packages containing superclasses of my classes and classes which |
|
2281 |
are extended by myself. |
|
16554 | 2282 |
They are mandatory, because we need these packages as a prerequisite for loading and compiling. |
14843 | 2283 |
This method is generated automatically, |
20664 | 2284 |
by searching along the inheritance chain of all of my classes. |
2285 |
Please take a look at the #referencedPreRequisites method as well." |
|
9575 | 2286 |
|
2287 |
^ #() |
|
14843 | 2288 |
! |
2289 |
||
2290 |
preRequisites |
|
20527 | 2291 |
"list packages which are required as a prerequisite (both mandatory and referenced). |
2292 |
This is used to build dependency chains in makefiles" |
|
14843 | 2293 |
|
2294 |
"use an OrderedSet here, so that mandatory prerequisites come first" |
|
2295 |
||
2296 |
^ OrderedSet new |
|
23124 | 2297 |
addAll:self mandatoryPreRequisites; |
2298 |
addAll:self referencedPreRequisites; |
|
2299 |
addAll:self includedInPreRequisites; |
|
2300 |
removeAllFoundIn:self excludedFromPreRequisites; |
|
2301 |
yourself. |
|
9575 | 2302 |
|
2303 |
"Modified: / 17-08-2006 / 19:54:21 / cg" |
|
2304 |
! |
|
2305 |
||
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
2306 |
preRequisitesFor:packageId |
14843 | 2307 |
|def| |
13411 | 2308 |
|
2309 |
def := self definitionClassForPackage:packageId. |
|
13820
f46f7306eea2
changed: #preRequisitesFor:
Claus Gittinger <cg@exept.de>
parents:
13809
diff
changeset
|
2310 |
def isNil ifTrue:[ |
23124 | 2311 |
"Maybe the package is not loaded? Try to load it..." |
2312 |
[ |
|
2313 |
Smalltalk loadPackage:packageId. |
|
2314 |
def := self definitionClassForPackage:packageId |
|
2315 |
] on:PackageLoadError do:[:ex| def := nil]. |
|
13820
f46f7306eea2
changed: #preRequisitesFor:
Claus Gittinger <cg@exept.de>
parents:
13809
diff
changeset
|
2316 |
]. |
21259 | 2317 |
^ def isNil ifTrue:[ |
23124 | 2318 |
"Still no project definition - maybe it does not exist?" |
2319 |
Transcript showCR:'Warning: no definition class for package: ', packageId. |
|
2320 |
((self searchForPreRequisites:packageId) |
|
2321 |
fold:[:d1 :d2| d1 addAll:d2; yourself]) keys |
|
2322 |
] ifFalse:[ |
|
2323 |
def effectivePreRequisites |
|
21259 | 2324 |
] |
13411 | 2325 |
|
2326 |
"Created: / 24-02-2011 / 22:47:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13820
f46f7306eea2
changed: #preRequisitesFor:
Claus Gittinger <cg@exept.de>
parents:
13809
diff
changeset
|
2327 |
"Modified: / 18-11-2011 / 14:52:43 / cg" |
f46f7306eea2
changed: #preRequisitesFor:
Claus Gittinger <cg@exept.de>
parents:
13809
diff
changeset
|
2328 |
"Modified (format): / 19-11-2011 / 11:25:36 / cg" |
21259 | 2329 |
"Modified: / 17-01-2017 / 16:55:39 / stefan" |
13411 | 2330 |
! |
2331 |
||
14843 | 2332 |
referencedPreRequisites |
16213 | 2333 |
"list packages which are a prerequisite, because they contain |
14843 | 2334 |
classes which are referenced by my classes. |
20664 | 2335 |
These packages are NOT needed as a prerequisite for compiling or loading, |
17472 | 2336 |
however, a class from it may be referenced during execution and having it |
2337 |
unloaded then may lead to a runtime doesNotUnderstand error, unless the caller |
|
2338 |
includes explicit checks for the package being present. |
|
14843 | 2339 |
This method is generated automatically, |
20664 | 2340 |
by searching all classes (and their packages) which are referenced by my classes. |
2341 |
Please also take a look at the #mandatoryPreRequisites method" |
|
14843 | 2342 |
|
2343 |
^ #() |
|
12186 | 2344 |
! |
2345 |
||
9685 | 2346 |
siblingsAreSubProjects |
2347 |
^ false |
|
2348 |
! |
|
2349 |
||
11377 | 2350 |
splashFileName |
2351 |
"answer the base-name of the splash bitmap. |
|
2352 |
||
2353 |
Default is nil, for no splash. If non-nil, it must be a bmp file's name" |
|
2354 |
||
2355 |
^ nil. |
|
2356 |
! |
|
2357 |
||
9575 | 2358 |
subProjects |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
2359 |
"list packages which are known as subprojects. |
14959 | 2360 |
The generated makefile will enter those and make there as well. |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
2361 |
However: they are not forced to be loaded when a package is loaded; |
20664 | 2362 |
for those, redefine #referencedPrerequisites or #mandatoryPreRequisites." |
9575 | 2363 |
|
2364 |
^ #() |
|
2365 |
||
2366 |
"Modified: / 17-08-2006 / 19:57:46 / cg" |
|
21449 | 2367 |
! |
2368 |
||
2369 |
superProject |
|
2370 |
"return the package which contains me as subProject, |
|
2371 |
or if not found, which contains me under its directory hierarchy, |
|
2372 |
or nil if none found" |
|
2373 |
||
2374 |
|p superPackage idx| |
|
23124 | 2375 |
|
21451 | 2376 |
p := self package. |
21449 | 2377 |
ProjectDefinition allSubclassesDo:[:prjDef | |
23124 | 2378 |
(prjDef subProjects includes:p) ifTrue:[^ prjDef]. |
21451 | 2379 |
]. |
21449 | 2380 |
[ |
23124 | 2381 |
(idx := p lastIndexOf:$/) ~~ 0 |
21449 | 2382 |
] whileTrue:[ |
23124 | 2383 |
|defClass| |
2384 |
||
2385 |
superPackage := p copyTo:idx-1. |
|
2386 |
(defClass := ProjectDefinition definitionClassForPackage:superPackage) notNil ifTrue:[ |
|
2387 |
^ defClass |
|
2388 |
]. |
|
2389 |
p := superPackage. |
|
2390 |
]. |
|
21449 | 2391 |
^ nil |
2392 |
||
2393 |
" |
|
23124 | 2394 |
stx_goodies_refactoryBrowser_lint superProject |
2395 |
exept_expecco_plugin_guiBrowser superProject |
|
21449 | 2396 |
" |
2397 |
||
2398 |
"Created: / 15-02-2017 / 16:49:05 / cg" |
|
9575 | 2399 |
! ! |
2400 |
||
12372 | 2401 |
!ProjectDefinition class methodsFor:'description - actions'! |
2402 |
||
2403 |
postLoadAction |
|
2404 |
"invoked after loading a project" |
|
2405 |
||
2406 |
"/ intentionally left blank, to be redefined by subclasses (i.e. real projects) |
|
2407 |
||
2408 |
"Modified: / 17-08-2006 / 19:59:17 / cg" |
|
2409 |
! |
|
2410 |
||
2411 |
preLoadAction |
|
2412 |
"invoked before loading a project" |
|
2413 |
||
2414 |
"/ intentionally left blank, to be redefined by subclasses (i.e. real projects) |
|
2415 |
! |
|
2416 |
||
2417 |
preUnloadAction |
|
2418 |
"invoked before unloading a project" |
|
2419 |
||
2420 |
"/ intentionally left blank, to be redefined by subclasses (i.e. real projects) |
|
2421 |
||
2422 |
"Modified: / 17-08-2006 / 19:59:26 / cg" |
|
2423 |
! ! |
|
2424 |
||
16256 | 2425 |
|
9575 | 2426 |
!ProjectDefinition class methodsFor:'description - compilation'! |
9536 | 2427 |
|
11940
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2428 |
additionalBaseAddressDefinition_bc_dot_mak |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2429 |
"allows for a base-address definition to be added to the bc.mak file. |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2430 |
Subclasses may redefine this to something like |
23124 | 2431 |
LIB_BASE=$(LIBWIDG_BASE) |
11940
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2432 |
This will be inserted BEFORE the 'include stdHeader' |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2433 |
" |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2434 |
|
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2435 |
^ nil |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2436 |
! |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2437 |
|
11829
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2438 |
additionalDefinitions |
22657 | 2439 |
"allows for additional definitions/rules to be added to both the Make.proto and bc.mak file." |
11829
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2440 |
|
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2441 |
^ '' |
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2442 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2443 |
"Modified (comment): / 03-02-2015 / 05:59:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11829
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2444 |
! |
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2445 |
|
10306 | 2446 |
additionalDefinitions_bc_dot_mak |
2447 |
"allows for additional definitions/rules to be added to the bc.mak file. |
|
10974 | 2448 |
Subclasses may redefine this." |
10306 | 2449 |
|
2450 |
^ self additionalDefinitions_nt_dot_mak |
|
2451 |
||
2452 |
"Created: / 22-08-2006 / 23:59:32 / cg" |
|
2453 |
! |
|
2454 |
||
9625 | 2455 |
additionalDefinitions_make_dot_proto |
2456 |
"allows for additional definitions/rules to be added to the make.proto file." |
|
2457 |
||
11829
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2458 |
^ self additionalDefinitions |
9625 | 2459 |
|
2460 |
"Created: / 22-08-2006 / 23:53:08 / cg" |
|
2461 |
! |
|
2462 |
||
2463 |
additionalDefinitions_nt_dot_mak |
|
10306 | 2464 |
"obsolete - kept for compatibility with old project files" |
9625 | 2465 |
|
11829
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2466 |
^ self additionalDefinitions |
9625 | 2467 |
|
2468 |
"Created: / 22-08-2006 / 23:59:32 / cg" |
|
2469 |
! |
|
2470 |
||
16328 | 2471 |
additionalHeaderRulesUsingTemplate:template withSeparator:pathSeparator |
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2472 |
"rules for header files (of autoloaded classes). |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2473 |
For each extended class, which is autoloaded (and therefore, we will not find a header file for it), |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2474 |
generate a rule to create the header file only." |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2475 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2476 |
^ String streamContents:[:s | |
23124 | 2477 |
(self extensionClassesWithSuperclasses:true) do:[:eachExtendedClass | |
2478 |
|headerFileDirPath baseFilename| |
|
2479 |
||
2480 |
(eachExtendedClass isLoaded not or:[eachExtendedClass wasAutoloaded]) ifTrue:[ |
|
2481 |
headerFileDirPath := self pathToPackage:eachExtendedClass package withSeparator:pathSeparator. |
|
2482 |
baseFilename := self filenameForClass:eachExtendedClass. |
|
2483 |
||
2484 |
s nextPutAll:(template |
|
2485 |
bindWith:headerFileDirPath |
|
2486 |
with:baseFilename). |
|
2487 |
] |
|
2488 |
]. |
|
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2489 |
]. |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2490 |
|
13688
4f43dc4a3182
added: #additionalHeaderRulesUsingTemplate:pathConverter:
Claus Gittinger <cg@exept.de>
parents:
13687
diff
changeset
|
2491 |
"Created: / 12-09-2011 / 16:23:52 / cg" |
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2492 |
! |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2493 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2494 |
additionalHeaderRules_bc_dot_mak |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2495 |
"rules for header files (of autoloaded classes)" |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2496 |
|
13695 | 2497 |
^ self |
23124 | 2498 |
additionalHeaderRulesUsingTemplate:(self singleHeaderRuleTemplate_bc_dot_mak) |
2499 |
withSeparator:'\' |
|
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2500 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2501 |
"Created: / 12-09-2011 / 15:44:09 / cg" |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2502 |
! |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2503 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2504 |
additionalHeaderRules_make_dot_proto |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2505 |
"rules for header files (of autoloaded classes)" |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2506 |
|
13695 | 2507 |
^ self |
23124 | 2508 |
additionalHeaderRulesUsingTemplate:(self singleHeaderRuleTemplate_make_dot_proto) |
2509 |
withSeparator:'/' |
|
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2510 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2511 |
"Created: / 12-09-2011 / 15:44:28 / cg" |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2512 |
! |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2513 |
|
10306 | 2514 |
additionalLinkLibraries_bc_dot_mak |
2515 |
"allows for additional static libraries to be added to the bc.mak file. |
|
2516 |
Subclasses may redefine this" |
|
2517 |
||
2518 |
"backward compatibilty with old projects" |
|
2519 |
||
2520 |
^ self additionalLinkLibraries_nt_dot_mak |
|
2521 |
||
2522 |
||
2523 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
|
2524 |
! |
|
2525 |
||
9733 | 2526 |
additionalLinkLibraries_make_dot_proto |
9972
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2527 |
"allows for additional static libraries to be added to the make.proto file." |
9733 | 2528 |
|
2529 |
^ '' |
|
2530 |
||
2531 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
|
2532 |
! |
|
2533 |
||
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2534 |
additionalLinkLibraries_nt_dot_mak |
10306 | 2535 |
"obsolete - kept for compatibility with old project files" |
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2536 |
|
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2537 |
^ '' |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2538 |
|
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2539 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2540 |
! |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2541 |
|
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2542 |
additionalRulesFor: fileToGenerateFor |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2543 |
"Return additional rules for given file specified by <rule:file:> or <rule:extends:file:>. |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2544 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2545 |
See class documentation on rule extension methods" |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2546 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2547 |
| rules cls processed | |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2548 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2549 |
cls := self. |
20503 | 2550 |
rules := '' writeStream. |
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2551 |
processed := Set new. |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2552 |
[ cls ~~ Object ] whileTrue:[ |
23124 | 2553 |
cls class selectorsAndMethodsDo:[:selector :method | |
2554 |
method annotationsAt: #file:target: orAt:#file:target:extends: do: [ :annotation | |
|
2555 |
(processed includes: selector) ifFalse:[ |
|
2556 |
| file target extends contents | |
|
2557 |
||
2558 |
processed add: selector. |
|
2559 |
file := annotation argumentAt: 1. |
|
2560 |
target := annotation argumentAt: 2. |
|
2561 |
annotation key == #file:target:extends: ifTrue:[ |
|
2562 |
extends := annotation argumentAt: 3. |
|
2563 |
]. |
|
2564 |
(#('Make.proto' 'bc.mak' ) includes: file) ifFalse:[ |
|
2565 |
self error:'Only Make.proto or bc.mak can have extension rules!!' |
|
2566 |
]. |
|
2567 |
extends notNil ifTrue:[ |
|
2568 |
file = 'Make.proto' ifTrue:[ |
|
2569 |
(#('all' 'clean' ) includes: extends) ifFalse:[ |
|
2570 |
self error: ('Rule %1 cannot be extended. Check documentation to see which rules can be extended' bindWith: extends). |
|
2571 |
]. |
|
2572 |
]. |
|
2573 |
file = 'bc.mak' ifTrue:[ |
|
2574 |
(#('ALL' 'clean') includes: extends) ifFalse:[ |
|
2575 |
self error: ('Rule %1 cannot be extended. Check documentation to see which rules can be extended' bindWith: extends). |
|
2576 |
]. |
|
2577 |
]. |
|
2578 |
]. |
|
2579 |
||
2580 |
(fileToGenerateFor = file and:[(contents := self perform: selector) notNil]) ifTrue:[ |
|
2581 |
rules nextPutAll: contents. |
|
2582 |
rules cr. |
|
2583 |
extends notNil ifTrue:[ |
|
2584 |
rules nextPutAll: extends; nextPutAll:'::'; space; nextPutLine: target; cr. |
|
2585 |
]. |
|
2586 |
]. |
|
2587 |
]. |
|
2588 |
] |
|
2589 |
]. |
|
2590 |
cls := cls superclass. |
|
2591 |
]. |
|
2592 |
fileToGenerateFor = 'Make.proto' ifTrue:[ |
|
2593 |
rules nextPutAll: self additionalRules_make_dot_proto. |
|
2594 |
] ifFalse:[ |
|
2595 |
fileToGenerateFor = 'bc.mak' ifTrue:[ |
|
2596 |
rules nextPutAll: self additionalRules_bc_dot_mak |
|
2597 |
] |
|
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2598 |
]. |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2599 |
^ rules contents asStringCollection withTabs asString. |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2600 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2601 |
" |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2602 |
stx_libjava additionalRulesFor: 'Make.proto' |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2603 |
stx_libjava additionalRulesFor: 'bc.mak' |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2604 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2605 |
stx_libjava generateFile:'Make.proto' |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2606 |
stx_libjava generateFile:'bc.mak' |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2607 |
" |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2608 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2609 |
"Created: / 03-02-2015 / 06:49:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17404
e15994335cb4
Allow to extend target clean in both Make.proto and bc.mak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17366
diff
changeset
|
2610 |
"Modified: / 04-02-2015 / 07:41:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2611 |
! |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2612 |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2613 |
additionalRulesHG_bc_dot_mak |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2614 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2615 |
(self class includesSelector: #version_HG) ifFalse:[^'']. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2616 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2617 |
^' |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2618 |
# **Must be at end** |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2619 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2620 |
# Enforce recompilation of package definition class if Mercurial working |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2621 |
# copy state changes. Together with --guessVersion it ensures that package |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2622 |
# definition class always contains correct binary revision string. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2623 |
!!IFDEF HGROOT |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2624 |
$(OUTDIR)%1.$(O): $(HGROOT)\.hg\dirstate |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2625 |
!!ENDIF |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2626 |
' bindWith: self name. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2627 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2628 |
" |
23124 | 2629 |
stx_libscm_mercurial additionalRulesHG_bc_dot_mak |
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2630 |
" |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2631 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2632 |
"Created: / 28-11-2012 / 10:15:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2633 |
"Modified: / 08-12-2012 / 12:18:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2634 |
! |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2635 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2636 |
additionalRulesHG_make_dot_proto |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2637 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2638 |
(self class includesSelector: #version_HG) ifFalse:[^'']. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2639 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2640 |
^' |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2641 |
# Enforce recompilation of package definition class if Mercurial working |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2642 |
# copy state changes. Together with --guessVersion it ensures that package |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2643 |
# definition class always contains correct binary revision string. |
23310 | 2644 |
ifdef HGROOT |
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2645 |
ifneq (**NOHG**, $(shell hg root 2> /dev/null || echo -n ''**NOHG**'')) |
23310 | 2646 |
%1.$(O): $(shell hg root)/.hg/dirstate |
2647 |
endif |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2648 |
endif |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2649 |
' bindWith: self name. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2650 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2651 |
" |
23310 | 2652 |
stx_libscm_mercurial additionalRulesHG_make_dot_proto |
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2653 |
" |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2654 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2655 |
"Created: / 28-11-2012 / 10:12:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23310 | 2656 |
"Modified: / 28-08-2018 / 16:00:49 / Claus Gittinger" |
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2657 |
! |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2658 |
|
12028 | 2659 |
additionalRulesSvn_make_dot_proto |
2660 |
||
2661 |
(self class includesSelector: #svnRevisionNr) ifFalse:[^'']. |
|
2662 |
||
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2663 |
^' |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2664 |
# Update SVN revision in package definition class |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2665 |
ifneq (,$(findstring .svn,$(wildcard .svn))) |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2666 |
.svnversion: *.st |
23124 | 2667 |
if [ -d .svn ]; then \ |
2668 |
rev=$(shell svnversion -n); \ |
|
2669 |
echo -n $$rev > .svnversion; \ |
|
2670 |
else \ |
|
2671 |
echo -n exported > .svnversion; \ |
|
2672 |
fi |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2673 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2674 |
%1.o: %1.st .svnversion |
23124 | 2675 |
@if [ -d .svn ]; then \ |
2676 |
rev2="$(shell printf "%-16s" $$(cat .svnversion))"; \ |
|
2677 |
echo " [SV] Expanding svnRevisionNo in $1.st"; \ |
|
2678 |
sed -e "s/\"\$$SVN\-Revision:\".*\"\$$\"/\"\$$SVN-Revision:\"\''$$rev2\''\"\$$\"/g" $< > .%1.svn.st; \ |
|
2679 |
fi |
|
2680 |
$(MAKE) CC="$(CLASSLIB_CC)" OPT="$(OPT)" SEPINITCODE="$(SEPINITCODE)" STC="$(STC)" STFILE=.%1.svn $(C_RULE); |
|
2681 |
sed -i -e "s/\".%1.svn.st\");/\"\%1.st\");/g" .%1.svn.c |
|
2682 |
$(MAKE) .%1.svn.$(O) |
|
2683 |
@mv .%1.svn.$(O) %1.$(O) |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2684 |
endif |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2685 |
' bindWith: self name. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2686 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2687 |
" |
23124 | 2688 |
stx_libbasic3 additionalRulesSvn_make_dot_proto |
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2689 |
" |
12028 | 2690 |
|
2691 |
"Created: / 24-06-2009 / 21:33:32 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2692 |
"Modified: / 28-11-2012 / 10:12:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12028 | 2693 |
! |
2694 |
||
10306 | 2695 |
additionalRules_bc_dot_mak |
10312
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2696 |
"obsolete - kept for compatibility with old project files" |
13419 | 2697 |
|
10312
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2698 |
^ '' |
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2699 |
|
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2700 |
"Created: / 22-08-2006 / 23:59:24 / cg" |
10306 | 2701 |
! |
2702 |
||
9625 | 2703 |
additionalRules_make_dot_proto |
2704 |
"allows for additional rules to be added to the make.proto file." |
|
2705 |
||
2706 |
^ '' |
|
2707 |
||
2708 |
"Created: / 22-08-2006 / 23:59:16 / cg" |
|
2709 |
! |
|
2710 |
||
9972
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2711 |
additionalSharedLinkLibraries_make_dot_proto |
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2712 |
"allows for additional shared libraries to be added to the make.proto file." |
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2713 |
|
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2714 |
^ '' |
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2715 |
! |
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2716 |
|
12028 | 2717 |
additionalTargetsSvn_make_dot_proto |
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2718 |
"Returns additional targets to make when build projec |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2719 |
checked out from SVN" |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2720 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2721 |
"As of 2011-02-06, new version of libsvn does not use any additional targets" |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2722 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2723 |
^'' |
12028 | 2724 |
|
2725 |
"Created: / 24-06-2009 / 21:35:15 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2726 |
"Modified (comment): / 06-02-2012 / 15:34:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12028 | 2727 |
! |
2728 |
||
10306 | 2729 |
additionalTargets_bc_dot_mak |
23517 | 2730 |
"can list additional bc.mak targets (additional windows support files)" |
13419 | 2731 |
|
10312
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2732 |
^ '' |
10306 | 2733 |
|
2734 |
"Created: / 23-08-2006 / 00:00:35 / cg" |
|
23517 | 2735 |
"Modified (comment): / 07-11-2018 / 19:19:51 / Claus Gittinger" |
10306 | 2736 |
! |
2737 |
||
9625 | 2738 |
additionalTargets_make_dot_proto |
23517 | 2739 |
"can list additional Make.proto targets (additional unix support files)" |
9625 | 2740 |
|
2741 |
^ '' |
|
2742 |
||
2743 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
|
23517 | 2744 |
"Modified (comment): / 07-11-2018 / 19:20:02 / Claus Gittinger" |
9625 | 2745 |
! |
2746 |
||
18428 | 2747 |
additional_post_nsis_rules |
2748 |
"this will be performed after the nsis did build the program installer" |
|
2749 |
^ '' |
|
2750 |
||
2751 |
"Created: / 02-06-2015 / 17:41:37 / gg" |
|
2752 |
! |
|
2753 |
||
19592 | 2754 |
additional_post_nsis_rules64 |
2755 |
"this will be performed after the nsis did build the program installer for 64bit build" |
|
2756 |
^ '' |
|
2757 |
||
2758 |
"Created: / 02-06-2015 / 17:41:37 / gg" |
|
2759 |
! |
|
2760 |
||
10979 | 2761 |
globalDefines |
2762 |
"allow for the specification of additional defines for stc compilation of prerequisite packages |
|
2763 |
an subprojects" |
|
2764 |
||
2765 |
^ '' |
|
2766 |
! |
|
2767 |
||
2768 |
globalDefines_unix |
|
2769 |
"allow for the specification of additional defines for stc compilation of prerequisite packages |
|
2770 |
an subprojects" |
|
2771 |
||
2772 |
^ self globalDefines |
|
2773 |
! |
|
2774 |
||
2775 |
globalDefines_win32 |
|
2776 |
"allow for the specification of additional defines for stc compilation of prerequisite packages |
|
2777 |
an subprojects" |
|
2778 |
||
2779 |
^ self globalDefines |
|
2780 |
! |
|
2781 |
||
10331 | 2782 |
localDefines |
10979 | 2783 |
"allow for the specification of additional defines for stc compilation" |
10331 | 2784 |
|
2785 |
^ '' |
|
2786 |
! |
|
2787 |
||
2788 |
localDefines_unix |
|
10979 | 2789 |
"allow for the specification of additional defines for stc compilation" |
10331 | 2790 |
|
2791 |
^ self localDefines |
|
2792 |
! |
|
2793 |
||
2794 |
localDefines_win32 |
|
10979 | 2795 |
"allow for the specification of additional defines for stc compilation" |
10331 | 2796 |
|
2797 |
^ self localDefines |
|
2798 |
! |
|
2799 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2800 |
localIncludes |
10979 | 2801 |
"allow for the specification of additional include directories" |
9714 | 2802 |
|
2803 |
^ '' |
|
2804 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2805 |
"Created: / 06-09-2006 / 18:14:31 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2806 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2807 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2808 |
localIncludes_unix |
10979 | 2809 |
"allow for the specification of additional include directories" |
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2810 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2811 |
^ self makeUnixIncludes:(self localIncludes) |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2812 |
|
9714 | 2813 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2814 |
"Modified: / 06-09-2006 / 18:15:26 / cg" |
9714 | 2815 |
! |
2816 |
||
2817 |
localIncludes_win32 |
|
10979 | 2818 |
"allow for the specification of additional include directories" |
9714 | 2819 |
|
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2820 |
^ self makeWin32Includes:(self localIncludes) |
9714 | 2821 |
|
2822 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
|
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2823 |
"Modified: / 06-09-2006 / 18:15:37 / cg" |
9714 | 2824 |
! |
2825 |
||
11576
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2826 |
primaryTarget |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2827 |
"allows the primary make target to be defined in the Make.proto/bc.mak file." |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2828 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2829 |
^ '' |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2830 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2831 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2832 |
! |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2833 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2834 |
primaryTarget_bc_dot_mak |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2835 |
"allows the primary make target to be defined in the bc.mak file." |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2836 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2837 |
^ self primaryTarget |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2838 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2839 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2840 |
! |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2841 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2842 |
primaryTarget_make_dot_proto |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2843 |
"allows the primary make target to be defined in the Make.proto file." |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2844 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2845 |
^ self primaryTarget |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2846 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2847 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2848 |
! |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2849 |
|
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2850 |
singleHeaderRuleTemplate_bc_dot_mak |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2851 |
"rules for header files (of autoloaded classes)" |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2852 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2853 |
^ ' |
13688
4f43dc4a3182
added: #additionalHeaderRulesUsingTemplate:pathConverter:
Claus Gittinger <cg@exept.de>
parents:
13687
diff
changeset
|
2854 |
%1\%2.$(H): |
17253 | 2855 |
',Character tab,'pushd %1 \ |
2856 |
',Character tab,'& $(STC) $(FFLAGS) $(STCFLAGS) $(STC_MSGFORMAT) $(DBGFLAGS) $(DEFS) -C -headerOnly %2.st \ |
|
2857 |
',Character tab,'& popd |
|
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2858 |
' |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2859 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2860 |
"Created: / 12-09-2011 / 15:55:49 / cg" |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2861 |
! |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2862 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2863 |
singleHeaderRuleTemplate_make_dot_proto |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2864 |
"rules for header files (of autoloaded classes)" |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2865 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2866 |
^ ' |
13688
4f43dc4a3182
added: #additionalHeaderRulesUsingTemplate:pathConverter:
Claus Gittinger <cg@exept.de>
parents:
13687
diff
changeset
|
2867 |
%1/%2.$(H): |
17253 | 2868 |
',Character tab,'cd %1 && $(STC) $(FFLAGS) $(STCFLAGS) $(STC_MSGFORMAT) $(DBGFLAGS) $(DEFS) -C -headerOnly %2.st \ |
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2869 |
' |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2870 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2871 |
"Created: / 12-09-2011 / 15:55:57 / cg" |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2872 |
! |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2873 |
|
9575 | 2874 |
stcOptimizationOptions |
2875 |
"see the stc reference / stc usage for options. |
|
17070 | 2876 |
Can be redefined in concrete packages. |
9575 | 2877 |
For now, the following variants are useful: |
23124 | 2878 |
+optspace3 most compact code |
2879 |
- use for all gui, application code. |
|
2880 |
||
2881 |
+optinline +optinline2 +inlineNew |
|
2882 |
fastest code |
|
2883 |
- use only for computation-intensive classes" |
|
9575 | 2884 |
|
2885 |
^ '+optspace3' |
|
2886 |
||
2887 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
|
9536 | 2888 |
! |
2889 |
||
9575 | 2890 |
stcWarningOptions |
2891 |
"see the stc reference / stc usage for options. |
|
17070 | 2892 |
Can be redefined in concrete packages. |
9575 | 2893 |
For now, the following variants are useful: |
23124 | 2894 |
-warn no warnings |
2895 |
-warnNonStandard no warnings about non-standard smalltalk features |
|
2896 |
-warnUnused no warnings about unused variables" |
|
9575 | 2897 |
|
9714 | 2898 |
^ '-warnNonStandard' |
9575 | 2899 |
|
2900 |
"Created: / 18-08-2006 / 12:51:38 / cg" |
|
2901 |
! ! |
|
9536 | 2902 |
|
22688 | 2903 |
!ProjectDefinition class methodsFor:'description - contents'! |
2904 |
||
2905 |
additionalClassNamesAndAttributes |
|
2906 |
"a List of classes, that belong to the project, but may not be included |
|
2907 |
in the image (someone may have removed it by purpose)" |
|
2908 |
||
2909 |
^ #() |
|
2910 |
||
2911 |
"Created: / 21-08-2006 / 19:53:04 / cg" |
|
2912 |
! |
|
2913 |
||
2914 |
classNamesAndAttributes |
|
2915 |
"a correponding method with real names must be present in my concrete subclasses" |
|
2916 |
||
2917 |
"/ should this be a subclassResponsibility here ? |
|
2918 |
^ #() |
|
2919 |
||
2920 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
2921 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
2922 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
|
2923 |
! |
|
2924 |
||
2925 |
extensionMethodNames |
|
2926 |
"lists the extension methods which are to be included in the project. |
|
2927 |
Entries are 2-element array literals, consisting of class-name and selector. |
|
2928 |
A correponding method with real names must be present in my concrete subclasses |
|
2929 |
if it has extensions." |
|
2930 |
||
2931 |
"/ should this be a subclassResponsibility here ? |
|
2932 |
^ #() |
|
2933 |
||
2934 |
"Modified: / 17-08-2006 / 20:49:51 / cg" |
|
2935 |
! |
|
2936 |
||
2937 |
ignoredClassNames |
|
2938 |
"can be redefined to suppress some classes from being included in a |
|
2939 |
generated classNamesAndAttributes spec" |
|
2940 |
||
2941 |
^ #() |
|
2942 |
||
2943 |
"Created: / 23-01-2007 / 19:08:27 / cg" |
|
2944 |
! ! |
|
22657 | 2945 |
|
23452 | 2946 |
|
9575 | 2947 |
!ProjectDefinition class methodsFor:'description - project information'! |
2948 |
||
11611
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2949 |
applicationAdditionalIconFileNames |
13419 | 2950 |
"Return the icon-filenames for additional icons of the application |
11611
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2951 |
(empty collection if there are none)" |
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2952 |
|
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2953 |
^ #() |
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2954 |
! |
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2955 |
|
20567 | 2956 |
applicationDocumentTypeDescriptions |
2957 |
"Return the OSX document type descriptions. |
|
2958 |
For deployment, some systems can make use of additional information |
|
2959 |
on which documents are handled by the application. |
|
2960 |
This is used eg. for double-clicking on a document in OSX. |
|
2961 |
If the deployed app can/should handle this, redefine this |
|
21562 | 2962 |
to return a collection of instances of ApplicationDocumentTypeDescription." |
20567 | 2963 |
|
2964 |
||
2965 |
^ nil |
|
21562 | 2966 |
|
2967 |
"Modified (comment): / 24-02-2017 / 09:36:42 / cg" |
|
20567 | 2968 |
! |
2969 |
||
11039
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
2970 |
applicationIconFileName |
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
2971 |
"Return the icon-filename for the application (nil if there is none)" |
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
2972 |
|
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
2973 |
^ nil |
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
2974 |
! |
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
2975 |
|
20567 | 2976 |
applicationIconFileNameLinux |
2977 |
"Return the icon-filename for the application (nil if there is none)" |
|
2978 |
||
2979 |
^ nil |
|
2980 |
! |
|
2981 |
||
2982 |
applicationIconFileNameOSX |
|
2983 |
"Return the OSX icon-filename for the application (nil if there is none). |
|
2984 |
This must be the name of a .icns file, which contains the app-icon in |
|
2985 |
multiple resolutions." |
|
2986 |
||
2987 |
^ nil |
|
2988 |
! |
|
2989 |
||
2990 |
applicationIconFileNameWindows |
|
2991 |
"Return the icon-filename for the application (nil if there is none). |
|
2992 |
This must be the name of a .ico file, which contains the app-icon in |
|
2993 |
single or multiple resolutions." |
|
2994 |
||
2995 |
"/ for backward compatibility |
|
2996 |
^ self applicationIconFileName |
|
2997 |
! |
|
2998 |
||
21571 | 2999 |
applicationReadMeFileNameOSX |
3000 |
"Return the OSX filename for a readme file. |
|
3001 |
If nil, nothing is installed; |
|
3002 |
if non-nil, it is copied into the dmg folder." |
|
3003 |
||
3004 |
^ nil |
|
3005 |
||
3006 |
"Created: / 24-02-2017 / 14:21:57 / cg" |
|
3007 |
! |
|
3008 |
||
9575 | 3009 |
companyName |
9584 | 3010 |
"Returns a company string which will appear in <lib>.rc. |
20564 | 3011 |
Under win32, this is placed into the dll's file-info. |
3012 |
Other systems may put it elsewhere, or ignore it." |
|
9575 | 3013 |
|
20601 | 3014 |
|m| |
23124 | 3015 |
|
20601 | 3016 |
m := self module. |
3017 |
(m = 'stx') ifTrue:[ |
|
23124 | 3018 |
^ 'Claus Gittinger & eXept Software AG' |
20601 | 3019 |
]. |
3020 |
(m = 'exept') ifTrue:[ |
|
23124 | 3021 |
^ 'eXept Software AG' |
20601 | 3022 |
]. |
9575 | 3023 |
^ 'My Company' |
3024 |
||
9584 | 3025 |
"Modified: / 18-08-2006 / 16:08:20 / cg" |
9536 | 3026 |
! |
3027 |
||
3028 |
description |
|
10306 | 3029 |
"Returns a description string which will appear in vc.def / bc.def" |
9536 | 3030 |
|
9803 | 3031 |
^self productName,' ',self packageName |
3032 |
"/ ^ self name |
|
9536 | 3033 |
|
3034 |
"Created: / 08-08-2006 / 11:15:01 / fm" |
|
9575 | 3035 |
"Modified: / 17-08-2006 / 20:53:34 / cg" |
3036 |
! |
|
3037 |
||
3038 |
fileDescription |
|
10416 | 3039 |
"Returns a description string which will appear in libName.rc and the rc-file" |
9575 | 3040 |
|
9803 | 3041 |
^self description |
9575 | 3042 |
|
3043 |
"Modified: / 17-08-2006 / 20:27:07 / cg" |
|
3044 |
! |
|
3045 |
||
3046 |
fileMajorVersionNr |
|
3047 |
"Returns a versionNumber which will appear in libName.rc" |
|
3048 |
||
11100
c9ec12ef4b3b
Set default for fileMajorVersionNumber and fileMajorVersionNumber
Stefan Vogel <sv@exept.de>
parents:
11074
diff
changeset
|
3049 |
^ self majorVersionNr |
9575 | 3050 |
|
3051 |
"Created: / 18-08-2006 / 12:03:32 / cg" |
|
9817 | 3052 |
"Modified: / 30-08-2006 / 18:50:51 / cg" |
9575 | 3053 |
! |
3054 |
||
3055 |
fileMinorVersionNr |
|
3056 |
"Returns a versionNumber which will appear in libName.rc" |
|
3057 |
||
11100
c9ec12ef4b3b
Set default for fileMajorVersionNumber and fileMajorVersionNumber
Stefan Vogel <sv@exept.de>
parents:
11074
diff
changeset
|
3058 |
^ self minorVersionNr |
9575 | 3059 |
|
3060 |
"Created: / 18-08-2006 / 12:03:13 / cg" |
|
9817 | 3061 |
"Modified: / 30-08-2006 / 18:50:46 / cg" |
9575 | 3062 |
! |
3063 |
||
3064 |
fileReleaseNr |
|
3065 |
"Returns a releaseNumber which will appear in libName.rc" |
|
3066 |
||
11035
ff88ec6339a3
Generate valid project.rc files even if the CVS revision string ends with
Stefan Vogel <sv@exept.de>
parents:
10979
diff
changeset
|
3067 |
"take the default revision from the cvs-version, |
ff88ec6339a3
Generate valid project.rc files even if the CVS revision string ends with
Stefan Vogel <sv@exept.de>
parents:
10979
diff
changeset
|
3068 |
but ignore a possibly present 'm'-flag that is set when this revision has been modified" |
ff88ec6339a3
Generate valid project.rc files even if the CVS revision string ends with
Stefan Vogel <sv@exept.de>
parents:
10979
diff
changeset
|
3069 |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3070 |
"JV@2012-11-20: Original code was: |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3071 |
|
11035
ff88ec6339a3
Generate valid project.rc files even if the CVS revision string ends with
Stefan Vogel <sv@exept.de>
parents:
10979
diff
changeset
|
3072 |
^ self cvsRevision last upTo:$m |
9575 | 3073 |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3074 |
But this is too CVS specific. Modern SCMs does not use X.Y style |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3075 |
revision numbers, instead it uses hashes (Git/Mercurial/Darcs/Monotone). |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3076 |
Even worse, all the SCM code passes strings around, so providing compatible, |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3077 |
polymorph object is not possible. Hence following hack." |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3078 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3079 |
| nr | |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3080 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3081 |
nr := (self cvsRevision last upTo:$m) select:[:c|c isDigit]. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3082 |
nr isEmptyOrNil ifTrue:[^'0']. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3083 |
nr := (nr asInteger min: 16r7FFF) printString. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3084 |
^nr |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3085 |
|
9575 | 3086 |
"Created: / 18-08-2006 / 12:02:58 / cg" |
9817 | 3087 |
"Modified: / 30-08-2006 / 18:54:48 / cg" |
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3088 |
"Modified: / 23-11-2012 / 11:24:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9536 | 3089 |
! |
3090 |
||
9575 | 3091 |
fileRevisionNr |
3092 |
"Returns a revisionNumber which will appear in libName.rc" |
|
9536 | 3093 |
|
9817 | 3094 |
"take the default revision from the cvs-version" |
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3095 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3096 |
"JV@2012-11-20: Original code was: |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3097 |
|
9618 | 3098 |
^ self cvsRevision first |
9575 | 3099 |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3100 |
But this is too CVS specific. Modern SCMs does not use X.Y style |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3101 |
revision numbers, instead it uses hashes (Git/Mercurial/Darcs/Monotone). |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3102 |
Even worse, all the SCM code passes strings around, so providing compatible, |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3103 |
polymorph object is not possible. Hence following hack." |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3104 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3105 |
| nr | |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3106 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3107 |
nr := self cvsRevision first select:[:c|c isDigit]. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3108 |
nr isEmptyOrNil ifTrue:[^'0']. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3109 |
nr := (nr asInteger min: 16r7FFF) printString. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3110 |
^nr |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3111 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3112 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3113 |
" |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3114 |
stx_libbasic fileRevisionNr |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3115 |
stx_libbasic2 fileRevisionNr |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3116 |
stx_libscm_mercurial fileRevisionNr |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3117 |
" |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3118 |
|
9575 | 3119 |
"Created: / 18-08-2006 / 12:02:39 / cg" |
9817 | 3120 |
"Modified: / 30-08-2006 / 18:54:39 / cg" |
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3121 |
"Modified: / 23-11-2012 / 11:24:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9536 | 3122 |
! |
3123 |
||
9575 | 3124 |
fileVersion |
3125 |
"Returns a fileVersion string which will appear in libName.rc" |
|
3126 |
||
3127 |
"<major>.<minor>.<rev>.<rel> (such as '1.2.17.1') " |
|
3128 |
||
13419 | 3129 |
^ '%1.%2.%3.%4' |
23124 | 3130 |
bindWith:self fileMajorVersionNr |
3131 |
with:self fileMinorVersionNr |
|
3132 |
with:self fileRevisionNr |
|
3133 |
with:self fileReleaseNr. |
|
9575 | 3134 |
|
3135 |
" |
|
3136 |
self fileVersion |
|
3137 |
" |
|
3138 |
||
9817 | 3139 |
"Modified: / 30-08-2006 / 18:51:49 / cg" |
9575 | 3140 |
! |
9536 | 3141 |
|
9575 | 3142 |
fileVersionCommaSeparated |
3143 |
"Returns a fileVersion string which will appear in libName.rc" |
|
3144 |
||
9817 | 3145 |
"<major>,<minor>,<revision>,<release> (such as '2,17,1,2') " |
3146 |
||
13419 | 3147 |
^ '%1,%2,%3,%4' |
23124 | 3148 |
bindWith:self fileMajorVersionNr |
3149 |
with:self fileMinorVersionNr |
|
3150 |
with:self fileRevisionNr |
|
3151 |
with:self fileReleaseNr. |
|
9575 | 3152 |
|
3153 |
"Created: / 17-08-2006 / 20:16:17 / cg" |
|
9817 | 3154 |
"Modified: / 30-08-2006 / 18:54:20 / cg" |
3155 |
! |
|
3156 |
||
9575 | 3157 |
internalName |
3158 |
"Returns a name string which will appear in libName.rc" |
|
3159 |
||
11041
3bb26d86e616
Fix #description and #internalName
Stefan Vogel <sv@exept.de>
parents:
11039
diff
changeset
|
3160 |
^ self package |
9575 | 3161 |
|
3162 |
"Modified: / 17-08-2006 / 20:27:37 / cg" |
|
9536 | 3163 |
! |
3164 |
||
9575 | 3165 |
legalCopyright |
9584 | 3166 |
"Returns a copyright string which will appear in <lib>.rc. |
20564 | 3167 |
Under win32, this is placed into the dll's file-info. |
3168 |
Other systems may put it elsewhere, or ignore it." |
|
9575 | 3169 |
|
20985 | 3170 |
|m thisYear template| |
23124 | 3171 |
|
20985 | 3172 |
m := self module. |
3173 |
thisYear := Date today year. |
|
3174 |
||
20601 | 3175 |
m = 'stx' ifTrue:[ |
23124 | 3176 |
"hardwired-default" |
3177 |
template := 'Copyright Claus Gittinger %1\nCopyright eXept Software AG %1' |
|
20985 | 3178 |
] ifFalse:[ |
23124 | 3179 |
m = 'exept' ifTrue:[ |
3180 |
"hardwired-default" |
|
3181 |
template := 'Copyright eXept Software AG %1' |
|
3182 |
] ifFalse:[ |
|
3183 |
template := 'My CopyRight or CopyLeft %1' |
|
3184 |
]. |
|
20985 | 3185 |
]. |
3186 |
^ template bindWith:thisYear |
|
3187 |
||
3188 |
" |
|
3189 |
self legalCopyright |
|
3190 |
" |
|
3191 |
||
3192 |
"Modified (comment): / 18-11-2016 / 12:23:36 / cg" |
|
9575 | 3193 |
! |
3194 |
||
3195 |
majorVersionNr |
|
3196 |
"Returns a versionNumber which will appear in libName.rc" |
|
3197 |
||
3198 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
|
3199 |
the default here takes smalltalks version number. |
|
20424 | 3200 |
But that's probably not good for an end-user-app." |
9575 | 3201 |
|
11042 | 3202 |
^ Smalltalk majorVersionNr |
9575 | 3203 |
|
3204 |
"Created: / 17-08-2006 / 20:20:18 / cg" |
|
9817 | 3205 |
"Modified: / 30-08-2006 / 18:52:13 / cg" |
9575 | 3206 |
! |
3207 |
||
3208 |
minorVersionNr |
|
3209 |
"Returns a versionNumber which will appear in libName.rc" |
|
9536 | 3210 |
|
9575 | 3211 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
3212 |
the default here takes smalltalks version number. |
|
20424 | 3213 |
But that's probably not good for an end-user-app." |
9575 | 3214 |
|
11042 | 3215 |
^ Smalltalk minorVersionNr |
9575 | 3216 |
|
3217 |
"Created: / 17-08-2006 / 20:20:32 / cg" |
|
9817 | 3218 |
"Modified: / 30-08-2006 / 18:52:16 / cg" |
9575 | 3219 |
! |
3220 |
||
3221 |
productDate |
|
11043 | 3222 |
"Returns a product-date string which will appear in libName.rc and the installer file" |
9575 | 3223 |
|
3224 |
"take the current date - by default" |
|
9536 | 3225 |
|
9575 | 3226 |
^ Timestamp now printStringRFC1123Format |
3227 |
||
3228 |
"Created: / 17-08-2006 / 20:17:28 / cg" |
|
3229 |
! |
|
3230 |
||
13177 | 3231 |
productDescription |
3232 |
"Returns a description (for autopackage)" |
|
3233 |
||
3234 |
^ self description |
|
3235 |
||
3236 |
"Created: / 21-12-2010 / 09:32:16 / cg" |
|
3237 |
! |
|
3238 |
||
10426 | 3239 |
productFilename |
20546 | 3240 |
"Returns a filename which will be used as linkname, product file name etc. |
3241 |
The final deployable will be named like this (<fn>.dmg / <fn>Setup.ex / <fn>Install.pkg etc.)" |
|
10426 | 3242 |
|
3243 |
^ self productNameAsValidFilename |
|
3244 |
||
3245 |
" |
|
13419 | 3246 |
stx_projects_smalltalk productName |
10426 | 3247 |
stx_projects_smalltalk productFilename |
20546 | 3248 |
stx_libbasic productFilename |
3249 |
stx_doc_coding_demoConsoleApp productFilename |
|
10426 | 3250 |
" |
3251 |
||
3252 |
"Created: / 01-03-2007 / 19:33:06 / cg" |
|
3253 |
! |
|
3254 |
||
9898 | 3255 |
productInstallDir |
13873 | 3256 |
"Returns a default installDir which will appear in <app>.nsi." |
3257 |
||
3258 |
^ '$PROGRAMFILES\',(self productInstallDirBaseName). |
|
3259 |
||
3260 |
" |
|
3261 |
stx_projects_smalltalk productInstallDir |
|
3262 |
stx_clients_Clock_QlockTwoWatchApplication productInstallDir |
|
3263 |
" |
|
9898 | 3264 |
|
3265 |
"Created: / 14-09-2006 / 21:23:01 / cg" |
|
3266 |
! |
|
3267 |
||
13873 | 3268 |
productInstallDirBaseName |
3269 |
"Returns a default installDir which will appear in <app>.nsi. |
|
3270 |
This is usually not the one you want to keep" |
|
3271 |
||
3272 |
^ self module |
|
3273 |
||
3274 |
"Created: / 21-12-2011 / 16:31:38 / cg" |
|
3275 |
! |
|
3276 |
||
13177 | 3277 |
productLicense |
3278 |
"Returns the license (for autopackage)" |
|
3279 |
||
3280 |
^ 'Commercial' |
|
3281 |
||
3282 |
"Created: / 21-12-2010 / 09:31:25 / cg" |
|
3283 |
! |
|
3284 |
||
3285 |
productMaintainer |
|
3286 |
"Returns the maintainer (for autopackage)" |
|
3287 |
||
3288 |
^ self companyName |
|
3289 |
||
3290 |
"Created: / 21-12-2010 / 09:26:16 / cg" |
|
3291 |
! |
|
3292 |
||
9575 | 3293 |
productName |
9584 | 3294 |
"Returns a product name which will appear in <lib>.rc. |
20564 | 3295 |
Under win32, this is placed into the dll's file-info. |
15216 | 3296 |
This method is usually redefined in a concrete application definition" |
3297 |
||
21683 | 3298 |
|m| |
10785
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
3299 |
|
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
3300 |
m := self module. |
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
3301 |
m = 'stx' ifTrue:[ |
23124 | 3302 |
^ 'Smalltalk/X' |
9575 | 3303 |
]. |
10785
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
3304 |
m = 'exept' ifTrue:[ |
23124 | 3305 |
^ 'eXept AddOns' |
10785
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
3306 |
]. |
21683 | 3307 |
^ nil. |
10296 | 3308 |
|
20982 | 3309 |
"Modified: / 18-11-2016 / 11:44:03 / cg" |
21683 | 3310 |
"Modified: / 03-04-2017 / 19:09:22 / stefan" |
9536 | 3311 |
! |
3312 |
||
10426 | 3313 |
productNameAsValidFilename |
20546 | 3314 |
"Returns a filename generated from the product name. |
3315 |
This will be the name of the deployable package (i.e. <fn>.dmg, <fn>Setup.exe, etc.)" |
|
10426 | 3316 |
|
3317 |
|nm| |
|
3318 |
||
3319 |
nm := self productName. |
|
20546 | 3320 |
^ nm copy replaceAny:'/\:;., ' with:$_ |
10426 | 3321 |
|
3322 |
" |
|
3323 |
'Smalltalk/X' replaceAny:'/\:;.,' with:nil |
|
20546 | 3324 |
stx_doc_coding_demoConsoleApp productName |
3325 |
stx_doc_coding_demoConsoleApp productNameAsValidFilename |
|
10426 | 3326 |
" |
3327 |
||
3328 |
"Created: / 01-03-2007 / 19:19:21 / cg" |
|
3329 |
! |
|
3330 |
||
9898 | 3331 |
productPublisher |
3332 |
"Returns a product publisher which will appear in <app>.nsi." |
|
3333 |
||
3334 |
( #('exept' 'stx') includes:self module) ifTrue:[ |
|
23124 | 3335 |
^ 'eXept Software AG' |
9898 | 3336 |
]. |
3337 |
||
11789
8d56dc5fa8a8
Default productPublisher is companyName
Stefan Vogel <sv@exept.de>
parents:
11777
diff
changeset
|
3338 |
^ self companyName |
9898 | 3339 |
|
3340 |
"Created: / 14-09-2006 / 21:12:54 / cg" |
|
3341 |
! |
|
3342 |
||
13177 | 3343 |
productType |
3344 |
"Returns the product type for autopackage" |
|
3345 |
||
3346 |
^ 'Application' |
|
3347 |
||
3348 |
"Created: / 21-12-2010 / 09:28:48 / cg" |
|
3349 |
! |
|
3350 |
||
9575 | 3351 |
productVersion |
11043 | 3352 |
"Returns a product version which will appear in libName.rc and the installer file" |
9575 | 3353 |
|
3354 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1')" |
|
9536 | 3355 |
|
13419 | 3356 |
^ '%1.%2.%3.%4' |
23124 | 3357 |
bindWith:self majorVersionNr |
3358 |
with:self minorVersionNr |
|
3359 |
with:self revisionNr |
|
3360 |
with:self releaseNr. |
|
9536 | 3361 |
|
9575 | 3362 |
" |
3363 |
self productVersion |
|
3364 |
" |
|
3365 |
||
9817 | 3366 |
"Modified: / 30-08-2006 / 18:52:47 / cg" |
9536 | 3367 |
! |
3368 |
||
9575 | 3369 |
productVersionCommaSeparated |
3370 |
"Returns a product version which will appear in libName.rc" |
|
3371 |
||
3372 |
"<major>.<minor>.<revision>.<release> (such as '0,1,1,1') " |
|
9536 | 3373 |
|
13419 | 3374 |
^ '%1,%2,%3,%4' |
23124 | 3375 |
bindWith:self majorVersionNr |
3376 |
with:self minorVersionNr |
|
3377 |
with:self revisionNr |
|
3378 |
with:self releaseNr. |
|
11042 | 3379 |
|
3380 |
" |
|
3381 |
self productVersionCommaSeparated |
|
3382 |
" |
|
9536 | 3383 |
|
9575 | 3384 |
"Created: / 17-08-2006 / 20:13:32 / cg" |
9817 | 3385 |
"Modified: / 30-08-2006 / 18:52:42 / cg" |
9536 | 3386 |
! |
3387 |
||
9898 | 3388 |
productWebSite |
3389 |
"Returns a product webSite which will appear in <app>.nsi." |
|
3390 |
||
3391 |
( #('exept' 'stx') includes:self module) ifTrue:[ |
|
23124 | 3392 |
^ 'http://www.exept.de' |
9898 | 3393 |
]. |
3394 |
||
10426 | 3395 |
"/ should be redefined by concrete ApplicationDefinition |
9898 | 3396 |
^ 'http://www.yoursite.com' |
3397 |
||
3398 |
"Created: / 14-09-2006 / 21:15:05 / cg" |
|
10426 | 3399 |
"Modified: / 01-03-2007 / 18:11:27 / cg" |
9898 | 3400 |
! |
3401 |
||
9575 | 3402 |
releaseNr |
3403 |
"Returns a releaseNr which will appear in libName.rc" |
|
3404 |
||
3405 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
|
3406 |
the default here takes smalltalks version number. |
|
20424 | 3407 |
But that's probably not good for an end-user-app." |
9575 | 3408 |
|
11042 | 3409 |
^ Smalltalk releaseNr |
9536 | 3410 |
|
9575 | 3411 |
"Created: / 17-08-2006 / 20:20:51 / cg" |
9817 | 3412 |
"Modified: / 30-08-2006 / 18:52:22 / cg" |
9575 | 3413 |
! |
3414 |
||
3415 |
revisionNr |
|
3416 |
"Returns a revisionNr which will appear in libName.rc" |
|
9536 | 3417 |
|
9575 | 3418 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
3419 |
the default here takes smalltalks version number. |
|
20424 | 3420 |
But that's probably not good for an end-user-app." |
9575 | 3421 |
|
11042 | 3422 |
^ Smalltalk revisionNr |
9575 | 3423 |
|
3424 |
"Created: / 17-08-2006 / 20:20:40 / cg" |
|
9817 | 3425 |
"Modified: / 30-08-2006 / 18:52:32 / cg" |
9536 | 3426 |
! |
3427 |
||
17236 | 3428 |
supportedLanguages |
3429 |
"Returns a list of languages that (should be / are) supported by this application or library. |
|
23124 | 3430 |
Currently this is only used by lint, to verify that the corresponding languages are |
17236 | 3431 |
present in the resource files." |
3432 |
||
19656 | 3433 |
self module = 'stx' ifTrue:[ |
23124 | 3434 |
^ #(en de) |
3435 |
]. |
|
17236 | 3436 |
^ #(en) |
19656 | 3437 |
|
3438 |
" |
|
3439 |
stx_goodies_rdoit supportedLanguages |
|
3440 |
cg_tools supportedLanguages |
|
3441 |
" |
|
17236 | 3442 |
! |
3443 |
||
9536 | 3444 |
versionNumber |
10306 | 3445 |
"Returns a version string which will appear in bc.def / vc.def " |
9536 | 3446 |
|
9575 | 3447 |
^'' |
9536 | 3448 |
|
3449 |
"Created: / 08-08-2006 / 11:35:52 / fm" |
|
9575 | 3450 |
"Modified: / 17-08-2006 / 19:46:29 / cg" |
9536 | 3451 |
! ! |
3452 |
||
16854 | 3453 |
!ProjectDefinition class methodsFor:'doc generation'! |
3454 |
||
3455 |
autoDocClassNamePatterns |
|
3456 |
"lists patterns for class names for which autodoc html-documentation files |
|
3457 |
are to be built. |
|
3458 |
Return #( '*' ) to get doc files for all classes" |
|
3459 |
||
3460 |
^ #( |
|
23124 | 3461 |
'*' |
16854 | 3462 |
) |
3463 |
! |
|
3464 |
||
3465 |
generate_autoDocFiles |
|
3466 |
"generate html documentation for all classes matching the autoDocNamePatterns. |
|
3467 |
Use this, if you don't want to deliver source code, but still need some documentation |
|
3468 |
to be deployed." |
|
3469 |
||
3470 |
self classes do:[:eachClass | |
|
23124 | 3471 |
(self autoDocClassNamePatterns contains:[:pattern | pattern match:eachClass name]) ifTrue:[ |
3472 |
self generateClassDocumentationFor:eachClass. |
|
3473 |
] |
|
16854 | 3474 |
]. |
3475 |
! ! |
|
3476 |
||
9569 | 3477 |
!ProjectDefinition class methodsFor:'file generation'! |
9536 | 3478 |
|
13177 | 3479 |
apspecFilename |
13968 | 3480 |
"/ for linux |
13177 | 3481 |
^ 'autopackage/default.apspec' |
3482 |
||
3483 |
"Created: / 21-12-2010 / 09:43:13 / cg" |
|
3484 |
! |
|
3485 |
||
9852 | 3486 |
basicFileNamesToGenerate |
22387 | 3487 |
"answer a dictionary (filename -> generator method) with all the build-support files, |
11937 | 3488 |
that have to be generated for this package" |
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3489 |
|
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3490 |
| dict cls | |
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3491 |
|
13419 | 3492 |
dict := OrderedDictionary withKeysAndValues:#( |
23124 | 3493 |
'Make.spec' #'generate_make_dot_spec' |
3494 |
'Make.proto' #'generate_make_dot_proto' |
|
3495 |
"/ cg: changed to generate Makefile.init instead of Makefile, |
|
3496 |
"/ because macosx files are not case sensitive. |
|
3497 |
"/ You will have to execute make -f Makefile.init initially |
|
3498 |
"/ 'Makefile' #'generate_makefile' "/ for unix |
|
3499 |
'Makefile.init' #'generate_makefile' "/ for unix |
|
3500 |
'bc.mak' #'generate_bc_dot_mak' "/ for windows |
|
3501 |
'abbrev.stc' #'generate_abbrev_dot_stc' |
|
3502 |
'bmake.bat' #'generate_bmake_dot_mak' "/ for bcc32 |
|
3503 |
'vcmake.bat' #'generate_vcmake_dot_mak' "/ for msvc |
|
3504 |
"/ 'lccmake.bat' #'generate_lccmake_dot_mak' "/ for lcc - not supported at the moment |
|
3505 |
"/ 'tccmake.bat' #'generate_tccmake_dot_mak' "/ for tcc - cannot link at the moment |
|
3506 |
'mingwmake.bat' #'generate_mingwmake_dot_mak' "/ for mingw |
|
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3507 |
). |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3508 |
|
13419 | 3509 |
dict |
23124 | 3510 |
at:self rcFilename put:#'generate_packageName_dot_rc'. "/ for windows |
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3511 |
|
22387 | 3512 |
"Add additional custom files as specified in file:overwrite: annotations" |
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3513 |
cls := self. |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3514 |
[ cls ~~ Object ] whileTrue:[ |
23124 | 3515 |
cls class selectorsAndMethodsDo:[:selector :method | |
3516 |
| annotation | |
|
3517 |
||
3518 |
annotation := method annotationAt: #file:overwrite:. |
|
3519 |
annotation notNil ifTrue:[ |
|
3520 |
dict at: (annotation argumentAt: 1) put: selector |
|
3521 |
]. |
|
3522 |
]. |
|
3523 |
cls := cls superclass. |
|
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3524 |
]. |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3525 |
|
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3526 |
^ dict. |
13154
bac0fcd8a888
make sure that the makefiles are generated before the libInit file
Claus Gittinger <cg@exept.de>
parents:
13148
diff
changeset
|
3527 |
|
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3528 |
" |
22387 | 3529 |
stx_libbasic basicFileNamesToGenerate |
3530 |
stx_libjava basicFileNamesToGenerate |
|
3531 |
" |
|
3532 |
||
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3533 |
"Modified: / 19-01-2015 / 16:33:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
22387 | 3534 |
"Modified (comment): / 04-12-2017 / 17:40:03 / cg" |
9852 | 3535 |
! |
3536 |
||
9536 | 3537 |
fileNamesToGenerate |
22387 | 3538 |
"answer the build-support files that have to be generated as a dictionary of names and generator method" |
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3539 |
|
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3540 |
^ self basicFileNamesToGenerate removeAllKeys:self protectedFileNames ifAbsent:[] |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3541 |
|
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3542 |
" |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3543 |
stx_libbasic fileNamesToGenerate |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3544 |
" |
22387 | 3545 |
|
3546 |
"Modified (comment): / 04-12-2017 / 17:40:23 / cg" |
|
9536 | 3547 |
! |
3548 |
||
13419 | 3549 |
forEachFileNameAndGeneratedContentsDo:aTwoArgBlock |
14930 | 3550 |
"for build-support file generation, checkin etc., use this common method which |
22387 | 3551 |
enumerates all build-support fileNames with their generated contents to be built." |
14930 | 3552 |
|
9544 | 3553 |
|pairs| |
3554 |
||
3555 |
pairs := OrderedCollection new. |
|
23123 | 3556 |
self fileNamesToGenerate keysDo:[:fileName | |
23434 | 3557 |
|fileContents| |
3558 |
||
3559 |
fileContents := self generateFile:fileName confirmMissingClasses:false. |
|
3560 |
fileContents notNil ifTrue:[ |
|
3561 |
pairs add:(Array with:fileName with:fileContents) |
|
3562 |
]. |
|
9544 | 3563 |
]. |
3564 |
||
3565 |
pairs pairsDo:aTwoArgBlock |
|
3566 |
||
3567 |
"Created: / 16-08-2006 / 18:37:52 / User" |
|
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3568 |
"Modified: / 19-01-2015 / 16:58:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
22387 | 3569 |
"Modified (comment): / 04-12-2017 / 17:40:49 / cg" |
9544 | 3570 |
! |
3571 |
||
9536 | 3572 |
generateFile:filename |
23434 | 3573 |
^ self generateFile:filename confirmMissingClasses:true |
3574 |
! |
|
3575 |
||
3576 |
generateFile:filename confirmMissingClasses:confirmBoolean |
|
23123 | 3577 |
|action missingNames| |
3578 |
||
23434 | 3579 |
confirmBoolean ifTrue:[ |
3580 |
(#('bc.mak' 'Make.proto' 'loadAll') includes:filename) ifTrue:[ |
|
3581 |
"if there are missing classes in image, the dependencies cannot be computed. |
|
3582 |
Warn the user" |
|
3583 |
||
3584 |
missingNames := |
|
3585 |
self allClassNames "compiled_classNames" |
|
3586 |
select:[:aName | |
|
3587 |
|cls| |
|
3588 |
||
3589 |
cls := Smalltalk at:aName asSymbol. |
|
3590 |
cls isNil |
|
3591 |
]. |
|
3592 |
missingNames notEmpty ifTrue:[ |
|
3593 |
(self confirm:(self classResources |
|
3594 |
stringWithCRs:'While generating %1:\Some classes from the list of compiled classes are missing in the image:\\%2\\If you continue, you have to fix dependencies for these classes in %1 manually!!\\Continue anyway?' |
|
3595 |
with:filename |
|
3596 |
with:(missingNames asStringWith:', '))) |
|
3597 |
ifFalse:[^ nil]. |
|
3598 |
]. |
|
3599 |
]. |
|
23123 | 3600 |
]. |
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3601 |
|
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3602 |
action := self basicFileNamesToGenerate at:filename ifAbsent:[]. |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3603 |
action notNil ifTrue:[ |
23434 | 3604 |
^ self perform:action |
3605 |
]. |
|
3606 |
(filename = 'app.rc' |
|
3607 |
or:[filename = 'lib.rc' |
|
3608 |
or:[filename = self rcFilename]] |
|
3609 |
) ifTrue:[ |
|
3610 |
^ self generate_packageName_dot_rc |
|
9607 | 3611 |
]. |
9850 | 3612 |
(filename = 'loadAll') ifTrue:[ |
23434 | 3613 |
^ self generate_loadAll |
9850 | 3614 |
]. |
13177 | 3615 |
self error:('File "%1" not appropriate (not generated) for this type of project.' bindWith:filename) |
3616 |
||
21569 | 3617 |
"Modified: / 24-02-2017 / 11:53:18 / cg" |
9536 | 3618 |
! |
3619 |
||
13411 | 3620 |
generateFile:filename in: directory |
16257 | 3621 |
|dir| |
3622 |
||
13411 | 3623 |
dir := directory asFilename. |
3624 |
dir exists ifFalse:[self error:'Directory does not exist']. |
|
16257 | 3625 |
|
3626 |
(dir / (filename asFilename baseName)) contents:(self generateFile: filename). |
|
13411 | 3627 |
|
3628 |
" |
|
23124 | 3629 |
stx_projects_smalltalk generateFile:'package.deps.rake' in: '/tmp' |
13411 | 3630 |
" |
3631 |
||
3632 |
"Created: / 26-02-2011 / 10:42:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3633 |
"Modified: / 09-06-2011 / 14:53:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3634 |
! |
|
3635 |
||
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3636 |
generateRemoveShellScriptOn:aStream |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3637 |
"generate a shell script to a cvs remove of broken class filenames. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3638 |
To be called after the output of #generateRenameShellScript: has been performed" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3639 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3640 |
|firstLine| |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3641 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3642 |
firstLine := true. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3643 |
self searchForClasses do:[:eachClass| |
23124 | 3644 |
eachClass isJavaClass ifFalse:[ |
3645 |
firstLine ifTrue:[ |
|
3646 |
aStream nextPutAll:'cvs rm -f '. |
|
3647 |
firstLine := false. |
|
3648 |
]. |
|
3649 |
eachClass classFilename ~= (eachClass generateClassFilename, '.st') ifTrue:[ |
|
3650 |
aStream nextPutAll:eachClass classBaseFilename; space. |
|
3651 |
] |
|
3652 |
]. |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3653 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3654 |
firstLine ifFalse:[ |
23124 | 3655 |
aStream cr. |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3656 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3657 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3658 |
" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3659 |
stx_goodies_webServer_htmlTree generateRemoveShellScriptOn:Transcript |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3660 |
" |
16802
0875f5d7c9ce
Care for Java classes that are part of a Smalltalk/X package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16786
diff
changeset
|
3661 |
|
0875f5d7c9ce
Care for Java classes that are part of a Smalltalk/X package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16786
diff
changeset
|
3662 |
"Modified: / 30-07-2014 / 20:44:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3663 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3664 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3665 |
generateRenameShellScriptOn:aStream |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3666 |
"generate a shell script to rename broken class filenames" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3667 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3668 |
self searchForClasses do:[:eachClass| |
23124 | 3669 |
eachClass isJavaClass ifFalse:[ |
3670 |
eachClass classFilename ~= (eachClass generateClassFilename, '.st') ifTrue:[ |
|
3671 |
aStream nextPutAll:'cp '; |
|
3672 |
nextPutAll:eachClass classBaseFilename; nextPutAll:',v '; |
|
3673 |
nextPutAll:eachClass generateClassFilename; nextPutAll:'.st,v'; cr. |
|
3674 |
] |
|
3675 |
] |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3676 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3677 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3678 |
" |
11981
e479249ba36e
Fix #generateRenameShellScriptOn:
Stefan Vogel <sv@exept.de>
parents:
11980
diff
changeset
|
3679 |
stx_libdb generateRemoveShellScriptOn:Transcript |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3680 |
" |
16802
0875f5d7c9ce
Care for Java classes that are part of a Smalltalk/X package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16786
diff
changeset
|
3681 |
|
0875f5d7c9ce
Care for Java classes that are part of a Smalltalk/X package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16786
diff
changeset
|
3682 |
"Modified: / 30-07-2014 / 20:44:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3683 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3684 |
|
9536 | 3685 |
generate_abbrev_dot_stc |
13968 | 3686 |
"/ for stc: provides abbreviations and namespace information |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3687 |
self checkIfClassesArePresent. |
10104
96bce48c03b5
some care for incomplete information bein present when
Claus Gittinger <cg@exept.de>
parents:
10103
diff
changeset
|
3688 |
|
13419 | 3689 |
^ String |
23124 | 3690 |
streamContents:[:s | |
3691 |
|addEntry| |
|
3692 |
||
3693 |
addEntry := |
|
3694 |
[:eachClassName | |
|
3695 |
|cls fn wasLoaded failedToLoad numClassInstvars| |
|
3696 |
||
3697 |
s nextPutAll:eachClassName. |
|
3698 |
s nextPutAll:' '. |
|
3699 |
||
3700 |
cls := Smalltalk classNamed:eachClassName. |
|
3701 |
cls isNil ifTrue:[ |
|
3702 |
fn := self filenameForClass:eachClassName. |
|
3703 |
s nextPutAll:fn. |
|
3704 |
s nextPutAll:' '; nextPutAll:(self package); nextPutAll:' '. |
|
3705 |
s nextPutAll:' '; nextPutAll:'unknownCategory' storeString; nextPutAll:' '. |
|
3706 |
s nextPutAll:' '; nextPutAll:'0'. |
|
3707 |
] ifFalse:[ |
|
3708 |
wasLoaded := cls isLoaded. |
|
3709 |
wasLoaded ifFalse:[ |
|
3710 |
failedToLoad := false. |
|
3711 |
||
3712 |
Error handle:[:ex | |
|
3713 |
failedToLoad := true. |
|
3714 |
] do:[ |
|
3715 |
ParserFlags |
|
3716 |
withSTCCompilation:#never |
|
3717 |
do:[ |
|
3718 |
cls autoload. |
|
3719 |
] |
|
3720 |
]. |
|
3721 |
]. |
|
3722 |
||
3723 |
fn := self filenameForClass:cls. |
|
3724 |
(fn includes:Character space) ifTrue:[ |
|
3725 |
s nextPutAll:fn storeString. |
|
3726 |
] ifFalse:[ |
|
3727 |
s nextPutAll:fn. |
|
3728 |
]. |
|
3729 |
s nextPutAll:' '; nextPutAll:(self package); nextPutAll:' '. |
|
3730 |
s nextPutAll: (cls category asString storeString). |
|
3731 |
failedToLoad ifTrue:[ |
|
3732 |
s nextPutAll:' 0'. |
|
3733 |
] ifFalse:[ |
|
3734 |
numClassInstvars := cls theMetaclass instSize - Class instSize. |
|
3735 |
s nextPutAll:' '; nextPutAll:numClassInstvars printString. |
|
3736 |
]. |
|
3737 |
||
3738 |
wasLoaded ifFalse:[ |
|
3739 |
UserPreferences current autoUnloadAutoloadedClassesInProjectDefinition ifTrue:[ |
|
3740 |
cls unload |
|
3741 |
] |
|
3742 |
] |
|
3743 |
]. |
|
3744 |
s cr. |
|
3745 |
]. |
|
3746 |
||
3747 |
s nextPutLine:'# automagically generated by the project definition'. |
|
3748 |
s nextPutLine:'# this file is needed for stc to be able to compile modules independently.'. |
|
3749 |
s nextPutLine:'# it provides information about a classes filename, category and especially namespace.'. |
|
3750 |
||
3751 |
self allClassNames do:addEntry. |
|
3752 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do: [:nm :attr | |
|
3753 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
|
3754 |
addEntry value:nm |
|
3755 |
]. |
|
3756 |
]. |
|
3757 |
] |
|
3758 |
||
3759 |
" |
|
3760 |
stx_libbasic generate_abbrev_dot_stc |
|
3761 |
DapasXProject generate_abbrev_dot_stc |
|
3762 |
DapasX_Datenbasis generate_abbrev_dot_stc |
|
3763 |
bosch_dapasx_interactiver_editor generate_abbrev_dot_stc |
|
9536 | 3764 |
" |
3765 |
||
3766 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
15916 | 3767 |
"Modified: / 28-01-2014 / 21:43:56 / cg" |
9536 | 3768 |
! |
3769 |
||
13177 | 3770 |
generate_autopackage_default_dot_apspec |
3771 |
||
13419 | 3772 |
^self |
23124 | 3773 |
replaceMappings: self autopackage_default_dot_apspec_mappings |
3774 |
in: self autopackage_default_dot_apspec |
|
13177 | 3775 |
|
3776 |
" |
|
3777 |
stx_projects_smalltalk generate_autopackage_default_dot_apspec |
|
3778 |
" |
|
3779 |
||
3780 |
"Created: / 21-12-2010 / 09:40:04 / cg" |
|
3781 |
! |
|
3782 |
||
13419 | 3783 |
generate_bc_dot_mak |
3784 |
^ (self |
|
23124 | 3785 |
replaceMappings: self bc_dot_mak_mappings |
3786 |
in: self bc_dot_mak) asStringCollection withTabs asString |
|
10306 | 3787 |
|
3788 |
" |
|
3789 |
DapasXProject generate_bc_dot_mak |
|
3790 |
DapasX_Datenbasis generate_bc_dot_mak |
|
3791 |
" |
|
3792 |
||
3793 |
"Modified: / 09-08-2006 / 11:46:14 / fm" |
|
3794 |
! |
|
3795 |
||
13419 | 3796 |
generate_bmake_dot_mak |
3797 |
||
3798 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
23124 | 3799 |
in: self bmake_dot_mak |
9575 | 3800 |
|
3801 |
"Created: / 17-08-2006 / 20:03:43 / cg" |
|
3802 |
! |
|
3803 |
||
13411 | 3804 |
generate_builder_baseline_dot_rbspec |
3805 |
^ self replaceMappings:self builder_baseline_dot_rbspec_mappings |
|
23124 | 3806 |
in:self builder_baseline_dot_rbspec |
13411 | 3807 |
|
3808 |
" |
|
3809 |
stx_projects_smalltalk generate_builder_baseline_dot_rbspec |
|
3810 |
||
3811 |
" |
|
3812 |
||
3813 |
"Created: / 24-02-2011 / 11:38:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3814 |
! |
|
3815 |
||
14334 | 3816 |
generate_lccmake_dot_mak |
13419 | 3817 |
|
3818 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
23124 | 3819 |
in: self lccmake_dot_mak |
14334 | 3820 |
|
3821 |
"Created: / 03-09-2012 / 19:49:56 / cg" |
|
11979 | 3822 |
! |
3823 |
||
9850 | 3824 |
generate_loadAll |
13419 | 3825 |
^ String |
23124 | 3826 |
streamContents:[:s | |
3827 |
|classNames classesLoaded classNamesUnloaded classesSorted| |
|
3828 |
||
3829 |
classNames := self compiled_classNames_common. |
|
3830 |
classesLoaded := classNames |
|
3831 |
collect:[:nm | Smalltalk classNamed:nm] |
|
3832 |
thenSelect:[:cls | cls notNil and:[cls isLoaded] ]. |
|
3833 |
classNamesUnloaded := classNames |
|
3834 |
select:[:nm | |
|
3835 |
|cls| |
|
3836 |
cls := Smalltalk classNamed:nm. |
|
3837 |
cls isNil or:[cls isLoaded not] |
|
3838 |
]. |
|
3839 |
||
3840 |
classesSorted := Class classesSortedByLoadOrder:classesLoaded. |
|
3841 |
||
3842 |
s nextPutAll:'"/ |
|
9850 | 3843 |
"/ $' , 'Header' , '$ |
3844 |
"/ |
|
3845 |
"/ loadAll-file to fileIn code for: ' , self package , ' |
|
3846 |
"/ |
|
3847 |
"/ Automatically generated from the ProjectDefinition. |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
3848 |
"/ DO NOT MODIFY THIS FILE; |
9850 | 3849 |
"/ |
3850 |
"/ |
|
3851 |
"/ Prerequisites: |
|
3852 |
"/ |
|
3853 |
"/ Smalltalk loadPackage:''module:directory''. |
|
3854 |
"/ Smalltalk loadPackage:''....''. |
|
3855 |
!! |
|
3856 |
||
3857 |
"{ package:''' , self package, ''' }" |
|
3858 |
!! |
|
3859 |
||
3860 |
|files| |
|
3861 |
||
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
3862 |
''loading package ' , self package ,'...'' infoPrint. |
9850 | 3863 |
|
3864 |
files := #( |
|
3865 |
'. |
|
3866 |
||
23124 | 3867 |
classesSorted do:[:eachClass | |
3868 |
s nextPutLine:' ''' , (self filenameForClass:eachClass), ''''. |
|
3869 |
]. |
|
3870 |
classNamesUnloaded do:[:nm | |
|
3871 |
s nextPutLine:' ''' , (self filenameForClass:nm), ''''. |
|
3872 |
]. |
|
3873 |
||
3874 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do:[:nm :attr | |
|
3875 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
|
3876 |
s nextPutLine:' ''' , (self filenameForClass:nm), ''''. |
|
3877 |
]. |
|
3878 |
]. |
|
3879 |
||
3880 |
self hasExtensionMethods ifTrue:[ |
|
3881 |
s nextPutLine:' ''extensions.st'''. |
|
3882 |
]. |
|
3883 |
||
3884 |
s nextPutAll:' |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
3885 |
). |
9850 | 3886 |
|
3887 |
"/ see if there is a classLibrary |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
3888 |
(Smalltalk fileInClassLibrary:''' , (self libraryName) , ''') ifTrue:[ |
9850 | 3889 |
|handle loaded| |
3890 |
||
13419 | 3891 |
handle := ObjectFileLoader loadedObjectHandles |
23124 | 3892 |
detect:[:h | h package = ''' , self package , '''] ifNone:nil. |
9850 | 3893 |
handle ifNotNil:[ |
23124 | 3894 |
loaded := Set new:(handle classes size). |
3895 |
handle classes do:[:c| c isMeta ifFalse:[loaded add:c classBaseFilename]]. |
|
3896 |
files := files \ loaded. |
|
9850 | 3897 |
]. |
3898 |
]. |
|
3899 |
||
3900 |
"/ load files which are not in the classLibrary (all if there is none) |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
3901 |
files notEmpty ifTrue:[ |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
3902 |
'''' infoPrintCR. |
9850 | 3903 |
files do:[:f | |
3904 |
''.'' infoPrint. |
|
3905 |
f asFilename exists ifTrue:[ |
|
23124 | 3906 |
Smalltalk fileIn:f. |
9850 | 3907 |
] ifFalse:[ |
23124 | 3908 |
Smalltalk fileIn:(''source/'' , f) |
9850 | 3909 |
] |
3910 |
]. |
|
3911 |
'' '' infoPrintCR. |
|
3912 |
]. |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
3913 |
''done (' , self package ,').'' infoPrintCR. |
9850 | 3914 |
'. |
23124 | 3915 |
]. |
9850 | 3916 |
|
3917 |
"Created: / 14-09-2006 / 14:21:31 / cg" |
|
10080 | 3918 |
"Modified: / 12-10-2006 / 15:55:00 / cg" |
9850 | 3919 |
! |
3920 |
||
13419 | 3921 |
generate_make_dot_proto |
3922 |
||
3923 |
^ (self |
|
23124 | 3924 |
replaceMappings: self make_dot_proto_mappings |
3925 |
in: self make_dot_proto) asStringCollection withTabs asString |
|
9536 | 3926 |
|
9733 | 3927 |
" |
12428 | 3928 |
stx_libbasic2 generate_make_dot_proto |
9733 | 3929 |
" |
9536 | 3930 |
|
3931 |
"Modified: / 09-08-2006 / 11:31:01 / fm" |
|
3932 |
! |
|
3933 |
||
3934 |
generate_make_dot_spec |
|
13419 | 3935 |
^ (self |
23124 | 3936 |
replaceMappings: self make_dot_spec_mappings |
3937 |
in: self make_dot_spec) asStringCollection withTabs asString |
|
9536 | 3938 |
|
9733 | 3939 |
" |
3940 |
DapasXProject generate_make_dot_spec |
|
3941 |
DapasX_Datenbasis generate_make_dot_spec |
|
3942 |
bosch_dapasx_kernel_Definition generate_make_dot_spec |
|
3943 |
" |
|
9536 | 3944 |
|
3945 |
"Modified: / 09-08-2006 / 11:31:09 / fm" |
|
3946 |
! |
|
3947 |
||
13419 | 3948 |
generate_makefile |
3949 |
||
3950 |
^ (self |
|
23124 | 3951 |
replaceMappings: self makefile_mappings |
3952 |
in: self makefile) asStringCollection withTabs asString |
|
12428 | 3953 |
|
3954 |
" |
|
3955 |
stx_libbasic2 generate_makefile |
|
3956 |
" |
|
3957 |
! |
|
3958 |
||
14345 | 3959 |
generate_mingwmake_dot_mak |
3960 |
||
3961 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
23124 | 3962 |
in: self mingwmake_dot_mak |
14345 | 3963 |
|
3964 |
"Created: / 05-09-2012 / 19:44:07 / cg" |
|
3965 |
! |
|
3966 |
||
9536 | 3967 |
generate_packageName_dot_rc |
3968 |
||
13419 | 3969 |
^self replaceMappings: self packageName_dot_rc_mappings |
23124 | 3970 |
in: self packageName_dot_rc |
9536 | 3971 |
|
3972 |
" |
|
3973 |
bosch_dapasx_datenbasis generate_packageName_dot_rc |
|
3974 |
bosch_dapasx_hw_schnittstellen generate_packageName_dot_rc |
|
9575 | 3975 |
stx_libbasic3 generate_packageName_dot_rc |
9618 | 3976 |
stx_libwidg3 generate_packageName_dot_rc |
13419 | 3977 |
stx_libwidg3 productVersion |
9536 | 3978 |
|
3979 |
" |
|
3980 |
||
3981 |
"Modified: / 09-08-2006 / 11:31:09 / fm" |
|
9618 | 3982 |
"Modified: / 21-08-2006 / 19:33:21 / cg" |
9831 | 3983 |
! |
3984 |
||
13411 | 3985 |
generate_package_dot_deps_dot_rake |
3986 |
^ (self replaceMappings:self package_dot_deps_dot_rake_mappings |
|
23124 | 3987 |
in:self package_dot_deps_dot_rake) asStringCollection |
3988 |
withTabs asString |
|
13411 | 3989 |
|
3990 |
" |
|
3991 |
stx_libjava generate_dependencies_dot_rake" |
|
3992 |
||
3993 |
"Created: / 24-02-2011 / 22:32:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3994 |
! |
|
3995 |
||
14334 | 3996 |
generate_tccmake_dot_mak |
3997 |
||
3998 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
23124 | 3999 |
in: self tccmake_dot_mak |
14334 | 4000 |
|
4001 |
"Created: / 03-09-2012 / 19:50:25 / cg" |
|
4002 |
! |
|
4003 |
||
13419 | 4004 |
generate_vcmake_dot_mak |
4005 |
||
4006 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
23124 | 4007 |
in: self vcmake_dot_mak |
11937 | 4008 |
! |
4009 |
||
23112 | 4010 |
nsiFilename |
4011 |
"only applications define it" |
|
23124 | 4012 |
|
23112 | 4013 |
^ nil. |
4014 |
||
4015 |
"Created: / 18-06-2018 / 14:07:43 / Claus Gittinger" |
|
4016 |
! |
|
4017 |
||
9852 | 4018 |
protectedFileNames |
13178
07e3a9bb37c8
changed: #protectedFileNames
Claus Gittinger <cg@exept.de>
parents:
13177
diff
changeset
|
4019 |
"names of files which should NOT be generated (because they are hand-maintained) |
12200
7e452033e984
rememberOverwrittenExtensionMethods
Claus Gittinger <cg@exept.de>
parents:
12198
diff
changeset
|
4020 |
- redefine this to protect a hand-written Make.proto or other handwritten support files" |
9852 | 4021 |
|
4022 |
^ #() |
|
4023 |
||
4024 |
"Created: / 14-09-2006 / 14:38:40 / cg" |
|
13178
07e3a9bb37c8
changed: #protectedFileNames
Claus Gittinger <cg@exept.de>
parents:
13177
diff
changeset
|
4025 |
"Modified: / 21-12-2010 / 11:36:46 / cg" |
9852 | 4026 |
! |
4027 |
||
9831 | 4028 |
rcFilename |
19996 | 4029 |
^ self fullPackageName,'WINrc.rc'. |
9831 | 4030 |
|
4031 |
"Created: / 07-09-2006 / 17:07:00 / cg" |
|
19996 | 4032 |
! |
4033 |
||
4034 |
resourceFilename |
|
4035 |
^ (self rcFilename asFilename withSuffix:'$(RES)') name |
|
4036 |
||
4037 |
"Created: / 07-09-2006 / 17:12:53 / cg" |
|
9536 | 4038 |
! ! |
4039 |
||
12364 | 4040 |
!ProjectDefinition class methodsFor:'file mappings'! |
9536 | 4041 |
|
13177 | 4042 |
autopackage_default_dot_apspec_mappings |
4043 |
|mappings| |
|
4044 |
||
4045 |
mappings := Dictionary new. |
|
16257 | 4046 |
^ mappings |
23124 | 4047 |
at: 'TOP' put: (self pathToTopWithSeparator:'/'); "/ unix here |
14339 | 4048 |
"/ at: 'MODULE_PATH' put: ( self moduleDirectory ); "/ unix here |
23124 | 4049 |
at: 'DESCRIPTION' put: (self description); |
4050 |
at: 'PRODUCT_NAME' put: (self productName); |
|
4051 |
at: 'PRODUCT_VERSION' put: (self productVersion); |
|
4052 |
at: 'PRODUCT_DATE' put: (self productDate); |
|
4053 |
at: 'PRODUCT_PUBLISHER' put: (self productPublisher); |
|
4054 |
at: 'PRODUCT_WEBSITE' put: (self productWebSite); |
|
4055 |
at: 'PRODUCT_INSTALLDIR' put: (self productInstallDir); |
|
4056 |
at: 'PRODUCT_TYPE' put: (self productType); |
|
4057 |
at: 'PRODUCT_LICENSE' put: (self productLicense); |
|
4058 |
at: 'PRODUCT_DESCRIPTION' put: (self productDescription); |
|
4059 |
at: 'PRODUCT_CPU_VERSIONS' put: 'x86'; |
|
4060 |
at: 'PRODUCT_ROOT_NAME' put: (self productName); |
|
4061 |
at: 'MAINTAINER' put: (self productMaintainer); |
|
4062 |
at: 'PACKAGER' put: (self productPublisher); |
|
4063 |
at: 'ADDITIONAL_SOURCE_DIRS' put: ''; |
|
4064 |
at: 'ADDITIONAL_COPYFILES' put: ''; |
|
4065 |
at: 'ADDITIONAL_INSTALL' put: ''; |
|
4066 |
yourself. |
|
13419 | 4067 |
|
13177 | 4068 |
|
4069 |
"Created: / 21-12-2010 / 09:00:49 / cg" |
|
14339 | 4070 |
"Modified: / 05-09-2012 / 10:09:06 / cg" |
13177 | 4071 |
! |
4072 |
||
10306 | 4073 |
bc_dot_mak_mappings |
4074 |
|d| |
|
4075 |
||
14337 | 4076 |
d := self common_mappings. |
14944 | 4077 |
^ d |
23124 | 4078 |
at: 'TOP' put: ( self pathToTopWithSeparator:'\' ); "/ win32 here |
4079 |
at: 'MODULE_PATH' put: ( self moduleDirectory_win32 ); "/ win32 here |
|
4080 |
at: 'PRIMARY_TARGET' put: (self primaryTarget_bc_dot_mak); |
|
4081 |
at: 'ADDITIONAL_BASE_ADDRESS_DEFINITION' put: (self additionalBaseAddressDefinition_bc_dot_mak ? ''); |
|
4082 |
at: 'ADDITIONAL_DEFINITIONS' put: (self additionalDefinitions_bc_dot_mak ? ''); |
|
4083 |
at: 'ADDITIONAL_HEADERRULES' put: (self additionalHeaderRules_bc_dot_mak); |
|
4084 |
at: 'ADDITIONAL_RULES' put: (self additionalRulesFor: 'bc.mak'); |
|
4085 |
at: 'ADDITIONAL_RULES_HG' put: (self additionalRulesHG_bc_dot_mak ? ''); |
|
4086 |
at: 'ADDITIONAL_TARGETS' put: (self additionalTargets_bc_dot_mak ? ''); |
|
4087 |
at: 'ADDITIONAL_LINK_LIBRARIES' put: (self additionalLinkLibraries_bc_dot_mak ? ''); |
|
4088 |
at: 'ADDITIONAL_POSTNSISRULES' put: (self additional_post_nsis_rules); "/ win32 bc here |
|
4089 |
at: 'ADDITIONAL_POSTNSISRULES64' put: (self additional_post_nsis_rules64); "/ win64 mingw here |
|
4090 |
at: 'LOCAL_INCLUDES' put: (self generateLocalIncludes_win32 ? ''); |
|
4091 |
at: 'LOCAL_DEFINES' put: self localDefines_win32 ? ''; |
|
4092 |
at: 'GLOBAL_DEFINES' put: self globalDefines_win32 ? ''; |
|
4093 |
yourself. |
|
10306 | 4094 |
|
4095 |
"Created: / 18-08-2006 / 11:43:39 / cg" |
|
14339 | 4096 |
"Modified: / 05-09-2012 / 10:02:51 / cg" |
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
4097 |
"Modified: / 03-02-2015 / 07:28:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
18428 | 4098 |
"Modified: / 02-06-2015 / 17:44:11 / gg" |
10306 | 4099 |
! |
4100 |
||
9627 | 4101 |
bmake_dot_mak_mappings |
14337 | 4102 |
^ self common_mappings |
23124 | 4103 |
at:'TOP' put: ( self pathToTopWithSeparator:'\' ); |
4104 |
at:'SUBPROJECT_BMAKE_CALLS' put:(self subProjectBmakeCalls); |
|
4105 |
at:'SUBPROJECT_VCMAKE_CALLS' put:(self subProjectVCmakeCalls); |
|
4106 |
at:'SUBPROJECT_LCCMAKE_CALLS' put:(self subProjectLCCmakeCalls); |
|
4107 |
at:'SUBPROJECT_TCCMAKE_CALLS' put:(self subProjectTCCmakeCalls); |
|
4108 |
at:'SUBPROJECT_MINGWMAKE_CALLS' put:(self subProjectMingwmakeCalls); |
|
4109 |
yourself |
|
9627 | 4110 |
|
4111 |
"Created: / 17-08-2006 / 21:41:56 / cg" |
|
14345 | 4112 |
"Modified: / 05-09-2012 / 19:45:36 / cg" |
9575 | 4113 |
! |
4114 |
||
13411 | 4115 |
builder_baseline_dot_rbspec_mappings |
4116 |
|mappings| |
|
4117 |
||
4118 |
mappings := Dictionary new. |
|
16257 | 4119 |
^ mappings |
23124 | 4120 |
at:'APPLICATION' put:(self perform:#applicationName ifNotUnderstood:[self packageName]); |
4121 |
at:'APPLICATION_PACKAGE' put:self package printString; |
|
4122 |
at:'PREAMBLE' put:self builder_baseline_dot_rbspec_preamble; |
|
4123 |
at:'POSTAMBLE' put:self builder_baseline_dot_rbspec_postamble; |
|
4124 |
at:'PACKAGES' put:self builder_baseline_dot_rbspec_packages; |
|
4125 |
yourself. |
|
13411 | 4126 |
|
4127 |
"Modified: / 21-12-2010 / 11:00:22 / cg" |
|
4128 |
"Created: / 24-02-2011 / 11:58:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4129 |
"Modified: / 09-06-2011 / 14:55:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4130 |
! |
|
4131 |
||
4132 |
builder_baseline_dot_rbspec_packages |
|
19955 | 4133 |
^ String streamContents:[:s | |
23124 | 4134 |
self allPreRequisitesSorted do: [:packageId | |
4135 |
s nextPutLine:(' package "%1"' bindWith:packageId). |
|
4136 |
] |
|
19955 | 4137 |
]. |
13411 | 4138 |
|
4139 |
"Created: / 24-02-2011 / 11:59:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
19955 | 4140 |
"Modified: / 06-06-2016 / 14:32:44 / cg" |
13411 | 4141 |
! |
4142 |
||
13419 | 4143 |
classLine_mappings:aClassName |
12545 | 4144 |
^ Dictionary new |
23124 | 4145 |
at:'CLASS' put:(self st2c:aClassName); |
4146 |
yourself |
|
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4147 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4148 |
"Modified: / 09-08-2006 / 18:27:07 / fm" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4149 |
"Created: / 19-09-2006 / 22:47:43 / cg" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4150 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4151 |
|
14337 | 4152 |
common_mappings |
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4153 |
^ Dictionary new |
23124 | 4154 |
at: 'TAB' put: ( Character tab asString ); |
4155 |
at: 'TOP' put: ( 'depends-on-file(unix vs. win32)' ); "/ must be in specific mapping |
|
4156 |
at: 'LIBRARY_NAME' put: ( self libraryName ); |
|
4157 |
at: 'SUBDIRECTORIES' put: (self generateSubDirectories); |
|
4158 |
at: 'MODULE' put: ( self module ); |
|
4159 |
at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); "/ always unix format |
|
4160 |
at: 'MODULE_PATH' put: ( 'depends-on-file(unix vs. win32)' ); "/ must be in specific mapping |
|
4161 |
yourself |
|
14337 | 4162 |
|
4163 |
"Created: / 04-09-2012 / 13:04:26 / cg" |
|
4164 |
! |
|
4165 |
||
4166 |
make_dot_proto_mappings |
|
4167 |
^ self common_mappings |
|
23124 | 4168 |
at: 'MODULE' put: ( self module ); |
4169 |
at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); |
|
4170 |
at: 'MODULE_PATH' put: ( self moduleDirectory ); |
|
4171 |
at: 'TOP' put: ( self pathToTopWithSeparator:'/' ); |
|
4172 |
at: 'SUBDIRECTORIES' put: (self generateSubDirectories); |
|
4173 |
at: 'LIBRARY_NAME' put: ( self libraryName ); |
|
4174 |
at: 'LOCAL_INCLUDES' put: (self generateLocalIncludes_unix); |
|
4175 |
at: 'LOCAL_DEFINES' put: self localDefines_unix; |
|
4176 |
at: 'GLOBAL_DEFINES' put: self globalDefines_unix; |
|
4177 |
at: 'COMMONSYMFLAG' put: (self commonSymbolsFlag); |
|
4178 |
at: 'HEADEROUTPUTARG' put: (self headerFileOutputArg); |
|
4179 |
at: 'PRIMARY_TARGET' put: (self primaryTarget_make_dot_proto); |
|
4180 |
at: 'ADDITIONAL_DEFINITIONS' put: (self additionalDefinitions_make_dot_proto); |
|
4181 |
at: 'ADDITIONAL_HEADERRULES' put: (self additionalHeaderRules_make_dot_proto); |
|
4182 |
at: 'ADDITIONAL_RULES' put: (self additionalRulesFor: 'Make.proto'); |
|
4183 |
at: 'ADDITIONAL_RULES_SVN' put: (self additionalRulesSvn_make_dot_proto); |
|
4184 |
at: 'ADDITIONAL_RULES_HG' put: (self additionalRulesHG_make_dot_proto); |
|
4185 |
at: 'ADDITIONAL_TARGETS' put: (self additionalTargets_make_dot_proto); |
|
4186 |
at: 'ADDITIONAL_TARGETS_SVN' put: (self additionalTargetsSvn_make_dot_proto); |
|
4187 |
at: 'ADDITIONAL_LINK_LIBRARIES' put: (self additionalLinkLibraries_make_dot_proto); |
|
4188 |
at: 'ADDITIONAL_SHARED_LINK_LIBRARIES' put: (self additionalSharedLinkLibraries_make_dot_proto); |
|
4189 |
at: 'DEPENDENCIES' put: (self generateDependencies_unix); |
|
4190 |
yourself |
|
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4191 |
|
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4192 |
"Created: / 09-08-2006 / 11:20:45 / fm" |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4193 |
"Modified: / 09-08-2006 / 16:44:48 / fm" |
12028 | 4194 |
"Modified: / 24-06-2009 / 21:50:13 / Jan Vrany <vranyj1@fel.cvut.cz>" |
14339 | 4195 |
"Modified: / 05-09-2012 / 10:10:40 / cg" |
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
4196 |
"Modified: / 03-02-2015 / 07:17:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4197 |
! |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4198 |
|
9627 | 4199 |
make_dot_spec_mappings |
14337 | 4200 |
^ self common_mappings |
23124 | 4201 |
at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); |
4202 |
at: 'STCWARNINGOPTIONS' put: (self stcWarningOptions); |
|
4203 |
at: 'STCOPTIMIZATIONOPTIONS' put: (self stcOptimizationOptions); |
|
4204 |
at: 'CLASSES' put: [self generateClasses_make_dot_spec]; |
|
4205 |
at: 'OBJECTS' put: [self generateObjects_make_dot_spec]; |
|
4206 |
yourself |
|
9627 | 4207 |
|
4208 |
"Created: / 18-08-2006 / 11:44:23 / cg" |
|
14339 | 4209 |
"Modified: / 05-09-2012 / 10:11:02 / cg" |
9575 | 4210 |
! |
4211 |
||
12428 | 4212 |
makefile_mappings |
4213 |
^ Dictionary new |
|
23124 | 4214 |
yourself |
12428 | 4215 |
! |
4216 |
||
9627 | 4217 |
packageName_dot_rc_mappings |
11611
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
4218 |
|d s resourceCount| |
9627 | 4219 |
|
9630 | 4220 |
d := Dictionary new. |
4221 |
d |
|
23124 | 4222 |
at: 'PRODUCT_NAME' put: (self productName); |
4223 |
at: 'PRODUCT_VERSION' put: (self productVersion); |
|
4224 |
at: 'PRODUCT_DATE' put: (self productDate); |
|
4225 |
at: 'FILETYPE' put: ( 'VFT_DLL' ); |
|
4226 |
at: 'FILE_VERSION_COMMASEPARATED' put: (self fileVersionCommaSeparated); |
|
4227 |
at: 'PRODUCT_VERSION_COMMASEPARATED' put: (self productVersionCommaSeparated); |
|
4228 |
||
4229 |
at: 'COMPANY_NAME' put: (self companyName); |
|
4230 |
at: 'FILE_DESCRIPTION' put: (self fileDescription); |
|
4231 |
at: 'FILE_VERSION' put: (self fileVersion); |
|
4232 |
at: 'INTERNAL_NAME' put: (self internalName). |
|
11377 | 4233 |
|
9630 | 4234 |
s := self legalCopyright. |
4235 |
s notNil ifTrue:[ |
|
23124 | 4236 |
d at: 'LEGAL_COPYRIGHT_LINE' put: ' VALUE "LegalCopyright", "',s,'\0"' |
9630 | 4237 |
]. |
11611
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
4238 |
s := String streamContents:[:stream| |
23124 | 4239 |
|suff| |
4240 |
||
4241 |
s := self applicationIconFileNameWindows. |
|
4242 |
s notNil ifTrue:[ |
|
4243 |
s asFilename suffix isEmptyOrNil ifTrue:[ |
|
4244 |
suff := '.ico' |
|
4245 |
] ifFalse:[ |
|
4246 |
suff := '' |
|
4247 |
]. |
|
4248 |
'IDR_MAINFRAME ICON DISCARDABLE "%1%2"' |
|
4249 |
expandPlaceholdersWith:(Array with:s with:suff) on:stream. |
|
4250 |
stream cr. |
|
4251 |
]. |
|
4252 |
||
4253 |
s := self splashFileName. |
|
4254 |
s notNil ifTrue:[ |
|
4255 |
s asFilename suffix isEmptyOrNil ifTrue:[ |
|
4256 |
suff := '.bmp' |
|
4257 |
] ifFalse:[ |
|
4258 |
suff := '' |
|
4259 |
]. |
|
4260 |
'IDR_SPLASH BITMAP DISCARDABLE "%1%2"' |
|
4261 |
expandPlaceholdersWith:(Array with:s with:suff) on:stream. |
|
4262 |
stream cr. |
|
4263 |
]. |
|
4264 |
resourceCount := 2. |
|
4265 |
self applicationAdditionalIconFileNames do:[:eachFilename| |
|
4266 |
'IDR_MAINFRAME+%1 ICON DISCARDABLE "%2"' |
|
4267 |
expandPlaceholdersWith:(Array with:resourceCount with:eachFilename) on:stream. |
|
4268 |
stream cr. |
|
4269 |
resourceCount := resourceCount+1. |
|
4270 |
]. |
|
4271 |
]. |
|
11611
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
4272 |
d at: #'ICONDEFINITION_LINE' put:s. |
9817 | 4273 |
|
9630 | 4274 |
^ d |
9627 | 4275 |
|
4276 |
"Created: / 09-08-2006 / 11:21:21 / fm" |
|
13309
27f463f6c0cb
changed: #packageName_dot_rc_mappings
Claus Gittinger <cg@exept.de>
parents:
13285
diff
changeset
|
4277 |
"Modified: / 22-02-2011 / 11:30:36 / cg" |
9536 | 4278 |
! |
4279 |
||
13411 | 4280 |
package_dot_deps_dot_rake_mappings |
14843 | 4281 |
|dependencies| |
4282 |
||
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
4283 |
dependencies := String |
23124 | 4284 |
streamContents:[:s | |
4285 |
self allPreRequisites do:[:package | |
|
4286 |
(self preRequisitesFor:package) do:[:prereq | |
|
4287 |
s |
|
4288 |
nextPutAll:('task "%1" => "%2"' bindWith:package with:prereq); |
|
4289 |
cr |
|
4290 |
]. |
|
4291 |
s cr |
|
4292 |
]. |
|
4293 |
self effectivePreRequisites do:[:prereq | |
|
4294 |
s |
|
4295 |
nextPutAll:('task "%1" => "%2"' bindWith:self package with:prereq); |
|
4296 |
cr |
|
4297 |
]. |
|
4298 |
]. |
|
13411 | 4299 |
|
4300 |
^ (Dictionary new) |
|
23124 | 4301 |
at:'DEPENDENCIES' put:dependencies; |
4302 |
yourself |
|
4303 |
||
4304 |
" |
|
4305 |
stx_libjava generate_package_dot_deps_dot_rake |
|
13411 | 4306 |
" |
4307 |
||
4308 |
"Created: / 24-02-2011 / 22:32:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4309 |
! |
|
4310 |
||
9627 | 4311 |
replaceMappings: mappings in: fileTemplate |
9733 | 4312 |
"Replaces the defined variable mappings found in a file template with the corresponding information" |
9627 | 4313 |
|
9733 | 4314 |
^ fileTemplate bindWithArguments:mappings. |
9627 | 4315 |
|
9733 | 4316 |
" |
13419 | 4317 |
self replaceMappings: (self nt_dot_def_mappingsFor: self) in: self nt_dot_def |
9733 | 4318 |
" |
9627 | 4319 |
|
4320 |
"Created: / 08-08-2006 / 11:44:27 / fm" |
|
4321 |
"Modified: / 08-08-2006 / 12:46:13 / fm" |
|
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4322 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4323 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4324 |
st2c:aString |
23124 | 4325 |
^ (aString asString |
4326 |
copyReplaceString:'_' withString:('_',($_ codePoint printStringRadix:8))) |
|
4327 |
replaceAny:':' with:$_ |
|
9536 | 4328 |
! ! |
4329 |
||
12364 | 4330 |
!ProjectDefinition class methodsFor:'file mappings support'! |
9817 | 4331 |
|
12545 | 4332 |
classNamesByCategory |
4333 |
"answer a dictionary |
|
23124 | 4334 |
category -> classNames topological sorted" |
12545 | 4335 |
|
15916 | 4336 |
|classes classNames mapping alreadyWarned| |
12545 | 4337 |
|
4338 |
mapping := Dictionary new. |
|
4339 |
||
15126 | 4340 |
classes := Class classesSortedByLoadOrder:self compiled_classes_common. |
15124 | 4341 |
classNames := classes collect:[:eachClass| eachClass name]. |
4342 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do: [:nm :attr | |
|
23124 | 4343 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
4344 |
classNames add:nm. |
|
4345 |
]. |
|
15124 | 4346 |
]. |
4347 |
mapping at:'COMMON' put:classNames. |
|
4348 |
||
15916 | 4349 |
alreadyWarned := false. |
12545 | 4350 |
OperatingSystem knownPlatformNames do:[:platformID | |
23124 | 4351 |
|platformClasses platformClassNames| |
4352 |
||
4353 |
platformClasses := self compiled_classesForPlatform:platformID. |
|
4354 |
platformClasses notEmpty ifTrue:[ |
|
4355 |
(platformClasses contains:[:each| each isNil or:[each isLoaded not]]) ifTrue:[ |
|
4356 |
"win32 classes are not present in linux..." |
|
4357 |
Transcript show:'Missing classes for platform: '. Transcript showCR:platformID. |
|
4358 |
platformClassNames := self compiled_classNamesForPlatform:platformID. |
|
4359 |
platformClassNames |
|
4360 |
select:[:nm | |cls| cls := Smalltalk classNamed:nm. cls isNil or:[cls isLoaded not]] |
|
4361 |
thenDo:[:nm | Transcript tab; showCR:nm]. |
|
4362 |
UserPreferences current suppressProjectDefinitionWarnings ifFalse:[ |
|
4363 |
alreadyWarned ifFalse:[ |
|
4364 |
(Dialog confirm:('Dependencies (and therefore build-order) might be incorrect\(some classes for platform ''%1'' are not present or autoloaded; see Transcript).\\Continue anyway without recomputing the compilation order for this platform''s classes?' withCRs bindWith:platformID)) |
|
4365 |
ifFalse:[ |
|
4366 |
AbortOperationRequest raise. |
|
4367 |
]. |
|
4368 |
]. |
|
4369 |
alreadyWarned := true |
|
4370 |
]. |
|
4371 |
] ifFalse:[ |
|
4372 |
classes := Class classesSortedByLoadOrder:platformClasses. |
|
4373 |
platformClassNames := platformClasses collect:[:eachClass| eachClass name]. |
|
4374 |
]. |
|
4375 |
mapping at:platformID asUppercase put:platformClassNames. |
|
4376 |
]. |
|
12545 | 4377 |
]. |
4378 |
^ mapping |
|
4379 |
||
4380 |
" |
|
4381 |
stx_libbasic classNamesByCategory |
|
4382 |
stx_libbasic3 classNamesByCategory |
|
4383 |
stx_libview classNamesByCategory |
|
15124 | 4384 |
stx_libjava classNamesByCategory |
12545 | 4385 |
" |
4386 |
||
4387 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
15916 | 4388 |
"Modified: / 28-01-2014 / 21:40:23 / cg" |
12545 | 4389 |
! |
4390 |
||
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4391 |
commonSymbolsFlag |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4392 |
"only for libraries" |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4393 |
|
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4394 |
^ '' |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4395 |
! |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4396 |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4397 |
filenameForClass:classNameOrClass |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4398 |
"answer the base filename of the class without suffix" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4399 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4400 |
"/ "enable this code if you want to convert old filenames to new filenames. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4401 |
"/ See also: #generateRemoveShellScriptOn: and #generateRenamShellScriptOn:" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4402 |
"/ classNameOrClass isBehavior ifTrue:[ |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4403 |
"/ ^ classNameOrClass generateClassFilename. |
13419 | 4404 |
"/ ] ifFalse:[ |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4405 |
"/ |cls| |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4406 |
"/ |
13419 | 4407 |
"/ cls := Smalltalk classNamed:classNameOrClass. |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4408 |
"/ cls notNil ifTrue:[ |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4409 |
"/ ^ cls generateClassFilename. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4410 |
"/ ]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4411 |
"/ ]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4412 |
"/ "end special code" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4413 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4414 |
^ Smalltalk fileNameForClass:classNameOrClass. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4415 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4416 |
" |
23124 | 4417 |
self filenameForClass:HTML::Encoder |
4418 |
Smalltalk fileNameForClass:HTML::Encoder |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4419 |
" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4420 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4421 |
"Created: / 08-08-2006 / 20:17:28 / fm" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4422 |
"Modified: / 20-10-2006 / 16:22:58 / cg" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4423 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4424 |
|
13419 | 4425 |
generateClassLines:classLineTemplate |
12771
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4426 |
"for the init-file: generate class-init-lines for all classes" |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4427 |
|
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4428 |
^ self generateClassLines:classLineTemplate forClasses:(self compiled_classNames_common) |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4429 |
! |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4430 |
|
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4431 |
generateClassLines:classLineTemplate forClasses:classNames |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4432 |
"for the init-file: generate class-init-lines for a collection of classes" |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4433 |
|
13419 | 4434 |
^ self generateClassLines:classLineTemplate forClasses:classNames includeAdditionalClasses:true |
12804
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4435 |
! |
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4436 |
|
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4437 |
generateClassLines:classLineTemplate forClasses:classNames includeAdditionalClasses:includeAdditionalClasses |
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4438 |
"for the init-file: generate class-init-lines for a collection of classes" |
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4439 |
|
13419 | 4440 |
^ String |
23124 | 4441 |
streamContents:[:s | |
4442 |
|classesLoaded classNamesUnloaded classNamesSorted putLineForClassName| |
|
4443 |
||
4444 |
putLineForClassName := |
|
4445 |
[:className | |
|
4446 |
|newClassLine mappings| |
|
4447 |
||
4448 |
mappings := self classLine_mappings:className. |
|
4449 |
newClassLine := self replaceMappings:mappings in:classLineTemplate. |
|
4450 |
s nextPutLine:newClassLine |
|
4451 |
]. |
|
4452 |
classesLoaded := classNames collect:[:eachClassName | Smalltalk classNamed:eachClassName] |
|
4453 |
thenSelect:[:eachClass | eachClass notNil and:[eachClass isLoaded]]. |
|
4454 |
classNamesUnloaded := classNames |
|
4455 |
select:[:nm | |
|
4456 |
|cls| |
|
4457 |
||
4458 |
cls := Smalltalk classNamed:nm. |
|
4459 |
cls isNil or:[ cls isLoaded not ] |
|
4460 |
]. |
|
4461 |
classNamesSorted := (Class classesSortedByLoadOrder:classesLoaded) collect:[:cls | cls name]. |
|
4462 |
classNamesSorted do:putLineForClassName. |
|
4463 |
classNamesUnloaded do:putLineForClassName. |
|
4464 |
||
4465 |
includeAdditionalClasses ifTrue:[ |
|
4466 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) |
|
4467 |
do:[:nm :attr | |
|
4468 |
(attr isEmptyOrNil or:[ (attr includes:#autoload) not ]) ifTrue:[ |
|
4469 |
putLineForClassName value:nm. |
|
4470 |
]. |
|
4471 |
]. |
|
4472 |
#( ('UNIX' unix) |
|
4473 |
('WIN32' win32) |
|
4474 |
('OSX' osx) |
|
4475 |
('VMS' vms) |
|
4476 |
('BEOS' beos) ) |
|
4477 |
pairsDo:[:ifdef :platformName | |
|
4478 |
|archClassNames archClassesLoaded| |
|
4479 |
||
4480 |
archClassNames := self compiled_classNamesForPlatform:platformName. |
|
4481 |
archClassNames notEmpty ifTrue:[ |
|
4482 |
s nextPutLine:'#ifdef ' , ifdef. |
|
4483 |
archClassNames do:[:clsName | |
|
4484 |
putLineForClassName value:clsName |
|
4485 |
]. |
|
4486 |
s nextPutLine:'#endif /* ' , ifdef , ' */'. |
|
4487 |
]. |
|
4488 |
]. |
|
4489 |
] |
|
4490 |
] |
|
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4491 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4492 |
" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4493 |
bosch_dapasx_datenbasis generateClassLines_libInit_dot_cc |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4494 |
bosch_dapasx_kernel generateClassLines_libInit_dot_cc |
10010 | 4495 |
stx_libbasic3 generateClassLines_libInit_dot_cc |
4496 |
" |
|
4497 |
||
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4498 |
"Modified: / 16-08-2006 / 18:52:10 / User" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4499 |
"Created: / 19-09-2006 / 22:47:50 / cg" |
9979
e2e247d73233
oops - libInit forgot non-loaded, alien-OS files.
Claus Gittinger <cg@exept.de>
parents:
9972
diff
changeset
|
4500 |
"Modified: / 20-09-2006 / 11:47:25 / cg" |
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4501 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4502 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4503 |
generateClassLines_libInit_dot_cc |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4504 |
^ self generateClassLines:(self classLine_libInit_dot_cc) |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4505 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4506 |
" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4507 |
bosch_dapasx_datenbasis generateClassLines_libInit_dot_cc |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4508 |
bosch_dapasx_kernel generateClassLines_libInit_dot_cc |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4509 |
stx_libbasic3 generateClassLines_libInit_dot_cc |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4510 |
" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4511 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4512 |
"Created: / 09-08-2006 / 11:21:48 / fm" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4513 |
"Modified: / 16-08-2006 / 18:52:10 / User" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4514 |
"Modified: / 19-09-2006 / 22:48:14 / cg" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4515 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4516 |
|
13419 | 4517 |
generateClasses_make_dot_spec |
12545 | 4518 |
|classNamesDict| |
4519 |
||
4520 |
classNamesDict := self classNamesByCategory. |
|
4521 |
||
4522 |
^ String streamContents:[:s | |
|
23124 | 4523 |
classNamesDict keysAndValuesDo:[:eachCategory :classNames| |
4524 |
s nextPutLine:eachCategory,'_CLASSES= \'. |
|
4525 |
classNames do:[:eachClassName| |
|
4526 |
s tab; nextPutAll:eachClassName; nextPutLine:' \'. |
|
4527 |
]. |
|
4528 |
s cr. |
|
4529 |
]. |
|
4530 |
s cr. |
|
12545 | 4531 |
]. |
4532 |
||
4533 |
" |
|
4534 |
stx_libbasic generateClasses_make_dot_spec |
|
4535 |
stx_libbasic3 generateClasses_make_dot_spec |
|
4536 |
stx_libview generateClasses_make_dot_spec |
|
4537 |
stx_libboss generateClasses_make_dot_spec |
|
4538 |
" |
|
4539 |
||
4540 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
4541 |
"Modified: / 20-10-2006 / 16:18:54 / cg" |
|
4542 |
! |
|
4543 |
||
19309 | 4544 |
generateDefinitionClassLine_libInit_dot_cc |
4545 |
"for the init-file: generate a single class-init-line for the definition class itself" |
|
4546 |
||
4547 |
^ self |
|
23124 | 4548 |
generateClassLines:(self classLine_libInit_dot_cc) |
4549 |
forClasses:(Array with:self name) |
|
4550 |
includeAdditionalClasses:false |
|
19309 | 4551 |
|
4552 |
" |
|
4553 |
stx_libbasic generateDefinitionClassLine_libInit_dot_cc |
|
4554 |
" |
|
4555 |
! |
|
4556 |
||
13419 | 4557 |
generateDependencies:whichArchitecture |
4558 |
^ String |
|
23124 | 4559 |
streamContents:[:s | |
4560 |
|classNames classesPresent classesLoaded clsBaseName putDependencyForClassBlock |
|
4561 |
putDependencyForClassBaseNameBlock |
|
4562 |
archClassNames archClassesPresent archClassesLoaded |
|
4563 |
putSingleClassDependencyEntryBlock putDependencyForExtensionsBlock classSortBlock| |
|
4564 |
||
4565 |
classSortBlock := [ :a :b| |
|
4566 |
a package == b package ifTrue:[ |
|
4567 |
a name < b name |
|
4568 |
] ifFalse:[ |
|
4569 |
a package < b package |
|
4570 |
]. |
|
4571 |
]. |
|
4572 |
||
4573 |
putSingleClassDependencyEntryBlock := [:cls | |
|
4574 |
|sclsBaseName| |
|
4575 |
||
4576 |
s nextPutAll:' $(INCLUDE_TOP)'. |
|
4577 |
s nextPutAll:(self pathSeparator:whichArchitecture). |
|
4578 |
sclsBaseName := self filenameForClass:cls. |
|
4579 |
s nextPutAll:(self |
|
4580 |
topRelativePathTo:sclsBaseName |
|
4581 |
inPackage:cls package |
|
4582 |
architecture:whichArchitecture). |
|
4583 |
s nextPutAll:'.$(H)'. |
|
4584 |
]. |
|
4585 |
||
4586 |
putDependencyForClassBaseNameBlock := [:clsBaseName | |
|
4587 |
s nextPutAll:('$(OUTDIR)',clsBaseName,'.$(O)'). |
|
4588 |
s nextPutAll:' '. |
|
4589 |
s nextPutAll:(clsBaseName,'.$(C)'). |
|
4590 |
s nextPutAll:' '. |
|
4591 |
s nextPutAll:clsBaseName. |
|
4592 |
s nextPutAll:'.$(H)'. |
|
4593 |
s nextPutAll:': '. |
|
4594 |
s nextPutAll:clsBaseName. |
|
4595 |
s nextPutAll:'.st'. |
|
4596 |
]. |
|
4597 |
||
4598 |
||
4599 |
putDependencyForClassBlock := [:cls | |
|
4600 |
|clsBaseName classes| |
|
4601 |
||
4602 |
clsBaseName := self filenameForClass:cls. |
|
4603 |
putDependencyForClassBaseNameBlock value:clsBaseName. |
|
4604 |
cls isLoaded ifTrue:[ |
|
4605 |
classes := IdentitySet new. |
|
4606 |
cls |
|
4607 |
sharedPools do:[:poolClass | |
|
4608 |
poolClass isNil ifTrue:[ |
|
4609 |
Dialog warn:'At least one pool class is missing.\\Dependencies are incomplete.' withCRs |
|
4610 |
] ifFalse:[ |
|
4611 |
classes add:poolClass. |
|
4612 |
] |
|
4613 |
]. |
|
4614 |
||
4615 |
cls |
|
4616 |
allSuperclassesDo:[:scls | |
|
4617 |
classes add:scls. |
|
4618 |
]. |
|
4619 |
cls |
|
4620 |
allPrivateClassesDo:[:eachPrivateClass | |
|
4621 |
eachPrivateClass |
|
4622 |
allSuperclassesDo:[:scls | |
|
4623 |
|sclsBaseName| |
|
4624 |
||
4625 |
scls ~~ cls ifTrue:[ |
|
4626 |
scls isPrivate ifFalse:[ |
|
4627 |
(classes includes:scls) ifFalse:[ |
|
4628 |
classes add:scls. |
|
4629 |
]. |
|
4630 |
]. |
|
4631 |
]. |
|
4632 |
] |
|
4633 |
]. |
|
4634 |
"/ Sort them to get stable order to avoid false conflicts |
|
4635 |
classes := classes asSortedCollection:classSortBlock. |
|
4636 |
classes do:[:each | putSingleClassDependencyEntryBlock value:each]. |
|
4637 |
]. |
|
4638 |
s nextPutLine:' $(STCHDR)'. |
|
4639 |
]. |
|
4640 |
||
4641 |
putDependencyForExtensionsBlock := [ |
|
4642 |
| classes | |
|
4643 |
||
4644 |
s nextPutAll:'$(OUTDIR)extensions.$(O): extensions.st'. |
|
4645 |
classes := Set new. |
|
4646 |
self extensionMethodNames pairWiseDo:[:className :selector | |
|
4647 |
|mthdCls cls| |
|
4648 |
||
4649 |
((mthdCls := Smalltalk classNamed:className) notNil |
|
4650 |
and:[ mthdCls isLoaded ]) |
|
4651 |
ifTrue:[ |
|
4652 |
cls := mthdCls theNonMetaclass. |
|
4653 |
(classes includes:cls) ifFalse:[ |
|
4654 |
cls |
|
4655 |
withAllSuperclassesDo:[:scls | |
|
4656 |
(classes includes:scls) ifFalse:[ |
|
4657 |
classes add:scls. |
|
4658 |
]. |
|
4659 |
]. |
|
4660 |
]. |
|
4661 |
]. |
|
4662 |
]. |
|
4663 |
"/ Sort them to get stable order to avoid false conflicts |
|
4664 |
classes := classes asSortedCollection:classSortBlock. |
|
4665 |
classes do:[:each | putSingleClassDependencyEntryBlock value:each]. |
|
4666 |
s nextPutLine:' $(STCHDR)'. |
|
4667 |
]. |
|
4668 |
||
4669 |
classNames := self compiled_classNames_common. |
|
4670 |
classesPresent := classNames |
|
4671 |
collect:[:className | Smalltalk classNamed:className] |
|
4672 |
thenSelect:[:cls | cls notNil]. |
|
4673 |
classesLoaded := classesPresent select:[:cls | cls isLoaded]. |
|
4674 |
||
4675 |
(Class classesSortedByLoadOrder:classesLoaded) do:putDependencyForClassBlock. |
|
4676 |
classesPresent reject:[:cls | cls isLoaded] thenDo:putDependencyForClassBlock. |
|
4677 |
||
4678 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) |
|
4679 |
do:[:className :attr | |
|
4680 |
|cls| |
|
4681 |
||
4682 |
(attr isEmptyOrNil or:[ (attr includes:#autoload) not ]) ifTrue:[ |
|
4683 |
((cls := Smalltalk classNamed:className) notNil) ifTrue:[ |
|
4684 |
putDependencyForClassBlock value:cls. |
|
4685 |
] |
|
4686 |
]. |
|
4687 |
]. |
|
4688 |
archClassNames := self compiled_classNamesForPlatform:whichArchitecture. |
|
4689 |
archClassesPresent := archClassNames |
|
4690 |
collect:[:className | Smalltalk classNamed:className] |
|
4691 |
thenSelect:[:cls | cls notNil]. |
|
4692 |
||
4693 |
archClassesLoaded := archClassesPresent select:[:cls | cls isLoaded]. |
|
4694 |
||
4695 |
(Class classesSortedByLoadOrder:archClassesLoaded) |
|
4696 |
do:putDependencyForClassBlock. |
|
4697 |
||
4698 |
"some classes are not loaded - probably this is the wrong architecture. |
|
4699 |
Sorry, but for these classes, we do not know the superclass chain" |
|
4700 |
archClassesPresent |
|
4701 |
select:[:cls | cls isLoaded not] |
|
4702 |
thenDo:putDependencyForClassBlock. |
|
4703 |
||
4704 |
"for the following classes, we do not know the superclass chain |
|
4705 |
and neither the real class file name" |
|
4706 |
archClassNames |
|
4707 |
select:[:eachClassName | (Smalltalk classNamed:eachClassName) isNil] |
|
4708 |
thenDo:[:eachClassName | |
|
4709 |
putDependencyForClassBaseNameBlock value:(self filenameForClass:eachClassName). |
|
4710 |
s nextPutLine:' $(STCHDR)'. |
|
4711 |
]. |
|
4712 |
||
4713 |
self hasExtensionMethods ifTrue:putDependencyForExtensionsBlock. |
|
4714 |
] |
|
9887 | 4715 |
|
4716 |
" |
|
4717 |
stx_libbasic3 generateDependencies:#unix |
|
10010 | 4718 |
stx_libbasic3 generateDependencies:#win32 |
4719 |
" |
|
4720 |
||
9887 | 4721 |
"Created: / 14-09-2006 / 12:38:57 / cg" |
13798
894c48237cd5
changed: #generateDependencies:
Claus Gittinger <cg@exept.de>
parents:
13797
diff
changeset
|
4722 |
"Modified: / 27-10-2011 / 16:35:59 / cg" |
16163 | 4723 |
"Modified: / 27-02-2014 / 22:34:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9887 | 4724 |
! |
4725 |
||
4726 |
generateDependencies_unix |
|
4727 |
^ self generateDependencies:#unix |
|
4728 |
||
4729 |
" |
|
4730 |
stx_libbasic3 generateDependencies:#unix |
|
4731 |
stx_libbasic3 generateDependencies:#win32 |
|
4732 |
" |
|
4733 |
||
4734 |
"Modified: / 14-09-2006 / 13:32:34 / cg" |
|
4735 |
! |
|
4736 |
||
4737 |
generateDependencies_win32 |
|
4738 |
^ self generateDependencies:#win32 |
|
4739 |
||
4740 |
"Created: / 14-09-2006 / 12:39:18 / cg" |
|
4741 |
! |
|
4742 |
||
19309 | 4743 |
generateExternalDeclarationLines_libInit_dot_cc |
4744 |
"for the init-file: generate a single external definition for a single class for the definition class itself" |
|
4745 |
||
4746 |
^ self |
|
23124 | 4747 |
generateClassLines:(self classExternalDeclarationLine_libInit_dot_cc) |
19309 | 4748 |
|
4749 |
" |
|
4750 |
stx_libbasic generateExternalDeclarationLines_libInit_dot_cc |
|
4751 |
" |
|
4752 |
! |
|
4753 |
||
9956 | 4754 |
generateLocalIncludes_unix |
4755 |
^ String streamContents:[:s | |
|
23124 | 4756 |
s nextPutAll:(self localIncludes_unix). |
4757 |
self searchForProjectsWhichProvideHeaderFiles asSortedCollection |
|
4758 |
do:[:includeProject | |
|
4759 |
s nextPutAll:' -I$(INCLUDE_TOP)/',(self topRelativePathToPackage:includeProject withSeparator:'/') |
|
4760 |
] |
|
9956 | 4761 |
] |
4762 |
||
4763 |
" |
|
4764 |
bosch_dapasx generateLocalIncludes_unix |
|
13419 | 4765 |
bosch_dapasx_datenbasis generateLocalIncludes_unix |
4766 |
stx_libbasic generateLocalIncludes_unix |
|
4767 |
stx_libview generateLocalIncludes_unix |
|
4768 |
stx_libtool2 generateLocalIncludes_unix |
|
4769 |
stx_libui generateLocalIncludes_unix |
|
14939 | 4770 |
cg_demos_helloWorld localIncludes_unix |
9956 | 4771 |
" |
4772 |
||
4773 |
"Created: / 09-08-2006 / 16:46:49 / fm" |
|
10251 | 4774 |
"Modified: / 07-12-2006 / 17:47:06 / cg" |
15950 | 4775 |
"Modified: / 25-11-2013 / 16:40:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9956 | 4776 |
! |
4777 |
||
9887 | 4778 |
generateLocalIncludes_win32 |
4779 |
^ String streamContents:[:s | |
|
23124 | 4780 |
s nextPutAll:(self localIncludes_win32). |
4781 |
self searchForProjectsWhichProvideHeaderFiles asSortedCollection |
|
4782 |
do:[:includeProject | |
|
4783 |
s nextPutAll:' -I$(INCLUDE_TOP)\',(self topRelativePathToPackage:includeProject withSeparator:'\') |
|
4784 |
] |
|
9887 | 4785 |
] |
4786 |
||
4787 |
" |
|
4788 |
bosch_dapasx_application generateLocalIncludes_win32 |
|
13419 | 4789 |
bosch_dapasx_datenbasis generateLocalIncludes_win32 |
4790 |
stx_libbasic generateLocalIncludes_win32 |
|
4791 |
stx_libview generateLocalIncludes_win32 |
|
4792 |
stx_libtool2 generateLocalIncludes_win32 |
|
9887 | 4793 |
" |
4794 |
||
4795 |
"Created: / 09-08-2006 / 16:46:49 / fm" |
|
10251 | 4796 |
"Modified: / 07-12-2006 / 17:47:10 / cg" |
15950 | 4797 |
"Modified: / 25-11-2013 / 16:40:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9887 | 4798 |
! |
4799 |
||
13419 | 4800 |
generateObjects_make_dot_spec |
12545 | 4801 |
|classNamesDict| |
4802 |
||
4803 |
classNamesDict := self classNamesByCategory. |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
4804 |
|
9817 | 4805 |
^ String streamContents:[:s | |
23124 | 4806 |
|putLineForClassName| |
4807 |
||
4808 |
putLineForClassName := |
|
4809 |
[:eachClassName | |
|
4810 |
|mappings newObjectLine| |
|
4811 |
mappings := self objectLine_make_dot_spec_mappings: eachClassName. |
|
4812 |
newObjectLine := self replaceMappings: mappings in: self objectLine_make_dot_spec. |
|
4813 |
s nextPutLine:newObjectLine. |
|
4814 |
]. |
|
4815 |
||
4816 |
classNamesDict keysAndValuesDo:[:eachCategory :classNames| |
|
4817 |
s nextPutLine:eachCategory,'_OBJS= \'. |
|
4818 |
classNames do:putLineForClassName. |
|
4819 |
(eachCategory = 'COMMON' and:[self hasExtensionMethods]) ifTrue:[ |
|
4820 |
s nextPutLine:' $(OUTDIR)extensions.$(O) \'. |
|
4821 |
]. |
|
4822 |
||
4823 |
s cr. |
|
4824 |
]. |
|
4825 |
s cr. |
|
12545 | 4826 |
]. |
9817 | 4827 |
|
4828 |
" |
|
12545 | 4829 |
stx_libbasic generateObjects_make_dot_spec |
9817 | 4830 |
stx_libbasic3 generateObjects_make_dot_spec |
12545 | 4831 |
stx_libview generateObjects_make_dot_spec |
4832 |
stx_libboss generateObjects_make_dot_spec |
|
9817 | 4833 |
" |
4834 |
||
4835 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
10103
f63f419f9e27
some care for incomplete information bein present when
Claus Gittinger <cg@exept.de>
parents:
10086
diff
changeset
|
4836 |
"Modified: / 20-10-2006 / 16:18:54 / cg" |
9887 | 4837 |
! |
4838 |
||
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4839 |
generateRequiredMakePrerequisites_bc_dot_mak |
11380
ac50ce4321b5
Fix prerequisite makes (pushd)
Stefan Vogel <sv@exept.de>
parents:
11377
diff
changeset
|
4840 |
|myProjectId| |
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4841 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4842 |
^ String streamContents:[:s | |
23124 | 4843 |
myProjectId := self package. |
4844 |
"Note: the trailing blank in 'CFLAGS_LOCAL=$(GLOBALDEFINES) ' |
|
4845 |
is required!! |
|
4846 |
Use 'pushd' instead of 'cd', since cd is executed by borland make directly. |
|
4847 |
'popd' is not needed, since each line is executed in |
|
4848 |
an own cmd.exe process. |
|
4849 |
'popd' is not desireable, since it masks a possible |
|
4850 |
error return from the 'bmake'. |
|
4851 |
" |
|
4852 |
||
4853 |
"cg: changed to not go and remake librun" |
|
4854 |
(self allPreRequisitesSorted:#effectiveMandatoryPreRequisites "#effectivePreRequisites") do:[:eachProjectId | |
|
4855 |
s tab; nextPutAll:'pushd '; |
|
4856 |
nextPutAll:(self msdosPathToPackage:eachProjectId from:myProjectId); |
|
4857 |
nextPutLine:' & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "'. |
|
4858 |
]. |
|
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4859 |
]. |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4860 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4861 |
" |
13419 | 4862 |
exept_expecco_application generateRequiredMakePrerequisites_bc_dot_mak |
4863 |
alspa_batch_application generateRequiredMakePrerequisites_bc_dot_mak |
|
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4864 |
" |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4865 |
! |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4866 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4867 |
generateRequiredMakePrerequisites_make_dot_proto |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4868 |
|libPath| |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4869 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4870 |
^ String streamContents:[:s | |
23124 | 4871 |
"cg: changed to not go and remake librun" |
4872 |
(self allPreRequisitesSorted:#effectiveMandatoryPreRequisites "#effectivePreRequisites") do:[:projectID | |
|
4873 |
libPath := self pathToPackage:projectID withSeparator:'/'. |
|
4874 |
s tab; nextPutAll: 'cd ', libPath; nextPutLine:' && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "'. |
|
4875 |
]. |
|
4876 |
||
4877 |
s cr. |
|
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4878 |
]. |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4879 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4880 |
" |
13419 | 4881 |
exept_expecco_application generateRequiredMakePrerequisites_make_dot_proto |
4882 |
alspa_batch_application generateRequiredMakePrerequisites_make_dot_proto |
|
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4883 |
" |
19290 | 4884 |
|
4885 |
"Modified: / 03-03-2016 / 21:23:31 / cg" |
|
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4886 |
! |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4887 |
|
14882 | 4888 |
generateRequiredMakeReferences_bc_dot_mak |
4889 |
|myProjectId preRequisites| |
|
4890 |
||
4891 |
myProjectId := self package. |
|
4892 |
"Note: the trailing blank in 'CFLAGS_LOCAL=$(GLOBALDEFINES) ' |
|
4893 |
is required!! |
|
4894 |
Use 'pushd' instead of 'cd', since cd is executed by borland make directly. |
|
4895 |
'popd' is not needed, since each line is executed in |
|
23124 | 4896 |
an own cmd.exe process. |
14882 | 4897 |
'popd' is not desierable, since it masks a possible |
23124 | 4898 |
error return from the 'bmake'. |
14882 | 4899 |
" |
4900 |
||
4901 |
preRequisites := self allPreRequisitesSorted:#effectivePreRequisites. |
|
4902 |
"these have been already built in preReq" |
|
4903 |
preRequisites removeAllFoundIn:(self allPreRequisites:#mandatoryPreRequisites). |
|
4904 |
||
4905 |
^ String streamContents:[:s | |
|
23124 | 4906 |
preRequisites do:[:eachProjectId | |
4907 |
s tab; nextPutAll:'pushd '; |
|
4908 |
nextPutAll:(self msdosPathToPackage:eachProjectId from:myProjectId); |
|
4909 |
nextPutLine:' & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "'. |
|
4910 |
]. |
|
14882 | 4911 |
]. |
4912 |
||
4913 |
" |
|
4914 |
exept_expecco_application generateRequiredMakeReferences_bc_dot_mak |
|
4915 |
alspa_batch_application generateRequiredMakeReferences_bc_dot_mak |
|
4916 |
" |
|
4917 |
! |
|
4918 |
||
4919 |
generateRequiredMakeReferences_make_dot_proto |
|
4920 |
|libPath preRequisites| |
|
4921 |
||
4922 |
preRequisites := self allPreRequisitesSorted:#effectivePreRequisites. |
|
4923 |
"these have been already built in preReq" |
|
4924 |
preRequisites removeAllFoundIn:(self allPreRequisites:#mandatoryPreRequisites). |
|
4925 |
||
4926 |
^ String streamContents:[:s | |
|
23124 | 4927 |
preRequisites do:[:projectID | |
4928 |
libPath := self pathToPackage:projectID withSeparator:'/'. |
|
4929 |
s tab; nextPutAll: 'cd ', libPath; nextPutLine:' && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "'. |
|
4930 |
]. |
|
4931 |
||
4932 |
s cr. |
|
14882 | 4933 |
]. |
4934 |
||
4935 |
" |
|
4936 |
exept_expecco_application generateRequiredMakeReferences_make_dot_proto |
|
4937 |
alspa_batch_application generateRequiredMakeReferences_make_dot_proto |
|
4938 |
" |
|
19290 | 4939 |
|
4940 |
"Modified: / 03-03-2016 / 21:23:45 / cg" |
|
14882 | 4941 |
! |
4942 |
||
10022 | 4943 |
generateSubDirectories |
4944 |
^ String streamContents:[:s | |
|
23124 | 4945 |
self subProjects |
4946 |
do:[:eachProjectID | |
|
4947 |
s space; nextPutAll:(self pathToPackage:eachProjectID from:self package withSeparator:'/') |
|
4948 |
] |
|
10022 | 4949 |
] |
4950 |
||
4951 |
" |
|
10380
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
4952 |
exept_expecco generateSubDirectories |
10022 | 4953 |
" |
4954 |
||
4955 |
"Created: / 09-08-2006 / 11:26:59 / fm" |
|
4956 |
"Modified: / 14-09-2006 / 18:46:18 / cg" |
|
4957 |
! |
|
4958 |
||
12771
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4959 |
generate_definitionClassLine_libInit_dot_cc |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4960 |
"for the init-file: generate a single class-init-line for the definition class itself" |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4961 |
|
13419 | 4962 |
^ self |
23124 | 4963 |
generateClassLines:(self classLine_libInit_dot_cc) |
4964 |
forClasses:(Array with:self name) |
|
4965 |
includeAdditionalClasses:false |
|
12804
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4966 |
|
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4967 |
" |
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4968 |
stx_libbasic generate_definitionClassLine_libInit_dot_cc |
12771
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4969 |
" |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4970 |
! |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4971 |
|
10022 | 4972 |
headerFileOutputArg |
20590 | 4973 |
"Every header file is left locally in its lib-dir" |
4974 |
||
13875
2e01d09fa4c4
-headerDir= instead of --headerDir=
Claus Gittinger <cg@exept.de>
parents:
13873
diff
changeset
|
4975 |
^ '-headerDir=.' |
10022 | 4976 |
! |
4977 |
||
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4978 |
objectLine_make_dot_spec_mappings: aClassName |
13419 | 4979 |
^ Dictionary new |
23124 | 4980 |
at: 'CLASSFILE' put:(self filenameForClass:aClassName); |
4981 |
yourself |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4982 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4983 |
"Created: / 08-08-2006 / 20:17:28 / fm" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4984 |
"Modified: / 09-08-2006 / 18:26:52 / fm" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4985 |
"Modified: / 20-10-2006 / 16:22:58 / cg" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4986 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4987 |
|
9887 | 4988 |
subProjectBmakeCalls |
12439 | 4989 |
"generate submake-calls for borland bcc" |
4990 |
||
13419 | 4991 |
^ self subProjectMakeCallsUsing:'call bmake %1 %2'. |
12438
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
4992 |
! |
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
4993 |
|
14334 | 4994 |
subProjectLCCmakeCalls |
4995 |
"generate submake-calls for lcc" |
|
4996 |
||
4997 |
^ self subProjectMakeCallsUsing:'call lccmake %1 %2'. |
|
4998 |
||
4999 |
"Created: / 03-09-2012 / 19:49:08 / cg" |
|
12438
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
5000 |
! |
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
5001 |
|
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
5002 |
subProjectMakeCallsUsing:callString |
20703 | 5003 |
"for xxxmake.bat files" |
23124 | 5004 |
|
9887 | 5005 |
^ String streamContents:[:s | |
23124 | 5006 |
(self effectiveSubProjects:#win32) do:[:packageID | |
5007 |
|pkgLabel skipLabel joinLabel| |
|
5008 |
||
5009 |
pkgLabel := (packageID copyReplaceAll:$: with:$_) copyReplaceAll:$/ with:$_. |
|
5010 |
skipLabel := 'skip_',pkgLabel. |
|
5011 |
joinLabel := 'done_',pkgLabel. |
|
5012 |
s nextPutLine:'@if not exist ',(self msdosPathToPackage:packageID from:(self package)),' goto ',skipLabel. |
|
5013 |
s nextPutLine:'@echo "***********************************"'. |
|
5014 |
s nextPutLine:'@echo "Building ',(packageID copyReplaceAll:$: with:$/),'"'. |
|
5015 |
s nextPutLine:'@echo "***********************************"'. |
|
5016 |
s nextPutLine:'@pushd ', (self msdosPathToPackage:packageID from:(self package)). |
|
5017 |
s nextPutAll:'@'; nextPutAll:callString; nextPutLine:' || exit /b "%errorlevel%"'. |
|
5018 |
s nextPutLine:'@popd'. |
|
5019 |
s nextPutLine:'@goto ',joinLabel. |
|
5020 |
s nextPutLine:':',skipLabel. |
|
5021 |
s nextPutLine:'@echo "###################################"'. |
|
5022 |
s nextPutLine:'@echo "FOLDER MISSING: ',(packageID copyReplaceAll:$: with:$/),'"'. |
|
5023 |
s nextPutLine:'@echo "###################################"'. |
|
5024 |
s nextPutLine:'exit /b 1'. |
|
5025 |
s nextPutLine:':',joinLabel. |
|
5026 |
s cr. |
|
5027 |
] |
|
9887 | 5028 |
] |
5029 |
||
5030 |
"Created: / 14-09-2006 / 18:40:09 / cg" |
|
13734 | 5031 |
"Modified: / 27-09-2011 / 19:36:12 / cg" |
21259 | 5032 |
"Modified: / 17-01-2017 / 16:32:45 / stefan" |
11937 | 5033 |
! |
5034 |
||
14345 | 5035 |
subProjectMingwmakeCalls |
5036 |
"generate submake-calls for mingw" |
|
5037 |
||
5038 |
^ self subProjectMakeCallsUsing:'call mingwmake %1 %2'. |
|
5039 |
||
5040 |
"Created: / 05-09-2012 / 19:45:53 / cg" |
|
5041 |
! |
|
5042 |
||
14334 | 5043 |
subProjectTCCmakeCalls |
5044 |
"generate submake-calls for tcc" |
|
5045 |
||
5046 |
^ self subProjectMakeCallsUsing:'call tccmake %1 %2'. |
|
5047 |
||
5048 |
"Created: / 03-09-2012 / 19:50:53 / cg" |
|
5049 |
! |
|
5050 |
||
11937 | 5051 |
subProjectVCmakeCalls |
12439 | 5052 |
"generate submake-calls for visual-C" |
5053 |
||
13419 | 5054 |
^ self subProjectMakeCallsUsing:'call vcmake %1 %2'. |
9817 | 5055 |
! ! |
5056 |
||
23452 | 5057 |
|
12364 | 5058 |
!ProjectDefinition class methodsFor:'file templates'! |
5059 |
||
13177 | 5060 |
autopackage_default_dot_apspec |
5061 |
"for linux's autopackage" |
|
5062 |
||
5063 |
^ |
|
5064 |
'# -*- shell-script -*- |
|
5065 |
[Meta] |
|
5066 |
ShortName: %(APPLICATION) |
|
5067 |
SoftwareVersion: %(PRODUCT_VERSION) |
|
5068 |
DisplayName: %(DESCRIPTION) |
|
20550 | 5069 |
RootName: %(PRODUCT_ROOT_NAME) |
13177 | 5070 |
Summary: %(DESCRIPTION) |
5071 |
Maintainer: %(MAINTAINER) |
|
5072 |
Packager: %(PACKAGER) |
|
5073 |
PackageVersion: 1 |
|
20550 | 5074 |
CPUArchitectures: %(PRODUCT_CPU_VERSIONS) |
13177 | 5075 |
AutopackageTarget: 1.0 |
5076 |
Type: %(PRODUCT_TYPE) |
|
13419 | 5077 |
License: %(PRODUCT_LICENSE) |
13177 | 5078 |
|
5079 |
[Description] |
|
5080 |
%(PRODUCT_DESCRIPTION) |
|
5081 |
||
5082 |
[BuildPrepare] |
|
5083 |
# If you''re using autotools, the default should be enough. |
|
5084 |
# prepareBuild will set up apbuild and run configure for you. If you |
|
5085 |
# need to pass arguments to configure, just add them to prepareBuild: |
|
5086 |
# prepareBuild --enable-foo --disable-bar |
|
5087 |
#prepareBuild |
|
5088 |
||
5089 |
[BuildUnprepare] |
|
5090 |
# If you''re using prepareBuild above, there is no need to change this!! |
|
5091 |
#unprepareBuild |
|
5092 |
||
5093 |
[Globals] |
|
5094 |
# Variables declared in this section will be available in all other sections |
|
5095 |
export APKG_BUILD_SKIP_CONFIGURE=1 |
|
5096 |
export APKG_BUILD_SKIP_MAKE=1 |
|
5097 |
export MYPREFIX=/opt/%(APPLICATION) |
|
5098 |
||
5099 |
[Prepare] |
|
5100 |
#recommend ''@autopackage.org/autopackage-gtk'' 1 |
|
5101 |
||
5102 |
[Imports] |
|
5103 |
import <<EOF |
|
5104 |
$source_dir/%(APPLICATION) |
|
20550 | 5105 |
%(ADDITIONAL_SOURCE_DIRS) |
13177 | 5106 |
EOF |
5107 |
||
5108 |
for i in $source_dir/*.so |
|
5109 |
do |
|
5110 |
echo $source_dir/$(readlink $i) |
|
5111 |
done | import |
|
5112 |
||
5113 |
[Install] |
|
5114 |
if [ "$PREFIX" !!= "/usr" ] |
|
5115 |
then |
|
5116 |
export MYPREFIX=$PREFIX |
|
5117 |
fi |
|
5118 |
||
5119 |
find . -type d \( -name CVS -or -name ''not_*'' \) -print | xargs rm -rf |
|
5120 |
mkdir -p $MYPREFIX |
|
23440 | 5121 |
copyFiles %(PRODUCT_NAME) *.rc resources $MYPREFIX/bin |
20550 | 5122 |
%(ADDITIONAL_COPYFILES) |
5123 |
||
5124 |
#installExe %(PRODUCT_NAME) |
|
13177 | 5125 |
#installLib *.so |
20550 | 5126 |
%(ADDITIONAL_INSTALL) |
13177 | 5127 |
|
5128 |
[Uninstall] |
|
5129 |
# Leaving this at the default is safe unless you use custom commands in |
|
5130 |
# "Install" to create files. All autopackage API functions |
|
5131 |
# that installs files are logged. |
|
5132 |
uninstallFromLog |
|
5133 |
' |
|
5134 |
||
5135 |
"Created: / 21-12-2010 / 09:06:21 / cg" |
|
5136 |
! |
|
5137 |
||
12364 | 5138 |
bc_dot_mak |
5139 |
"answer a template for the bc.mak makefile. |
|
5140 |
Any variable definition %(Variable) will be later replaced by the mapping. |
|
5141 |
$% characters have to be duplicated. |
|
5142 |
Only needed for WIN" |
|
5143 |
||
5144 |
^ self subclassResponsibility |
|
5145 |
! |
|
5146 |
||
5147 |
bmake_dot_mak |
|
17186 | 5148 |
"the template code for the bmake.bat file |
5149 |
Notice: duplicate %'s if they are needed as such in the generated file" |
|
12364 | 5150 |
|
13419 | 5151 |
^ |
12364 | 5152 |
'@REM ------- |
14336 | 5153 |
@REM make using Borland bcc32 |
12364 | 5154 |
@REM type bmake, and wait... |
5155 |
@REM do not edit - automatically generated from ProjectDefinition |
|
5156 |
@REM ------- |
|
15950 | 5157 |
@SET DEFINES= |
18521 | 5158 |
|
17186 | 5159 |
make.exe -N -f bc.mak %%DEFINES%% %%* |
5160 |
||
19627 | 5161 |
%(SKIP_IF_ARG_IS_APP_TARGET) |
19594 | 5162 |
|
12364 | 5163 |
%(SUBPROJECT_BMAKE_CALLS) |
5164 |
' |
|
5165 |
||
5166 |
"Created: / 17-08-2006 / 20:04:14 / cg" |
|
14336 | 5167 |
"Modified: / 04-09-2012 / 11:46:22 / cg" |
12364 | 5168 |
! |
5169 |
||
13411 | 5170 |
builder_baseline_dot_rbspec |
5171 |
"For rake-base automatic builder" |
|
13419 | 5172 |
|
13411 | 5173 |
^ ' |
5174 |
# generated from project definition |
|
5175 |
||
5176 |
# load package dependencies |
|
5177 |
load ''package.deps.rake'' |
|
5178 |
||
5179 |
# kludge: clear some invalid dependencies of libwidg |
|
5180 |
# (should be fixed in baseline) |
|
5181 |
clear "stx:libwidg" => "stx:libui" |
|
5182 |
clear "stx:libwidg2" => "stx:libui" |
|
5183 |
||
5184 |
project :''%(APPLICATION):baseline'' do |
|
5185 |
# preamble |
|
5186 |
%(PREAMBLE) |
|
5187 |
# -------- |
|
5188 |
||
5189 |
%(PACKAGES) |
|
5190 |
||
5191 |
application "%(APPLICATION_PACKAGE)" |
|
5192 |
||
5193 |
# postamble |
|
5194 |
%(POSTABLE) |
|
5195 |
# --------- |
|
5196 |
||
5197 |
end |
|
5198 |
' |
|
5199 |
||
5200 |
"Created: / 24-02-2011 / 11:39:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5201 |
"Modified: / 27-02-2011 / 12:42:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5202 |
! |
|
5203 |
||
5204 |
builder_baseline_dot_rbspec_postamble |
|
5205 |
^ '' |
|
5206 |
||
5207 |
"Created: / 24-02-2011 / 11:58:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5208 |
! |
|
5209 |
||
5210 |
builder_baseline_dot_rbspec_preamble |
|
5211 |
^ '' |
|
5212 |
||
5213 |
"Created: / 24-02-2011 / 11:58:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5214 |
! |
|
5215 |
||
19309 | 5216 |
classExternalDeclarationLine_libInit_dot_cc |
5217 |
||
5218 |
^'extern void _%(CLASS)_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);' |
|
5219 |
! |
|
5220 |
||
12364 | 5221 |
classLine_libInit_dot_cc |
5222 |
||
19309 | 5223 |
^' _%(CLASS)_Init(pass,__pRT__,snd);' |
12364 | 5224 |
|
5225 |
"Created: / 08-08-2006 / 12:51:44 / fm" |
|
5226 |
"Modified: / 08-08-2006 / 15:46:05 / fm" |
|
5227 |
! |
|
5228 |
||
20582 | 5229 |
generate_osx_info_dot_plist |
20567 | 5230 |
"template for the info.plist file, which is included in an OS X deployment" |
23124 | 5231 |
|
20567 | 5232 |
|plist| |
5233 |
||
20582 | 5234 |
(plist := self osx_info_dot_plist_dictionary) isNil ifTrue:[^ nil]. |
20586 | 5235 |
MacPlistXMLCoder isNil ifTrue:[ |
23124 | 5236 |
Smalltalk loadPackage:'stx:goodies/xml/stx'. |
5237 |
Smalltalk loadPackage:'stx:goodies/fileformats/plist'. |
|
5238 |
]. |
|
5239 |
^ MacPlistXMLCoder encode:plist |
|
20567 | 5240 |
|
5241 |
" |
|
5242 |
exept_expecco_application info_dot_plist |
|
5243 |
" |
|
5244 |
! |
|
5245 |
||
14334 | 5246 |
lccmake_dot_mak |
5247 |
"the template code for the lccmake.bat file" |
|
12364 | 5248 |
|
13419 | 5249 |
^ |
12364 | 5250 |
'@REM ------- |
5251 |
@REM make using lcc compiler |
|
14334 | 5252 |
@REM type lccmake, and wait... |
12364 | 5253 |
@REM do not edit - automatically generated from ProjectDefinition |
5254 |
@REM ------- |
|
14361 | 5255 |
make.exe -N -f bc.mak -DUSELCC=1 %%* |
12364 | 5256 |
|
19627 | 5257 |
%(SKIP_IF_ARG_IS_APP_TARGET) |
19595 | 5258 |
|
12364 | 5259 |
%(SUBPROJECT_LCCMAKE_CALLS) |
5260 |
' |
|
14334 | 5261 |
|
5262 |
"Created: / 03-09-2012 / 19:49:23 / cg" |
|
12364 | 5263 |
! |
5264 |
||
5265 |
make_dot_proto |
|
5266 |
"the template code for the make.proto file" |
|
5267 |
||
5268 |
^ self subclassResponsibility |
|
5269 |
! |
|
5270 |
||
5271 |
make_dot_spec |
|
5272 |
||
13419 | 5273 |
^ |
12364 | 5274 |
'# $','Header','$ |
5275 |
# |
|
13419 | 5276 |
# DO NOT EDIT |
14248 | 5277 |
# automagically generated from the projectDefinition: ',self name,"' at ',Timestamp now printString,"'. |
12364 | 5278 |
# |
5279 |
# Warning: once you modify this file, do not rerun |
|
5280 |
# stmkmp or projectDefinition-build again - otherwise, your changes are lost. |
|
5281 |
# |
|
5282 |
# This file contains specifications which are common to all platforms. |
|
5283 |
# |
|
5284 |
||
5285 |
# Do NOT CHANGE THESE DEFINITIONS |
|
5286 |
# (otherwise, ST/X will have a hard time to find out the packages location from its packageID, |
|
5287 |
# to find the source code of a class and to find the library for a package) |
|
5288 |
MODULE=%(MODULE) |
|
5289 |
MODULE_DIR=%(MODULE_DIRECTORY) |
|
5290 |
PACKAGE=$(MODULE):$(MODULE_DIR) |
|
5291 |
||
5292 |
||
5293 |
# Argument(s) to the stc compiler (stc --usage). |
|
13875
2e01d09fa4c4
-headerDir= instead of --headerDir=
Claus Gittinger <cg@exept.de>
parents:
13873
diff
changeset
|
5294 |
# -headerDir=. : create header files locally |
12364 | 5295 |
# (if removed, they will be created as common |
5296 |
# -Pxxx : defines the package |
|
5297 |
# -Zxxx : a prefix for variables within the classLib |
|
20152 | 5298 |
# -Dxxx : defines passed to CC for inline C-code |
12364 | 5299 |
# -Ixxx : include path passed to CC for inline C-code |
5300 |
# +optspace : optimized for space |
|
5301 |
# +optspace2 : optimized more for space |
|
5302 |
# +optspace3 : optimized even more for space |
|
5303 |
# +optinline : generate inline code for some ST constructs |
|
5304 |
# +inlineNew : additionally inline new |
|
5305 |
# +inlineMath : additionally inline some floatPnt math stuff |
|
5306 |
# |
|
5307 |
# ********** OPTIONAL: MODIFY the next line(s) *** |
|
5308 |
# STCLOCALOPTIMIZATIONS=+optinline +inlineNew |
|
5309 |
# STCLOCALOPTIMIZATIONS=+optspace3 |
|
5310 |
STCLOCALOPTIMIZATIONS=%(STCOPTIMIZATIONOPTIONS) |
|
5311 |
||
5312 |
||
5313 |
# Argument(s) to the stc compiler (stc --usage). |
|
5314 |
# -warn : no warnings |
|
5315 |
# -warnNonStandard : no warnings about ST/X extensions |
|
5316 |
# -warnEOLComments : no warnings about EOL comment extension |
|
5317 |
# -warnPrivacy : no warnings about privateClass extension |
|
17070 | 5318 |
# -warnUnused : no warnings about unused variables |
12364 | 5319 |
# |
5320 |
# ********** OPTIONAL: MODIFY the next line(s) *** |
|
5321 |
# STCWARNINGS=-warn |
|
5322 |
# STCWARNINGS=-warnNonStandard |
|
5323 |
# STCWARNINGS=-warnEOLComments |
|
5324 |
STCWARNINGS=%(STCWARNINGOPTIONS) |
|
5325 |
||
12545 | 5326 |
%(CLASSES) |
5327 |
||
12364 | 5328 |
%(OBJECTS) |
5329 |
' |
|
5330 |
||
5331 |
"Created: / 08-08-2006 / 19:31:29 / fm" |
|
5332 |
"Modified: / 09-08-2006 / 15:10:57 / fm" |
|
14248 | 5333 |
"Modified: / 26-07-2012 / 00:56:03 / cg" |
12364 | 5334 |
! |
5335 |
||
12428 | 5336 |
makefile |
13419 | 5337 |
^ |
12428 | 5338 |
'# |
13419 | 5339 |
# DO NOT EDIT |
12428 | 5340 |
# |
13419 | 5341 |
# make uses this file (Makefile) only, if there is no |
12428 | 5342 |
# file named "makefile" (lower-case m) in the same directory. |
5343 |
# My only task is to generate the real makefile and call make again. |
|
5344 |
# Thereafter, I am no longer used and needed. |
|
5345 |
# |
|
15201 | 5346 |
# MACOSX caveat: |
5347 |
# as filenames are not case sensitive (in a default setup), |
|
15385 | 5348 |
# we cannot use the above trick. Therefore, this file is now named |
15201 | 5349 |
# "Makefile.init", and you have to execute "make -f Makefile.init" to |
5350 |
# get the initial makefile. This is now also done by the toplevel CONFIG |
|
5351 |
# script. |
|
12428 | 5352 |
|
5353 |
.PHONY: run |
|
5354 |
||
5355 |
run: makefile |
|
23124 | 5356 |
$(MAKE) -f makefile |
12428 | 5357 |
|
5358 |
#only needed for the definition of $(TOP) |
|
5359 |
include Make.proto |
|
5360 |
||
14665 | 5361 |
makefile: mf |
5362 |
||
5363 |
mf: |
|
23124 | 5364 |
$(TOP)/rules/stmkmf |
12428 | 5365 |
' |
5366 |
! |
|
5367 |
||
14345 | 5368 |
mingwmake_dot_mak |
5369 |
"the template code for the mingwmake.bat file" |
|
5370 |
||
5371 |
^ |
|
5372 |
'@REM ------- |
|
5373 |
@REM make using mingw gnu compiler |
|
5374 |
@REM type mingwmake, and wait... |
|
5375 |
@REM do not edit - automatically generated from ProjectDefinition |
|
5376 |
@REM ------- |
|
15950 | 5377 |
@SET DEFINES= |
14642 | 5378 |
|
14850 | 5379 |
@pushd %(TOP)\rules |
5380 |
@call find_mingw.bat |
|
5381 |
@popd |
|
15950 | 5382 |
make.exe -N -f bc.mak %DEFINES% %%USEMINGW_ARG%% %%* |
14345 | 5383 |
|
19627 | 5384 |
%(SKIP_IF_ARG_IS_APP_TARGET) |
19595 | 5385 |
|
14345 | 5386 |
%(SUBPROJECT_MINGWMAKE_CALLS) |
5387 |
' |
|
5388 |
||
5389 |
"Created: / 05-09-2012 / 19:44:51 / cg" |
|
15950 | 5390 |
"Modified: / 19-03-2013 / 08:54:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14345 | 5391 |
! |
5392 |
||
12364 | 5393 |
objectLine_make_dot_spec |
5394 |
||
21236 | 5395 |
^' $(OUTDIR)%(CLASSFILE).$(O) \' |
12364 | 5396 |
|
5397 |
"Created: / 08-08-2006 / 20:16:46 / fm" |
|
5398 |
"Modified: / 23-08-2006 / 11:11:38 / cg" |
|
5399 |
! |
|
5400 |
||
20582 | 5401 |
osx_info_dot_plist_dictionary |
5402 |
"template for the info.plist file, which is included in an OS X deployment" |
|
23124 | 5403 |
|
20582 | 5404 |
|plist pkg icnFilename docTypeDescriptions| |
23124 | 5405 |
|
20582 | 5406 |
plist := Dictionary new. |
5407 |
plist at:'CFBundleInfoDictionaryVersion' put:'6.0'. |
|
5408 |
pkg := self package copyReplaceAny:':/' with:$.. |
|
5409 |
(pkg endsWith:'.application') ifTrue:[ |
|
23124 | 5410 |
pkg := pkg copyButLast:'.application' size. |
5411 |
]. |
|
20582 | 5412 |
plist at:'CFBundleIdentifier' put:pkg. |
5413 |
plist at:'CFBundleShortVersionString' put:(self fileVersion asString). |
|
5414 |
plist at:'CFBundleVersion' put:(self fileVersion asString). |
|
5415 |
plist at:'LSMinimumSystemVersion' put:'10.6'. |
|
5416 |
"/ plist at:'CFBundleDevelopmentRegion' put:'English'. |
|
20601 | 5417 |
plist at:'CFBundleExecutable' put:(self applicationName). |
23124 | 5418 |
|
20582 | 5419 |
self isLibraryDefinition ifTrue:[ |
23124 | 5420 |
plist at:'CFBundleName' put:(self package copyReplaceAny:':/' with:$.). |
20582 | 5421 |
] ifFalse:[ |
23124 | 5422 |
plist at:'CFBundleName' put:(self applicationName). |
5423 |
plist at:'CFBundlePackageType' put:'APPL'. |
|
5424 |
]. |
|
5425 |
||
5426 |
(icnFilename := self applicationIconFileNameOSX) notNil ifTrue:[ |
|
5427 |
plist at:'CFBundleIconFile' put:icnFilename. |
|
20582 | 5428 |
]. |
5429 |
(docTypeDescriptions := self applicationDocumentTypeDescriptions) notNil ifTrue:[ |
|
23124 | 5430 |
plist at:'CFBundleDocumentTypes' put: |
5431 |
(docTypeDescriptions collect:[:each | |
|
5432 |
|d| |
|
5433 |
d := Dictionary new. |
|
5434 |
d at:'CFBundleTypeExtensions' put:{ each extension }. |
|
5435 |
d at:'CFBundleTypeIconFile' put:{ each iconFileOSX }. |
|
5436 |
d at:'CFBundleTypeMimeTypes' put:{ each mimeType }. |
|
5437 |
d at:'CFBundleTypeName' put:(each documentTypeName). |
|
5438 |
d at:'CFBundleTypeRole' put:'Editor'. |
|
5439 |
d |
|
5440 |
]). |
|
5441 |
]. |
|
20582 | 5442 |
^ plist |
5443 |
||
5444 |
" |
|
5445 |
exept_expecco_application info_dot_plist |
|
5446 |
" |
|
21562 | 5447 |
|
5448 |
"Modified (format): / 24-02-2017 / 09:35:09 / cg" |
|
20582 | 5449 |
! |
5450 |
||
12364 | 5451 |
packageName_dot_rc |
5452 |
"the template code for the <libName>.rc file. |
|
5453 |
Only used for WIN" |
|
5454 |
||
13419 | 5455 |
^ |
12364 | 5456 |
'// |
13419 | 5457 |
// DO NOT EDIT |
12364 | 5458 |
// automagically generated from the projectDefinition: ',self name,'. |
5459 |
// |
|
5460 |
VS_VERSION_INFO VERSIONINFO |
|
5461 |
FILEVERSION %(FILE_VERSION_COMMASEPARATED) |
|
5462 |
PRODUCTVERSION %(PRODUCT_VERSION_COMMASEPARATED) |
|
13769
8259f3bf7fa2
changed: #packageName_dot_rc
Claus Gittinger <cg@exept.de>
parents:
13763
diff
changeset
|
5463 |
#if (__BORLANDC__) |
12364 | 5464 |
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE |
5465 |
FILEFLAGS VS_FF_PRERELEASE | VS_FF_SPECIALBUILD |
|
5466 |
FILEOS VOS_NT_WINDOWS32 |
|
5467 |
FILETYPE %(FILETYPE) |
|
5468 |
FILESUBTYPE VS_USER_DEFINED |
|
13769
8259f3bf7fa2
changed: #packageName_dot_rc
Claus Gittinger <cg@exept.de>
parents:
13763
diff
changeset
|
5469 |
#endif |
12364 | 5470 |
|
5471 |
BEGIN |
|
5472 |
BLOCK "StringFileInfo" |
|
5473 |
BEGIN |
|
5474 |
BLOCK "040904E4" |
|
5475 |
BEGIN |
|
5476 |
VALUE "CompanyName", "%(COMPANY_NAME)\0" |
|
5477 |
VALUE "FileDescription", "%(FILE_DESCRIPTION)\0" |
|
5478 |
VALUE "FileVersion", "%(FILE_VERSION)\0" |
|
5479 |
VALUE "InternalName", "%(INTERNAL_NAME)\0" |
|
5480 |
%(LEGAL_COPYRIGHT_LINE) |
|
5481 |
VALUE "ProductName", "%(PRODUCT_NAME)\0" |
|
5482 |
VALUE "ProductVersion", "%(PRODUCT_VERSION)\0" |
|
5483 |
VALUE "ProductDate", "%(PRODUCT_DATE)\0" |
|
5484 |
END |
|
5485 |
||
5486 |
END |
|
5487 |
||
5488 |
BLOCK "VarFileInfo" |
|
5489 |
BEGIN // Language | Translation |
|
5490 |
VALUE "Translation", 0x409, 0x4E4 // U.S. English, Windows Multilingual |
|
5491 |
END |
|
5492 |
END |
|
5493 |
' |
|
5494 |
" |
|
5495 |
stx_libbasic3 packageName_dot_rc |
|
5496 |
stx_libbasic3 generate_packageName_dot_rc |
|
5497 |
" |
|
5498 |
||
5499 |
"Created: / 08-08-2006 / 19:31:29 / fm" |
|
5500 |
"Modified: / 09-08-2006 / 15:10:57 / fm" |
|
13769
8259f3bf7fa2
changed: #packageName_dot_rc
Claus Gittinger <cg@exept.de>
parents:
13763
diff
changeset
|
5501 |
"Modified: / 07-10-2011 / 10:51:34 / cg" |
12364 | 5502 |
! |
5503 |
||
13411 | 5504 |
package_dot_deps_dot_rake |
5505 |
^ ' |
|
5506 |
# Package dependencies. |
|
21753 | 5507 |
# Automatically generated by project definition. |
13411 | 5508 |
|
5509 |
%(DEPENDENCIES) |
|
5510 |
||
5511 |
' |
|
5512 |
||
5513 |
"Created: / 24-02-2011 / 22:32:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
21753 | 5514 |
"Modified: / 17-05-2017 / 12:35:21 / mawalch" |
13411 | 5515 |
! |
5516 |
||
14334 | 5517 |
tccmake_dot_mak |
5518 |
"the template code for the tccmake.bat file" |
|
5519 |
||
5520 |
^ |
|
5521 |
'@REM ------- |
|
14336 | 5522 |
@REM make using tcc compiler (Tiny-C) |
14334 | 5523 |
@REM type tccmake, and wait... |
5524 |
@REM do not edit - automatically generated from ProjectDefinition |
|
5525 |
@REM ------- |
|
14361 | 5526 |
make.exe -N -f bc.mak -DUSETCC=1 %%* |
14334 | 5527 |
|
19627 | 5528 |
%(SKIP_IF_ARG_IS_APP_TARGET) |
19596 | 5529 |
|
5530 |
||
14334 | 5531 |
%(SUBPROJECT_TCCMAKE_CALLS) |
5532 |
' |
|
5533 |
||
5534 |
"Created: / 03-09-2012 / 19:50:41 / cg" |
|
5535 |
! |
|
5536 |
||
12364 | 5537 |
vcmake_dot_mak |
5538 |
"the template code for the vcmake.bat file" |
|
5539 |
||
13419 | 5540 |
^ |
12364 | 5541 |
'@REM ------- |
14336 | 5542 |
@REM make using Microsoft Visual C compiler |
12364 | 5543 |
@REM type vcmake, and wait... |
5544 |
@REM do not edit - automatically generated from ProjectDefinition |
|
5545 |
@REM ------- |
|
13789 | 5546 |
|
5547 |
@if not defined VSINSTALLDIR ( |
|
14850 | 5548 |
pushd %(TOP)\rules |
5549 |
call vcsetup.bat |
|
5550 |
popd |
|
13789 | 5551 |
) |
15950 | 5552 |
@SET DEFINES= |
18521 | 5553 |
|
15950 | 5554 |
make.exe -N -f bc.mak -DUSEVC=1 %DEFINES% %* |
5555 |
||
19627 | 5556 |
%(SKIP_IF_ARG_IS_APP_TARGET) |
15950 | 5557 |
|
12364 | 5558 |
%(SUBPROJECT_VCMAKE_CALLS) |
5559 |
' |
|
12966 | 5560 |
|
14336 | 5561 |
"Modified: / 04-09-2012 / 11:45:49 / cg" |
12364 | 5562 |
! ! |
5563 |
||
5564 |
!ProjectDefinition class methodsFor:'loading'! |
|
5565 |
||
19905 | 5566 |
checkForLoad |
21563 | 5567 |
"raise an error, if the package is not suitable for loading" |
19905 | 5568 |
|
5569 |
self supportedOnPlatform ifFalse:[ |
|
23124 | 5570 |
PackageNotCompatibleError raiseWith:self package. |
19905 | 5571 |
]. |
21563 | 5572 |
|
5573 |
"Modified (comment): / 24-02-2017 / 10:06:44 / cg" |
|
19905 | 5574 |
! |
5575 |
||
12397 | 5576 |
ensureFullyLoaded |
5577 |
"ensure that all classes and extensions are loaded properly. |
|
5578 |
This is normally no problem for compiled classLibs - however, if a package |
|
5579 |
has only be installedAsAutoloaded, some classes might want to ensure that |
|
5580 |
when being loaded themself." |
|
5581 |
||
16892 | 5582 |
self supportedOnPlatform ifFalse:[^ self]. |
5583 |
||
12397 | 5584 |
self hasAllExtensionsLoaded ifFalse:[ |
23124 | 5585 |
self breakPoint:#cg. |
12397 | 5586 |
]. |
5587 |
self hasAllClassesFullyLoaded ifFalse:[ |
|
23124 | 5588 |
self hasAllClassesLoaded ifFalse:[ |
5589 |
self breakPoint:#cg. |
|
5590 |
]. |
|
5591 |
self installAutoloadedClasses. |
|
5592 |
self classes do:[:cls | cls autoload ]. |
|
12397 | 5593 |
]. |
5594 |
||
5595 |
" |
|
5596 |
stx_libbasic ensureFullyLoaded |
|
5597 |
" |
|
12731 | 5598 |
"Verbose := true |
5599 |
stx_libjavascript hasAllExtensionsLoaded |
|
5600 |
" |
|
12735
215f7514f56b
comment/format in: #ensureFullyLoaded
Claus Gittinger <cg@exept.de>
parents:
12731
diff
changeset
|
5601 |
"Verbose := true |
215f7514f56b
comment/format in: #ensureFullyLoaded
Claus Gittinger <cg@exept.de>
parents:
12731
diff
changeset
|
5602 |
stx_goodies_soap_xe hasAllExtensionsLoaded |
215f7514f56b
comment/format in: #ensureFullyLoaded
Claus Gittinger <cg@exept.de>
parents:
12731
diff
changeset
|
5603 |
" |
13689
9d93d5e56029
changed: #ensureFullyLoaded
Claus Gittinger <cg@exept.de>
parents:
13688
diff
changeset
|
5604 |
|
9d93d5e56029
changed: #ensureFullyLoaded
Claus Gittinger <cg@exept.de>
parents:
13688
diff
changeset
|
5605 |
"Modified: / 12-09-2011 / 16:57:53 / cg" |
12397 | 5606 |
! |
5607 |
||
12364 | 5608 |
load |
5609 |
"load the project |
|
13419 | 5610 |
Answer true, if new classes have been installed for this package, |
12364 | 5611 |
false if the package's classes have been already present." |
5612 |
||
5613 |
^ self loadAsAutoloaded:false. |
|
5614 |
! |
|
5615 |
||
5616 |
loadAsAutoloaded:asAutoloaded |
|
5617 |
"load the project. |
|
5618 |
If asAutoloaded == true, install all new classes as autoloaded. |
|
5619 |
Answer true, if new classes have been installed for this package, |
|
5620 |
false if the package's classes have been already present." |
|
5621 |
||
5622 |
|newStuffHasBeenLoaded meOrMySecondIncarnation| |
|
5623 |
||
16892 | 5624 |
self supportedOnPlatform ifFalse:[^ false]. |
5625 |
||
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5626 |
self projectIsLoaded ifTrue:[ |
23124 | 5627 |
asAutoloaded ifFalse:[ |
5628 |
"/ to be considered !! |
|
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5629 |
"/ self isFullyLoaded ifFalse:[ |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5630 |
"/ self hasAllExtensionsLoaded ifFalse:[ |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5631 |
"/ self loadExtensions. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5632 |
"/ ]. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5633 |
"/ self loadAllAutoloadedClasses |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5634 |
"/ ]. |
23124 | 5635 |
]. |
5636 |
^ false |
|
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5637 |
]. |
17587 | 5638 |
|
5639 |
"/ the following prevents us from crshing if a project definition's prerequisites |
|
5640 |
"/ are wrong and circular/recursive |
|
5641 |
||
12749 | 5642 |
thisContext isRecursive ifTrue:[self breakPoint:#cg. ^ false]. "/ avoid endless loops |
15172 | 5643 |
(PackagesBeingLoaded includes:self package) ifTrue:[ |
23124 | 5644 |
"/ seems to be a recursive call |
5645 |
^ false |
|
14851 | 5646 |
]. |
12364 | 5647 |
|
15172 | 5648 |
PackagesBeingLoaded add:self package. |
17587 | 5649 |
PackageLoadInProgressQuery |
23124 | 5650 |
answerNotifyLoading:self package |
5651 |
do:[ |
|
5652 |
||
5653 |
[ |
|
5654 |
newStuffHasBeenLoaded := false. |
|
5655 |
||
5656 |
Smalltalk silentLoading ifFalse:[ |
|
5657 |
"/ thisContext fullPrintAll. |
|
5658 |
Logger info:('loading %1%2...' |
|
5659 |
bindWith:(asAutoloaded ifTrue:['as autoloaded '] ifFalse:['']) |
|
5660 |
with:self name). |
|
5661 |
]. |
|
5662 |
||
5663 |
self rememberOverwrittenExtensionMethods. |
|
5664 |
||
5665 |
self activityNotification:'Executing pre-load action'. |
|
5666 |
self executeHooks: #preLoad. |
|
5667 |
self preLoadAction. |
|
5668 |
||
5669 |
meOrMySecondIncarnation := self. |
|
5670 |
||
5671 |
Class withoutUpdatingChangesDo:[ |
|
5672 |
self activityNotification:'Loading prerequisities'. |
|
5673 |
self loadMandatoryPreRequisitesAsAutoloaded:asAutoloaded. |
|
5674 |
||
5675 |
self checkPrerequisitesForLoading. |
|
5676 |
||
5677 |
asAutoloaded ifFalse:[ |
|
5678 |
"ignore binary class library load failure - try is the hard way (loading classes)" |
|
5679 |
PackageLoadError ignoreIn:[ |
|
5680 |
self loadClassLibrary. |
|
5681 |
"/ could have overloaded my first incarnation |
|
5682 |
meOrMySecondIncarnation := (Smalltalk at:(self name)) ? self. |
|
5683 |
meOrMySecondIncarnation ~~ self ifTrue:[ |
|
5684 |
meOrMySecondIncarnation fetchSlotsFrom:self. |
|
5685 |
]. |
|
5686 |
]. |
|
5687 |
]. |
|
5688 |
||
5689 |
self hasAllExtensionsLoaded ifFalse:[ |
|
5690 |
self activityNotification:'Loading extensions'. |
|
5691 |
"/ evaluating or here - want extensions to be loaded |
|
5692 |
newStuffHasBeenLoaded := newStuffHasBeenLoaded | meOrMySecondIncarnation loadExtensions. |
|
5693 |
]. |
|
5694 |
(self hasAllClassesLoaded:asAutoloaded not) ifFalse:[ |
|
5695 |
self activityNotification:'Loading classes'. |
|
5696 |
"/ evaluating or here - want autoloaded classes to be loaded |
|
5697 |
newStuffHasBeenLoaded := newStuffHasBeenLoaded | (meOrMySecondIncarnation loadAllClassesAsAutoloaded:asAutoloaded). |
|
5698 |
]. |
|
5699 |
"/ no, don't load subProjects here - will lead to a recursion, which leads |
|
5700 |
"/ to some classes being loaded from source (soap) |
|
5701 |
"/ self activityNotification:'Loading sub projects'. |
|
5702 |
"/ meOrMySecondIncarnation loadSubProjectsAsAutoloaded:asAutoloaded. |
|
5703 |
]. |
|
5704 |
self activityNotification:('Executing post-load action for %1' bindWith:self package). |
|
5705 |
||
5706 |
"/ mhmh - already done for dll-loaded packages |
|
5707 |
"/ meOrMySecondIncarnation initializeAllClasses. |
|
5708 |
||
5709 |
meOrMySecondIncarnation projectIsLoaded:true. |
|
5710 |
meOrMySecondIncarnation ~~ self ifTrue:[ |
|
5711 |
self projectIsLoaded:true. |
|
5712 |
]. |
|
5713 |
] ensure:[ |
|
5714 |
PackagesBeingLoaded remove:self package ifAbsent:[]. |
|
5715 |
]. |
|
5716 |
"/ load the other prerequisites |
|
5717 |
self loadPreRequisitesAsAutoloaded:asAutoloaded. |
|
5718 |
]. |
|
13194
8e451f8ff654
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13178
diff
changeset
|
5719 |
self activityNotification:('Done (%1).' bindWith:self package). |
12364 | 5720 |
^ newStuffHasBeenLoaded |
5721 |
||
5722 |
"Created: / 17-08-2006 / 01:01:41 / cg" |
|
5723 |
"Modified: / 30-10-2008 / 08:16:21 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
5724 |
"Modified: / 22-08-2009 / 12:02:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13623
46625f58d8ee
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13614
diff
changeset
|
5725 |
"Modified: / 04-09-2011 / 10:01:53 / cg" |
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
5726 |
"Modified: / 20-11-2012 / 23:06:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12364 | 5727 |
! |
5728 |
||
5729 |
unloadPackage |
|
5730 |
"unload the project. |
|
5731 |
Fails if there are still instances of any of my classes in the system" |
|
5732 |
||
5733 |
self projectIsLoaded ifFalse:[^ false]. |
|
5734 |
thisContext isRecursive ifTrue:[^ false]. |
|
5735 |
||
20952 | 5736 |
Smalltalk silentLoading ifFalse:[ |
23124 | 5737 |
"/ thisContext fullPrintAll. |
5738 |
Logger info:'unloading %1' with:self name. |
|
12364 | 5739 |
]. |
5740 |
||
5741 |
self activityNotification:'Executing pre-unload action'. |
|
5742 |
self preUnloadAction. |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
5743 |
self executeHooks: #preUnload. |
12364 | 5744 |
|
5745 |
self activityNotification:'Restoring original methods'. |
|
5746 |
self restoreOverwrittenExtensionMethods. |
|
5747 |
||
5748 |
Class withoutUpdatingChangesDo:[ |
|
23124 | 5749 |
self activityNotification:'Unloading subprojects'. |
5750 |
self unloadSubProjects. |
|
5751 |
||
5752 |
self activityNotification:'Unloading classes'. |
|
5753 |
self unloadClassLibrary. |
|
5754 |
self unloadAllClasses. |
|
12364 | 5755 |
]. |
5756 |
self projectIsLoaded:false. |
|
5757 |
^ true |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
5758 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
5759 |
"Modified: / 20-11-2012 / 23:06:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12364 | 5760 |
! ! |
5761 |
||
12086 | 5762 |
|
9575 | 5763 |
!ProjectDefinition class methodsFor:'private'! |
9536 | 5764 |
|
13411 | 5765 |
abbrevs |
13592 | 5766 |
"return a dictionary containing my abbreviations; |
5767 |
this dictionary is read from my project-directory's abbrev.stc file, |
|
5768 |
and cached for future use" |
|
5769 |
||
5770 |
|abbrevs| |
|
5771 |
||
5772 |
AccessLock critical:[ |
|
23124 | 5773 |
|mustRead file myPackageDirectory| |
5774 |
||
5775 |
AbbrevDictionary isNil ifTrue:[ |
|
5776 |
AbbrevDictionary := WeakIdentityDictionary new. |
|
5777 |
]. |
|
5778 |
||
5779 |
mustRead := false. |
|
5780 |
abbrevs := AbbrevDictionary at:self ifAbsent:[ mustRead := true. Dictionary new ]. |
|
5781 |
||
5782 |
mustRead ifTrue:[ |
|
5783 |
myPackageDirectory := self packageDirectory. |
|
5784 |
myPackageDirectory isNil ifTrue:[ |
|
5785 |
] ifFalse:[ |
|
5786 |
file := myPackageDirectory / 'abbrev.stc'. |
|
5787 |
file exists ifTrue: [ |
|
5788 |
file readingFileDo:[:stream | |
|
5789 |
Smalltalk |
|
5790 |
withAbbreviationsFromStream:stream |
|
5791 |
do:[:nm :fn :pkg :cat :sz| |
|
5792 |
abbrevs at: nm put: (AbbrevEntry new className:nm fileName:fn category:cat numClassInstVars:sz) |
|
5793 |
] |
|
5794 |
] |
|
5795 |
]. |
|
5796 |
]. |
|
5797 |
]. |
|
13419 | 5798 |
]. |
13695 | 5799 |
|
13411 | 5800 |
^abbrevs |
5801 |
||
5802 |
"Created: / 06-03-2011 / 18:25:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13959 | 5803 |
"Modified: / 20-01-2012 / 15:42:47 / cg" |
13411 | 5804 |
! |
5805 |
||
12368 | 5806 |
additionalClassAttributesFor: aClass |
5807 |
"Answers additional set of class attributes for given class |
|
5808 |
Individual project definitions may override this method, but |
|
5809 |
overriding method should always merge its attributes with result |
|
5810 |
of 'super additionalClassAttributesFor: aClass'. |
|
5811 |
||
5812 |
Here, we add #autoload attributes to all test cases and |
|
21102 | 5813 |
test resources, as they are not necessary for the package |
12368 | 5814 |
and should not be compiled (because of unwanted dependency |
5815 |
on stx:goodies/sunit package) |
|
15950 | 5816 |
|
5817 |
But not make them autoloaded when the package is separate |
|
5818 |
test-package - by conventions such package should by named |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
5819 |
#'module:package/subpackage/tests' |
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
5820 |
" |
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
5821 |
((self package endsWith: '/tests') or:[(self package endsWith: '/test')]) ifFalse:[ |
23124 | 5822 |
(TestCase notNil and:[aClass inheritsFrom: TestCase]) ifTrue:[^#(autoload)]. |
5823 |
(TestResource notNil and:[aClass inheritsFrom: TestResource]) ifTrue:[^#(autoload)]. |
|
15950 | 5824 |
]. |
12368 | 5825 |
|
5826 |
"No additional attributes" |
|
5827 |
^#() |
|
5828 |
||
5829 |
" |
|
23124 | 5830 |
stx_libbasic additionalClassAttributesFor: Object |
5831 |
stx_libtool additionalClassAttributesFor: Tools::NavigationHistoryTests |
|
5832 |
stx_goodies_sunit additionalClassAttributesFor: TestCase |
|
5833 |
stx_goodies_petitparser_tests additionalClassAttributesFor: PPAbstractParseTest |
|
5834 |
||
5835 |
||
5836 |
stx_libtool classNamesAndAttributes_code_ignoreOldEntries:true ignoreOldDefinition: true |
|
12368 | 5837 |
|
5838 |
" |
|
5839 |
||
5840 |
"Created: / 26-10-2009 / 12:54:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
5841 |
"Modified (comment): / 01-11-2014 / 00:27:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12368 | 5842 |
! |
5843 |
||
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5844 |
checkIfClassesArePresent |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5845 |
"check if all classes defined by this project are present and |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5846 |
offer a dialog to abort the current operation if not" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5847 |
|
18684 | 5848 |
|check nonExistentClasses| |
5849 |
||
5850 |
nonExistentClasses := Set new. |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5851 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5852 |
check := |
23124 | 5853 |
[:eachClassName | |
5854 |
|cls fn wasLoaded failedToLoad numClassInstvars| |
|
5855 |
||
5856 |
cls := Smalltalk classNamed:eachClassName. |
|
5857 |
cls isNil ifTrue:[ |
|
5858 |
Transcript showCR:eachClassName. |
|
5859 |
nonExistentClasses add:eachClassName. |
|
5860 |
]. |
|
5861 |
]. |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5862 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5863 |
self allClassNames do:check. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5864 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do:[:nm :attr | |
23124 | 5865 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
5866 |
check value:nm |
|
5867 |
]. |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5868 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5869 |
|
18684 | 5870 |
nonExistentClasses notEmpty ifTrue:[ |
23124 | 5871 |
Transcript showCR:('"%1" and possibly more classes are missing.\Cannot generate a correct "abbrev.stc" file.' bindWith:nonExistentClasses). |
5872 |
UserPreferences current suppressProjectDefinitionWarnings ifFalse:[ |
|
5873 |
(Dialog confirm:(Dialog classResources |
|
5874 |
stringWithCRs:'"%1" and possibly more classes are missing.\Cannot generate a correct "abbrev.stc" file.\\Continue anyway?' |
|
5875 |
with:nonExistentClasses anElement allBold)) ifFalse:[ |
|
5876 |
AbortOperationRequest raise. |
|
5877 |
]. |
|
5878 |
]. |
|
5879 |
^ false. |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5880 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5881 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5882 |
^ true |
15916 | 5883 |
|
5884 |
"Modified: / 28-01-2014 / 21:44:37 / cg" |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5885 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5886 |
|
12368 | 5887 |
classNamesAndAttributesAsSpecArray |
13419 | 5888 |
"given a classNamesAndAttributes array, make this a spec array (array of arrays). |
12368 | 5889 |
This decompresses class-name entries into a one-element array for easier processing" |
5890 |
||
5891 |
^ self classNamesAndAttributes |
|
23124 | 5892 |
collect:[:entry | |
5893 |
entry isArray ifTrue:[ |
|
5894 |
entry first isSymbol ifTrue:[ |
|
5895 |
entry |
|
5896 |
] ifFalse:[ |
|
5897 |
(Array with:entry first asSymbol) , (entry copyFrom:2) |
|
5898 |
]. |
|
5899 |
] ifFalse:[ |
|
5900 |
Array with:entry asSymbol. |
|
5901 |
]]. |
|
12368 | 5902 |
|
5903 |
"Created: / 19-02-2007 / 16:11:53 / cg" |
|
5904 |
! |
|
5905 |
||
9627 | 5906 |
classNamesAndAttributesDo: aBlock |
5907 |
self namesAndAttributesIn:(self classNamesAndAttributes) do: aBlock |
|
5908 |
||
5909 |
"Modified: / 22-08-2006 / 18:20:21 / cg" |
|
9607 | 5910 |
! |
5911 |
||
12368 | 5912 |
classNamesAndAttributesFromSpecArray:aSpecArray |
5913 |
"given a spec array (array of arrays), make this a classNamesAndAttributes array |
|
5914 |
as stored literally in the method. |
|
5915 |
This compresses single element array-elements into plain names |
|
16572 | 5916 |
(to save code in the compiled binaries) and especially sorts them by load/compile order" |
5917 |
||
5918 |
|newSpec loadedClasses loadedClassNames itemsForUnloadedClasses |
|
5919 |
entriesByName| |
|
5920 |
||
5921 |
entriesByName := Dictionary new. |
|
16024 | 5922 |
|
5923 |
newSpec := |
|
23124 | 5924 |
aSpecArray |
5925 |
collect:[:entry | |
|
5926 |
|nm newEntry| |
|
5927 |
||
5928 |
(entry isArray and:[entry size == 1]) ifTrue:[ |
|
5929 |
nm := newEntry := entry first. |
|
5930 |
entriesByName at:nm put:nm. |
|
5931 |
] ifFalse:[ |
|
5932 |
newEntry := entry. |
|
5933 |
(entry isArray and:[entry size > 1]) ifTrue:[ |
|
5934 |
nm := entry first. |
|
5935 |
entriesByName at:nm put:entry. |
|
5936 |
] ifFalse:[ |
|
5937 |
nm := entry. |
|
5938 |
entriesByName at:nm put:entry. |
|
5939 |
]. |
|
5940 |
]. |
|
5941 |
newEntry |
|
5942 |
]. |
|
16024 | 5943 |
|
5944 |
"/ extract loaded and unloaded classes. |
|
5945 |
loadedClasses := OrderedCollection new. |
|
5946 |
itemsForUnloadedClasses := OrderedCollection new. |
|
5947 |
||
5948 |
newSpec do:[:entry | |
|
23124 | 5949 |
|clsName clsOrNil| |
5950 |
||
5951 |
(entry isArray and:[entry includes:#autoload]) ifTrue:[ |
|
5952 |
itemsForUnloadedClasses add:entry. |
|
5953 |
] ifFalse:[ |
|
5954 |
clsName := entry isArray ifTrue:[ entry first ] ifFalse:[ entry ]. |
|
5955 |
clsOrNil := Smalltalk classNamed:clsName. |
|
5956 |
(clsOrNil notNil and:[clsOrNil isLoaded]) ifTrue:[ |
|
5957 |
loadedClasses add:clsOrNil. |
|
5958 |
] ifFalse:[ |
|
5959 |
itemsForUnloadedClasses add:entry. |
|
5960 |
] |
|
5961 |
] |
|
16024 | 5962 |
]. |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
5963 |
"/ and sort by load order |
16024 | 5964 |
loadedClassNames := (Class classesSortedByLoadOrder:loadedClasses) collect:[:cls | cls name]. |
16619 | 5965 |
newSpec := loadedClassNames collect:[:nm | entriesByName at:nm ifAbsent:[ { nm . #autoload }]]. |
16572 | 5966 |
|
16024 | 5967 |
"/ reconstruct contents array, unloaded classes last. |
16572 | 5968 |
^ newSpec asArray , itemsForUnloadedClasses asArray. |
12368 | 5969 |
! |
5970 |
||
9664 | 5971 |
compile:someCode categorized:category |
15006 | 5972 |
^ self compile:someCode categorized:category using:nil |
5973 |
! |
|
5974 |
||
5975 |
compile:someCode categorized:category using:compilerOrNil |
|
5976 |
^ Class packageQuerySignal |
|
23124 | 5977 |
answer:self package |
5978 |
do:[ |
|
5979 |
(compilerOrNil ? self theMetaclass compilerClass) |
|
5980 |
compile:someCode |
|
5981 |
forClass:self theMetaclass |
|
5982 |
inCategory:category |
|
5983 |
] |
|
9664 | 5984 |
|
5985 |
"Created: / 23-08-2006 / 14:36:53 / cg" |
|
5986 |
! |
|
5987 |
||
9627 | 5988 |
compiled_classes |
13419 | 5989 |
^ self compiled_classNames |
23124 | 5990 |
collect: |
5991 |
[:eachName| |
|
5992 |
|cls| |
|
5993 |
||
5994 |
cls := (Smalltalk at:eachName asSymbol). |
|
5995 |
(cls isNil or:[cls isBehavior not]) ifTrue:[ |
|
5996 |
Transcript showCR:('ProjectDefinition: missing/invalid class: ', eachName). |
|
5997 |
cls := nil. |
|
5998 |
]. |
|
5999 |
cls. |
|
6000 |
] |
|
6001 |
thenSelect:[:cls | cls notNil] |
|
9627 | 6002 |
|
6003 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
6004 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
10251 | 6005 |
"Modified: / 07-12-2006 / 17:48:11 / cg" |
9536 | 6006 |
! |
6007 |
||
9627 | 6008 |
compiled_classesDo:aBlock |
6009 |
self compiled_classes do:aBlock. |
|
6010 |
||
6011 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
6012 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
6013 |
! |
|
6014 |
||
15124 | 6015 |
compiled_classesForPlatform:arch |
13419 | 6016 |
^ (self compiled_classNamesForPlatform:arch) |
23124 | 6017 |
collect:[:eachName | (Smalltalk classNamed:eachName)] |
9627 | 6018 |
|
10251 | 6019 |
" |
6020 |
stx_libbasic compiled_classesForArchitecture:#win32 |
|
6021 |
stx_libbasic compiled_classesForArchitecture:#macos |
|
6022 |
stx_libbasic compiled_classesForArchitecture:#unix |
|
6023 |
" |
|
6024 |
||
9627 | 6025 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
6026 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
10251 | 6027 |
"Modified: / 07-12-2006 / 17:43:17 / cg" |
9627 | 6028 |
! |
6029 |
||
6030 |
compiled_classes_common |
|
13419 | 6031 |
^ self |
23124 | 6032 |
compiled_classNames_common |
6033 |
collect:[:eachName | |
|
6034 |
|cls| |
|
6035 |
||
6036 |
cls := Smalltalk classNamed:eachName. |
|
6037 |
cls isNil ifTrue:[ |
|
6038 |
Transcript showCR:('Warning: Missing/invalid class: %1 - the class is skipped in the list of compiled classes.'). |
|
6039 |
UserPreferences current suppressProjectDefinitionWarnings ifFalse:[ |
|
6040 |
self warn:('Missing/invalid class: %1\\%2' |
|
6041 |
bindWith:eachName |
|
6042 |
with:('Warning: The class is skipped in the list of compiled classes.' allBold)) withCRs. |
|
6043 |
]. |
|
6044 |
cls := nil. |
|
6045 |
]. |
|
6046 |
cls |
|
6047 |
] |
|
6048 |
thenSelect:[:cls| cls notNil "isBehavior"] |
|
9627 | 6049 |
|
6050 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
6051 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
15916 | 6052 |
"Modified: / 28-01-2014 / 21:45:08 / cg" |
9607 | 6053 |
! |
6054 |
||
9627 | 6055 |
cvsRevision |
6056 |
|rev| |
|
6057 |
||
6058 |
rev := self revision. |
|
6059 |
rev isNil ifTrue:[ |
|
23124 | 6060 |
"not yet pubplished" |
6061 |
^ #( '0' '1' ) |
|
9627 | 6062 |
]. |
6063 |
^ rev asCollectionOfSubstringsSeparatedBy:$. . |
|
6064 |
||
6065 |
" |
|
6066 |
self cvsRevision |
|
13419 | 6067 |
stx_libbasic3 cvsRevision |
9627 | 6068 |
" |
6069 |
||
6070 |
"Created: / 17-08-2006 / 20:19:03 / cg" |
|
9575 | 6071 |
! |
6072 |
||
13411 | 6073 |
defaultClassAttributesFor: aClass |
6074 |
"Answers default set of class attributes for given class. |
|
6075 |
This is internal method only, to per-project customization |
|
6076 |
please override either #additionalClassAttributes or |
|
6077 |
#additional classAttributesFor:" |
|
6078 |
||
6079 |
| attrs | |
|
6080 |
||
6081 |
"JV @ 2010-06-19 |
|
6082 |
Add a programming language attribute for non-smalltalk classes. |
|
6083 |
Used by multi-lang enabled loading mechanism" |
|
13419 | 6084 |
attrs := aClass programmingLanguage isSmalltalk |
23124 | 6085 |
ifTrue:[#()] |
6086 |
ifFalse:[Array with: (Array with: #lang with: aClass programmingLanguage name asSymbol)]. |
|
13419 | 6087 |
|
13411 | 6088 |
|
6089 |
"JV @ 2009-10-26 |
|
6090 |
Give a project definition to specify additional attributes for given class." |
|
6091 |
attrs := attrs , (self additionalClassAttributesFor: aClass). |
|
6092 |
||
6093 |
^attrs |
|
6094 |
||
6095 |
"Created: / 19-06-2010 / 10:44:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6096 |
! |
|
6097 |
||
9627 | 6098 |
inconsistency:message |
6099 |
Dialog warn:message |
|
9536 | 6100 |
|
9627 | 6101 |
" |
6102 |
self searchForNeverCompiledSuperclasses |
|
13419 | 6103 |
DapasX_Datenbasis searchForNeverCompiledSuperclasses |
9627 | 6104 |
" |
6105 |
||
6106 |
"Created: / 09-08-2006 / 16:32:31 / fm" |
|
9536 | 6107 |
! |
6108 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6109 |
makeOSIncludesWith:fileSeparator from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6110 |
^ aString copy replaceAny:'/\' with:fileSeparator |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6111 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6112 |
" |
13419 | 6113 |
self makeOSIncludesWith:$/ from:'-I$(TOP)/foo/bar' |
6114 |
self makeOSIncludesWith:$\ from:'-I$(TOP)/foo/bar' |
|
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6115 |
" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6116 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6117 |
"Created: / 06-09-2006 / 18:17:03 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6118 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6119 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6120 |
makeUnixIncludes:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6121 |
^ self makeOSIncludesWith:$/ from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6122 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6123 |
"Created: / 06-09-2006 / 18:16:19 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6124 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6125 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6126 |
makeWin32Includes:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6127 |
^ self makeOSIncludesWith:$\ from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6128 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6129 |
"Created: / 06-09-2006 / 18:16:13 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6130 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6131 |
|
13411 | 6132 |
mergeClassAttributes: attr1 with: attr2 |
6133 |
||
6134 |
^attr1 , (attr2 reject:[:each|attr1 includes: each]) |
|
6135 |
||
6136 |
"Created: / 19-06-2010 / 10:50:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6137 |
! |
|
6138 |
||
6139 |
mergeDefaultClassAttributesFor: aClass with: attributes |
|
6140 |
||
6141 |
^self mergeClassAttributes: attributes with: (self defaultClassAttributesFor: aClass) |
|
6142 |
||
6143 |
"Created: / 19-06-2010 / 10:51:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6144 |
! |
|
6145 |
||
9627 | 6146 |
namesAndAttributesIn:aCollection do: aBlock |
18988 | 6147 |
aCollection isNil ifTrue:[^ self]. |
6148 |
||
9627 | 6149 |
aCollection do:[:entry | |
23124 | 6150 |
|className attributes| |
6151 |
||
6152 |
entry isArray ifFalse:[ |
|
6153 |
className := entry. |
|
6154 |
attributes := #(). |
|
6155 |
] ifTrue:[ |
|
6156 |
className := entry first. |
|
6157 |
attributes := entry copyFrom:2. |
|
6158 |
]. |
|
6159 |
aBlock value: className value: attributes |
|
9627 | 6160 |
]. |
6161 |
||
6162 |
"Created: / 22-08-2006 / 18:20:09 / cg" |
|
9621 | 6163 |
! |
6164 |
||
9627 | 6165 |
searchForClasses |
10010 | 6166 |
"answer all non-private classes that belong to this project. |
10005 | 6167 |
They are sorted in load order" |
6168 |
||
13419 | 6169 |
^ Class classesSortedByLoadOrder:(self searchForClassesWithProject: self package) |
9627 | 6170 |
|
6171 |
" |
|
10010 | 6172 |
stx_libbasic3 searchForClasses |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
6173 |
stx_goodies_webServer_htmlTree searchForClasses |
9627 | 6174 |
" |
6175 |
||
6176 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
6177 |
"Created: / 17-08-2006 / 21:18:30 / cg" |
|
9536 | 6178 |
! |
6179 |
||
9627 | 6180 |
searchForClassesWithProject: aProjectID |
15098 | 6181 |
"answer all public and private classes belonging to aProjectID" |
9627 | 6182 |
|
13419 | 6183 |
^ Smalltalk allClasses |
23124 | 6184 |
select:[:cls | cls package = aProjectID]. |
9627 | 6185 |
|
6186 |
" |
|
15098 | 6187 |
self searchForClassesWithProject: #'exept:ctypes' |
9627 | 6188 |
" |
6189 |
||
6190 |
"Created: / 07-08-2006 / 20:42:39 / fm" |
|
9536 | 6191 |
! |
6192 |
||
9627 | 6193 |
searchForExtensions |
6194 |
^ self searchForExtensionsWithProject:self package |
|
6195 |
||
6196 |
" |
|
13419 | 6197 |
self searchForExtensions |
9627 | 6198 |
DapasXProject searchForExtensions |
6199 |
DapasX_Datenbasis searchForExtensions |
|
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
6200 |
stx_libtool searchForExtensions |
9627 | 6201 |
" |
6202 |
||
6203 |
"Modified: / 09-08-2006 / 13:01:26 / fm" |
|
6204 |
"Created: / 17-08-2006 / 21:17:46 / cg" |
|
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
6205 |
"Modified: / 23-10-2006 / 11:03:07 / cg" |
9575 | 6206 |
! |
6207 |
||
9627 | 6208 |
searchForExtensionsWithProject:aProjectID |
6209 |
"search for any class which has extensions from aProjectID. |
|
10086
024ea420d1a6
extension method stuff refactored
Claus Gittinger <cg@exept.de>
parents:
10080
diff
changeset
|
6210 |
Return the extension-methods sorted by classname-selector" |
9627 | 6211 |
|
6212 |
|methods| |
|
6213 |
||
11152 | 6214 |
methods := Smalltalk allExtensionsForPackage:aProjectID. |
13419 | 6215 |
methods |
23124 | 6216 |
sort:[:m1 :m2 | |
6217 |
|c1 c2| |
|
6218 |
||
6219 |
c1 := m1 mclass. |
|
6220 |
c2 := m2 mclass. |
|
6221 |
c1 == c2 ifTrue:[ |
|
6222 |
m1 selector < m2 selector |
|
6223 |
] ifFalse:[ |
|
6224 |
(c2 isMeta and:[c1 isMeta not]) ifTrue:[ |
|
6225 |
true |
|
6226 |
] ifFalse:[ |
|
6227 |
(c1 isMeta and:[c2 isMeta not]) ifTrue:[ |
|
6228 |
false |
|
6229 |
] ifFalse:[ |
|
6230 |
c1 name < c2 name |
|
9908
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6231 |
"/ (c2 isSubclassOf:c1) ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6232 |
"/ true |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6233 |
"/ ] ifFalse:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6234 |
"/ (c1 isSubclassOf:c2) ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6235 |
"/ false |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6236 |
"/ ] ifFalse:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6237 |
"/ "/ leave as is |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6238 |
"/ true |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6239 |
"/ ]. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6240 |
"/ ]. |
23124 | 6241 |
]. |
6242 |
]. |
|
6243 |
]. |
|
6244 |
]. |
|
9627 | 6245 |
^ methods |
6246 |
||
6247 |
" |
|
6248 |
self searchForExtensionsWithProject:#'bosch:dapasx' |
|
6249 |
self searchForExtensionsWithProject:#'cg:oyster' |
|
10086
024ea420d1a6
extension method stuff refactored
Claus Gittinger <cg@exept.de>
parents:
10080
diff
changeset
|
6250 |
self searchForExtensionsWithProject:#'stx:libboss' |
9627 | 6251 |
" |
6252 |
||
6253 |
"Created: / 17-08-2006 / 21:19:04 / cg" |
|
10086
024ea420d1a6
extension method stuff refactored
Claus Gittinger <cg@exept.de>
parents:
10080
diff
changeset
|
6254 |
"Modified: / 12-10-2006 / 20:45:39 / cg" |
9536 | 6255 |
! |
6256 |
||
9627 | 6257 |
searchForProjectsWhichProvideHeaderFiles |
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6258 |
|addPackage myPackageID requiredPackages| |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6259 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6260 |
myPackageID := self package. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6261 |
requiredPackages := Set new. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6262 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6263 |
addPackage := |
23124 | 6264 |
[:package | |
6265 |
(package ~= myPackageID) ifTrue:[ |
|
6266 |
true "(package startsWith:'stx:') not" ifTrue:[ |
|
6267 |
package ~= PackageId noProjectID ifTrue:[ |
|
6268 |
requiredPackages add:package. |
|
6269 |
] |
|
6270 |
] |
|
6271 |
] |
|
6272 |
]. |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6273 |
|
12555
9924562388ed
changed: #searchForProjectsWhichProvideHeaderFiles
Claus Gittinger <cg@exept.de>
parents:
12554
diff
changeset
|
6274 |
"/ need them also... |
14886 | 6275 |
self mandatoryPreRequisites do:[:eachPreRequisitePackage | |
23124 | 6276 |
addPackage value:eachPreRequisitePackage |
12555
9924562388ed
changed: #searchForProjectsWhichProvideHeaderFiles
Claus Gittinger <cg@exept.de>
parents:
12554
diff
changeset
|
6277 |
]. |
9924562388ed
changed: #searchForProjectsWhichProvideHeaderFiles
Claus Gittinger <cg@exept.de>
parents:
12554
diff
changeset
|
6278 |
|
16554 | 6279 |
"/ cg: also need include lines for all referenced packages, |
6280 |
"/ because otherwise, a reference to a symbol in a namespace |
|
6281 |
"/ is not resolved correctly by stc (which would not know, if the |
|
6282 |
"/ symbol is in Smalltalk or the NameSpace. |
|
6283 |
"/ This happens eg. when referring to a class Foo in namespace N |
|
6284 |
"/ as Foo from within the same namespace, but Foo is in another package. |
|
6285 |
"/ It is then only in the referencedPreRequisites's, not the mandatory prereqs. |
|
6286 |
"/ actually, the question is, if then the package should not be listed in the |
|
6287 |
"/ mandatoryPrereqs right away. Discuss this with sv. |
|
6288 |
self referencedPreRequisites do:[:eachPreRequisitePackage | |
|
23124 | 6289 |
addPackage value:eachPreRequisitePackage |
16554 | 6290 |
]. |
6291 |
||
10788 | 6292 |
self compiled_classesDo:[:cls | |
23124 | 6293 |
cls allSuperclassesDo:[:eachSuperClass | |
6294 |
addPackage value:(eachSuperClass package) |
|
6295 |
]. |
|
6296 |
||
6297 |
cls allPrivateClassesDo:[:eachPrivateClass | |
|
6298 |
eachPrivateClass allSuperclassesDo:[:eachSuperClass | |
|
6299 |
eachSuperClass isPrivate ifFalse:[ |
|
6300 |
addPackage value:(eachSuperClass package) |
|
6301 |
]. |
|
6302 |
] |
|
6303 |
]. |
|
6304 |
||
6305 |
cls sharedPoolNames do:[:eachPoolName | |
|
6306 |
|eachPoolClass| |
|
6307 |
||
6308 |
eachPoolClass := Smalltalk classNamed:eachPoolName. |
|
6309 |
eachPoolClass isNil ifTrue:[ |
|
6310 |
Transcript showCR:('Warning: missing pool: %1 (required by %2)' bindWith:eachPoolName with:cls name) |
|
6311 |
] ifFalse:[ |
|
6312 |
eachPoolClass withAllSuperclassesDo:[:eachPoolSuperClass | |
|
6313 |
addPackage value:(eachPoolSuperClass package) |
|
6314 |
] |
|
6315 |
] |
|
6316 |
]. |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6317 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6318 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6319 |
self extensionMethodNames pairWiseDo:[:className :selector | |
23124 | 6320 |
|cls| |
6321 |
((cls := Smalltalk classNamed:className) notNil and:[cls isLoaded]) ifTrue:[ |
|
6322 |
cls withAllSuperclassesDo:[:eachSuperClass | |
|
6323 |
addPackage value:(eachSuperClass package) |
|
6324 |
] |
|
6325 |
] |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6326 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6327 |
^ requiredPackages |
9627 | 6328 |
|
9880 | 6329 |
" |
13419 | 6330 |
stx_libtool searchForProjectsWhichProvideHeaderFiles |
14939 | 6331 |
cg_demos_helloWorld searchForProjectsWhichProvideHeaderFiles |
16554 | 6332 |
cg_tools_emulators_freecell searchForProjectsWhichProvideHeaderFiles |
9880 | 6333 |
" |
9627 | 6334 |
|
10251 | 6335 |
"Created: / 07-12-2006 / 17:46:38 / cg" |
13216 | 6336 |
"Modified: / 18-01-2011 / 17:58:33 / cg" |
9664 | 6337 |
! |
6338 |
||
9667 | 6339 |
searchForSiblingProjects |
10132 | 6340 |
"answer all the packages (package names) having the my parent package" |
6341 |
||
9667 | 6342 |
|myPackage myParentPackage| |
6343 |
||
6344 |
myPackage := self package asPackageId. |
|
6345 |
myParentPackage := myPackage parentPackage. |
|
6346 |
myParentPackage isNil ifTrue:[^ #() ]. |
|
6347 |
||
19476 | 6348 |
^ Smalltalk allPackageIDs |
23124 | 6349 |
select:[:projectID | |
6350 |
|thisPackage| |
|
6351 |
thisPackage := projectID asPackageId. |
|
6352 |
(thisPackage parentPackage = myParentPackage) |
|
6353 |
and:[ thisPackage ~= myPackage ]. |
|
6354 |
] |
|
9667 | 6355 |
|
6356 |
" |
|
6357 |
self searchForSiblingProjects |
|
6358 |
bosch_dapasx_Application searchForSiblingProjects |
|
6359 |
stx_goodies_refactoryBrowser_changes searchForSiblingProjects |
|
6360 |
" |
|
6361 |
||
6362 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
6363 |
"Created: / 23-08-2006 / 15:06:12 / cg" |
|
6364 |
! |
|
6365 |
||
9664 | 6366 |
searchForSubProjects |
10132 | 6367 |
"answer all packages (package names), that are my subProjects" |
6368 |
||
9664 | 6369 |
|myPackage| |
6370 |
||
6371 |
myPackage := self package. |
|
19476 | 6372 |
^ Smalltalk allPackageIDs |
23124 | 6373 |
select:[:projectID | |
6374 |
projectID ~= PackageId noProjectID |
|
6375 |
and:[ (projectID asPackageId parentPackage) = myPackage ]]. |
|
13419 | 6376 |
|
6377 |
" |
|
6378 |
self searchForSubProjects |
|
9664 | 6379 |
bosch_dapasx_Application searchForSubProjects |
6380 |
stx_goodies_refactoryBrowser_changes searchForSubProjects |
|
6381 |
" |
|
6382 |
||
6383 |
"Created: / 07-08-2006 / 20:42:39 / fm" |
|
6384 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
10215 | 6385 |
"Modified: / 05-12-2006 / 18:04:27 / cg" |
9664 | 6386 |
! |
6387 |
||
6388 |
setupForType:typeOrNil |
|
9714 | 6389 |
typeOrNil = GUIApplicationType ifTrue:[ |
23124 | 6390 |
self compile: |
12425 | 6391 |
'isGUIApplication |
6392 |
"return true, if this is a GUI application. |
|
6393 |
(these need more libraries and use a different startup procedure)" |
|
6394 |
||
6395 |
^ true |
|
6396 |
' |
|
23124 | 6397 |
categorized:'description'. |
6398 |
self setSuperclass: ApplicationDefinition. |
|
6399 |
^ self |
|
9664 | 6400 |
]. |
12856
1651184275a2
comment/format in: #setupForType:
Claus Gittinger <cg@exept.de>
parents:
12804
diff
changeset
|
6401 |
|
9714 | 6402 |
typeOrNil = NonGUIApplicationType ifTrue:[ |
23124 | 6403 |
self compile: |
12425 | 6404 |
'isGUIApplication |
6405 |
"return true, if this is a GUI application. |
|
6406 |
(these need more libraries and use a different startup procedure)" |
|
6407 |
||
6408 |
^ false |
|
6409 |
' |
|
23124 | 6410 |
categorized:'description'. |
6411 |
self setSuperclass: ApplicationDefinition. |
|
6412 |
^ self |
|
13419 | 6413 |
]. |
12856
1651184275a2
comment/format in: #setupForType:
Claus Gittinger <cg@exept.de>
parents:
12804
diff
changeset
|
6414 |
|
12349 | 6415 |
self theMetaclass removeSelector: #isGUIApplication. |
15070 | 6416 |
self setSuperclass: LibraryDefinition. |
9664 | 6417 |
^ self. |
6418 |
||
6419 |
"Created: / 23-08-2006 / 14:26:10 / cg" |
|
13411 | 6420 |
! |
6421 |
||
6422 |
shouldExcludeTest: test |
|
16257 | 6423 |
^ self excludedFromTestSuite contains:[:spec| |
23124 | 6424 |
(spec isSymbol and:[test class name == spec]) |
6425 |
or:[spec isArray and:[test class name == spec first and:[test selector == spec second]]] |
|
6426 |
]. |
|
13411 | 6427 |
|
6428 |
"Created: / 03-06-2011 / 17:01:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
18323 | 6429 |
! |
6430 |
||
6431 |
verbose:aBoolean |
|
6432 |
"enable/disable diagnostic output, which gives more detail on why package loading fails" |
|
6433 |
||
6434 |
Verbose := aBoolean |
|
6435 |
||
6436 |
" |
|
6437 |
self verbose:true |
|
6438 |
self verbose:false |
|
6439 |
" |
|
9536 | 6440 |
! ! |
6441 |
||
12210 | 6442 |
!ProjectDefinition class methodsFor:'private-extension handling'! |
6443 |
||
15057 | 6444 |
extensionOverwriteInfo |
6445 |
^ extensionOverwriteInfo |
|
6446 |
! |
|
6447 |
||
6448 |
fetchSlotsFrom:myFirstIncarnation |
|
6449 |
"this is invoked in a just loaded instance of myself, |
|
6450 |
to fetch the safe and extensionInfo from my first incarnation" |
|
6451 |
||
6452 |
safeForOverwrittenMethods := myFirstIncarnation safeForOverwrittenMethods. |
|
6453 |
extensionOverwriteInfo := myFirstIncarnation extensionOverwriteInfo. |
|
6454 |
! |
|
6455 |
||
12210 | 6456 |
hasSavedOverwrittenMethods |
6457 |
"true, if any of my methods was overwritten by another loaded package. |
|
6458 |
These methods are now in my safe" |
|
6459 |
||
12208
0b65ddcb68f2
added: #hasSafedOverwrittenMethods
Michael Beyl <mb@exept.de>
parents:
12202
diff
changeset
|
6460 |
^ safeForOverwrittenMethods notEmptyOrNil |
0b65ddcb68f2
added: #hasSafedOverwrittenMethods
Michael Beyl <mb@exept.de>
parents:
12202
diff
changeset
|
6461 |
! |
0b65ddcb68f2
added: #hasSafedOverwrittenMethods
Michael Beyl <mb@exept.de>
parents:
12202
diff
changeset
|
6462 |
|
14984 | 6463 |
methodOverwrittenBy:anExtensionMethod |
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6464 |
"return the (hidden) original method, which was located in another package |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6465 |
and which got overwritten by one of my extension methods. Nil if there is none." |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6466 |
|
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6467 |
|mclass selector oldPackage| |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6468 |
|
12218
a3662ecd1438
changed: #methodOverwrittenBy:
Claus Gittinger <cg@exept.de>
parents:
12213
diff
changeset
|
6469 |
extensionOverwriteInfo isNil ifTrue:[^ nil]. |
a3662ecd1438
changed: #methodOverwrittenBy:
Claus Gittinger <cg@exept.de>
parents:
12213
diff
changeset
|
6470 |
|
14984 | 6471 |
mclass := anExtensionMethod mclass. |
6472 |
selector := anExtensionMethod selector. |
|
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6473 |
oldPackage := extensionOverwriteInfo at:(mclass name,'>>',selector) ifAbsent:nil. |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6474 |
oldPackage isNil ifTrue:[^ nil]. |
13419 | 6475 |
^ oldPackage asPackageId projectDefinitionClass |
23124 | 6476 |
savedOverwrittenMethodForClass:mclass selector:selector. |
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6477 |
! |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6478 |
|
12210 | 6479 |
rememberOverwrittenExtensionMethods |
6480 |
"before loading, tell other packages to keep a safe reference to any method |
|
6481 |
which gets overloaded by me, and also remember here, whome I have overloaded. |
|
6482 |
This allows for two things: |
|
23124 | 6483 |
a) correct fileout of the other base-package (for example, when checking in any of its class) |
6484 |
b) correct unloading of myself" |
|
12210 | 6485 |
|
6486 |
self extensionMethodNames pairWiseDo:[:className :selector | |
|
23124 | 6487 |
|class oldMethod oldPackage defClass| |
6488 |
||
6489 |
class := Smalltalk classNamed:className. |
|
6490 |
class notNil ifTrue:[ |
|
6491 |
oldMethod := class compiledMethodAt:selector. |
|
6492 |
]. |
|
6493 |
oldMethod notNil ifTrue:[ |
|
6494 |
oldPackage := oldMethod package. |
|
6495 |
oldPackage ~= PackageId noProjectID ifTrue:[ |
|
6496 |
defClass := oldPackage asPackageId projectDefinitionClass. |
|
6497 |
defClass notNil ifTrue:[ |
|
6498 |
defClass rememberOverwrittenMethod:oldMethod inClass:class. |
|
6499 |
extensionOverwriteInfo isNil ifTrue:[ |
|
6500 |
extensionOverwriteInfo := Dictionary new. |
|
6501 |
]. |
|
6502 |
extensionOverwriteInfo at:(className,'>>',selector) put:oldPackage. |
|
6503 |
] |
|
6504 |
]. |
|
6505 |
]. |
|
12210 | 6506 |
]. |
6507 |
! |
|
6508 |
||
6509 |
rememberOverwrittenMethod:oldMethod inClass:aClass |
|
6510 |
"invoked from another projectDefinition, when that package is about to be loaded |
|
13419 | 6511 |
and about to overwrite one of my methods. |
6512 |
I will save the method locally, to allow for correct fileout of this class/project or |
|
12210 | 6513 |
to correctly reestablish my methods when the other package is unloaded later." |
6514 |
||
6515 |
|thisIsOneOfMyMethods selector| |
|
6516 |
||
6517 |
selector := oldMethod selector. |
|
6518 |
||
12293
983b9555f6e8
changed: #rememberOverwrittenMethod:inClass:
Claus Gittinger <cg@exept.de>
parents:
12286
diff
changeset
|
6519 |
thisIsOneOfMyMethods := (self classNames includes:aClass theNonMetaclass name) |
23124 | 6520 |
or:[ aClass isPrivate and:[ self classNames includes: aClass topOwningClass theNonMetaclass name ]]. |
12210 | 6521 |
thisIsOneOfMyMethods ifFalse:[ |
23124 | 6522 |
self extensionMethodNames pairWiseDo:[:extClassName :extSelector | |
6523 |
extClassName = aClass name ifTrue:[ |
|
6524 |
selector = extSelector ifTrue:[ |
|
6525 |
thisIsOneOfMyMethods := true |
|
6526 |
]. |
|
6527 |
]. |
|
6528 |
] |
|
12210 | 6529 |
]. |
6530 |
thisIsOneOfMyMethods ifFalse:[ |
|
23124 | 6531 |
"/ self error:'oops - this is not one of my methods' mayProceed:true. |
6532 |
Transcript showCR:self name,' [warning]:not one of my methods in rememberOverwritten'. |
|
6533 |
^ self |
|
12210 | 6534 |
]. |
6535 |
||
6536 |
safeForOverwrittenMethods isNil ifTrue:[ |
|
23124 | 6537 |
safeForOverwrittenMethods := Dictionary new. |
12210 | 6538 |
]. |
14984 | 6539 |
safeForOverwrittenMethods at:(aClass name,'>>',selector) put:oldMethod. |
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6540 |
! |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6541 |
|
12624 | 6542 |
restoreOverwrittenExtensionMethods |
21764 | 6543 |
"after unloading, tell other packages to restore any saved reference to any method |
14981 | 6544 |
which got overloaded by me. |
6545 |
Unfinished!!" |
|
12624 | 6546 |
|
16786 | 6547 |
extensionOverwriteInfo notEmptyOrNil ifTrue:[ |
23124 | 6548 |
self extensionMethodNames pairWiseDo:[:className :selector | |
6549 |
|class oldMethod oldPackage| |
|
6550 |
||
6551 |
oldPackage := extensionOverwriteInfo at:(className,'>>',selector). |
|
6552 |
oldPackage notNil ifTrue:[ |
|
6553 |
class := Smalltalk classNamed:className. |
|
6554 |
class notNil ifTrue:[ |
|
6555 |
oldMethod := oldPackage savedOverwrittenMethodForClass:class selector:selector. |
|
6556 |
oldMethod notNil ifTrue:[ |
|
6557 |
self breakPoint:#cg. |
|
6558 |
]. |
|
6559 |
] |
|
6560 |
]. |
|
6561 |
]. |
|
12624 | 6562 |
]. |
21764 | 6563 |
|
6564 |
"Modified (comment): / 18-05-2017 / 14:49:39 / mawalch" |
|
12624 | 6565 |
! |
6566 |
||
15057 | 6567 |
safeForOverwrittenMethods |
6568 |
^ safeForOverwrittenMethods |
|
6569 |
! |
|
6570 |
||
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6571 |
savedOverwrittenMethodForClass:aClass selector:aSelector |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6572 |
"return one of my saved original methods" |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6573 |
|
13692
2dffef08a4ac
changed: #savedOverwrittenMethodForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
13689
diff
changeset
|
6574 |
safeForOverwrittenMethods isNil ifTrue:[^ nil]. |
12274 | 6575 |
^ safeForOverwrittenMethods at:(aClass name,'>>',aSelector) ifAbsent:nil |
14981 | 6576 |
! |
6577 |
||
6578 |
savedOverwrittenMethods |
|
6579 |
"return my saved original methods" |
|
6580 |
||
6581 |
^ safeForOverwrittenMethods ? #() |
|
12210 | 6582 |
! ! |
6583 |
||
6584 |
!ProjectDefinition class methodsFor:'private-loading'! |
|
6585 |
||
12262
24861bbf25fc
added: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12251
diff
changeset
|
6586 |
checkPrerequisitesForLoading |
14957 | 6587 |
"check if I can be loaded - i.e. if all classes to be extended are already loaded. |
6588 |
Raise an error if not" |
|
6589 |
||
12264 | 6590 |
|classesAlreadyWarned| |
6591 |
||
6592 |
classesAlreadyWarned := Set new. |
|
6593 |
||
13419 | 6594 |
self extensionMethodNames |
23124 | 6595 |
pairWiseDo:[:className :selector | |
6596 |
|class errMsg| |
|
6597 |
||
6598 |
class := Smalltalk classNamed:className. |
|
6599 |
class isNil ifTrue:[ |
|
6600 |
(classesAlreadyWarned includes:className) ifFalse:[ |
|
6601 |
(self classNames includes:className) ifTrue:[ |
|
6602 |
errMsg := 'extension for a class in myself: ',className. |
|
6603 |
] ifFalse:[ |
|
6604 |
errMsg := 'missing class for extension: ',className. |
|
6605 |
]. |
|
6606 |
Logger error:errMsg. |
|
6607 |
self proceedableError:errMsg. |
|
6608 |
classesAlreadyWarned add:className. |
|
6609 |
]. |
|
6610 |
]. |
|
6611 |
] |
|
12263
c6d50824fbba
comment/format in: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12262
diff
changeset
|
6612 |
|
c6d50824fbba
comment/format in: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12262
diff
changeset
|
6613 |
"/ todo: more needed here... |
12731 | 6614 |
|
6615 |
" |
|
6616 |
stx_libjavascript checkPrerequisitesForLoading |
|
6617 |
" |
|
23013 | 6618 |
|
6619 |
"Modified: / 24-05-2018 / 21:04:56 / Claus Gittinger" |
|
12262
24861bbf25fc
added: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12251
diff
changeset
|
6620 |
! |
24861bbf25fc
added: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12251
diff
changeset
|
6621 |
|
15760 | 6622 |
executeHooks: hookSymbol |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
6623 |
"Execute all hooks annotated by the given hook-symbol. |
15760 | 6624 |
Currently supported hooks are: #preLoad, #postLoad, #preUnload." |
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6625 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6626 |
| cls | |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6627 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6628 |
cls := self. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6629 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6630 |
[ cls notNil ] whileTrue:[ |
23124 | 6631 |
cls class selectorsAndMethodsDo:[:selector :method| |
6632 |
(method annotationAt: hookSymbol) notNil ifTrue:[ |
|
6633 |
method numArgs == 0 ifTrue:[ |
|
6634 |
self perform: selector |
|
6635 |
] ifFalse:[ |
|
6636 |
self proceedableError:'Hook for %1 may not have arguments'. |
|
6637 |
] |
|
6638 |
] |
|
6639 |
]. |
|
6640 |
cls := cls superclass. |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6641 |
]. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6642 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6643 |
"Created: / 20-11-2012 / 23:00:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6644 |
"Modified: / 27-11-2012 / 16:15:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23013 | 6645 |
"Modified: / 24-05-2018 / 21:05:03 / Claus Gittinger" |
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6646 |
! |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6647 |
|
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
6648 |
loadAllAutoloadedClasses |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
6649 |
self allClasses do:[:cls | cls autoload] |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
6650 |
|
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
6651 |
"Created: / 21-08-2011 / 17:24:13 / cg" |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
6652 |
! |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
6653 |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6654 |
loadAllClassesAsAutoloaded:asAutoloaded |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6655 |
"load (fileIn) classes that should be present - |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6656 |
install as autoloaded classes marked to be autoloaded. |
10401 | 6657 |
If asAutoloaded == true, all classes will be installed as autoloaded, even if not marked. |
6658 |
||
6659 |
Answer true, if classes have been loaded" |
|
12028 | 6660 |
|
13411 | 6661 |
^self loadAllClassesAsAutoloaded:asAutoloaded languages: ProgrammingLanguage all |
6662 |
||
6663 |
"Created: / 17-08-2006 / 01:01:14 / cg" |
|
6664 |
"Modified: / 26-10-2006 / 12:30:01 / cg" |
|
6665 |
"Modified: / 16-08-2009 / 13:31:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
6666 |
"Modified: / 19-06-2010 / 11:37:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6667 |
! |
|
6668 |
||
6669 |
loadAllClassesAsAutoloaded:asAutoloaded languages: langs |
|
6670 |
"load (fileIn) classes in given languages that should be present - |
|
6671 |
install as autoloaded classes marked to be autoloaded. |
|
6672 |
If asAutoloaded == true, all classes will be installed as autoloaded, even if not marked. |
|
6673 |
langs should be collection of ProgrammingLanguage available in the system. |
|
6674 |
||
6675 |
Answer true, if classes have been loaded" |
|
6676 |
||
6677 |
|classNamesToLoad classNamesToAutoload classNamesToLangs hasClassesToLoad loadedClasses platformName |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6678 |
classesWhichFailedToLoad| |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6679 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6680 |
platformName := OperatingSystem platformName. |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6681 |
classNamesToLoad := OrderedCollection new. |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6682 |
classNamesToAutoload := OrderedCollection new. |
13411 | 6683 |
classNamesToLangs := Dictionary new. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6684 |
|
12315
71599fb91dcf
comment/format in: #packageDirectory
Claus Gittinger <cg@exept.de>
parents:
12314
diff
changeset
|
6685 |
hasClassesToLoad := false. |
13419 | 6686 |
self classNamesAndAttributesDo:[:eachClassname :eachAttributes | |
23124 | 6687 |
|eachClassnameSym isAutoload clsLangAttr clsLang cls | |
6688 |
||
6689 |
eachClassnameSym := eachClassname asSymbol. |
|
6690 |
isAutoload := asAutoloaded or:[eachAttributes includes:#autoload]. |
|
6691 |
clsLangAttr := eachAttributes detect:[:a| a isArray and: [a size == 2 and:[a first == #lang]]] ifNone:[nil]. |
|
6692 |
clsLang := clsLangAttr |
|
6693 |
ifNil:[SmalltalkLanguage instance] |
|
6694 |
ifNotNil:[ProgrammingLanguage named: clsLangAttr second ifNone:[nil]]. |
|
6695 |
classNamesToLangs at: eachClassname put: clsLang. |
|
6696 |
||
6697 |
"no need to (re-)load an existing class, but install if should be loaded" |
|
6698 |
cls := Smalltalk loadedClassNamed:eachClassnameSym. |
|
6699 |
((cls isNil or:[cls isLoaded not and:[isAutoload not]]) and:[clsLang notNil and:[langs includes: clsLang]]) ifTrue:[ |
|
6700 |
(eachAttributes isEmpty |
|
6701 |
or:[(eachAttributes size == 1 and:[isAutoload]) |
|
6702 |
or:[(eachAttributes includes:platformName) |
|
6703 |
or:[eachAttributes contains:[:a| a isArray]]]]) "/FIXME: Hack." |
|
6704 |
ifTrue:[ |
|
6705 |
hasClassesToLoad := true. |
|
6706 |
isAutoload ifTrue:[ |
|
6707 |
classNamesToAutoload add:eachClassnameSym. |
|
6708 |
] ifFalse:[ |
|
6709 |
classNamesToLoad add:eachClassnameSym. |
|
6710 |
]. |
|
6711 |
]. |
|
6712 |
]. |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6713 |
]. |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6714 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6715 |
hasClassesToLoad ifTrue:[ |
23124 | 6716 |
loadedClasses := OrderedCollection new. |
6717 |
||
6718 |
self packageDirectory isNil ifTrue:[ |
|
6719 |
classNamesToLoad notEmpty ifTrue:[ |
|
6720 |
"required classes are missing. |
|
6721 |
Autoloaded classes are considered as optional..." |
|
6722 |
self |
|
6723 |
error:(self name,'[error] cannot install because packageDirectory is unknown for missing classes: ', classNamesToLoad printString) |
|
6724 |
mayProceed:true. |
|
6725 |
^ false. |
|
6726 |
]. |
|
6727 |
(self name,'[info] cannot install autoloaded classes because packageDirectory is unknown') infoPrintCR. |
|
6728 |
^ true. |
|
6729 |
]. |
|
6730 |
||
6731 |
"we need the abbreviations, since sometimes there is no 1-to-1 mapping |
|
6732 |
of class name to file name" |
|
6733 |
||
6734 |
Smalltalk recursiveReadAllAbbreviationsFrom:self packageDirectory maxLevels:1. |
|
6735 |
||
6736 |
"install autoloaded classes first, |
|
6737 |
some others may depend on them" |
|
6738 |
||
6739 |
classNamesToAutoload withIndexDo:[:eachClassName :index| |
|
6740 |
ActivityNotification |
|
6741 |
raiseRequestWith: ((100 / classNamesToAutoload size ) * index) rounded |
|
6742 |
errorString: 'Autoloading class ', eachClassName. |
|
6743 |
||
6744 |
self loadClass: eachClassName asAutoloaded: true language: (classNamesToLangs at: eachClassName) . |
|
6745 |
]. |
|
6746 |
||
6747 |
classesWhichFailedToLoad := OrderedCollection new. |
|
6748 |
classNamesToLoad notEmpty ifTrue:[ |
|
6749 |
Verbose ifTrue:[ |
|
6750 |
Transcript showCR:(' %1: filing in missing classes (%2) individually...' |
|
6751 |
bindWith:self name with:classNamesToLoad size). |
|
6752 |
] |
|
6753 |
]. |
|
6754 |
classNamesToLoad withIndexDo:[:eachClassName :index| |
|
6755 |
|cls| |
|
6756 |
ActivityNotification |
|
6757 |
raiseRequestWith: ((100 / classNamesToLoad size) * index) rounded |
|
6758 |
errorString: 'Loading class ', eachClassName. |
|
6759 |
||
6760 |
Error handle:[:ex | |
|
6761 |
"maybe, fileIn failed, because the load order is wrong. |
|
6762 |
Work around this by installing the class as autoloaded and |
|
6763 |
loading it" |
|
6764 |
||
6765 |
classesWhichFailedToLoad add:eachClassName. |
|
6766 |
self loadClass: eachClassName asAutoloaded: true language: (classNamesToLangs at: eachClassName). |
|
6767 |
] do:[ |
|
6768 |
Verbose ifTrue:[ |
|
6769 |
Transcript showCR:(' %1: filing in %2...' bindWith:self name with:eachClassName). |
|
6770 |
]. |
|
6771 |
cls := self loadClass: eachClassName asAutoloaded: false language: (classNamesToLangs at: eachClassName). |
|
6772 |
cls notNil ifTrue:[ |
|
6773 |
loadedClasses add:cls |
|
6774 |
]. |
|
6775 |
]. |
|
6776 |
]. |
|
6777 |
||
6778 |
classesWhichFailedToLoad do:[:eachClassName | |
|
6779 |
(Smalltalk at:eachClassName) autoload. |
|
6780 |
]. |
|
6781 |
||
6782 |
loadedClasses do:[:eachLoadedClass | |
|
6783 |
"do not initialize, if initialize method is inherited" |
|
6784 |
(eachLoadedClass theMetaclass includesSelector:#initialize) ifTrue:[ |
|
6785 |
eachLoadedClass initialize |
|
6786 |
]. |
|
6787 |
]. |
|
6788 |
^ true. |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6789 |
]. |
10401 | 6790 |
^ false. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6791 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6792 |
"Modified: / 26-10-2006 / 12:30:01 / cg" |
12028 | 6793 |
"Modified: / 16-08-2009 / 13:31:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
13411 | 6794 |
"Created: / 19-06-2010 / 11:35:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6795 |
"Modified: / 19-06-2010 / 15:06:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6796 |
! |
|
6797 |
||
6798 |
loadClass: className asAutoloaded: asAutoloaded language: lang |
|
13592 | 6799 |
| packageDir classFile entry category numClassInstVars cls| |
6800 |
||
6801 |
"Handle smalltalk classes specially to provide backward compatibility" |
|
13411 | 6802 |
lang isSmalltalk ifTrue:[ |
23124 | 6803 |
entry := self abbrevs at: className ifAbsent:[nil]. |
6804 |
||
6805 |
asAutoloaded ifTrue:[ |
|
6806 |
category := entry isNil ifTrue:[#autoloaded] ifFalse:[entry category]. |
|
6807 |
numClassInstVars := entry isNil ifTrue:[0] ifFalse:[entry numClassInstVars]. |
|
6808 |
cls := Smalltalk |
|
6809 |
installAutoloadedClassNamed: className |
|
6810 |
category: category |
|
6811 |
package: self package |
|
6812 |
revision: nil |
|
6813 |
numClassInstVars:numClassInstVars. |
|
6814 |
entry notNil ifTrue:[ |
|
6815 |
cls setClassFilename:(entry fileName,'.st'). |
|
6816 |
]. |
|
6817 |
^ cls. |
|
6818 |
]. |
|
6819 |
^ Smalltalk |
|
6820 |
fileInClass:className |
|
6821 |
package:self package |
|
6822 |
initialize:false |
|
6823 |
lazy:false |
|
6824 |
silent:true |
|
13411 | 6825 |
]. |
6826 |
||
6827 |
"For non-smalltalk language do" |
|
6828 |
asAutoloaded ifTrue:[^self error:'Only Smalltalk classes may be autoloaded (yet)']. |
|
6829 |
||
6830 |
packageDir := self packageDirectory asFilename. |
|
6831 |
classFile := packageDir / ((Smalltalk fileNameForClass: className) , '.' , lang sourceFileSuffix). |
|
6832 |
classFile exists ifFalse:[^nil]. |
|
6833 |
lang fileIn: classFile. |
|
6834 |
^nil "FIXME: should return the class" |
|
6835 |
||
6836 |
"Created: / 19-06-2010 / 09:11:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6837 |
"Modified: / 06-03-2011 / 18:29:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13592 | 6838 |
"Modified: / 18-08-2011 / 14:22:15 / cg" |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6839 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6840 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6841 |
loadClassLibrary |
10430
fc34b59eca00
Don not try to load a class library already linked to the executable
Stefan Vogel <sv@exept.de>
parents:
10426
diff
changeset
|
6842 |
"try to load a binary class library |
16146 | 6843 |
Return true if ok, raise an exception if not." |
10430
fc34b59eca00
Don not try to load a class library already linked to the executable
Stefan Vogel <sv@exept.de>
parents:
10426
diff
changeset
|
6844 |
|
12295 | 6845 |
|libraryName| |
10430
fc34b59eca00
Don not try to load a class library already linked to the executable
Stefan Vogel <sv@exept.de>
parents:
10426
diff
changeset
|
6846 |
|
16894 | 6847 |
self supportedOnPlatform ifFalse:[^ false]. |
6848 |
||
10430
fc34b59eca00
Don not try to load a class library already linked to the executable
Stefan Vogel <sv@exept.de>
parents:
10426
diff
changeset
|
6849 |
libraryName := self libraryName. |
fc34b59eca00
Don not try to load a class library already linked to the executable
Stefan Vogel <sv@exept.de>
parents:
10426
diff
changeset
|
6850 |
|
fc34b59eca00
Don not try to load a class library already linked to the executable
Stefan Vogel <sv@exept.de>
parents:
10426
diff
changeset
|
6851 |
(Smalltalk isClassLibraryLoaded:libraryName) ifTrue:[ |
23124 | 6852 |
"already loaded" |
6853 |
^ true |
|
13419 | 6854 |
]. |
14021 | 6855 |
Verbose ifTrue:[ |
23124 | 6856 |
Transcript showCR:(' %1: loading classLibrary...' bindWith:self name). |
13419 | 6857 |
]. |
12743 | 6858 |
self activityNotification:'Loading classLibrary'. |
6859 |
||
12295 | 6860 |
^ Smalltalk fileInClassLibrary:libraryName inPackage:self package. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6861 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6862 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6863 |
loadExtensions |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6864 |
"load extension methods - do not load if they are already present" |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6865 |
|
16894 | 6866 |
self supportedOnPlatform ifFalse:[^ false]. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6867 |
self hasAllExtensionsLoaded ifFalse:[ |
23124 | 6868 |
self breakPoint:#cg. |
6869 |
Verbose ifTrue:[ |
|
6870 |
Transcript showCR:(' %1: filing in extensions...' bindWith:self name). |
|
6871 |
]. |
|
6872 |
Smalltalk loadExtensionsForPackage:self package. |
|
6873 |
^ true. |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6874 |
]. |
10401 | 6875 |
^ false. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6876 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6877 |
"Created: / 17-08-2006 / 00:21:39 / cg" |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6878 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6879 |
|
15950 | 6880 |
loadExtensionsForLanguage: lang |
6881 |
"load extension methods for given programming language" |
|
6882 |
||
6883 |
| filename file | |
|
16894 | 6884 |
|
6885 |
self supportedOnPlatform ifFalse:[^ self]. |
|
6886 |
||
15950 | 6887 |
filename := 'extensions.' , lang sourceFileSuffix. |
6888 |
file := self packageDirectory / filename. |
|
6889 |
file exists ifTrue:[ |
|
23124 | 6890 |
lang fileIn: file. |
15950 | 6891 |
] |
6892 |
||
6893 |
"Created: / 17-08-2006 / 00:21:39 / cg" |
|
6894 |
"Created: / 25-11-2011 / 18:13:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6895 |
! |
|
6896 |
||
15372 | 6897 |
loadMandatoryPreRequisitesAsAutoloaded:asAutoloaded |
6898 |
"load those packages which are required for loading. |
|
6899 |
Called after my definition has been loaded, but before the rest of the |
|
6900 |
package is." |
|
6901 |
||
6902 |
|prereq| |
|
6903 |
||
22186 | 6904 |
self supportedOnPlatform ifFalse:[ |
23124 | 6905 |
^ self |
22186 | 6906 |
]. |
6907 |
||
6908 |
prereq := self effectiveMandatoryPreRequisites. |
|
15372 | 6909 |
prereq notEmpty ifTrue:[ |
23124 | 6910 |
Verbose ifTrue:[ |
6911 |
Transcript showCR:(' %1 loading mandatory prerequisites...' bindWith:self name). |
|
6912 |
]. |
|
6913 |
self loadPackages:prereq asAutoloaded:asAutoloaded |
|
15372 | 6914 |
]. |
6915 |
! |
|
6916 |
||
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6917 |
loadPackages:aListOfPackages asAutoloaded:asAutoloaded |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6918 |
"load some packages (at least the projectDefinitions and their extensions). |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6919 |
If asAutoloaded == true, classes will be only installed as autoloaded." |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6920 |
|
14764
2497dc2ff1ab
tuned prereq-package loading
Claus Gittinger <cg@exept.de>
parents:
14748
diff
changeset
|
6921 |
Class withoutUpdatingChangesDo:[ |
23124 | 6922 |
aListOfPackages do:[:eachPackageID | |
6923 |
|cls| |
|
6924 |
||
6925 |
cls := self definitionClassForPackage:eachPackageID. |
|
6926 |
(cls isNil or:[cls isLoaded not or:[cls projectIsLoaded not]]) ifTrue:[ |
|
6927 |
Smalltalk loadPackage:eachPackageID asAutoloaded:asAutoloaded. |
|
6928 |
]. |
|
6929 |
]. |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6930 |
]. |
13166
aa93e348e5d3
changed: #loadPackages:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13154
diff
changeset
|
6931 |
|
13167 | 6932 |
"Modified: / 09-12-2010 / 12:36:17 / cg" |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6933 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6934 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6935 |
loadPreRequisitesAsAutoloaded:asAutoloaded |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6936 |
"load other packages (at least the projectDefinitions and their extensions)" |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6937 |
|
12743 | 6938 |
|prereq| |
6939 |
||
6940 |
prereq := self effectivePreRequisites. |
|
14843 | 6941 |
prereq notEmpty ifTrue:[ |
23124 | 6942 |
Verbose ifTrue:[ |
6943 |
Transcript showCR:(' %1 loading prerequisites...' bindWith:self name). |
|
6944 |
]. |
|
6945 |
self loadPackages:prereq asAutoloaded:asAutoloaded |
|
12743 | 6946 |
]. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6947 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6948 |
|
12596 | 6949 |
loadSubProjects |
6950 |
"load other packages (at least the projectDefinitions and their extensions)" |
|
6951 |
||
6952 |
self loadSubProjectsAsAutoloaded:false. |
|
15395 | 6953 |
self effectiveSubProjects do:[:p | |
23124 | 6954 |
|subDef| |
6955 |
||
6956 |
subDef := self definitionClassForPackage:p. |
|
6957 |
subDef notNil ifTrue:[ |
|
6958 |
subDef loadSubProjects |
|
6959 |
]. |
|
12596 | 6960 |
]. |
6961 |
! |
|
6962 |
||
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6963 |
loadSubProjectsAsAutoloaded:asAutoloaded |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6964 |
"load other packages (at least the projectDefinitions and their extensions)" |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6965 |
|
15395 | 6966 |
self loadPackages:(self effectiveSubProjects) asAutoloaded:asAutoloaded |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6967 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6968 |
"Modified: / 25-10-2006 / 17:51:58 / cg" |
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
6969 |
! |
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
6970 |
|
13411 | 6971 |
old_loadAllClassesAsAutoloaded:asAutoloaded |
6972 |
"load (fileIn) classes that should be present - |
|
6973 |
install as autoloaded classes marked to be autoloaded. |
|
6974 |
If asAutoloaded == true, all classes will be installed as autoloaded, even if not marked. |
|
6975 |
||
6976 |
Answer true, if classes have been loaded" |
|
6977 |
||
6978 |
|classNamesToLoad classNamesToAutoload hasClassesToLoad loadedClasses platformName |
|
6979 |
classesWhichFailedToLoad| |
|
6980 |
||
6981 |
platformName := OperatingSystem platformName. |
|
6982 |
classNamesToLoad := OrderedCollection new. |
|
6983 |
classNamesToAutoload := OrderedCollection new. |
|
6984 |
||
6985 |
hasClassesToLoad := false. |
|
13419 | 6986 |
self classNamesAndAttributesDo:[:eachClassname :eachAttributes | |
23124 | 6987 |
|eachClassnameSym isAutoload cls| |
6988 |
||
6989 |
eachClassnameSym := eachClassname asSymbol. |
|
6990 |
isAutoload := asAutoloaded or:[eachAttributes includes:#autoload]. |
|
6991 |
||
6992 |
"no need to (re-)load an existing class, but install if should be loaded" |
|
6993 |
cls := Smalltalk loadedClassNamed:eachClassnameSym. |
|
6994 |
(cls isNil or:[cls isLoaded not and:[isAutoload not]]) ifTrue:[ |
|
6995 |
(eachAttributes isEmpty |
|
6996 |
or:[(eachAttributes size == 1 and:[isAutoload]) |
|
6997 |
or:[eachAttributes includes:platformName]]) ifTrue:[ |
|
6998 |
hasClassesToLoad := true. |
|
6999 |
isAutoload ifTrue:[ |
|
7000 |
classNamesToAutoload add:eachClassnameSym. |
|
7001 |
] ifFalse:[ |
|
7002 |
classNamesToLoad add:eachClassnameSym. |
|
7003 |
]. |
|
7004 |
]. |
|
7005 |
]. |
|
13411 | 7006 |
]. |
7007 |
||
7008 |
hasClassesToLoad ifTrue:[ |
|
23124 | 7009 |
loadedClasses := OrderedCollection new. |
7010 |
||
7011 |
self packageDirectory isNil ifTrue:[ |
|
7012 |
self |
|
7013 |
error:(self name,'[error] cannot install because packageDirectory is unknown') |
|
7014 |
mayProceed:true. |
|
7015 |
^ false. |
|
7016 |
]. |
|
7017 |
||
7018 |
"we need the abbreviations, since sometimes there is no 1-to-1 mapping |
|
7019 |
of class name to file name" |
|
7020 |
||
7021 |
Smalltalk recursiveReadAllAbbreviationsFrom:self packageDirectory maxLevels:1. |
|
7022 |
||
7023 |
"install autoloaded classes first, |
|
7024 |
some others may depend on them" |
|
7025 |
||
7026 |
classNamesToAutoload withIndexDo:[:eachClassName :index| |
|
7027 |
ActivityNotification |
|
7028 |
raiseRequestWith: ((100 / classNamesToAutoload size ) * index) rounded |
|
7029 |
errorString: 'Autoloading class ', eachClassName. |
|
7030 |
||
7031 |
Smalltalk |
|
7032 |
installAutoloadedClassNamed:eachClassName |
|
7033 |
category:#autoloaded "FIXME" |
|
7034 |
package:self package |
|
7035 |
revision:nil |
|
7036 |
numClassInstVars:0. "FIXME" |
|
7037 |
]. |
|
7038 |
||
7039 |
classesWhichFailedToLoad := OrderedCollection new. |
|
7040 |
classNamesToLoad notEmpty ifTrue:[ |
|
7041 |
Verbose ifTrue:[ |
|
7042 |
Transcript showCR:(' %1: filing in missing classes (%2) individually...' |
|
7043 |
bindWith:self name with:classNamesToLoad size). |
|
7044 |
] |
|
7045 |
]. |
|
7046 |
classNamesToLoad withIndexDo:[:eachClassName :index| |
|
7047 |
|cls| |
|
7048 |
ActivityNotification |
|
7049 |
raiseRequestWith: ((100 / classNamesToLoad size) * index) rounded |
|
7050 |
errorString: 'Loading class ', eachClassName. |
|
7051 |
||
7052 |
Error handle:[:ex | |
|
7053 |
"maybe, fileIn failed, because the load order is wrong. |
|
7054 |
Work around this by installing the class as autoloaded and |
|
7055 |
loading it" |
|
7056 |
||
7057 |
classesWhichFailedToLoad add:eachClassName. |
|
7058 |
Smalltalk |
|
7059 |
installAutoloadedClassNamed:eachClassName |
|
7060 |
category:#autoloaded "FIXME" |
|
7061 |
package:self package |
|
7062 |
revision:nil |
|
7063 |
numClassInstVars:0. "FIXME" |
|
7064 |
] do:[ |
|
7065 |
Verbose ifTrue:[ |
|
7066 |
Transcript showCR:(' %1: filing in %2...' bindWith:self name with:eachClassName). |
|
7067 |
]. |
|
7068 |
cls := Smalltalk |
|
7069 |
fileInClass:eachClassName |
|
7070 |
package:self package |
|
7071 |
initialize:false |
|
7072 |
lazy:false |
|
7073 |
silent:true. |
|
7074 |
cls notNil ifTrue:[ |
|
7075 |
loadedClasses add:cls |
|
7076 |
]. |
|
7077 |
]. |
|
7078 |
]. |
|
7079 |
||
7080 |
classesWhichFailedToLoad do:[:eachClassName | |
|
7081 |
(Smalltalk at:eachClassName) autoload. |
|
7082 |
]. |
|
7083 |
||
7084 |
loadedClasses do:[:eachLoadedClass | |
|
7085 |
"do not initialize, if initialize method is inherited" |
|
7086 |
(eachLoadedClass theMetaclass includesSelector:#initialize) ifTrue:[ |
|
7087 |
eachLoadedClass initialize |
|
7088 |
]. |
|
7089 |
]. |
|
7090 |
^ true. |
|
13411 | 7091 |
]. |
7092 |
^ false. |
|
7093 |
||
7094 |
"Modified: / 26-10-2006 / 12:30:01 / cg" |
|
7095 |
"Modified: / 16-08-2009 / 13:31:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
7096 |
"Created: / 19-06-2010 / 11:36:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
7097 |
! |
|
7098 |
||
12624 | 7099 |
unloadAllClasses |
20605 | 7100 |
Logger warning:'unloading not yet fully supported' |
12624 | 7101 |
! |
7102 |
||
7103 |
unloadClassLibrary |
|
20604 | 7104 |
Logger warning:'unloading not yet fully supported' |
12624 | 7105 |
! |
7106 |
||
7107 |
unloadSubProjects |
|
7108 |
"unload other packages" |
|
7109 |
||
15395 | 7110 |
self effectiveSubProjects do:[:p | |
23124 | 7111 |
|subDef| |
7112 |
||
7113 |
subDef := self definitionClassForPackage:p. |
|
7114 |
subDef notNil ifTrue:[ |
|
7115 |
subDef unloadSubProjects. |
|
7116 |
subDef unloadPackage. |
|
7117 |
]. |
|
12624 | 7118 |
]. |
7119 |
! |
|
7120 |
||
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
7121 |
update:anAspectSymbol with:argument from:changedObject |
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
7122 |
"when any of my class methods is changed, we mark the project as unloaded. |
12926
620ef12f673c
comment/format in: #update:with:from:
Stefan Vogel <sv@exept.de>
parents:
12856
diff
changeset
|
7123 |
May be some more classes have to be loaded" |
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
7124 |
|
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
7125 |
(changedObject == self class and:[anAspectSymbol == #methodDictionary]) ifTrue:[ |
23124 | 7126 |
self projectIsLoaded:false. |
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
7127 |
] |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
7128 |
! ! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
7129 |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7130 |
!ProjectDefinition class methodsFor:'private-prerequisites'! |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7131 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7132 |
addReferencesToClassesFromGlobalsIn:aSetOfClasses to:usedClassReasons |
12371 | 7133 |
"helper for searchForPreRequisites" |
7134 |
||
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7135 |
aSetOfClasses |
23124 | 7136 |
do:[:aClass | |
7137 |
self |
|
7138 |
addReferencesToClassesFromGlobalsInMethods: |
|
7139 |
(aClass theNonMetaclass methodDictionary values |
|
7140 |
reject:[:m | m isExtension]) |
|
7141 |
to:usedClassReasons. |
|
7142 |
||
7143 |
self |
|
7144 |
addReferencesToClassesFromGlobalsInMethods: |
|
7145 |
(aClass theMetaclass methodDictionary values |
|
7146 |
reject:[:m | m isExtension]) |
|
7147 |
to:usedClassReasons. |
|
7148 |
]. |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7149 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7150 |
"Modified: / 10-10-2006 / 23:03:45 / cg" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7151 |
! |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7152 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7153 |
addReferencesToClassesFromGlobalsInMethods:someMethods to:usedClassReasons |
12371 | 7154 |
"helper for searchForPreRequisites" |
7155 |
||
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7156 |
someMethods do:[:method | |
23124 | 7157 |
|resources| |
7158 |
||
7159 |
resources := method resources. |
|
7160 |
(resources isNil |
|
7161 |
or:[ ((resources includesKey:#'ignoreInPrerequisites') not |
|
7162 |
and:[(resources includesKey:#'example') not])]) |
|
7163 |
ifTrue:[ |
|
7164 |
method usedGlobals |
|
7165 |
do:[:global | |
|
7166 |
|globalsName usedClass| |
|
7167 |
||
7168 |
globalsName := global asSymbol. |
|
7169 |
usedClass := Smalltalk at:globalsName. |
|
7170 |
(usedClass notNil and:[usedClass isClass and:[usedClass isNameSpace not]]) ifTrue:[ |
|
7171 |
usedClass name == globalsName ifTrue:[ "/ skip aliases |
|
7172 |
(usedClassReasons at:usedClass ifAbsentPut:[Set new]) |
|
7173 |
add:(usedClass name, ' - referenced by ', method mclass name,'>>',method selector) |
|
7174 |
] |
|
7175 |
] |
|
7176 |
] |
|
7177 |
] |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7178 |
] |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7179 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7180 |
"Created: / 10-10-2006 / 23:00:07 / cg" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7181 |
"Modified: / 30-05-2007 / 12:48:30 / cg" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7182 |
! |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7183 |
|
15066 | 7184 |
addReferencesToExtensionMethodsIn:someClasses to:usedMethodReasons |
7185 |
"helper for searchForPreRequisites: search for sends of a selector which |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7186 |
is defined in an extension method (in the set of passed-in methods). |
15066 | 7187 |
If found, add the extension method and a reason string to usedReasons. |
7188 |
This should find especially sends to extension methods from libcompat." |
|
7189 |
||
16257 | 7190 |
|allRealExtensions| |
7191 |
||
15066 | 7192 |
"/ only care for methods which are not already implemented in an extension methods's superclass |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7193 |
allRealExtensions := Smalltalk allExtensions |
23124 | 7194 |
select:[:mthd | |
7195 |
|superClass| |
|
7196 |
superClass := mthd mclass superclass. |
|
7197 |
(superClass isNil or:[superClass whichClassIncludesSelector:mthd selector]) isNil |
|
7198 |
]. |
|
15066 | 7199 |
|
7200 |
someClasses do:[:eachClass | |
|
23124 | 7201 |
eachClass instAndClassMethodsDo:[:method | |
7202 |
|resources extensionsSent| |
|
7203 |
||
7204 |
resources := method resources. |
|
7205 |
(resources isNil |
|
7206 |
or:[ ((resources includesKey:#'ignoreInPrerequisites') not |
|
7207 |
and:[(resources includesKey:#'example') not])]) |
|
7208 |
ifTrue:[ |
|
7209 |
extensionsSent := allRealExtensions select:[:ext | method messagesSent includes:ext selector]. |
|
7210 |
extensionsSent do:[:eachExtensionMethod | |
|
7211 |
(usedMethodReasons at:eachExtensionMethod ifAbsentPut:[Set new]) |
|
7212 |
add:(eachExtensionMethod selector, ' - sent by ', method mclass name,'>>',method selector) |
|
7213 |
] |
|
7214 |
] |
|
7215 |
] |
|
15066 | 7216 |
] |
7217 |
! |
|
7218 |
||
19955 | 7219 |
allMandatoryPreRequisites |
7220 |
"answer all (recursive) mandatory prerequisite project ids of myself - in random order." |
|
7221 |
||
7222 |
^ self allPreRequisites:#effectiveMandatoryPreRequisites. |
|
7223 |
||
7224 |
" |
|
23124 | 7225 |
stx_libbasic allMandatoryPreRequisites |
19955 | 7226 |
stx_libbasic2 allMandatoryPreRequisites |
23124 | 7227 |
stx_libview2 allMandatoryPreRequisites |
7228 |
stx_libcomp allMandatoryPreRequisites |
|
19955 | 7229 |
" |
7230 |
||
7231 |
"Created: / 06-06-2016 / 12:19:39 / cg" |
|
7232 |
! |
|
7233 |
||
7234 |
allMandatoryPreRequisitesSorted |
|
7235 |
[ |
|
23124 | 7236 |
^ self allPreRequisitesSorted:#effectiveMandatoryPreRequisites |
19955 | 7237 |
] on:Error do:[:ex | |
23124 | 7238 |
(self confirm:(self name,' [warning]: cycle in prerequisites:' ,, Character cr, ' ', (ex parameter printStringWithSeparator:' -> ') ,, Character cr, 'Proceed with incomplete (mandatory) prerequites?')) |
7239 |
ifFalse:[ |
|
7240 |
AbortOperationRequest raise |
|
7241 |
]. |
|
7242 |
^ self allPreRequisitesSorted:#mandatoryPreRequisites |
|
19955 | 7243 |
]. |
7244 |
||
7245 |
"Created: / 06-06-2016 / 12:20:40 / cg" |
|
7246 |
! |
|
7247 |
||
14843 | 7248 |
allPreRequisites |
7249 |
"answer all (recursive) prerequisite project ids of myself - in random order." |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7250 |
|
14885 | 7251 |
^ self allPreRequisites:#effectivePreRequisites. |
14843 | 7252 |
|
7253 |
" |
|
7254 |
stx_libbasic allPreRequisites |
|
7255 |
stx_libbasic2 allPreRequisites |
|
7256 |
stx_libview2 allPreRequisites |
|
7257 |
ubs_application allPreRequisites |
|
7258 |
ubs_application allPreRequisitesSorted |
|
7259 |
exept_expecco_application allPreRequisites |
|
7260 |
exept_expeccoNET_application allPreRequisites |
|
7261 |
alspa_batch_application allPreRequisites" |
|
7262 |
"Modified: / 13-04-2011 / 15:30:45 / sr" |
|
7263 |
"Modified (comment): / 06-09-2011 / 08:26:06 / cg" |
|
7264 |
! |
|
7265 |
||
14882 | 7266 |
allPreRequisites:aSelector |
7267 |
"answer all (recursive) prerequisite project ids of myself - in random order." |
|
7268 |
||
7269 |
|result| |
|
7270 |
||
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7271 |
result := self |
23124 | 7272 |
allPreRequisites:aSelector withParentDo:[:parent :prereq | |
7273 |
prereq = self package ifTrue:[ |
|
7274 |
Transcript showCR:('oops: %1 depends on itself' bindWith:prereq) |
|
7275 |
]. |
|
7276 |
]. |
|
14882 | 7277 |
result remove:self package ifAbsent:[]. |
7278 |
^ result. |
|
7279 |
||
7280 |
" |
|
7281 |
stx_libbasic allPreRequisites |
|
7282 |
stx_libbasic2 allPreRequisites |
|
7283 |
stx_libview2 allPreRequisites |
|
7284 |
ubs_application allPreRequisites |
|
7285 |
ubs_application allPreRequisitesSorted |
|
7286 |
exept_expecco_application allPreRequisites |
|
7287 |
exept_expeccoNET_application allPreRequisites |
|
7288 |
alspa_batch_application allPreRequisites" |
|
7289 |
"Modified: / 13-04-2011 / 15:30:45 / sr" |
|
7290 |
"Modified (comment): / 06-09-2011 / 08:26:06 / cg" |
|
7291 |
! |
|
7292 |
||
7293 |
allPreRequisites:aSelector withParentDo:aBlock |
|
7294 |
"answer all (recursive) prerequisite project ids of myself - in random order. |
|
7295 |
If we exclude a project, but one of our prerequisite projects depends on it, |
|
7296 |
then what ????" |
|
7297 |
||
7298 |
|setOfAllPreRequisites toAdd| |
|
7299 |
||
7300 |
setOfAllPreRequisites := Set new. |
|
7301 |
toAdd := Set withAll:(self perform:aSelector). |
|
7302 |
||
7303 |
"is a subproject really a prerequisite?? |
|
7304 |
No, it works the other way: parent projects are prerequisites of sub projects, |
|
7305 |
so the following line has been deleted. |
|
7306 |
Unfortunately the meaning of 'subproject' has never been well defined. SV." |
|
7307 |
"/ toAdd addAll:self effectiveSubProjects. |
|
7308 |
||
7309 |
[toAdd notEmpty] whileTrue:[ |
|
23124 | 7310 |
|aPreRequisiteProjectID def| |
7311 |
||
7312 |
aPreRequisiteProjectID := toAdd removeFirst. |
|
7313 |
(setOfAllPreRequisites includes:aPreRequisiteProjectID) ifFalse:[ |
|
7314 |
setOfAllPreRequisites add:aPreRequisiteProjectID. |
|
7315 |
||
7316 |
def := self definitionClassForPackage:aPreRequisiteProjectID. |
|
7317 |
def isNil ifTrue:[ |
|
7318 |
Transcript showCR:'ProjectDefinition ', aPreRequisiteProjectID, ' is missing - cannot find its preRequisites.'. |
|
7319 |
] ifFalse:[ |
|
7320 |
(def perform:aSelector) |
|
7321 |
select:[:eachSubPreRequisite | (setOfAllPreRequisites includes:eachSubPreRequisite) not] |
|
7322 |
thenDo:[:eachSubPreRequisite | |
|
7323 |
Verbose == true ifTrue:[ |
|
7324 |
Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' requires ', eachSubPreRequisite). |
|
7325 |
]. |
|
7326 |
aBlock value:def value:eachSubPreRequisite. |
|
7327 |
toAdd add:eachSubPreRequisite |
|
7328 |
]. |
|
7329 |
||
7330 |
"but subprojects of our prerequisites are also prerequisites" |
|
14994 | 7331 |
"/ SV: - I don't think so. Either we need them, because they have classes being superclasses |
19587 | 7332 |
"/ or referenced. Or we include the explicitly. In both cases we do not need this code. |
14994 | 7333 |
"/ But we do not want them only because there is a subProject with examples or tests!! |
7334 |
||
7335 |
"/ def effectiveSubProjects |
|
7336 |
"/ select:[:eachSubSubRequisite | eachSubSubRequisite ~= self package and:[ (setOfAllPreRequisites includes:eachSubSubRequisite) not ]] |
|
7337 |
"/ thenDo:[:eachSubSubRequisite | |
|
7338 |
"/ Verbose == true ifTrue:[ |
|
7339 |
"/ Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' hasSub ', eachSubSubRequisite). |
|
7340 |
"/ ]. |
|
7341 |
"/ aBlock value:def value:eachSubSubRequisite. |
|
7342 |
"/ toAdd add:eachSubSubRequisite |
|
7343 |
"/ ]. |
|
23124 | 7344 |
]. |
7345 |
] |
|
14882 | 7346 |
]. |
7347 |
^ setOfAllPreRequisites. |
|
7348 |
||
7349 |
" |
|
7350 |
stx_libbasic allPreRequisites |
|
7351 |
stx_libbasic2 allPreRequisites |
|
7352 |
stx_libview2 allPreRequisites |
|
7353 |
ubs_application allPreRequisites |
|
7354 |
ubs_application allPreRequisitesSorted |
|
7355 |
exept_expecco_application allPreRequisites |
|
7356 |
exept_expeccoNET_application allPreRequisites |
|
7357 |
alspa_batch_application allPreRequisites |
|
7358 |
" |
|
7359 |
||
7360 |
"Created: / 13-04-2011 / 15:23:21 / sr" |
|
7361 |
"Modified: / 20-07-2012 / 18:29:31 / cg" |
|
7362 |
! |
|
7363 |
||
14843 | 7364 |
allPreRequisitesSorted |
18178 | 7365 |
[ |
23124 | 7366 |
^ self allPreRequisitesSorted:#effectivePreRequisites |
18178 | 7367 |
] on:Error do:[:ex | |
23124 | 7368 |
(self confirm:(self name,' [warning]: cycle in prerequisites:' ,, Character cr, ' ', (ex parameter printStringWithSeparator:' -> ') ,, Character cr, 'Proceed with incomplete (only mandatory) prerequites?')) |
7369 |
ifFalse:[ |
|
7370 |
AbortOperationRequest raise |
|
7371 |
]. |
|
7372 |
^ self allPreRequisitesSorted:#mandatoryPreRequisites |
|
18178 | 7373 |
]. |
21509 | 7374 |
|
7375 |
"Modified: / 21-02-2017 / 17:53:35 / cg" |
|
14843 | 7376 |
! |
7377 |
||
14882 | 7378 |
allPreRequisitesSorted:aSelector |
7379 |
"answer all the prerequisites of this projects sorted in |
|
7380 |
the order they are needed. |
|
7381 |
Use this to e.g. compile packages in the dependency order" |
|
7382 |
||
7383 |
|allPreRequisites orderedTuples sortedPackages| |
|
7384 |
||
7385 |
orderedTuples := OrderedCollection new. |
|
7386 |
allPreRequisites := self allPreRequisites:aSelector. |
|
16540
12807abd853b
Use stable topological sort when sorting prerequisites.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16328
diff
changeset
|
7387 |
allPreRequisites := allPreRequisites collect:[ :e | e asString ]. |
14882 | 7388 |
|
7389 |
"/JV@2013-03-13: Added asSortedCollection to make the order of packages |
|
7390 |
"/as stable as possible. Makes merging of makefiles a lot easier. |
|
7391 |
allPreRequisites asSortedCollection do:[:eachPackageID | |
|
23124 | 7392 |
|def preRequisites| |
7393 |
||
7394 |
self assert:(eachPackageID ~= self package). |
|
7395 |
orderedTuples add:(Array with:eachPackageID with:self package). |
|
7396 |
||
7397 |
def := self definitionClassForPackage:eachPackageID. |
|
7398 |
def isNil ifTrue:[ |
|
7399 |
Transcript showCR:'Warning: no definition class for package: ', eachPackageID. |
|
7400 |
((self searchForPreRequisites: eachPackageID) |
|
7401 |
fold:[:d1 :d2| d1 addAll:d2; yourself]) keys |
|
7402 |
] ifFalse:[ |
|
7403 |
preRequisites := def perform:aSelector. |
|
7404 |
preRequisites := preRequisites copyWithoutAll:def excludedFromPreRequisites. |
|
7405 |
preRequisites do:[:eachPrerequisitePackageID| |
|
7406 |
self assert:(eachPrerequisitePackageID ~= eachPackageID). |
|
7407 |
orderedTuples add:(Array with:eachPrerequisitePackageID with:eachPackageID). |
|
7408 |
]. |
|
7409 |
]. |
|
14882 | 7410 |
]. |
7411 |
||
16812 | 7412 |
(orderedTuples contains:[:el | el first = el second]) ifTrue:[ |
23124 | 7413 |
self halt:'something seems to depend upon itself' |
14882 | 7414 |
]. |
16540
12807abd853b
Use stable topological sort when sorting prerequisites.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16328
diff
changeset
|
7415 |
sortedPackages := orderedTuples topologicalSortStable: true. |
14882 | 7416 |
|
7417 |
"packages which only result from extension methods are used for computing the sort order, |
|
7418 |
but they are not added, if not present in the first place" |
|
7419 |
^ sortedPackages select:[:eachProject| allPreRequisites includes:eachProject] |
|
7420 |
||
7421 |
" |
|
7422 |
stx_libbasic allPreRequisitesSorted |
|
7423 |
stx_libbasic2 allPreRequisitesSorted |
|
7424 |
stx_libwidg2 allPreRequisitesSorted |
|
7425 |
exept_expecco allPreRequisitesSorted |
|
7426 |
alspa_batch_application allPreRequisitesSorted |
|
7427 |
ubs_application allPreRequisitesSorted |
|
7428 |
" |
|
7429 |
||
7430 |
"Modified: / 13-04-2011 / 15:19:13 / sr" |
|
16540
12807abd853b
Use stable topological sort when sorting prerequisites.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16328
diff
changeset
|
7431 |
"Modified: / 05-06-2014 / 12:22:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14882 | 7432 |
! |
7433 |
||
19955 | 7434 |
allPreRequisitesWithMandatorySorted |
7435 |
"a list of all prerequisites (mandatory and non-mandatory, |
|
7436 |
with the mandatory ones coming first and being sorted by dependency" |
|
7437 |
||
7438 |
|pre mandatory| |
|
7439 |
||
7440 |
mandatory := self allMandatoryPreRequisitesSorted. |
|
7441 |
pre := OrderedSet withAll:mandatory. |
|
7442 |
self allPreRequisites do:[:each | |
|
23124 | 7443 |
(mandatory includes:each) ifFalse:[ pre add: each ] |
19955 | 7444 |
]. |
7445 |
^ pre |
|
7446 |
||
7447 |
"Created: / 06-06-2016 / 14:30:25 / cg" |
|
7448 |
! |
|
7449 |
||
14882 | 7450 |
allReferences |
7451 |
"answer all (recursive) projects to which I refer - in random order." |
|
7452 |
||
7453 |
|result| |
|
7454 |
||
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7455 |
result := self |
23124 | 7456 |
allPreRequisites:#referencedPreRequisites withParentDo:[:parent :prereq | |
7457 |
prereq = self package ifTrue:[ |
|
7458 |
Transcript showCR:('oops: %1 depends on itself' bindWith:prereq) |
|
7459 |
]. |
|
7460 |
]. |
|
14882 | 7461 |
result remove:self package ifAbsent:[]. |
7462 |
^ result. |
|
7463 |
||
7464 |
" |
|
7465 |
stx_libbasic allReferences |
|
7466 |
stx_libbasic2 allReferences |
|
7467 |
stx_libview2 allReferences |
|
7468 |
ubs_application allReferences |
|
7469 |
ubs_application allReferences |
|
7470 |
exept_expecco_application allReferences |
|
7471 |
exept_expeccoNET_application allReferences |
|
7472 |
alspa_batch_application allReferences |
|
7473 |
" |
|
7474 |
! |
|
7475 |
||
15082 | 7476 |
effectiveMandatoryPreRequisites |
15372 | 7477 |
"get the preRequisites, that are not excluded, which are needed for loading |
7478 |
and compiling (i.e. which must be present BEFORE)" |
|
15082 | 7479 |
|
7480 |
self mandatoryPreRequisites notEmpty ifTrue:[ |
|
23124 | 7481 |
"this is a new subclass - avoid overhead" |
7482 |
^ OrderedSet new |
|
7483 |
addAll:self mandatoryPreRequisites; |
|
7484 |
"/ addAll:self includedInPreRequisites; |
|
7485 |
removeAllFoundIn:self excludedFromMandatoryPreRequisites; |
|
7486 |
removeAllFoundIn:self excludedFromPreRequisites; |
|
7487 |
yourself. |
|
15082 | 7488 |
]. |
7489 |
||
7490 |
"I am an old subclass, where #preRequisites returns a plain array" |
|
7491 |
^ Set new |
|
23124 | 7492 |
addAll:self preRequisites; |
7493 |
addAll:self includedInPreRequisites; |
|
7494 |
removeAllFoundIn:self excludedFromMandatoryPreRequisites; |
|
7495 |
removeAllFoundIn:self excludedFromPreRequisites; |
|
7496 |
remove:self package ifAbsent:[]; |
|
7497 |
yourself. |
|
15082 | 7498 |
! |
7499 |
||
14843 | 7500 |
effectivePreRequisites |
7501 |
"get the preRequisites, that are not excluded. |
|
7502 |
This method appears to be obsolete, because its functionality |
|
7503 |
is now included in #preRequisites. |
|
20527 | 7504 |
But is to be kept for backward compatibilty with old existing subclasses." |
14843 | 7505 |
|
7506 |
self mandatoryPreRequisites notEmpty ifTrue:[ |
|
23124 | 7507 |
"this is a new subclass - avoid overhead" |
7508 |
^ self preRequisites. |
|
14843 | 7509 |
]. |
7510 |
||
15082 | 7511 |
"I am an old subclass, where #preRequisites returns a plain array" |
14843 | 7512 |
^ Set new |
23124 | 7513 |
addAll:self preRequisites; |
7514 |
addAll:self includedInPreRequisites; |
|
7515 |
removeAllFoundIn:self excludedFromPreRequisites; |
|
7516 |
remove:self package ifAbsent:[]; |
|
7517 |
yourself. |
|
14843 | 7518 |
! |
7519 |
||
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7520 |
searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7521 |
"answer a Dictionary where the keys are the prerequisite package for this package |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7522 |
and the values are a Set of reasons, why each package is required" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7523 |
|
15024 | 7524 |
^ self searchForPreRequisites:self package |
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7525 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7526 |
" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7527 |
self searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7528 |
stx_libbasic3 searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7529 |
bosch_dapasx_Application searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7530 |
bosch_dapasx_pav_browser searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7531 |
" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7532 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7533 |
"Created: / 07-08-2006 / 20:42:39 / fm" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7534 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7535 |
"Modified: / 06-09-2011 / 08:30:43 / cg" |
13411 | 7536 |
! |
7537 |
||
7538 |
searchForPreRequisites: packageId |
|
14860 | 7539 |
"answer an array containing two Dictionaries where the keys are the prerequisite package for the given package |
7540 |
and the values are a Set of reasons, why each key package is required. |
|
7541 |
The first entry in the array are the mandatory prereqs (required for compilation), |
|
7542 |
the second entry are the referenced prereqs (required for loading). |
|
7543 |
Referenced prereqs are due to elements accessed at execution time (such as globals)" |
|
13411 | 7544 |
|
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7545 |
^ self searchForPreRequisites: packageId withSubProjects:false |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7546 |
|
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7547 |
" |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7548 |
self searchForPreRequisites |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7549 |
self searchForPreRequisites:#'stx:libwidg3' |
14860 | 7550 |
self searchForPreRequisites:#'stx:libtool' |
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7551 |
bosch_dapasx_Application searchForPreRequisites |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7552 |
bosch_dapasx_pav_browser searchForPreRequisites |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7553 |
" |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7554 |
|
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7555 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7556 |
"Created: / 17-11-2010 / 18:27:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7557 |
"Modified: / 06-09-2011 / 08:30:20 / cg" |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7558 |
! |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7559 |
|
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7560 |
searchForPreRequisites:packageId withSubProjects:withSubProjectsBoolean |
14860 | 7561 |
"answer an array containing two Dictionaries where the keys are the prerequisite package for the given package |
7562 |
and the values are a Set of reasons, why each key package is required. |
|
7563 |
The first entry in the array are the mandatory prereqs (required for compilation), |
|
7564 |
the second entry are the referenced prereqs (required for loading). |
|
7565 |
Referenced prereqs are due to elements accessed at execution time (such as globals)" |
|
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7566 |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7567 |
|requiredClasses mandatoryClassesForLoadingWithReasons referencedClassesWithReasons |
15066 | 7568 |
ignoredPackages packageExtractionBlock mandatoryPackageReasons referencedPackageReasons referencedMethodsWithReasons| |
14843 | 7569 |
|
7570 |
mandatoryClassesForLoadingWithReasons := Dictionary new. |
|
7571 |
referencedClassesWithReasons := Dictionary new. |
|
15066 | 7572 |
referencedMethodsWithReasons := Dictionary new. |
13411 | 7573 |
|
7574 |
"my classes are required" |
|
15098 | 7575 |
requiredClasses := self searchForClassesWithProject: packageId. |
13411 | 7576 |
|
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7577 |
withSubProjectsBoolean ifTrue:[ |
23124 | 7578 |
"my subproject's classes are required" |
7579 |
self effectiveSubProjects do:[:eachProjectName | |
|
7580 |
requiredClasses addAll:(self searchForClassesWithProject:eachProjectName asSymbol) |
|
7581 |
]. |
|
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7582 |
]. |
13411 | 7583 |
|
16802
0875f5d7c9ce
Care for Java classes that are part of a Smalltalk/X package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16786
diff
changeset
|
7584 |
"/ ..but not if they're a Java class |
0875f5d7c9ce
Care for Java classes that are part of a Smalltalk/X package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16786
diff
changeset
|
7585 |
requiredClasses := requiredClasses reject:[:each | each isJavaClass ]. |
0875f5d7c9ce
Care for Java classes that are part of a Smalltalk/X package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16786
diff
changeset
|
7586 |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7587 |
"all superclasses of my classes |
15098 | 7588 |
and my subProject's classes (if required) are mandatory. |
7589 |
All shared pools used by my classes are required as well" |
|
13419 | 7590 |
requiredClasses do:[:cls | |
23124 | 7591 |
(self autoloaded_classNames includes:cls name) ifFalse:[ |
7592 |
cls allSuperclassesDo:[:eachSuperclass | |
|
7593 |
(mandatoryClassesForLoadingWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new]) |
|
7594 |
add: (eachSuperclass name, ' - superclass of ', cls name). |
|
7595 |
]. |
|
7596 |
]. |
|
7597 |
cls sharedPools do:[:eachSharedPool | |
|
7598 |
(mandatoryClassesForLoadingWithReasons at: eachSharedPool ifAbsentPut:[OrderedSet new]) |
|
7599 |
add: (eachSharedPool name, ' - shared pool used by ', cls name). |
|
7600 |
eachSharedPool allSuperclassesDo:[:eachSuperclass | |
|
7601 |
(mandatoryClassesForLoadingWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new]) |
|
7602 |
add: (eachSuperclass name, ' - superclass of shared pool ', eachSharedPool name). |
|
7603 |
] |
|
7604 |
] |
|
13411 | 7605 |
]. |
14843 | 7606 |
"all classes for which I define extensions are mandatory" |
7607 |
self allExtensionClasses do:[:eachExtendedClass | |
|
23124 | 7608 |
(mandatoryClassesForLoadingWithReasons at:eachExtendedClass ifAbsentPut:[OrderedSet new]) |
7609 |
add: (eachExtendedClass name, ' - extended'). |
|
7610 |
eachExtendedClass allSuperclassesDo:[:eachSuperclass | |
|
7611 |
(mandatoryClassesForLoadingWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new]) |
|
7612 |
add: (eachSuperclass name, ' - superclass of extended ', eachExtendedClass name). |
|
7613 |
] |
|
14843 | 7614 |
]. |
13411 | 7615 |
|
7616 |
"all classes referenced by my classes or my subproject's classes |
|
7617 |
are required. But: |
|
23124 | 7618 |
only search for locals refered to by my methods (assuming that superclasses' |
7619 |
prerequisites are specified in their package)." |
|
13411 | 7620 |
|
14843 | 7621 |
self addReferencesToClassesFromGlobalsIn:requiredClasses to:referencedClassesWithReasons. |
7622 |
self addReferencesToClassesFromGlobalsInMethods:(self searchForExtensionsWithProject:self package) to:referencedClassesWithReasons. |
|
15066 | 7623 |
self addReferencesToExtensionMethodsIn:requiredClasses to:referencedMethodsWithReasons. |
14843 | 7624 |
|
13411 | 7625 |
"now map classes to packages and collect the reasons" |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7626 |
packageExtractionBlock := |
23124 | 7627 |
[:classesWithReasons| |
7628 |
|requiredPackageReasons| |
|
7629 |
requiredPackageReasons := Dictionary new. |
|
7630 |
classesWithReasons keysAndValuesDo:[:usedClass :reasonsPerClass| |
|
7631 |
(requiredPackageReasons at:usedClass package ifAbsentPut:[Set new]) |
|
7632 |
addAll:reasonsPerClass. |
|
7633 |
]. |
|
7634 |
"sort, to avoid differences from one generation to the next one" |
|
7635 |
requiredPackageReasons |
|
7636 |
]. |
|
14843 | 7637 |
|
15066 | 7638 |
mandatoryPackageReasons := packageExtractionBlock value:mandatoryClassesForLoadingWithReasons. |
15126 | 7639 |
|
15066 | 7640 |
referencedPackageReasons := packageExtractionBlock value:referencedClassesWithReasons. |
7641 |
||
7642 |
"and map extension method invocations to packages and collect the reasons" |
|
7643 |
referencedMethodsWithReasons keysAndValuesDo:[:usedMethod :reasonsPerMethod | |
|
23124 | 7644 |
(referencedPackageReasons at:usedMethod package ifAbsentPut:[Set new]) |
7645 |
addAll:reasonsPerMethod. |
|
15066 | 7646 |
]. |
14885 | 7647 |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7648 |
ignoredPackages := Set |
23124 | 7649 |
with:packageId |
7650 |
with:PackageId noProjectID. |
|
14885 | 7651 |
|
15066 | 7652 |
referencedPackageReasons removeAllKeys:ignoredPackages ifAbsent:[]. |
15126 | 7653 |
"sort, to avoid differences from one generation to the next one" |
7654 |
referencedPackageReasons keysAndValuesDo:[:eachPackageId :eachReasons | referencedPackageReasons at:eachPackageId put:eachReasons asSortedCollection]. |
|
14885 | 7655 |
|
7656 |
"don't put classes from subProjects into the required list" |
|
7657 |
ignoredPackages addAll:(self siblingsAreSubProjects |
|
23124 | 7658 |
ifTrue:[ self searchForSiblingProjects ] |
7659 |
ifFalse:[ self searchForSubProjects ]) asSet. |
|
14885 | 7660 |
|
15066 | 7661 |
mandatoryPackageReasons removeAllKeys:ignoredPackages ifAbsent:[]. |
15126 | 7662 |
"sort, to avoid differences from one generation to the next one" |
7663 |
mandatoryPackageReasons keysAndValuesDo:[:eachPackageId :eachReasons | mandatoryPackageReasons at:eachPackageId put:eachReasons asSortedCollection]. |
|
14843 | 7664 |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7665 |
^ Array |
23124 | 7666 |
with:mandatoryPackageReasons |
7667 |
with:referencedPackageReasons. |
|
14885 | 7668 |
|
7669 |
" |
|
13411 | 7670 |
self searchForPreRequisites:#'stx:libwidg3' |
7671 |
bosch_dapasx_Application searchForPreRequisites |
|
7672 |
bosch_dapasx_pav_browser searchForPreRequisites |
|
15066 | 7673 |
self searchForPreRequisites:#'stx:goodies/json' withSubProjects:false |
13411 | 7674 |
" |
7675 |
||
7676 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
7677 |
"Created: / 17-11-2010 / 18:27:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7678 |
"Created: / 06-09-2011 / 08:29:37 / cg" |
16802
0875f5d7c9ce
Care for Java classes that are part of a Smalltalk/X package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16786
diff
changeset
|
7679 |
"Modified: / 30-07-2014 / 20:33:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
21509 | 7680 |
"Modified: / 21-02-2017 / 17:45:58 / cg" |
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7681 |
! ! |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7682 |
|
9585 | 7683 |
!ProjectDefinition class methodsFor:'queries'! |
7684 |
||
13419 | 7685 |
allClassNames |
12368 | 7686 |
^ self classNamesForWhich:[:nm :attr | true ]. |
7687 |
! |
|
7688 |
||
13559 | 7689 |
allClasses |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7690 |
^ self allClassNames |
23124 | 7691 |
collect:[:nm | |
7692 |
|cls| |
|
7693 |
||
7694 |
cls := Smalltalk classNamed:nm. |
|
7695 |
cls isNil ifTrue:[ |
|
7696 |
Logger warning:'%1: failed to autoload class %2' with:self name with:nm |
|
7697 |
]. |
|
7698 |
cls |
|
7699 |
] |
|
7700 |
thenSelect:[:cls | cls notNil ]. |
|
13559 | 7701 |
|
7702 |
"Created: / 06-08-2011 / 15:47:36 / cg" |
|
7703 |
! |
|
7704 |
||
13636 | 7705 |
allExtensionClasses |
7706 |
"answer the set of classes, which are extended by the package. |
|
7707 |
includes all superclasses of the extended classes" |
|
7708 |
||
7709 |
^ self extensionClassesWithSuperclasses:true |
|
7710 |
||
7711 |
" |
|
7712 |
stx_libboss allExtensionClasses |
|
7713 |
" |
|
7714 |
||
7715 |
"Created: / 06-09-2011 / 10:15:54 / cg" |
|
7716 |
! |
|
7717 |
||
13419 | 7718 |
autoloaded_classNames |
14042
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
7719 |
"the opposite of compiled class names" |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
7720 |
|
12368 | 7721 |
^ self classNamesForWhich:[:nm :attr | attr notEmptyOrNil and:[attr includes:#autoload]]. |
7722 |
||
7723 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
7724 |
"Created: / 30-08-2007 / 18:48:09 / cg" |
|
7725 |
! |
|
7726 |
||
14978 | 7727 |
canHaveExtensions |
7728 |
"return true, if this class allows extensions from other packages. |
|
7729 |
Private classes, namespaces and projectDefinitions don't allow this" |
|
7730 |
||
7731 |
^ self isAbstract |
|
7732 |
||
7733 |
" |
|
7734 |
Smalltalk allClasses select:[:each | each canHaveExtensions not] |
|
7735 |
" |
|
7736 |
||
7737 |
"Created: / 30-08-2006 / 15:29:49 / cg" |
|
7738 |
! |
|
7739 |
||
13419 | 7740 |
classNames |
12368 | 7741 |
"answer an array containing all the class names of the project's classes" |
7742 |
||
7743 |
^ self classNamesAndAttributesAsSpecArray collect:[:entry | entry first]. |
|
7744 |
||
7745 |
" |
|
7746 |
stx_libhtml classNames |
|
7747 |
stx_libhtml classNamesAndAttributesAsSpecArray |
|
7748 |
" |
|
7749 |
! |
|
7750 |
||
13419 | 7751 |
classNamesForWhich:aBlock |
12368 | 7752 |
"a correponding method with real names is generated in my subclasses" |
7753 |
||
7754 |
|coll| |
|
7755 |
||
7756 |
coll := OrderedCollection new. |
|
7757 |
self classNamesAndAttributesDo:[:nm :attributes | |
|
23124 | 7758 |
(aBlock value:nm value:attributes) ifTrue:[ |
7759 |
coll add:nm. |
|
7760 |
]. |
|
12368 | 7761 |
]. |
7762 |
^ coll |
|
7763 |
||
7764 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
7765 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
7766 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
|
7767 |
! |
|
7768 |
||
7769 |
classes |
|
7770 |
"list my classes. |
|
7771 |
Project must be loaded - otherwise an error is reported here. |
|
7772 |
Use #classNames if you are only interested in the names" |
|
7773 |
||
13728 | 7774 |
^ self classNames collect:[:nm | Smalltalk at:nm ifAbsent:[self error:'Missing class: ',nm]] |
12368 | 7775 |
|
7776 |
" |
|
7777 |
stx_libbasic3 classNames |
|
7778 |
stx_libbasic3 classes |
|
7779 |
" |
|
13728 | 7780 |
|
7781 |
"Modified: / 27-09-2011 / 18:12:33 / cg" |
|
12368 | 7782 |
! |
7783 |
||
13419 | 7784 |
compiled_classNames |
14042
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
7785 |
"the opposite of autoloaded class names" |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
7786 |
|
12368 | 7787 |
^ self classNamesForWhich:[:nm :attr | attr isEmptyOrNil or:[(attr includes:#autoload) not]]. |
7788 |
||
7789 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
7790 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
7791 |
"Modified: / 21-08-2006 / 18:48:31 / cg" |
|
14042
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
7792 |
"Modified (comment): / 05-03-2012 / 12:21:23 / cg" |
12368 | 7793 |
! |
7794 |
||
7795 |
compiled_classNamesForPlatform |
|
7796 |
"answer the classes to be compiled only for the current platformName" |
|
7797 |
||
7798 |
^ self compiled_classNamesForPlatform:OperatingSystem platformName |
|
7799 |
! |
|
7800 |
||
7801 |
compiled_classNamesForPlatform:platformName |
|
7802 |
"answer the classes to be compiled only for platformName |
|
17638 | 7803 |
platformName is one of #unix, #win32, #vms or #osx (OperatingSystem platformName)" |
12368 | 7804 |
|
13419 | 7805 |
^ self |
23124 | 7806 |
classNamesForWhich:[:nm :attr | |
7807 |
(attr includes:#autoload) not and:[attr includes:platformName] |
|
7808 |
]. |
|
12368 | 7809 |
|
7810 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
7811 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
7812 |
"Modified: / 09-10-2006 / 13:30:08 / cg" |
|
7813 |
! |
|
7814 |
||
7815 |
compiled_classNames_common |
|
7816 |
"classes to be compiled for any platform" |
|
7817 |
||
13419 | 7818 |
^ self |
23124 | 7819 |
classNamesForWhich:[:nm :attr | |
7820 |
attr isEmptyOrNil |
|
7821 |
]. |
|
12368 | 7822 |
|
7823 |
"Created: / 18-08-2006 / 13:37:51 / cg" |
|
7824 |
! |
|
7825 |
||
7826 |
compiled_classNames_unix |
|
7827 |
"class, only to be compiled under unix" |
|
13419 | 7828 |
|
12368 | 7829 |
^ self compiled_classNamesForPlatform:#unix. |
7830 |
||
7831 |
"Created: / 18-08-2006 / 13:37:51 / cg" |
|
7832 |
! |
|
7833 |
||
7834 |
compiled_classNames_windows |
|
7835 |
"class, only to be compiled under windows" |
|
13419 | 7836 |
|
12368 | 7837 |
^ self compiled_classNamesForPlatform:#win32. |
7838 |
||
7839 |
"Created: / 18-08-2006 / 13:37:56 / cg" |
|
7840 |
! |
|
7841 |
||
17500 | 7842 |
compiled_classesForPlatform |
7843 |
"list my classes for the current platform. |
|
7844 |
Project must be loaded - otherwise an error is reported here. |
|
7845 |
Use #classNames if you are only interested in the names" |
|
7846 |
||
23124 | 7847 |
^ self compiled_classNamesForPlatform collect:[:nm | |
7848 |
Smalltalk at:nm ifAbsent:[self error:'Missing class: ',nm]] |
|
17500 | 7849 |
|
7850 |
" |
|
7851 |
stx_libbasic compiled_classesForPlatform |
|
7852 |
stx_libbasic classes |
|
7853 |
" |
|
7854 |
! |
|
7855 |
||
13081 | 7856 |
extensionClasses |
7857 |
"answer the set of classes, which are extended by the package" |
|
7858 |
||
13636 | 7859 |
^ self extensionClassesWithSuperclasses:false |
7860 |
||
7861 |
" |
|
7862 |
stx_libboss extensionClasses |
|
7863 |
" |
|
7864 |
||
7865 |
"Modified: / 06-09-2011 / 10:21:44 / cg" |
|
7866 |
! |
|
7867 |
||
7868 |
extensionClassesWithSuperclasses:withSuperclassesBoolean |
|
7869 |
"answer the set of classes, which are extended by the package" |
|
7870 |
||
13081 | 7871 |
|classes| |
7872 |
||
7873 |
classes := IdentitySet new. |
|
7874 |
||
13419 | 7875 |
self extensionMethodNames pairWiseDo:[:className :selector | |
23124 | 7876 |
|mthdCls extendedClass| |
7877 |
||
7878 |
mthdCls := Smalltalk classNamed:className. |
|
7879 |
(mthdCls notNil and:[mthdCls isLoaded]) ifTrue:[ |
|
7880 |
extendedClass := mthdCls theNonMetaclass. |
|
7881 |
(classes includes:extendedClass) ifFalse:[ |
|
7882 |
withSuperclassesBoolean ifTrue:[ |
|
7883 |
extendedClass withAllSuperclassesDo:[:eachClass | |
|
7884 |
classes add:eachClass. |
|
7885 |
]. |
|
7886 |
] ifFalse:[ |
|
7887 |
classes add:extendedClass. |
|
7888 |
]. |
|
7889 |
]. |
|
7890 |
]. |
|
13081 | 7891 |
]. |
7892 |
^ classes. |
|
7893 |
||
7894 |
" |
|
23124 | 7895 |
stx_libboss extensionClasses |
13636 | 7896 |
" |
7897 |
||
7898 |
"Created: / 06-09-2011 / 10:17:06 / cg" |
|
13081 | 7899 |
! |
7900 |
||
12368 | 7901 |
extensionMethods |
7902 |
"list my extension methods. |
|
7903 |
Project must be loaded - otherwise an error is reported here. |
|
7904 |
Use #extensionMethodsNames if you are only interested in the names" |
|
7905 |
||
13419 | 7906 |
^ self extensionMethodNames |
23124 | 7907 |
pairWiseCollect:[:className :selector | |
7908 |
(Smalltalk classNamed:className) compiledMethodAt:selector. |
|
7909 |
]. |
|
12368 | 7910 |
|
7911 |
" |
|
7912 |
stx_libbasic2 extensionMethodNames |
|
7913 |
stx_libbasic2 extensionMethods |
|
7914 |
" |
|
7915 |
! |
|
7916 |
||
13081 | 7917 |
extensionPackages |
7918 |
"answer the set of packages, which are extended by this package" |
|
7919 |
||
13636 | 7920 |
^ self allExtensionClasses collect:[:eachClass| eachClass package] |
7921 |
||
7922 |
" |
|
23124 | 7923 |
stx_libboss extensionPackages |
13636 | 7924 |
" |
7925 |
||
7926 |
"Modified: / 06-09-2011 / 10:20:47 / cg" |
|
13081 | 7927 |
! |
7928 |
||
10144 | 7929 |
hasAllClassesFullyLoaded |
14957 | 7930 |
"return true, if all classes are present and loaded (not autoloaded)" |
10144 | 7931 |
|
7932 |
^ self hasAllClassesLoaded:true |
|
7933 |
||
7934 |
"Created: / 25-10-2006 / 16:08:25 / cg" |
|
7935 |
! |
|
7936 |
||
9627 | 7937 |
hasAllClassesLoaded |
10205 | 7938 |
"return true, if all classes are present (although, some might be autoloaded)" |
10144 | 7939 |
|
7940 |
^ self hasAllClassesLoaded:false |
|
7941 |
||
7942 |
"Modified: / 25-10-2006 / 16:08:11 / cg" |
|
7943 |
! |
|
7944 |
||
7945 |
hasAllClassesLoaded:checkIfFullyLoaded |
|
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
7946 |
"check if all classes for this platform are present. |
12421
67898c88eceb
comment/format in: #hasAllClassesLoaded:
Claus Gittinger <cg@exept.de>
parents:
12416
diff
changeset
|
7947 |
If checkIfFullyLoaded is true, they must be fully loaded; that means: not autoloaded" |
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
7948 |
|
13419 | 7949 |
^ (self |
23124 | 7950 |
hasClasses:(self classNamesForWhich:[:nm :attr | attr isEmptyOrNil or:[ attr includes:#autoload]]) |
7951 |
loaded:checkIfFullyLoaded) |
|
10154 | 7952 |
and:[ |
23124 | 7953 |
self |
7954 |
hasClasses:(self compiled_classNamesForPlatform:OperatingSystem platformName) |
|
7955 |
loaded:checkIfFullyLoaded ] |
|
10154 | 7956 |
|
7957 |
"Modified: / 07-11-2006 / 11:47:30 / cg" |
|
7958 |
! |
|
7959 |
||
7960 |
hasAllCompiledClassesFullyLoaded |
|
7961 |
"return true, if all compiled classes are present and loaded" |
|
7962 |
||
7963 |
^ self hasAllCompiledClassesLoaded:true |
|
7964 |
||
7965 |
"Created: / 07-11-2006 / 11:48:02 / cg" |
|
7966 |
! |
|
7967 |
||
7968 |
hasAllCompiledClassesLoaded:checkIfFullyLoaded |
|
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
7969 |
"check if all compiled classes for this platform are present. |
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
7970 |
If checkIfFullyLoaded is true, they must be fully loaded, that is not autoloaded" |
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
7971 |
|
13419 | 7972 |
^ (self |
23124 | 7973 |
hasClasses:(self classNamesForWhich:[:nm :attr | attr isEmptyOrNil]) |
7974 |
loaded:checkIfFullyLoaded) |
|
10154 | 7975 |
and:[ |
13419 | 7976 |
self |
23124 | 7977 |
hasClasses:(self compiled_classNamesForPlatform:OperatingSystem platformName) |
7978 |
loaded:checkIfFullyLoaded |
|
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
7979 |
] |
9585 | 7980 |
! |
7981 |
||
9627 | 7982 |
hasAllExtensionsLoaded |
10203
b210e7832fe1
Do not autoload when checking for extensions
Stefan Vogel <sv@exept.de>
parents:
10200
diff
changeset
|
7983 |
"answer true, if all extensions of this package have been loaded. |
b210e7832fe1
Do not autoload when checking for extensions
Stefan Vogel <sv@exept.de>
parents:
10200
diff
changeset
|
7984 |
This is a query - so no side effects please" |
b210e7832fe1
Do not autoload when checking for extensions
Stefan Vogel <sv@exept.de>
parents:
10200
diff
changeset
|
7985 |
|
18988 | 7986 |
(self extensionMethodNames ? #()) pairWiseDo:[:className :selector | |
23124 | 7987 |
|cls| |
7988 |
||
7989 |
cls := Smalltalk loadedClassNamed:className. |
|
7990 |
cls isNil ifTrue:[ |
|
7991 |
Verbose ifTrue:[ |
|
7992 |
Transcript showCR:(self name,' missing extension class "',className,'".'). |
|
7993 |
]. |
|
7994 |
^ false |
|
7995 |
]. |
|
7996 |
"there is no possibility that we installed an extension method in an unloaded class" |
|
7997 |
(cls isLoaded not or:[(cls compiledMethodAt:selector) isNil]) ifTrue:[ |
|
7998 |
Verbose ifTrue:[ |
|
7999 |
Transcript showCR:(self name,' missing extension method "',className,'>>',selector,'".'). |
|
8000 |
]. |
|
8001 |
^ false |
|
8002 |
]. |
|
9627 | 8003 |
]. |
8004 |
^ true. |
|
8005 |
||
8006 |
"Created: / 17-08-2006 / 00:50:01 / cg" |
|
10140 | 8007 |
"Modified: / 25-10-2006 / 00:01:10 / cg" |
9850 | 8008 |
! |
8009 |
||
10369
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8010 |
hasClasses:classNames loaded:checkIfFullyLoaded |
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8011 |
"answer true, if all classes referenced by classNames have been loaded |
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8012 |
into the image. If checkIfFullyLoaded, classes installed as autoloaded |
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8013 |
are not considered" |
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8014 |
|
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8015 |
classNames do:[:eachClassName | |
23124 | 8016 |
|cls| |
8017 |
||
8018 |
cls := Smalltalk loadedClassNamed:eachClassName. |
|
8019 |
cls isNil ifTrue:[ |
|
8020 |
Verbose ifTrue:[ |
|
8021 |
(self name, ' [info]: missing class: ', eachClassName) infoPrintCR. |
|
8022 |
]. |
|
8023 |
^ false |
|
8024 |
]. |
|
8025 |
(checkIfFullyLoaded and:[cls isLoaded not]) ifTrue:[ |
|
8026 |
Verbose ifTrue:[ |
|
8027 |
(self name,' [info]: unloaded class: ', eachClassName) infoPrintCR. |
|
8028 |
]. |
|
8029 |
^ false. |
|
8030 |
]. |
|
10369
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8031 |
]. |
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8032 |
|
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8033 |
^ true |
10154 | 8034 |
! |
8035 |
||
9906
9efd21c9b1b6
hasExtensions is a bad name (conflicts with the other query)
Claus Gittinger <cg@exept.de>
parents:
9904
diff
changeset
|
8036 |
hasExtensionMethods |
9850 | 8037 |
^ self extensionMethodNames notEmpty |
8038 |
||
8039 |
"Created: / 14-09-2006 / 14:19:35 / cg" |
|
10005 | 8040 |
! |
8041 |
||
12369 | 8042 |
hasPostLoadAction |
8043 |
"/ true if postLoadAction has been redefined |
|
8044 |
^ (self class whichClassIncludesSelector:#postLoadAction) theNonMetaclass isAbstract not |
|
8045 |
! |
|
8046 |
||
8047 |
hasPostUnloadAction |
|
8048 |
"/ true if postUnloadAction has been redefined |
|
8049 |
^ (self class whichClassIncludesSelector:#postUnloadAction) theNonMetaclass isAbstract not |
|
8050 |
! |
|
8051 |
||
8052 |
hasPreLoadAction |
|
8053 |
"/ true if preLoadAction has been redefined |
|
8054 |
^ (self class whichClassIncludesSelector:#preLoadAction) theNonMetaclass isAbstract not |
|
8055 |
! |
|
8056 |
||
8057 |
hasPreUnloadAction |
|
8058 |
"/ true if preUnloadAction has been redefined |
|
8059 |
^ (self class whichClassIncludesSelector:#preUnloadAction) theNonMetaclass isAbstract not |
|
8060 |
! |
|
8061 |
||
13609 | 8062 |
isAbstract |
8063 |
^ self == ProjectDefinition |
|
8064 |
||
8065 |
"Modified (format): / 20-08-2011 / 22:47:46 / cg" |
|
8066 |
! |
|
8067 |
||
17461 | 8068 |
isAutoloaded:aClassOrClassName |
8069 |
|className| |
|
8070 |
||
23124 | 8071 |
className := aClassOrClassName isBehavior |
8072 |
ifTrue:[ aClassOrClassName theNonMetaclass name ] |
|
8073 |
ifFalse:[ aClassOrClassName ]. |
|
17461 | 8074 |
^ self autoloaded_classNames includes:className |
8075 |
||
8076 |
" |
|
8077 |
'stx:goodies/soap/xe/tests' asPackageId projectDefinitionClass |
|
23124 | 8078 |
isAutoloaded:#'SOAP::XeAllTests' |
17461 | 8079 |
" |
8080 |
! |
|
8081 |
||
10140 | 8082 |
isFullyLoaded |
16160 | 8083 |
"as the inherited query isLoaded only refers to a single classes load status, |
8084 |
this one returns true iff the whole project (all classes plus all extensions) is loaded" |
|
8085 |
||
13419 | 8086 |
^ self hasAllCompiledClassesFullyLoaded |
13167 | 8087 |
and:[self hasAllClassesLoaded and:[self hasAllExtensionsLoaded]] |
10140 | 8088 |
|
8089 |
"Created: / 24-10-2006 / 23:52:23 / cg" |
|
13609 | 8090 |
"Modified: / 20-08-2011 / 22:47:16 / cg" |
12331 | 8091 |
! |
8092 |
||
8093 |
projectType |
|
8094 |
^ self subclassResponsibility |
|
16812 | 8095 |
! |
8096 |
||
16892 | 8097 |
supportedOnPlatform |
8098 |
"answer false, if this package is not suitable for |
|
8099 |
the current platform. The default here returns true. |
|
8100 |
Only to be redefined in packages which are definitely not valid |
|
23124 | 8101 |
for the given platform. For example, the OLE package is only |
16892 | 8102 |
usable under windows" |
8103 |
||
8104 |
^ true |
|
8105 |
! |
|
8106 |
||
16812 | 8107 |
whoReferences:aPackageString |
8108 |
"answer, which package references directly or indirectly a package defined by aPackageString" |
|
8109 |
||
22160 | 8110 |
|referrers| |
8111 |
||
8112 |
referrers := OrderedCollection new. |
|
16812 | 8113 |
|
8114 |
self allSubclassesDo:[:eachPackageDefinitionClass| |
|
23124 | 8115 |
(eachPackageDefinitionClass allPreRequisites includes:aPackageString) ifTrue:[ |
8116 |
referrers add:eachPackageDefinitionClass. |
|
8117 |
] |
|
16812 | 8118 |
]. |
8119 |
||
22160 | 8120 |
^ referrers. |
16812 | 8121 |
|
8122 |
" |
|
8123 |
self whoReferences:'stx:libview3' |
|
8124 |
self whoReferences:'stx:libwidg3' |
|
8125 |
self whoReferences:'stx:libbasic' |
|
8126 |
" |
|
22160 | 8127 |
|
8128 |
"Modified (format): / 02-08-2017 / 18:38:27 / cg" |
|
16812 | 8129 |
! |
8130 |
||
8131 |
whoReferencesSorted:aPackageString |
|
8132 |
"answer, which package references directly or indirectly a package define by aPackageString. |
|
22160 | 8133 |
Sort the result, so that the most direct referrers are at the top" |
16812 | 8134 |
|
8135 |
|referers orderedTuples sortedPackages| |
|
8136 |
||
8137 |
referers := self whoReferences:aPackageString. |
|
8138 |
orderedTuples := OrderedCollection new. |
|
8139 |
||
8140 |
referers do:[:eachProjectDefinition | |
|
23124 | 8141 |
|preRequisites| |
8142 |
||
8143 |
preRequisites := eachProjectDefinition effectivePreRequisites. |
|
8144 |
preRequisites do:[:eachPrerequisitePackageID| |
|
8145 |
|eachPrerequisitePackage| |
|
8146 |
||
8147 |
eachPrerequisitePackage := self definitionClassForPackage:eachPrerequisitePackageID. |
|
8148 |
(referers includes:eachPrerequisitePackage) ifTrue:[ |
|
8149 |
orderedTuples add:(Array with:eachPrerequisitePackage with:eachProjectDefinition). |
|
8150 |
]. |
|
8151 |
]. |
|
16812 | 8152 |
]. |
8153 |
||
8154 |
(orderedTuples contains:[:el | el first = el second]) ifTrue:[ |
|
23124 | 8155 |
self halt:'something seems to depend upon itself' |
16812 | 8156 |
]. |
8157 |
sortedPackages := orderedTuples topologicalSortStable: true. |
|
8158 |
||
8159 |
^ sortedPackages. |
|
8160 |
||
8161 |
" |
|
8162 |
self whoReferencesSorted:'stx:libview3' |
|
8163 |
self whoReferencesSorted:'stx:libwidg3' |
|
8164 |
self whoReferencesSorted:'stx:libbasic' |
|
8165 |
" |
|
22160 | 8166 |
|
8167 |
"Modified (comment): / 02-08-2017 / 18:38:03 / cg" |
|
9585 | 8168 |
! ! |
8169 |
||
10774 | 8170 |
!ProjectDefinition class methodsFor:'queries-privacy'! |
8171 |
||
8172 |
showClassDocumentationOf:aClass |
|
12198
f3f15cc6a32e
changed: #showClassDocumentationOf:
Claus Gittinger <cg@exept.de>
parents:
12192
diff
changeset
|
8173 |
"used by the HTMLDoc-generator to ask if a classes' protocol is to be documented |
f3f15cc6a32e
changed: #showClassDocumentationOf:
Claus Gittinger <cg@exept.de>
parents:
12192
diff
changeset
|
8174 |
or hidden. |
f3f15cc6a32e
changed: #showClassDocumentationOf:
Claus Gittinger <cg@exept.de>
parents:
12192
diff
changeset
|
8175 |
(used for expecco, to suppress documentation of workflow- and expecco classes |
f3f15cc6a32e
changed: #showClassDocumentationOf:
Claus Gittinger <cg@exept.de>
parents:
12192
diff
changeset
|
8176 |
in the expecco-class browser)" |
10774 | 8177 |
|
8178 |
^ true |
|
8179 |
||
8180 |
"Created: / 05-11-2007 / 16:44:16 / cg" |
|
8181 |
! ! |
|
8182 |
||
9726 | 8183 |
!ProjectDefinition class methodsFor:'sanity checks'! |
8184 |
||
8185 |
validateDescription |
|
13808 | 8186 |
"perform some consistency checks (set of classes in project same as those listed in description); |
14981 | 8187 |
called before checking in build support files. |
8188 |
Somewhat obsolete: use the ProjectChecker, which does more checks" |
|
13808 | 8189 |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
8190 |
|emptyProjects nonProjects emptyOrNonProjects classesInImage |
14510 | 8191 |
classesInDescription onlyInImage onlyInDescription missingPools myPackage| |
9956 | 8192 |
|
15395 | 8193 |
emptyProjects := Set withAll:self effectiveSubProjects. |
9956 | 8194 |
Smalltalk allClassesDo:[:cls | |
23124 | 8195 |
emptyProjects remove:(cls package) ifAbsent:[]. |
9956 | 8196 |
]. |
15395 | 8197 |
nonProjects := self effectiveSubProjects select:[:p | |
23124 | 8198 |
(self definitionClassForPackage: p) isNil |
8199 |
]. |
|
9956 | 8200 |
|
8201 |
emptyOrNonProjects := Set withAll:emptyProjects. |
|
8202 |
emptyOrNonProjects addAll:nonProjects. |
|
8203 |
||
8204 |
emptyOrNonProjects notEmpty ifTrue:[ |
|
23124 | 8205 |
(Dialog |
8206 |
confirm:('The following subprojects are non-existent, empty or without description:\\ ' |
|
8207 |
, ((emptyOrNonProjects |
|
8208 |
asSortedCollection |
|
8209 |
collect:[:p | p allBold]) |
|
8210 |
asStringWith:'\ ') |
|
8211 |
, '\\Continue ?') withCRs |
|
8212 |
yesLabel:'OK' noLabel:'Cancel') |
|
8213 |
ifFalse:[ |
|
8214 |
AbortSignal raise |
|
8215 |
]. |
|
9956 | 8216 |
]. |
8217 |
||
14510 | 8218 |
myPackage := self package. |
8219 |
classesInImage := Smalltalk allClasses select:[:cls | (cls package == myPackage) and:[cls isPrivate not]]. |
|
13728 | 8220 |
"/ classesInDescription := self classes asIdentitySet. |
8221 |
classesInDescription := IdentitySet new. |
|
8222 |
((self compiled_classNamesForPlatform:(OperatingSystem platformName)) |
|
8223 |
, (self compiled_classNames_common) |
|
8224 |
, (self autoloaded_classNames)) do:[:nm | |
|
23124 | 8225 |
|cls| |
8226 |
||
8227 |
cls := Smalltalk at:nm asSymbol. |
|
8228 |
cls isNil ifTrue:[ |
|
8229 |
(self autoloaded_classNames includes:nm) ifTrue:[ |
|
8230 |
Transcript showCR:'missing autoloaded class: ',nm. |
|
8231 |
] ifFalse:[ |
|
8232 |
self proceedableError:('missing class: ',nm). |
|
8233 |
] |
|
8234 |
] ifFalse:[ |
|
8235 |
classesInDescription add:cls. |
|
8236 |
] |
|
13728 | 8237 |
]. |
8238 |
||
13809
da77d6869c9c
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13808
diff
changeset
|
8239 |
missingPools := Set new. |
da77d6869c9c
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13808
diff
changeset
|
8240 |
classesInDescription do:[:eachClass | |
23124 | 8241 |
eachClass sharedPoolNames do:[:eachPoolName | |
8242 |
|pool| |
|
8243 |
||
8244 |
pool := eachClass nameSpace classNamed:eachPoolName. |
|
8245 |
pool isNil ifTrue:[ |
|
8246 |
eachClass nameSpace ~~ Smalltalk ifTrue:[ |
|
8247 |
pool := Smalltalk classNamed:eachPoolName. |
|
8248 |
] |
|
8249 |
]. |
|
8250 |
pool isNil ifTrue:[ |
|
8251 |
Transcript showCR:'missing pool: ',eachPoolName. |
|
8252 |
missingPools add:eachPoolName. |
|
8253 |
] ifFalse:[ |
|
8254 |
pool isSharedPool ifFalse:[ |
|
8255 |
Transcript showCR:'not a shared pool: ',eachPoolName. |
|
8256 |
missingPools add:eachPoolName. |
|
8257 |
]. |
|
8258 |
]. |
|
8259 |
]. |
|
13809
da77d6869c9c
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13808
diff
changeset
|
8260 |
]. |
14981 | 8261 |
|
13809
da77d6869c9c
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13808
diff
changeset
|
8262 |
missingPools notEmpty ifTrue:[ |
23124 | 8263 |
(Dialog |
8264 |
confirm:('The following sharedpools are non-existent, or not pools:\\ ' |
|
8265 |
, ((missingPools |
|
8266 |
asSortedCollection |
|
8267 |
collect:[:p | p allBold]) |
|
8268 |
asStringWith:'\ ') |
|
8269 |
, '\\Continue ?') withCRs |
|
8270 |
yesLabel:'OK' noLabel:'Cancel') |
|
8271 |
ifFalse:[ |
|
8272 |
AbortOperationRequest raise |
|
8273 |
]. |
|
13809
da77d6869c9c
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13808
diff
changeset
|
8274 |
]. |
da77d6869c9c
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13808
diff
changeset
|
8275 |
|
14981 | 8276 |
"/ also found by ProjectChecker... |
13694
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8277 |
classesInImage ~= classesInDescription ifTrue:[ |
23124 | 8278 |
onlyInImage := (classesInImage reject:[:cls | classesInDescription includes:cls]). |
8279 |
onlyInImage notEmpty ifTrue:[ |
|
8280 |
Transcript show:self name; show:': only in image: '; showCR:onlyInImage |
|
8281 |
]. |
|
8282 |
onlyInDescription := (classesInDescription reject:[:cls | classesInImage includes:cls]). |
|
8283 |
onlyInDescription notEmpty ifTrue:[ |
|
8284 |
Transcript show:self name; show:': only in description: '; showCR:onlyInDescription |
|
8285 |
]. |
|
8286 |
(Dialog confirm:'The set of classes in the image is different from the listed classes in the project definition.\\Proceed?' withCRs) ifFalse:[ |
|
8287 |
AbortOperationRequest raiseRequest |
|
8288 |
] |
|
13694
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8289 |
]. |
14981 | 8290 |
|
14045 | 8291 |
"/ self validateOrderOfClasses |
13694
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8292 |
|
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8293 |
" |
15395 | 8294 |
exept_expecco_application validateDescription |
13694
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8295 |
squeak_vmMaker validateDescription |
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8296 |
" |
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8297 |
|
14045 | 8298 |
"Modified: / 06-03-2012 / 11:31:37 / cg" |
21259 | 8299 |
"Modified: / 17-01-2017 / 16:33:56 / stefan" |
23013 | 8300 |
"Modified: / 24-05-2018 / 21:05:15 / Claus Gittinger" |
14042
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8301 |
! |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8302 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8303 |
validateOrderOfClasses |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8304 |
"check if the project's classes are listed in the correct dependency order in the classList. |
14045 | 8305 |
This would be required, if the generated makefile would compile files in that order, |
8306 |
and superclasses must be compiled before subclasses (for the header files). |
|
8307 |
However, the makefile list is generated by a separate mechanism, so that is not requiered." |
|
14042
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8308 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8309 |
|classesInDescriptionInOrder classesInProject already| |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8310 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8311 |
classesInDescriptionInOrder := OrderedCollection new. |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
8312 |
classesInDescriptionInOrder := |
23124 | 8313 |
self compiled_classNames |
8314 |
collect:[:eachName | |
|
8315 |
|cls| |
|
8316 |
||
8317 |
cls := Smalltalk at:eachName. |
|
8318 |
self assert:cls notNil message:'missing class: ',eachName. |
|
8319 |
cls |
|
8320 |
]. |
|
14042
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8321 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8322 |
classesInProject := classesInDescriptionInOrder asSet. |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8323 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8324 |
already := Set new. |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8325 |
classesInDescriptionInOrder do:[:eachClass | |
23124 | 8326 |
eachClass allSuperclassesDo:[:superclass | |
8327 |
(classesInProject includes:superclass) ifTrue:[ |
|
8328 |
"/ if in the set, it must have been already listed |
|
8329 |
self |
|
8330 |
assert:(already includes:superclass) |
|
8331 |
message:('superclass "%1" not compiled before "%2"' |
|
8332 |
bindWith:superclass name |
|
8333 |
with:eachClass name). |
|
8334 |
]. |
|
8335 |
]. |
|
8336 |
already add:eachClass. |
|
14042
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8337 |
]. |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8338 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8339 |
" |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8340 |
stx_goodies_refactoryBrowser_lint validateOrderOfClasses |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8341 |
squeak_vmMaker validateOrderOfClasses |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8342 |
" |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8343 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8344 |
"Created: / 05-03-2012 / 12:18:45 / cg" |
9726 | 8345 |
! ! |
8346 |
||
9585 | 8347 |
!ProjectDefinition class methodsFor:'testing'! |
8348 |
||
9664 | 8349 |
isApplicationDefinition |
23294 | 8350 |
"true iff an application-package (i.e. not a library). |
8351 |
Applications have a main and startup for standalon start" |
|
8352 |
||
9664 | 8353 |
^ false |
8354 |
||
8355 |
"Created: / 23-08-2006 / 15:17:32 / cg" |
|
9983 | 8356 |
"Modified: / 20-09-2006 / 14:59:56 / cg" |
8357 |
! |
|
8358 |
||
12309
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
8359 |
isConsoleApplication |
23051 | 8360 |
"Used with WIN32 only (i.e. affects bc.mak). |
23124 | 8361 |
Return true, if this is a console application. |
23051 | 8362 |
Console applications have stdout and stderr and open up a command-window |
8363 |
when started. Only console applications can interact with the user in the |
|
8364 |
command line window." |
|
8365 |
||
12309
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
8366 |
^ false |
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
8367 |
|
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
8368 |
"Created: / 20-09-2006 / 14:59:49 / cg" |
23051 | 8369 |
"Modified (comment): / 06-06-2018 / 15:17:21 / Claus Gittinger" |
12309
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
8370 |
! |
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
8371 |
|
16682 | 8372 |
isFolderForProjectsDefinition |
23294 | 8373 |
"true iff an 'empty' project which only holds subprojects, |
8374 |
but no own classes. Examples are stx, exept, etc." |
|
8375 |
||
16682 | 8376 |
^ false |
8377 |
! |
|
8378 |
||
9983 | 8379 |
isGUIApplication |
23294 | 8380 |
"true iff a GUI application. |
8381 |
Will include startup code to open a display" |
|
8382 |
||
9983 | 8383 |
^ false |
8384 |
||
8385 |
"Created: / 20-09-2006 / 14:59:49 / cg" |
|
9664 | 8386 |
! |
8387 |
||
8388 |
isLibraryDefinition |
|
23294 | 8389 |
"true iff a library. |
8390 |
Will NOT include startup code, and can only be loaded into or |
|
8391 |
linked with an application" |
|
8392 |
||
9664 | 8393 |
^ false |
8394 |
||
8395 |
"Created: / 23-08-2006 / 15:17:46 / cg" |
|
9983 | 8396 |
"Modified: / 20-09-2006 / 15:00:00 / cg" |
9664 | 8397 |
! |
8398 |
||
23527 | 8399 |
isPluginDefinition |
8400 |
"is this a plugin (only used by deployed applications)" |
|
8401 |
||
8402 |
^ false |
|
8403 |
||
8404 |
"Created: / 22-09-2018 / 11:01:33 / Claus Gittinger" |
|
8405 |
! |
|
8406 |
||
9627 | 8407 |
isProjectDefinition |
9664 | 8408 |
"concrete i.e. not abstract" |
8409 |
||
14978 | 8410 |
^ self isAbstract not |
9627 | 8411 |
|
8412 |
"Created: / 10-08-2006 / 16:24:02 / cg" |
|
13285 | 8413 |
"Modified: / 08-02-2011 / 10:03:49 / cg" |
9585 | 8414 |
! ! |
8415 |
||
13592 | 8416 |
!ProjectDefinition::AbbrevEntry methodsFor:'accessing'! |
8417 |
||
8418 |
category |
|
8419 |
^ category |
|
8420 |
! |
|
8421 |
||
8422 |
className |
|
8423 |
^ className |
|
8424 |
! |
|
8425 |
||
13695 | 8426 |
className:classNameArg fileName:fileNameArg category:categoryArg numClassInstVars:numClassInstVarsArg |
13592 | 8427 |
className := classNameArg. |
8428 |
fileName := fileNameArg. |
|
8429 |
category := categoryArg. |
|
8430 |
numClassInstVars := numClassInstVarsArg. |
|
8431 |
||
8432 |
"Created: / 18-08-2011 / 14:18:30 / cg" |
|
8433 |
! |
|
8434 |
||
8435 |
fileName |
|
8436 |
^ fileName |
|
8437 |
! |
|
8438 |
||
8439 |
numClassInstVars |
|
8440 |
^ numClassInstVars |
|
8441 |
||
8442 |
"Created: / 18-08-2011 / 14:18:37 / cg" |
|
8443 |
! ! |
|
8444 |
||
20567 | 8445 |
!ProjectDefinition::ApplicationDocumentTypeDescription class methodsFor:'documentation'! |
8446 |
||
8447 |
documentation |
|
8448 |
" |
|
8449 |
for deployment, some systems can make use of additional information |
|
8450 |
on which documents are handled by the application. |
|
8451 |
This is used eg. for double-clicking on a document in OSX. |
|
8452 |
If the deployed app can/should handle this, redefine the |
|
8453 |
applicatinDocumentTypeDescriptions / applicatinDocumentTypeDescriptionsOSX |
|
8454 |
methods in the projectDefinition to return a collection of instances of me. |
|
8455 |
||
8456 |
[author:] |
|
23124 | 8457 |
cg |
20567 | 8458 |
|
8459 |
For example: |
|
23124 | 8460 |
mimeType: 'application/x-expecco-testsuite |
8461 |
extension: 'ets' |
|
8462 |
typeName: 'expecco test suite' |
|
8463 |
iconFileWindows: 'expeccoSuite.ico' |
|
8464 |
iconFileOSX: 'expeccoSuite.icns' |
|
8465 |
roleOSX: 'Editor' |
|
20567 | 8466 |
" |
8467 |
! ! |
|
8468 |
||
8469 |
!ProjectDefinition::ApplicationDocumentTypeDescription methodsFor:'accessing'! |
|
8470 |
||
8471 |
extension |
|
8472 |
"the extension of the document" |
|
23124 | 8473 |
|
20567 | 8474 |
^ extension |
8475 |
! |
|
8476 |
||
8477 |
extension:aString |
|
8478 |
"the extension of the document" |
|
8479 |
||
8480 |
extension := aString. |
|
8481 |
! |
|
8482 |
||
8483 |
iconFileLinux |
|
8484 |
^ iconFileLinux |
|
8485 |
! |
|
8486 |
||
8487 |
iconFileLinux:aString |
|
8488 |
iconFileLinux := aString. |
|
8489 |
! |
|
8490 |
||
8491 |
iconFileOSX |
|
8492 |
^ iconFileOSX |
|
8493 |
! |
|
8494 |
||
8495 |
iconFileOSX:aString |
|
8496 |
iconFileOSX := aString. |
|
8497 |
! |
|
8498 |
||
8499 |
iconFileWindows |
|
8500 |
^ iconFileWindows |
|
8501 |
! |
|
8502 |
||
8503 |
iconFileWindows:aString |
|
8504 |
iconFileWindows := aString. |
|
8505 |
! |
|
8506 |
||
8507 |
mimeType |
|
8508 |
^ mimeType |
|
8509 |
! |
|
8510 |
||
8511 |
mimeType:aString |
|
8512 |
mimeType := aString. |
|
8513 |
! |
|
8514 |
||
8515 |
roleOSX |
|
8516 |
^ roleOSX |
|
8517 |
! |
|
8518 |
||
8519 |
roleOSX:aString |
|
8520 |
roleOSX := aString. |
|
8521 |
! |
|
8522 |
||
8523 |
typeName |
|
8524 |
"something like 'foo Document'; |
|
8525 |
eg. 'expecco test suite', 'expecco log file', etc." |
|
8526 |
||
8527 |
^ typeName |
|
8528 |
! |
|
8529 |
||
21562 | 8530 |
typeName:aString |
8531 |
"aString like 'foo Document'; |
|
20567 | 8532 |
eg. 'expecco test suite', 'expecco log file', etc." |
8533 |
||
21562 | 8534 |
typeName := aString. |
8535 |
||
8536 |
"Modified (comment): / 24-02-2017 / 09:37:26 / cg" |
|
20567 | 8537 |
! ! |
8538 |
||
9569 | 8539 |
!ProjectDefinition class methodsFor:'documentation'! |
9536 | 8540 |
|
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
8541 |
version |
18477 | 8542 |
^ '$Header$' |
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
8543 |
! |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
8544 |
|
12086 | 8545 |
version_CVS |
18477 | 8546 |
^ '$Header$' |
13411 | 8547 |
! |
8548 |
||
8549 |
version_SVN |
|
15221 | 8550 |
^ '$ Id: ProjectDefinition.st 10645 2011-06-09 15:28:45Z vranyj1 $' |
9536 | 8551 |
! ! |
9714 | 8552 |
|
14642 | 8553 |
|
9714 | 8554 |
ProjectDefinition initialize! |