author | Claus Gittinger <cg@exept.de> |
Mon, 16 Dec 2019 16:00:23 +0100 | |
changeset 25135 | 98f799af1e48 |
parent 24840 | 136cc7cdf694 |
child 25151 | ef1a928b257e |
permissions | -rw-r--r-- |
24342 | 1 |
"{ Encoding: utf8 }" |
2 |
||
9553 | 3 |
" |
4 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
23124 | 5 |
All Rights Reserved |
9553 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
9671 | 14 |
"{ Package: 'stx:libbasic' }" |
9536 | 15 |
|
17289 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
9569 | 18 |
Object subclass:#ProjectDefinition |
17289 | 19 |
instanceVariableNames:'' |
20546 | 20 |
classVariableNames:'AbbrevDictionary AccessLock FolderForSubApplicationsType |
21 |
GUIApplicationType LibraryType NonGUIApplicationType |
|
22 |
PackagesBeingLoaded Verbose' |
|
17289 | 23 |
poolDictionaries:'' |
24 |
category:'System-Support-Projects' |
|
9536 | 25 |
! |
26 |
||
14580 | 27 |
ProjectDefinition class instanceVariableNames:'safeForOverwrittenMethods extensionOverwriteInfo projectIsLoaded' |
9607 | 28 |
|
29 |
" |
|
30 |
No other class instance variables are inherited by this class. |
|
31 |
" |
|
32 |
! |
|
33 |
||
13592 | 34 |
Object subclass:#AbbrevEntry |
17289 | 35 |
instanceVariableNames:'className fileName category numClassInstVars' |
36 |
classVariableNames:'' |
|
37 |
poolDictionaries:'' |
|
38 |
privateIn:ProjectDefinition |
|
13592 | 39 |
! |
40 |
||
20567 | 41 |
Object subclass:#ApplicationDocumentTypeDescription |
42 |
instanceVariableNames:'extension iconFileOSX mimeType typeName iconFileWindows |
|
43 |
iconFileLinux roleOSX' |
|
44 |
classVariableNames:'' |
|
45 |
poolDictionaries:'' |
|
46 |
privateIn:ProjectDefinition |
|
47 |
! |
|
48 |
||
9569 | 49 |
!ProjectDefinition class methodsFor:'documentation'! |
9553 | 50 |
|
12210 | 51 |
buildingMakefiles |
52 |
" |
|
53 |
You can define additional rules and flag settings for use in the makeFile generation: |
|
54 |
||
55 |
redefinable build-file attributes: |
|
23124 | 56 |
stcOptimizationOptions -> STCLOCALOPT |
57 |
stcWarningOptions -> STCLOCALOPT |
|
58 |
localIncludes_unix -> LOCALINCLUDES (Make.proto) |
|
59 |
localIncludes_win32 -> LOCALINCLUDES (bc.mak) |
|
13419 | 60 |
|
61 |
for applications: |
|
23124 | 62 |
startupClassName |
63 |
startupSelector |
|
13419 | 64 |
|
65 |
for libraries: |
|
12210 | 66 |
|
67 |
" |
|
68 |
! |
|
69 |
||
9553 | 70 |
copyright |
71 |
" |
|
72 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
23124 | 73 |
All Rights Reserved |
9553 | 74 |
|
75 |
This software is furnished under a license and may be used |
|
76 |
only in accordance with the terms of that license and with the |
|
77 |
inclusion of the above copyright notice. This software may not |
|
78 |
be provided or otherwise made available to, or used by, any |
|
79 |
other person. No title to or ownership of the software is |
|
80 |
hereby transferred. |
|
81 |
" |
|
9714 | 82 |
! |
83 |
||
84 |
documentation |
|
85 |
" |
|
12210 | 86 |
As ST/X is (still) very tightly bound with stc, we keep the package and project information |
23124 | 87 |
in a class-object (instead of some project object) and all queries about package contents and |
88 |
attributes are implemented as class methods. |
|
21562 | 89 |
(after all: a class is an object, which can be asked by sending it messages... |
90 |
... so why would one want extra meta-descriptions with extra syntax?) |
|
23124 | 91 |
|
17025 | 92 |
This has the advantage, that it can be compiled and included in a compiled class library just like any other class. |
21562 | 93 |
|
17025 | 94 |
Every package includes a subclass of me (an instance of my meta), which provides useful |
23124 | 95 |
information about the versioning and packaging. |
96 |
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
|
97 |
files for compilation (see the browser's 'Checkin Build Support File' menu item. For more details, see |
21562 | 98 |
section 'Build Support Files' below). |
17025 | 99 |
|
100 |
When a package is loaded from a binary shared class lib (i.e. a compiled class library is loaded |
|
101 |
via 'Smalltalk loadPackage:'), the loading is done in multiple phases: |
|
23124 | 102 |
1) the shared object is loaded, but not installed (registered) in Smalltalk |
103 |
2) the ProjectDefinition class is registered and initialized. |
|
104 |
3) the ProjectDefinition class is asked to load its prerequisites. |
|
105 |
This may recursively lead to other packages to be loaded |
|
106 |
- either as binary class libraries, as bytecode or from source; whichever is found. |
|
107 |
4) the remaining classes and extensions of the package are registered |
|
12210 | 108 |
|
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
109 |
## Some special notes about extension methods: |
17025 | 110 |
if a package is loaded (Smalltalk loadPackage:'foo:bar/baz'), any already loaded package of which |
111 |
methods are overwritten by an extension method of the loaded package, the other package is asked to safe those |
|
23124 | 112 |
methods in its safe(ForOverwrittenMethods). |
17025 | 113 |
Thus, if the other package or any of its classes is asked |
114 |
to file itself out, it can do so using the safe (otherwise, you'd not be able to check the original class into |
|
115 |
its repository while it has an overriding extension loaded). |
|
116 |
||
117 |
Also, the information about which other package was in charge when a method is overwritten is recorded in |
|
23124 | 118 |
extensionOverwriteInfo. |
21562 | 119 |
This is used to correctly reinstall any overwritten method, whenever a package is unloaded. |
9714 | 120 |
|
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
121 |
## Build Support Files |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
122 |
|
21562 | 123 |
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
|
124 |
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
|
125 |
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
|
126 |
does (should) care for this. |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
127 |
|
21562 | 128 |
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
|
129 |
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
|
130 |
|
23124 | 131 |
* the first parameter is the file name to generate as String, relative to the package root. As directory |
132 |
separator, use slash (as on UNIX), it will be automagically converted to platform's separator. |
|
133 |
* The second parametrer (true or false) tells the SCM whether the file should be generated (and thus |
|
134 |
overwritten) upon each commit (when true) or only the first time (when false). Important: see the |
|
135 |
remark below. |
|
136 |
* The method itself should return file's contents a string. If it returns nil, then the file is *not* |
|
137 |
generated at all. |
|
17303
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 |
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
|
140 |
|
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
141 |
REMARK: CAUTION: |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
142 |
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
|
143 |
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
|
144 |
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
|
145 |
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
|
146 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
147 |
## 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
|
148 |
|
20986 | 149 |
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
|
150 |
1) overriding #additionalRules_make_dot_proto and/or #additionalRules_bc_dot_mak |
23124 | 151 |
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
|
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 |
### 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
|
154 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
155 |
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
|
156 |
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
|
157 |
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
|
158 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
159 |
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
|
160 |
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
|
161 |
#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
|
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 |
### 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
|
164 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
165 |
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
|
166 |
<file:target:> or <file:target:extends:> annotation. For example, |
20624 | 167 |
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
|
168 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
169 |
additionalRuleAnt_make_dot_proto |
23124 | 170 |
<file: 'Make.proto' target: 'ant' extends: 'pre_objs' > |
171 |
||
172 |
^ ' |
|
173 |
java: |
|
174 |
ant -f java/build.xml |
|
175 |
' |
|
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
176 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
177 |
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
|
178 |
|
23124 | 179 |
* file: <String> - name of the file in which to include |
180 |
the rule. Currently only two values are valid: |
|
181 |
'Make.proto' and 'bc.mak'. |
|
182 |
* target: <String> - name of the target' |
|
183 |
* extends: <String> - optional name of the target that this additional |
|
184 |
rule extends. This means that the extending target (specified by target: |
|
185 |
annotation parameter) is called as part of building of the extended target |
|
186 |
(i.e., the target specified by extends: annotation parameter). Not all targets |
|
187 |
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
|
188 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
189 |
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
|
190 |
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
|
191 |
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
|
192 |
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
|
193 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
194 |
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
|
195 |
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
|
196 |
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
|
197 |
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
|
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 |
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
|
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 |
#### 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
|
202 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
203 |
Make.proto: |
23124 | 204 |
all |
205 |
clean |
|
206 |
...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
|
207 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
208 |
bc.mak |
23124 | 209 |
ALL |
210 |
clean |
|
211 |
...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
|
212 |
|
9714 | 213 |
" |
9553 | 214 |
! ! |
9536 | 215 |
|
9569 | 216 |
!ProjectDefinition class methodsFor:'instance creation'! |
9559 | 217 |
|
12371 | 218 |
definitionClassForPackage:aPackageID |
17025 | 219 |
"given a packageID (such as 'stx:libfoo/bar'), lookup the corresponding peoject definition class. |
220 |
Return it, or nil if not present" |
|
221 |
||
12371 | 222 |
^ self definitionClassForPackage:aPackageID createIfAbsent:false |
223 |
||
17025 | 224 |
" |
225 |
ProjectDefinition definitionClassForPackage:'stx:libbasic' |
|
226 |
ProjectDefinition definitionClassForPackage:'stx:libfoobarBaz' |
|
227 |
" |
|
228 |
||
12371 | 229 |
"Modified: / 17-08-2006 / 14:33:35 / cg" |
230 |
! |
|
231 |
||
232 |
definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent |
|
233 |
^ self definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent projectType:nil |
|
234 |
||
235 |
"Modified: / 23-08-2006 / 14:29:15 / cg" |
|
236 |
! |
|
237 |
||
238 |
definitionClassForPackage: aPackageID createIfAbsent: doCreateIfAbsent projectType:typeOrNil |
|
239 |
|packageDefinitionClassName class| |
|
240 |
||
17344 | 241 |
packageDefinitionClassName := self projectDefinitionClassNameForDefinitionOf:aPackageID. |
12371 | 242 |
class := Smalltalk classNamed:packageDefinitionClassName. |
243 |
class isNil ifTrue:[ |
|
23124 | 244 |
doCreateIfAbsent ifTrue:[ |
245 |
typeOrNil = GUIApplicationType ifTrue:[ |
|
246 |
class := ApplicationDefinition newForPackage:aPackageID. |
|
247 |
] ifFalse:[ |
|
248 |
typeOrNil = NonGUIApplicationType ifTrue:[ |
|
249 |
class := ApplicationDefinition newForPackage:aPackageID. |
|
250 |
] ifFalse:[ |
|
251 |
typeOrNil = FolderForSubApplicationsType ifTrue:[ |
|
252 |
class := FolderForProjectsDefinition newForPackage:aPackageID. |
|
253 |
] ifFalse:[ |
|
254 |
class := LibraryDefinition newForPackage:aPackageID. |
|
255 |
] |
|
256 |
] |
|
257 |
]. |
|
258 |
"setup before prerequisites are defined" |
|
259 |
class setupForType:typeOrNil. |
|
260 |
"/ look what is there and include it; is this ok ? |
|
261 |
class compileDescriptionMethods |
|
262 |
]. |
|
12371 | 263 |
] ifFalse:[ |
23124 | 264 |
typeOrNil notNil ifTrue:[ |
265 |
doCreateIfAbsent ifTrue:[ |
|
266 |
class projectType == typeOrNil ifFalse: [ |
|
267 |
class setupForType:typeOrNil. |
|
268 |
] |
|
269 |
]. |
|
270 |
]. |
|
12371 | 271 |
]. |
272 |
^ class |
|
273 |
||
274 |
"Created: / 23-08-2006 / 14:29:21 / cg" |
|
275 |
"Modified: / 23-08-2006 / 15:35:26 / cg" |
|
276 |
! |
|
277 |
||
278 |
definitionClassForPackage:newProjectID projectType:typeOrNil createIfAbsent:createIfAbsent |
|
279 |
^ (self definitionClassForType:typeOrNil) |
|
23124 | 280 |
definitionClassForPackage:newProjectID |
281 |
createIfAbsent:createIfAbsent |
|
282 |
projectType:typeOrNil |
|
12371 | 283 |
|
284 |
"Created: / 23-08-2006 / 14:28:53 / cg" |
|
285 |
! |
|
286 |
||
287 |
definitionClassForType: type |
|
288 |
"answer the class that describes a give project type" |
|
289 |
||
290 |
(type = LibraryType) ifTrue:[ ^ LibraryDefinition ]. |
|
291 |
(type = GUIApplicationType) ifTrue:[ ^ ApplicationDefinition ]. |
|
292 |
(type = NonGUIApplicationType) ifTrue:[ ^ ApplicationDefinition ]. |
|
16682 | 293 |
(type = FolderForSubApplicationsType) ifTrue:[ ^ FolderForProjectsDefinition ]. |
12371 | 294 |
(type = 'Application') ifTrue:[ ^ ApplicationDefinition ]. "/ temporary - for backward compat. |
295 |
self error:'unknown project type'. |
|
296 |
||
297 |
"Created: / 17-08-2006 / 14:46:28 / cg" |
|
298 |
"Modified: / 23-08-2006 / 13:49:27 / cg" |
|
299 |
! |
|
300 |
||
9559 | 301 |
newForPackage:packageID |
13419 | 302 |
^ self |
23124 | 303 |
newNamed:(self projectDefinitionClassNameForDefinitionOf:packageID) |
304 |
package:packageID. |
|
9559 | 305 |
|
306 |
"Created: / 11-08-2006 / 14:27:19 / cg" |
|
307 |
! |
|
308 |
||
309 |
newNamed:newName package:packageID |
|
310 |
|newClass| |
|
311 |
||
312 |
"/ for now, we are strict. |
|
17344 | 313 |
self assert:(self projectDefinitionClassNameForDefinitionOf:packageID) = newName. |
9569 | 314 |
self assert:(self ~~ ProjectDefinition). "ProjectDefinition is abstract" |
9559 | 315 |
|
316 |
newClass := self |
|
23124 | 317 |
subclass:(newName asSymbol) |
318 |
instanceVariableNames:'' |
|
319 |
classVariableNames:'' |
|
320 |
poolDictionaries:'' |
|
321 |
category:(self defaultCategory). |
|
9559 | 322 |
|
323 |
newClass package:packageID asSymbol. |
|
324 |
^ newClass |
|
325 |
||
326 |
"Created: / 09-08-2006 / 17:57:37 / fm" |
|
327 |
"Modified: / 09-08-2006 / 19:27:53 / fm" |
|
9569 | 328 |
"Modified: / 17-08-2006 / 17:24:23 / cg" |
9559 | 329 |
! ! |
330 |
||
9569 | 331 |
!ProjectDefinition class methodsFor:'accessing'! |
9536 | 332 |
|
23452 | 333 |
additionalClassResources |
334 |
"for projects which need additional resources from some other |
|
335 |
package (i.e. plugins), redefine this to return a collection |
|
336 |
of inherited definitions. |
|
337 |
i.e. change to ^ { foo_package classResources }" |
|
338 |
||
339 |
^ #() |
|
340 |
! |
|
341 |
||
12575 | 342 |
directory |
343 |
"for packageId compatibility" |
|
344 |
||
345 |
^ self moduleDirectory |
|
346 |
||
347 |
" |
|
348 |
bosch_dapasx_datenbasis_Definition moduleDirectory |
|
349 |
bosch_dapasx_parameter_system_Definition moduleDirectory |
|
13419 | 350 |
stx_libbasic3 moduleDirectory |
351 |
cg_croquet moduleDirectory |
|
352 |
cg_croquet package asPackageId module |
|
353 |
cg_croquet moduleDirectory |
|
354 |
stx_goodies_xml_vw moduleDirectory |
|
12575 | 355 |
" |
356 |
||
357 |
"Created: / 08-08-2006 / 20:25:39 / fm" |
|
358 |
"Modified: / 18-08-2006 / 12:18:33 / cg" |
|
359 |
! |
|
360 |
||
13823 | 361 |
extensionsRevisionInfoForManager:managerOrNil |
362 |
"return the revisionInfo object for my extensions for a particular source code manager. |
|
363 |
Return nil, if there is either no manager, or I have no extensions" |
|
364 |
||
365 |
|mgr versionMethod revString| |
|
366 |
||
367 |
(mgr := managerOrNil) isNil ifTrue:[ |
|
23124 | 368 |
mgr := SourceCodeManagerUtilities sourceCodeManagerFor:self. |
369 |
mgr isNil ifTrue:[ |
|
370 |
^ nil |
|
371 |
]. |
|
13823 | 372 |
]. |
373 |
||
374 |
versionMethod := mgr nameOfVersionMethodForExtensions. |
|
375 |
(self class implements:versionMethod) ifFalse:[^ nil]. |
|
376 |
||
377 |
revString := self perform:(mgr nameOfVersionMethodForExtensions) ifNotUnderstood:nil. |
|
378 |
revString isNil ifTrue:[ |
|
23124 | 379 |
^ nil. |
13823 | 380 |
]. |
381 |
^ mgr revisionInfoFromString:revString. |
|
382 |
||
383 |
" |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
384 |
(stx_libcomp extensionsRevisionInfoForManager:nil) revision |
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
385 |
(stx_libbasic extensionsRevisionInfoForManager:nil) |
13823 | 386 |
" |
387 |
||
388 |
"Created: / 25-11-2011 / 14:34:01 / cg" |
|
389 |
! |
|
390 |
||
19996 | 391 |
fullPackageName |
392 |
"all components with underlines" |
|
393 |
||
394 |
^ self fullPackageNameFor: self package |
|
395 |
||
396 |
" |
|
397 |
stx_libwidg2 packageName |
|
398 |
stx_libwidg2 fullPackageName |
|
399 |
stx_goodies_refactoryBrowser_browser packageName |
|
400 |
stx_goodies_refactoryBrowser_browser fullPackageName |
|
401 |
" |
|
402 |
! |
|
403 |
||
404 |
fullPackageNameFor: aProjectID |
|
405 |
^ (aProjectID copyReplaceAny:':/' with:$_) |
|
406 |
||
407 |
" |
|
23124 | 408 |
stx_goodies_refactoryBrowser_lint fullPackageNameFor:#stx_goodies_refactoryBrowser_lint |
19996 | 409 |
" |
410 |
! |
|
411 |
||
9536 | 412 |
initialClassNameForDefinitionOf:aPackageId |
17344 | 413 |
<resource: #obsolete> |
414 |
||
415 |
"now obsolete - left here for backward compatibility |
|
416 |
given a package-ID, return an appropriate class name for this package" |
|
417 |
||
418 |
^ self projectDefinitionClassNameForDefinitionOf:aPackageId |
|
419 |
||
420 |
" |
|
421 |
ProjectDefinition projectDefinitionClassNameForDefinitionOf:'bosch:dapasx/interactiver_editor' |
|
422 |
ProjectDefinition projectDefinitionClassNameForDefinitionOf:'stx:libbasic' |
|
423 |
ProjectDefinition projectDefinitionClassNameForDefinitionOf:'stx:goodies/xml' |
|
424 |
ProjectDefinition projectDefinitionClassNameForDefinitionOf:'stx/goodies/xml' |
|
425 |
ProjectDefinition projectDefinitionClassNameForDefinitionOf:'stx_goodies_xml' |
|
426 |
" |
|
9536 | 427 |
! |
428 |
||
429 |
libraryName |
|
9575 | 430 |
^ self package asPackageId libraryName |
9536 | 431 |
|
9559 | 432 |
" |
9688 | 433 |
bosch_dapasx_datenbasis libraryName |
9575 | 434 |
stx_libbasic3 libraryName |
9559 | 435 |
" |
9536 | 436 |
|
437 |
"Modified: / 09-08-2006 / 18:20:29 / fm" |
|
9575 | 438 |
"Modified: / 18-08-2006 / 12:36:45 / cg" |
9536 | 439 |
! |
440 |
||
13419 | 441 |
libraryNameFor:aProjectID |
9575 | 442 |
^ aProjectID asPackageId libraryName |
9536 | 443 |
|
9559 | 444 |
" |
9575 | 445 |
bosch_dapasx_datenbasis libraryName |
446 |
stx_libbasic3 libraryNameFor:'stx:libbasic' |
|
13419 | 447 |
stx_libbasic3 libraryNameFor:'bosch:dapasx/datenbasis' |
9559 | 448 |
" |
9536 | 449 |
|
450 |
"Modified: / 09-08-2006 / 18:20:29 / fm" |
|
9575 | 451 |
"Modified: / 18-08-2006 / 12:37:02 / cg" |
9536 | 452 |
! |
453 |
||
14577 | 454 |
loadDirectory |
19731 | 455 |
"if I was loaded from a directory (as opposed to loaded via a dll or from a source code manager), |
14577 | 456 |
return that directory. Otherwise return nil." |
457 |
||
14583 | 458 |
^ self getAttribute:#projectDirectory |
14577 | 459 |
! |
460 |
||
461 |
loadDirectory:aDirectory |
|
462 |
"remember the directory from which I was loaded from" |
|
463 |
||
14583 | 464 |
self setAttribute:#projectDirectory to:aDirectory |
14577 | 465 |
! |
466 |
||
9536 | 467 |
module |
9559 | 468 |
^ self moduleOfClass:self |
9536 | 469 |
|
9559 | 470 |
" |
471 |
bosch_dapasx_datenbasis_Definition module |
|
472 |
DapasX_Datenbasis module |
|
13419 | 473 |
stx_libbasic3 module |
474 |
stx_libbasic3 directory |
|
9559 | 475 |
" |
9536 | 476 |
|
477 |
"Created: / 08-08-2006 / 20:24:53 / fm" |
|
478 |
"Modified: / 09-08-2006 / 16:16:37 / fm" |
|
9575 | 479 |
"Modified: / 17-08-2006 / 20:50:46 / cg" |
9536 | 480 |
! |
481 |
||
482 |
moduleDirectory |
|
9575 | 483 |
^ (PackageId from:self package) directory |
9536 | 484 |
|
9559 | 485 |
" |
9575 | 486 |
bosch_dapasx_datenbasis_Definition moduleDirectory |
487 |
bosch_dapasx_parameter_system_Definition moduleDirectory |
|
13419 | 488 |
stx_libbasic3 moduleDirectory |
489 |
cg_croquet moduleDirectory |
|
490 |
cg_croquet package asPackageId module |
|
491 |
cg_croquet moduleDirectory |
|
492 |
stx_goodies_xml_vw moduleDirectory |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
493 |
cg_demos_demo1 moduleDirectory |
9559 | 494 |
" |
9536 | 495 |
|
496 |
"Created: / 08-08-2006 / 20:25:39 / fm" |
|
14339 | 497 |
"Modified (comment): / 05-09-2012 / 10:07:18 / cg" |
9536 | 498 |
! |
499 |
||
13419 | 500 |
moduleDirectoryFor:aProjectID |
9559 | 501 |
^ (aProjectID subStrings:$:) last |
9536 | 502 |
|
9559 | 503 |
" |
23124 | 504 |
bosch_dapasx_datenbasis_Definition moduleDirectory |
505 |
bosch_dapasx_parameter_system_Definition moduleDirectory |
|
9559 | 506 |
" |
9536 | 507 |
|
508 |
"Created: / 08-08-2006 / 20:25:39 / fm" |
|
9559 | 509 |
"Modified: / 17-08-2006 / 14:13:41 / cg" |
9536 | 510 |
! |
511 |
||
9891 | 512 |
moduleDirectory_win32 |
15528 | 513 |
^ (PackageId from:self package) directory copyReplaceAll:$/ with:$\ |
9891 | 514 |
|
515 |
" |
|
516 |
bosch_dapasx_datenbasis moduleDirectory_win32 |
|
517 |
bosch_dapasx_parameter_system moduleDirectory_win32 |
|
13419 | 518 |
stx_libbasic3 moduleDirectory_win32 |
9891 | 519 |
" |
520 |
||
521 |
"Created: / 14-09-2006 / 20:19:17 / cg" |
|
522 |
! |
|
523 |
||
10562 | 524 |
moduleDirectory_win32For: projectID |
525 |
||
15528 | 526 |
^(self moduleDirectoryFor:projectID) copyReplaceAll:$/ with:$\ |
10562 | 527 |
|
528 |
" |
|
529 |
self moduleDirectory_win32For: #'bosch:dapasx/pav_vergleich' |
|
530 |
self moduleDirectory_win32For: #'stx:goodies/xml/stx' |
|
531 |
self moduleDirectory_win32For: #'stx:libbasic2' |
|
532 |
" |
|
15528 | 533 |
|
534 |
"Modified: / 16-07-2013 / 19:47:24 / cg" |
|
10562 | 535 |
! |
536 |
||
13419 | 537 |
moduleFor:aProjectID |
9559 | 538 |
^ (aProjectID subStrings:$:) first |
9536 | 539 |
|
9559 | 540 |
" |
541 |
DapasXProject module |
|
542 |
DapasX_Datenbasis module |
|
543 |
" |
|
9536 | 544 |
|
545 |
"Created: / 09-08-2006 / 16:16:16 / fm" |
|
9559 | 546 |
"Modified: / 17-08-2006 / 14:13:46 / cg" |
9536 | 547 |
! |
548 |
||
13419 | 549 |
moduleOfClass:aClass |
9559 | 550 |
^ self moduleFor:aClass package |
9536 | 551 |
|
9559 | 552 |
" |
553 |
DapasXProject module |
|
554 |
DapasX_Datenbasis module |
|
555 |
" |
|
9536 | 556 |
|
557 |
"Created: / 09-08-2006 / 16:16:16 / fm" |
|
9559 | 558 |
"Modified: / 17-08-2006 / 14:13:51 / cg" |
9536 | 559 |
! |
560 |
||
12360
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
561 |
monticelloPackageName |
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
562 |
"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
|
563 |
|
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
564 |
^ nil |
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
565 |
! |
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
566 |
|
9559 | 567 |
msdosPathToPackage:toPackageID from:fromPackageID |
568 |
"Returns the path to the package defined by aPackageID relative to my path" |
|
13419 | 569 |
|
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
|
570 |
|parts1 parts2 common up down| |
9852 | 571 |
|
572 |
parts1 := fromPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
573 |
parts2 := toPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
574 |
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
|
575 |
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
|
576 |
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
|
577 |
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
|
578 |
down isEmpty ifTrue:[^ '.']. |
23124 | 579 |
^ down. |
9852 | 580 |
]. |
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
|
581 |
down isEmpty ifTrue:[ |
23124 | 582 |
^ up. |
9714 | 583 |
]. |
13419 | 584 |
^ up, '\', down |
9901 | 585 |
|
9559 | 586 |
" |
587 |
self msdosPathToPackage:'bosch:dapasx/kernel' from:'bosch:dapasx/application' |
|
13419 | 588 |
self msdosPathToPackage:'stx:libbasic' from:'bosch:dapasx/application' |
589 |
self msdosPathToPackage:'bosch:dapasx/application' from:'stx:libbasic' |
|
590 |
self msdosPathToPackage:'exept:expecco' from:'exept:expecco/application' |
|
591 |
self msdosPathToPackage:'exept:expecco/application' from:'exept:expecco' |
|
9559 | 592 |
" |
9536 | 593 |
|
9559 | 594 |
"Created: / 17-08-2006 / 14:26:39 / cg" |
9901 | 595 |
"Modified: / 14-09-2006 / 22:04:56 / cg" |
9536 | 596 |
! |
597 |
||
12028 | 598 |
packageDirectory |
19731 | 599 |
"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
|
600 |
return that directory. |
14577 | 601 |
Otherwise ask Smalltalk for my package directory a long the package path." |
602 |
||
14580 | 603 |
|loadDirectory| |
604 |
||
14586 | 605 |
(loadDirectory := self loadDirectory) ifNotNil:[ ^ loadDirectory ]. |
12315
71599fb91dcf
comment/format in: #packageDirectory
Claus Gittinger <cg@exept.de>
parents:
12314
diff
changeset
|
606 |
^ Smalltalk packageDirectoryForPackageId: self package |
12028 | 607 |
|
608 |
"Created: / 15-06-2009 / 12:01:18 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
609 |
! |
|
610 |
||
9536 | 611 |
packageName |
9688 | 612 |
"the last component" |
9536 | 613 |
|
9688 | 614 |
^ self packageNameFor: self package |
9536 | 615 |
|
9688 | 616 |
" |
10810 | 617 |
stx_libwidg2 packageName |
16812 | 618 |
stx_goodies_refactoryBrowser_browser packageName |
9688 | 619 |
bosch_dapasx_hw_schnittstellen packageName |
620 |
bosch_dapasx_datenbasis packageName |
|
13419 | 621 |
bosch_dapasx_parameter_system packageName |
9688 | 622 |
" |
9536 | 623 |
|
624 |
"Created: / 08-08-2006 / 20:24:53 / fm" |
|
625 |
"Modified: / 09-08-2006 / 16:16:37 / fm" |
|
626 |
! |
|
627 |
||
628 |
packageNameFor: aProjectID |
|
9688 | 629 |
^ (aProjectID asCollectionOfSubstringsSeparatedByAny:':/') last. |
9536 | 630 |
|
9688 | 631 |
" |
632 |
bosch_dapasx_hw_schnittstellen packageName |
|
633 |
bosch_dapasx_datenbasis packageName |
|
13419 | 634 |
bosch_dapasx_parameter_system packageName |
635 |
cg_croquet packageName |
|
636 |
stx_goodies_xml_vw packageName |
|
637 |
stx_goodies_xml_vw packageDirectory |
|
9688 | 638 |
" |
9536 | 639 |
|
640 |
"Created: / 08-08-2006 / 20:24:53 / fm" |
|
641 |
"Modified: / 09-08-2006 / 16:16:37 / fm" |
|
642 |
"Modified: / 11-08-2006 / 14:02:32 / cg" |
|
643 |
! |
|
644 |
||
645 |
parentProject |
|
23124 | 646 |
"return the packageID of the parent project. |
17236 | 647 |
That is the projectID of the package above in the folder hierarchy" |
648 |
||
10306 | 649 |
^ (self parentProjectFor: self package) |
9536 | 650 |
|
17236 | 651 |
" |
652 |
bosch_dapasx_hw_schnittstellen_Definition parentProject |
|
653 |
DapasX_Datenbasis parentProject |
|
654 |
||
23124 | 655 |
stx_libbasic parentProject |
656 |
stx_goodies_refactoryBrowser_lint parentProject |
|
17236 | 657 |
" |
9536 | 658 |
! |
659 |
||
660 |
parentProjectFor: aProjectID |
|
17236 | 661 |
"given a packageID symbol or string, return the packageID of the |
23124 | 662 |
parent project. |
17236 | 663 |
That is the projectID of the package above in the folder hierarchy" |
664 |
||
665 |
|path| |
|
666 |
||
667 |
path := aProjectID splitByAny:':/'. |
|
668 |
path size == 1 ifTrue:[^ nil]. |
|
669 |
path size == 2 ifTrue:[^ path first]. |
|
670 |
^ path first , ':' , ((path copyFrom:2 to:path size - 1) asStringWith:'/') |
|
671 |
||
672 |
" |
|
673 |
bosch_dapasx_hw_schnittstellen parentProject |
|
674 |
||
23124 | 675 |
self parentProjectFor:'bosch:dapasx' |
676 |
self parentProjectFor:'bosch:dapasx/hw_schnittstellen' |
|
677 |
self parentProjectFor:'stx:goodies/refactoryBrowser/lint' |
|
678 |
self parentProjectFor:'stx:goodies/svg' |
|
679 |
self parentProjectFor:'stx:libbasic' |
|
680 |
self parentProjectFor:'exept:expecco/application' |
|
681 |
||
682 |
self parentProjectFor:'stx' |
|
683 |
self parentProjectFor:'exept' |
|
17236 | 684 |
" |
9536 | 685 |
! |
686 |
||
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
687 |
pathSeparator:platformName |
16328 | 688 |
^ platformName == #unix ifTrue:['/'] ifFalse:['\']. |
9850 | 689 |
! |
690 |
||
691 |
pathTo:aBaseFilename inPackage:aPackageID architecture:arch |
|
692 |
"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" |
|
693 |
||
16328 | 694 |
|p separator| |
695 |
||
696 |
separator := self pathSeparator:arch. |
|
697 |
p := self pathToPackage:aPackageID withSeparator:separator. |
|
698 |
aBaseFilename isNil ifTrue:[^ p]. |
|
699 |
^ p , separator, aBaseFilename |
|
700 |
! |
|
701 |
||
702 |
pathToPackage:toPackageID from:fromPackageID withSeparator:pathSeparator |
|
703 |
"Returns the path to the package defined by aPackageID relative to my path" |
|
704 |
||
705 |
|parts1 parts2 common up down rel oneUp| |
|
706 |
||
707 |
oneUp := '..', pathSeparator. |
|
708 |
||
709 |
parts1 := fromPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
710 |
parts2 := toPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
711 |
common := parts1 commonPrefixWith:parts2. |
|
712 |
common notEmpty ifTrue:[ |
|
23516 | 713 |
up := ((1 to:parts1 size - common size) collect:[:p | oneUp]) asStringWith:''. |
714 |
down := (parts2 copyFrom:common size+1) asStringWith:pathSeparator. |
|
715 |
(up isEmpty and:[down isEmpty]) ifTrue:[^ '.']. |
|
716 |
(up endsWith:'/') ifTrue:[ |
|
717 |
down isEmpty ifTrue:[^ up copyButLast] |
|
718 |
]. |
|
719 |
(up isEmpty) ifTrue:[ |
|
720 |
(down startsWith:'/') ifTrue:[^ down copyButFirst] |
|
721 |
]. |
|
722 |
^ up , down |
|
9850 | 723 |
]. |
16328 | 724 |
|
725 |
rel := (self topRelativePathToPackage:toPackageID withSeparator:pathSeparator). |
|
726 |
(rel startsWith:('stx', pathSeparator)) ifTrue:[ |
|
23516 | 727 |
^ '$(TOP)', (rel copyFrom:'stx/' size) "/ notice: the separator remains |
9850 | 728 |
]. |
16328 | 729 |
|
730 |
^ '$(TOP)', pathSeparator, oneUp, rel. |
|
731 |
||
732 |
" |
|
733 |
self pathToPackage:'bosch:dapasx/kernel' from:'bosch:dapasx/application' withSeparator:'\' |
|
734 |
self pathToPackage:'stx:libbasic' from:'bosch:dapasx/application' withSeparator:'\' |
|
735 |
self pathToPackage:'bosch:dapasx/application' from:'stx:libbasic' withSeparator:'\' |
|
23516 | 736 |
exept_expecco_application pathToPackage:'exept:expecco' from:'exept:expecco/application' withSeparator:'/' |
737 |
exept_expecco_application pathToPackage:'exept:expecco/plugins/guiBrowser' from:'exept:expecco/application' withSeparator:'/' |
|
16328 | 738 |
" |
739 |
||
740 |
"Created: / 14-09-2006 / 15:21:10 / cg" |
|
23516 | 741 |
"Modified: / 07-11-2018 / 17:24:26 / Claus Gittinger" |
16328 | 742 |
! |
743 |
||
744 |
pathToPackage:aPackageID withSeparator:pathSeparator |
|
9850 | 745 |
"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" |
746 |
||
10875
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
747 |
|rel| |
9850 | 748 |
|
9880 | 749 |
aPackageID asPackageId module = self package asPackageId module ifTrue:[ |
23474 | 750 |
^ self pathToPackage:aPackageID from:self package withSeparator:pathSeparator. |
9880 | 751 |
]. |
16328 | 752 |
rel := self topRelativePathToPackage:aPackageID withSeparator:pathSeparator. |
753 |
(rel startsWith:('stx', pathSeparator)) ifTrue:[ |
|
23474 | 754 |
^ '$(TOP)', (rel copyFrom:'stx/' size). "keep the separator" |
9850 | 755 |
] ifFalse:[ |
23474 | 756 |
^ '$(TOP)', pathSeparator, '..', pathSeparator, rel |
9850 | 757 |
] |
758 |
||
759 |
" |
|
16328 | 760 |
exept_expecco_application pathToPackage:'exept:expecco/application' withSeparator:'\' |
761 |
exept_expecco_application pathToPackage:'exept:expecco/report' withSeparator:'\' |
|
23474 | 762 |
exept_expecco_application make_dot_proto_resource_rules |
16328 | 763 |
stx_libbasic pathToPackage:'exept:expecco/application' withSeparator:'\' |
9850 | 764 |
" |
765 |
||
766 |
"Modified: / 16-08-2006 / 18:55:41 / User" |
|
767 |
"Created: / 14-09-2006 / 13:21:23 / cg" |
|
9880 | 768 |
"Modified: / 14-09-2006 / 15:23:59 / cg" |
23474 | 769 |
"Modified (comment): / 26-10-2018 / 21:06:56 / Claus Gittinger" |
9850 | 770 |
! |
771 |
||
16328 | 772 |
pathToTopFor:aProjectID withSeparator:aPathSeparator |
773 |
"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" |
|
774 |
||
775 |
|parts oneUp| |
|
776 |
||
777 |
oneUp := '..', aPathSeparator. |
|
778 |
||
779 |
parts := aProjectID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
780 |
||
781 |
parts first = 'stx' ifTrue:[ |
|
23124 | 782 |
parts size == 1 ifTrue:[^ '']. |
783 |
^ (((2 to:parts size-1) collect:[:p | oneUp]) asStringWith:'') , '..' |
|
9880 | 784 |
]. |
785 |
||
16328 | 786 |
^ ((parts collect:[:p | oneUp]) asStringWith:'') , 'stx' |
787 |
||
788 |
" |
|
789 |
self pathToTopFor: #'exept' with:'/' |
|
790 |
self pathToTopFor: #'exept:expecco' with:'/' |
|
791 |
self pathToTopFor: #'exept:expecco/application' with:'/' |
|
792 |
self pathToTopFor: #'stx' with:'/' |
|
793 |
self pathToTopFor: #'stx:libview' with:'/' |
|
794 |
self pathToTopFor: #'stx:goodies/foo' with:'/' |
|
795 |
" |
|
796 |
||
797 |
"Created: / 14-09-2006 / 14:59:53 / cg" |
|
798 |
! |
|
799 |
||
800 |
pathToTopWithSeparator:aPathSeparator |
|
9714 | 801 |
"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" |
802 |
||
16328 | 803 |
^ self pathToTopFor:self package withSeparator:aPathSeparator |
804 |
||
805 |
" |
|
806 |
exept_expecco_application pathToTopWithSeparator:'\' |
|
807 |
stx_libbasic pathToTopWithSeparator:'\' |
|
808 |
stx_goodies_xml pathToTopWithSeparator:'\' |
|
809 |
stx_libhtml pathToTopWithSeparator:'\' |
|
810 |
stx_goodies_refactoryBrowser_changes pathToTopWithSeparator:'\' |
|
9714 | 811 |
" |
812 |
||
813 |
"Created: / 09-08-2006 / 15:45:54 / fm" |
|
9852 | 814 |
"Modified: / 14-09-2006 / 15:01:47 / cg" |
9714 | 815 |
! |
816 |
||
17344 | 817 |
projectDefinitionClassNameForDefinitionOf:aPackageId |
818 |
"given a package-ID, return an appropriate class name for this package" |
|
819 |
||
820 |
|s| |
|
821 |
||
18503 | 822 |
s := aPackageId asString copy replaceAny:' :/-' with:$_. |
17344 | 823 |
(s endsWith:$_) ifTrue:[ |
23124 | 824 |
s := s copyButLast:1 |
17344 | 825 |
]. |
826 |
^ s |
|
827 |
||
828 |
" |
|
829 |
ProjectDefinition initialClassNameForDefinitionOf:'bosch:dapasx/interactiver_editor' |
|
830 |
ProjectDefinition initialClassNameForDefinitionOf:'stx:libbasic' |
|
831 |
ProjectDefinition initialClassNameForDefinitionOf:'stx:goodies/xml' |
|
832 |
ProjectDefinition initialClassNameForDefinitionOf:'stx/goodies/xml' |
|
833 |
ProjectDefinition initialClassNameForDefinitionOf:'stx_goodies_xml' |
|
834 |
" |
|
835 |
! |
|
836 |
||
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
837 |
projectIsLoaded |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
838 |
"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
|
839 |
|
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
840 |
projectIsLoaded isNil ifTrue:[ |
23124 | 841 |
projectIsLoaded := false. |
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
842 |
]. |
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
843 |
^ projectIsLoaded |
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
844 |
|
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
845 |
" |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
846 |
stx_libbasic projectIsLoaded |
13251 | 847 |
(ProjectDefinition definitionClassForPackage:#'stx:libbasic') projectIsLoaded |
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
848 |
" |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
849 |
! |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
850 |
|
15760 | 851 |
projectIsLoaded:aBoolean |
852 |
projectIsLoaded := aBoolean. |
|
853 |
aBoolean ifTrue:[ |
|
23124 | 854 |
"register myself as dependent - I want to get notified on method changes" |
855 |
self class addDependent:self. |
|
856 |
self postLoadAction. |
|
857 |
self executeHooks: #postLoad. |
|
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
858 |
]. |
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
859 |
! |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
860 |
|
21449 | 861 |
projectTags |
862 |
"a list of resource-tags used in the project. |
|
863 |
These are offered in the browser's methodList menu as 'Tag as' items. |
|
864 |
Allowing convenient tagging for things like '<resource: EXPECCO_API>'. |
|
865 |
When redefined, a collection of useful tag-strings should be returned." |
|
23124 | 866 |
|
21449 | 867 |
^ #() |
868 |
||
869 |
"Created: / 15-02-2017 / 16:42:48 / cg" |
|
870 |
! |
|
871 |
||
9850 | 872 |
topRelativePathTo:aBaseFilename inPackage:aPackageID architecture:arch |
13419 | 873 |
"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
|
874 |
and adding for each one '../' to get the ST/X top directory" |
9850 | 875 |
|
16328 | 876 |
|p separator| |
877 |
||
878 |
separator := self pathSeparator:arch. |
|
879 |
p := self topRelativePathToPackage:aPackageID withSeparator:separator. |
|
880 |
aBaseFilename isNil ifTrue:[^ p]. |
|
881 |
^ p , separator, aBaseFilename |
|
882 |
! |
|
883 |
||
884 |
topRelativePathToPackage:aPackageID withSeparator:aDirectorySeparator |
|
18503 | 885 |
"Returns the path to the package as specified by aPackageID relative to the top directory. |
886 |
Basically this simply replaces colons and slashes by the OS's path separator." |
|
13419 | 887 |
|
16328 | 888 |
^ aPackageID asString copyReplaceAny:':/' with:aDirectorySeparator first |
889 |
||
890 |
" |
|
891 |
self topRelativePathToPackage:'stx:goodies/xml' withSeparator:'\' |
|
892 |
self topRelativePathToPackage:'bosch:dapasx/kernel' withSeparator:'\' |
|
9850 | 893 |
" |
894 |
||
895 |
"Created: / 14-09-2006 / 13:20:40 / cg" |
|
9536 | 896 |
! ! |
897 |
||
15950 | 898 |
!ProjectDefinition class methodsFor:'accessing - coverage'! |
899 |
||
900 |
excludedFromCoverage |
|
901 |
"List of classes and/or methods excluded from coverage report. |
|
902 |
Entries maybe ClassName or #(ClassName selector) |
|
903 |
||
904 |
Please note that certain classes and methods are excluded |
|
905 |
in #Builder::CoverageReport>>excludedFromCoverage:. |
|
906 |
" |
|
907 |
^ #() |
|
908 |
||
909 |
"Created: / 28-06-2013 / 02:11:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
910 |
"Modified (comment): / 28-06-2013 / 11:25:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
911 |
! |
|
912 |
||
913 |
excludedFromCoverage: aMethod |
|
914 |
"Return true if given method should be excluded from coverage |
|
18224 | 915 |
info. This method may be redefined in subclasses to automagically omit methods |
15950 | 916 |
matching some criteria. |
917 |
||
918 |
Please note that certain classes and methods are excluded |
|
919 |
in Builder::CoverageReport>>excludedFromCoverage:. |
|
920 |
" |
|
921 |
||
18224 | 922 |
|excluded mclass mselector| |
923 |
||
924 |
excluded := self excludedFromCoverage. |
|
925 |
excluded notEmptyOrNil ifTrue:[ |
|
23124 | 926 |
mclass := aMethod mclass. |
927 |
mselector := aMethod selector. |
|
928 |
excluded do:[:eachSpecLine| |
|
929 |
eachSpecLine isArray ifTrue:[ |
|
930 |
(eachSpecLine first = mclass name and:[eachSpecLine second == mselector]) ifTrue:[ ^ true ]. |
|
931 |
]. |
|
932 |
eachSpecLine = mclass name ifTrue:[ ^ true ]. |
|
933 |
]. |
|
18224 | 934 |
]. |
935 |
||
936 |
^ false |
|
15950 | 937 |
|
938 |
"Created: / 28-06-2013 / 02:14:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
939 |
"Modified (comment): / 28-06-2013 / 11:25:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
940 |
! ! |
|
941 |
||
24342 | 942 |
|
17228 | 943 |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
944 |
!ProjectDefinition class methodsFor:'accessing - packaging'! |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
945 |
|
12371 | 946 |
classNames:aCollectionOfClassNames |
947 |
"set the set of classes" |
|
948 |
||
949 |
self classNamesAndAttributes:aCollectionOfClassNames usingCompiler:nil |
|
950 |
! |
|
951 |
||
952 |
classNamesAndAttributes:newSpec usingCompiler:compilerOrNil |
|
13419 | 953 |
"set the set of classes. and attributes |
954 |
Because this requires compilation of my classList-method, a compiler can be passed in, |
|
12371 | 955 |
which has to do the job. |
956 |
(this is used by the systembrowser to pass in a CodeGeneratorTool with undo support)" |
|
957 |
||
958 |
|oldSpec newCode| |
|
959 |
||
960 |
oldSpec := self classNamesAndAttributes. |
|
961 |
newSpec = oldSpec ifTrue: [^ self]. |
|
962 |
||
963 |
newCode := self classNamesAndAttributes_codeFor:newSpec. |
|
964 |
||
15006 | 965 |
self compile:newCode categorized:'description - contents' using:compilerOrNil |
12371 | 966 |
! |
967 |
||
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
968 |
excludeClasses:toExclude usingCompiler:compilerOrNil |
13419 | 969 |
"exclude (remove from classList) a number of classes. |
970 |
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
|
971 |
which has to do the job. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
972 |
(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
|
973 |
|
12371 | 974 |
|newSpec| |
975 |
||
976 |
newSpec := self classNamesAndAttributes copy. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
977 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
978 |
toExclude do:[:eachClassToExclude | |
23124 | 979 |
|className| |
980 |
className := eachClassToExclude theNonMetaclass name. |
|
981 |
(self allClassNames includes:className) ifTrue:[ |
|
982 |
|idx| |
|
983 |
||
984 |
idx := newSpec findFirst:[:entry | entry = className or:[entry first = className]]. |
|
985 |
idx ~~ 0 ifTrue:[ |
|
986 |
newSpec := newSpec copyWithoutIndex:idx. |
|
987 |
]. |
|
988 |
]. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
989 |
]. |
12371 | 990 |
self classNamesAndAttributes:newSpec usingCompiler:compilerOrNil |
12339
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 |
"Created: / 30-08-2007 / 18:28:28 / cg" |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
993 |
! |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
994 |
|
15069 | 995 |
excludeMethodFor:selector inClassNamed:className usingCompiler:compilerOrNil |
996 |
"exclude (remove from extensionList) a method by name. |
|
997 |
Because this requires compilation of my extensionMethodNames-method, a compiler can be passed in, |
|
998 |
which has to do the job. |
|
999 |
This is used by the systembrowser to pass in a CodeGeneratorTool with undo support. |
|
1000 |
If nil is passed in, the recurlar compiler is used (no undo support)" |
|
1001 |
||
15764 | 1002 |
|oldSpec newSpec newCode idx| |
15069 | 1003 |
|
1004 |
oldSpec := self extensionMethodNames. |
|
15764 | 1005 |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
1006 |
idx := (1 to:oldSpec size-1 by:2) |
23124 | 1007 |
detect:[:i | |
1008 |
((oldSpec at:i) = className) |
|
1009 |
and:[ (oldSpec at:i+1) = selector ]] |
|
1010 |
ifNone:[ ^ self ]. |
|
15069 | 1011 |
|
1012 |
"/ attention: there are two spec-elements per method |
|
15764 | 1013 |
newSpec := oldSpec copyWithoutIndex:idx toIndex:idx+1. |
15069 | 1014 |
|
1015 |
newCode := self extensionMethodNames_code_For:newSpec. |
|
1016 |
self compile:newCode categorized:'description - contents' using:compilerOrNil |
|
1017 |
! |
|
1018 |
||
15005 | 1019 |
excludeMethods:toRemove usingCompiler:compilerOrNil |
1020 |
"exclude (remove from extensionList) a number of methods. |
|
1021 |
Because this requires compilation of my extensionMethodNames-method, a compiler can be passed in, |
|
1022 |
which has to do the job. |
|
1023 |
This is used by the systembrowser to pass in a CodeGeneratorTool with undo support. |
|
1024 |
If nil is passed in, the recurlar compiler is used (no undo support)" |
|
1025 |
||
1026 |
|oldSpec newSpec newCode extensionMethods| |
|
1027 |
||
1028 |
oldSpec := self extensionMethodNames. |
|
1029 |
newSpec := oldSpec copy. |
|
1030 |
extensionMethods := self extensionMethods. |
|
1031 |
||
1032 |
toRemove do:[:eachMethodToRemove | |
|
23124 | 1033 |
|className selector idx| |
1034 |
||
1035 |
(extensionMethods includes:eachMethodToRemove) ifTrue:[ |
|
1036 |
className := eachMethodToRemove mclass name. |
|
1037 |
selector := eachMethodToRemove selector. |
|
1038 |
idx := (1 to:newSpec size-1 by:2) |
|
1039 |
detect:[:i | |
|
1040 |
((newSpec at:i) = className) |
|
1041 |
and:[ (newSpec at:i+1) = selector ]] |
|
1042 |
ifNone:nil. |
|
1043 |
idx notNil ifTrue:[ |
|
1044 |
"/ attention: there are two spec-elements per method |
|
1045 |
newSpec := newSpec removeFromIndex:idx toIndex:idx+1 |
|
1046 |
] |
|
1047 |
]. |
|
15005 | 1048 |
]. |
1049 |
||
1050 |
newCode := self extensionMethodNames_code_For:newSpec. |
|
15006 | 1051 |
self compile:newCode categorized:'description - contents' using:compilerOrNil |
15005 | 1052 |
! |
1053 |
||
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1054 |
includeClasses:toInclude usingCompiler:compilerOrNil |
13419 | 1055 |
"include (add to classList) a number of classes. |
1056 |
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
|
1057 |
which has to do the job. |
15005 | 1058 |
This is used by the systembrowser to pass in a CodeGeneratorTool with undo support. |
1059 |
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
|
1060 |
|
12371 | 1061 |
|oldSpec newSpec| |
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1062 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1063 |
oldSpec := self classNamesAndAttributes. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1064 |
newSpec := oldSpec copy. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1065 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1066 |
toInclude do:[:eachClassToInclude | |
23124 | 1067 |
|className| |
1068 |
||
1069 |
className := eachClassToInclude theNonMetaclass name. |
|
1070 |
(self compiled_classNames includes:className) ifFalse:[ |
|
1071 |
| idx entry| |
|
1072 |
||
1073 |
idx := oldSpec findFirst:[:entry | entry = className or:[entry first = className]]. |
|
1074 |
idx == 0 ifTrue:[ |
|
1075 |
newSpec := newSpec copyWith:(Array with:className) |
|
1076 |
] ifFalse:[ |
|
1077 |
entry := newSpec at:idx. |
|
1078 |
entry isArray ifTrue:[ |
|
1079 |
entry := entry copyWithout:#autoload |
|
1080 |
]. |
|
1081 |
newSpec at:idx put:entry |
|
1082 |
]. |
|
1083 |
]. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1084 |
]. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1085 |
|
12371 | 1086 |
self classNamesAndAttributes:newSpec usingCompiler:compilerOrNil |
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1087 |
! |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1088 |
|
15005 | 1089 |
includeMethods:toInclude usingCompiler:compilerOrNil |
1090 |
"include (add to extensionList) a number of methods. |
|
1091 |
Because this requires compilation of my extensionMethodNames-method, a compiler can be passed in, |
|
1092 |
which has to do the job. |
|
1093 |
This is used by the systembrowser to pass in a CodeGeneratorTool with undo support. |
|
1094 |
If nil is passed in, the recurlar compiler is used (no undo support)" |
|
1095 |
||
1096 |
|oldSpec newSpec newCode extensionMethods| |
|
1097 |
||
1098 |
oldSpec := self extensionMethodNames. |
|
1099 |
newSpec := oldSpec copy. |
|
1100 |
extensionMethods := self extensionMethods. |
|
1101 |
||
1102 |
toInclude do:[:eachMethodToInclude | |
|
23124 | 1103 |
(extensionMethods includes:eachMethodToInclude) ifFalse:[ |
1104 |
newSpec := newSpec copyWith:eachMethodToInclude mclass name. |
|
1105 |
newSpec := newSpec copyWith:eachMethodToInclude selector. |
|
1106 |
]. |
|
15005 | 1107 |
]. |
1108 |
||
1109 |
newCode := self extensionMethodNames_code_For:newSpec. |
|
15006 | 1110 |
self compile:newCode categorized:'description - contents' using:compilerOrNil |
15005 | 1111 |
! |
1112 |
||
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1113 |
makeClassesAutoloaded:toMakeAutoloaded usingCompiler:compilerOrNil |
13419 | 1114 |
"include as autoloaded (add to classList) a number of classes. |
1115 |
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
|
1116 |
which has to do the job. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1117 |
(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
|
1118 |
|
12371 | 1119 |
|newSpec| |
1120 |
||
1121 |
newSpec := self classNamesAndAttributes copy. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1122 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1123 |
toMakeAutoloaded do:[:eachClassToMakeAutoloaded | |
23124 | 1124 |
|className| |
1125 |
||
1126 |
className := eachClassToMakeAutoloaded theNonMetaclass name. |
|
1127 |
(self autoloaded_classNames includes:className) ifFalse:[ |
|
1128 |
|idx entry| |
|
1129 |
||
1130 |
idx := newSpec findFirst:[:entry | entry = className or:[entry first = className]]. |
|
1131 |
idx == 0 ifTrue:[ |
|
1132 |
newSpec := newSpec copyWith:(Array with:className with:#autoload) |
|
1133 |
] ifFalse:[ |
|
1134 |
entry := newSpec at:idx. |
|
1135 |
entry isArray ifTrue:[ |
|
1136 |
entry := (entry copyWithout:#autoload) copyWith:#autoload. |
|
1137 |
] ifFalse:[ |
|
1138 |
entry := Array with:entry with:#autoload |
|
1139 |
]. |
|
1140 |
newSpec at:idx put:entry. |
|
1141 |
]. |
|
1142 |
]. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1143 |
]. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1144 |
|
12371 | 1145 |
self classNamesAndAttributes:newSpec usingCompiler:compilerOrNil |
14982 | 1146 |
! |
1147 |
||
15052 | 1148 |
updateContentsMethodsCodeUsingCompiler:compilerOrNil ignoreOldDefinition:doRegenerate |
1149 |
"regenerate the contents-describing methods. |
|
1150 |
This searches through the system and picks classes and extension methods |
|
1151 |
which have me as package and lists them in the generated class- |
|
1152 |
and extensionMethods methods. |
|
1153 |
If doRegenerate is true, forget any any previous contents info; |
|
1154 |
otherwise, merge new items into the existing lists." |
|
1155 |
||
1156 |
Class packageQuerySignal |
|
23124 | 1157 |
answer:self package |
1158 |
do:[ |
|
1159 |
self |
|
1160 |
forEachContentsMethodsCodeToCompileDo: |
|
1161 |
[:code :category | |
|
1162 |
(compilerOrNil ? self theMetaclass compilerClass) |
|
1163 |
compile:code |
|
1164 |
forClass:self theMetaclass |
|
1165 |
inCategory:category. |
|
1166 |
] |
|
1167 |
ignoreOldDefinition:doRegenerate |
|
1168 |
]. |
|
15052 | 1169 |
! |
1170 |
||
14982 | 1171 |
updateExtensionMethodNamesUsingCompiler:compilerOrNil |
1172 |
"set the set of extension methods |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
1173 |
Because this requires compilation of my extensionMethodNames-method, |
14982 | 1174 |
a compiler can be passed in, which has to do the job. |
1175 |
(this is used by the systembrowser to pass in a CodeGeneratorTool with undo support)" |
|
1176 |
||
1177 |
|newCode| |
|
1178 |
||
1179 |
newCode := self extensionMethodNames_code. |
|
15006 | 1180 |
self compile:newCode categorized:'description - contents' using:compilerOrNil |
15052 | 1181 |
! |
1182 |
||
1183 |
updateMethodsCodeUsingCompiler:compilerOrNil ignoreOldDefinition:doRegenerate |
|
1184 |
"regenerate the all contents- plus version describing methods. |
|
1185 |
This searches through the system and picks classes and extension methods |
|
1186 |
which have me as package and lists them in the generated class- |
|
1187 |
and extensionMethods methods. |
|
1188 |
If doRegenerate is true, forget any any previous contents info; |
|
1189 |
otherwise, merge new items into the existing lists." |
|
1190 |
||
1191 |
Class packageQuerySignal |
|
23124 | 1192 |
answer:self package |
1193 |
do:[ |
|
1194 |
self |
|
1195 |
forEachMethodsCodeToCompileDo: |
|
1196 |
[:code :category | |
|
1197 |
(compilerOrNil ? self theMetaclass compilerClass) |
|
1198 |
compile:code |
|
1199 |
forClass:self theMetaclass |
|
1200 |
inCategory:category. |
|
1201 |
] |
|
1202 |
ignoreOldDefinition:doRegenerate |
|
1203 |
]. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1204 |
! ! |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1205 |
|
13411 | 1206 |
!ProjectDefinition class methodsFor:'accessing - tests'! |
1207 |
||
13419 | 1208 |
excludedFromTestSuite |
13411 | 1209 |
"List of testcases and/or tests excluded from testsuite. |
1210 |
Entries maybe ClassName or #(ClassName testName) |
|
1211 |
" |
|
1212 |
^ #() |
|
1213 |
||
1214 |
"Created: / 03-06-2011 / 16:56:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1215 |
! |
|
1216 |
||
1217 |
testSuite |
|
13544 | 1218 |
"generate and return a testSuite containing all of my test-classes" |
13411 | 1219 |
|
1220 |
|suite classes| |
|
1221 |
||
1222 |
suite := TestSuite named:self package. |
|
13695 | 1223 |
classes := self classes |
23124 | 1224 |
select:[:each | |
1225 |
[ |
|
1226 |
each isLoaded ifFalse:[each autoload]. |
|
1227 |
(each isTestCaseLike) and:[ each isAbstract not ] |
|
1228 |
] on: Autoload autoloadFailedSignal do:[ |
|
1229 |
'FAILED TO LOAD: ' infoPrint. |
|
1230 |
each name infoPrintCR. |
|
1231 |
false |
|
1232 |
] |
|
1233 |
]. |
|
13544 | 1234 |
|
13411 | 1235 |
classes := classes asSortedCollection:[:a :b | a name <= b name ]. |
13695 | 1236 |
classes do: [:eachClass | |
23124 | 1237 |
| tests | |
1238 |
||
1239 |
eachClass name infoPrintCR. |
|
1240 |
tests := eachClass suite tests. |
|
1241 |
tests := tests reject:[:test|self shouldExcludeTest: test]. |
|
1242 |
suite addTests: tests |
|
13544 | 1243 |
]. |
1244 |
^ suite |
|
13411 | 1245 |
|
1246 |
"Created: / 01-04-2011 / 15:20:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1247 |
"Modified: / 03-06-2011 / 17:07:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13568 | 1248 |
"Modified: / 08-08-2011 / 14:59:45 / cg" |
12028 | 1249 |
! ! |
1250 |
||
9714 | 1251 |
!ProjectDefinition class methodsFor:'class initialization'! |
1252 |
||
1253 |
initialize |
|
14776
28a1f265cd65
add user friendly name to semaphores
Stefan Vogel <sv@exept.de>
parents:
14764
diff
changeset
|
1254 |
AccessLock isNil ifTrue:[ |
23124 | 1255 |
LibraryType := #Library. |
1256 |
GUIApplicationType := #'GUI-Application'. |
|
1257 |
NonGUIApplicationType := #'NonGUI-Application'. |
|
1258 |
FolderForSubApplicationsType := #'Folder for Subapplications'. |
|
1259 |
AccessLock := Semaphore forMutualExclusion name:'ProjectDefinition Lock'. |
|
1260 |
Verbose := false. |
|
1261 |
PackagesBeingLoaded := Set new. |
|
14776
28a1f265cd65
add user friendly name to semaphores
Stefan Vogel <sv@exept.de>
parents:
14764
diff
changeset
|
1262 |
]. |
9714 | 1263 |
|
10121 | 1264 |
" |
1265 |
self initialize |
|
1266 |
" |
|
1267 |
||
13592 | 1268 |
"Modified: / 18-08-2011 / 13:48:31 / cg" |
10121 | 1269 |
! |
1270 |
||
1271 |
initializeAllProjectDefinitions |
|
16179 | 1272 |
"tells all already loaded project definition classes that they are loaded |
15761 | 1273 |
(i.e. calls postLoadAction). |
1274 |
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
|
1275 |
Therefore, it's not invoked by the projDef's #initialize, |
15761 | 1276 |
but instead explicitely, by Smalltalk as a late step in the startup." |
13695 | 1277 |
|
13609 | 1278 |
|isStandAloneApp| |
1279 |
||
1280 |
isStandAloneApp := Smalltalk isStandAloneApp. |
|
1281 |
||
1282 |
self allSubclassesDo:[:eachProjectDefinitionClass | |
|
23124 | 1283 |
eachProjectDefinitionClass isAbstract ifFalse:[ |
1284 |
isStandAloneApp ifFalse:[ |
|
1285 |
eachProjectDefinitionClass installAutoloadedClasses. |
|
1286 |
]. |
|
1287 |
eachProjectDefinitionClass projectIsLoaded:true. |
|
1288 |
] |
|
13609 | 1289 |
]. |
10115 | 1290 |
|
9714 | 1291 |
" |
1292 |
self initialize |
|
1293 |
" |
|
10113
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1294 |
|
10121 | 1295 |
"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
|
1296 |
! |
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1297 |
|
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1298 |
installAutoloadedClasses |
12372 | 1299 |
"install all of my autoloaded classes (if any)" |
1300 |
||
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1301 |
|classesToFixClassFileName| |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1302 |
|
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1303 |
classesToFixClassFileName := OrderedCollection new. |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1304 |
|
13592 | 1305 |
self autoloaded_classNames do:[:className | |
23124 | 1306 |
|cls| |
1307 |
||
1308 |
"/ 'install as autoloaded: ' errorPrint. className errorPrintCR. |
|
1309 |
(cls := Smalltalk classNamed:className) isNil ifTrue:[ |
|
1310 |
Error handle:[:ex | |
|
1311 |
(self name,' [warning]: failed to install autoloaded: ',className) errorPrintCR. |
|
1312 |
(self name,' [info]: reason: ',ex description) errorPrintCR. |
|
1313 |
"/ thisContext fullPrintAll. |
|
1314 |
] do:[ |
|
1315 |
cls := Smalltalk |
|
1316 |
installAutoloadedClassNamed:className |
|
1317 |
category:'* as yet unknown category *' |
|
1318 |
package:self package |
|
1319 |
revision:nil |
|
1320 |
]. |
|
1321 |
cls notNil ifTrue:[ |
|
1322 |
classesToFixClassFileName add:cls. |
|
1323 |
]. |
|
1324 |
]. |
|
13592 | 1325 |
]. |
10113
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1326 |
|
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1327 |
Smalltalk addStartBlock:[ |
23124 | 1328 |
|abbrevs| |
1329 |
||
1330 |
abbrevs := self abbrevs. |
|
1331 |
"/ patch the classFileNames |
|
1332 |
classesToFixClassFileName do:[:cls | |
|
1333 |
|entry classFilenameFromAbbreviations| |
|
1334 |
||
1335 |
entry := abbrevs at:cls name ifAbsent:nil. |
|
1336 |
entry notNil ifTrue:[ |
|
1337 |
classFilenameFromAbbreviations := entry fileName. |
|
1338 |
classFilenameFromAbbreviations notNil ifTrue:[ |
|
1339 |
classFilenameFromAbbreviations := classFilenameFromAbbreviations,'.st'. |
|
1340 |
(classFilenameFromAbbreviations ~= cls getClassFilename) ifTrue:[ |
|
1341 |
cls setClassFilename:classFilenameFromAbbreviations |
|
1342 |
]. |
|
1343 |
]. |
|
1344 |
] |
|
1345 |
]. |
|
1346 |
||
1347 |
"/ patch the categories |
|
1348 |
Class withoutUpdatingChangesDo:[ |
|
1349 |
|entry| |
|
1350 |
||
1351 |
self classNames do:[:nm | |
|
1352 |
|cls| |
|
1353 |
||
1354 |
((cls := Smalltalk at: nm) notNil |
|
1355 |
and:[ cls isLoaded not |
|
1356 |
and:[ (entry := abbrevs at:cls name ifAbsent:[nil]) notNil |
|
1357 |
]]) ifTrue:[ |
|
1358 |
cls category: (entry category) |
|
1359 |
] |
|
1360 |
] |
|
1361 |
] |
|
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1362 |
]. |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1363 |
|
13411 | 1364 |
|
10113
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1365 |
" |
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1366 |
stx_libbasic installAutoloadedClasses |
12268
b3cd2af642f2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
12264
diff
changeset
|
1367 |
stx_libhtml installAutoloadedClasses |
13592 | 1368 |
stx_libtool2 installAutoloadedClasses |
10113
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1369 |
" |
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1370 |
|
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1371 |
"Created: / 23-10-2006 / 16:02:12 / cg" |
13411 | 1372 |
"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
|
1373 |
"Modified: / 20-08-2011 / 23:32:32 / cg" |
9714 | 1374 |
! ! |
1375 |
||
9998 | 1376 |
!ProjectDefinition class methodsFor:'code generation'! |
1377 |
||
20567 | 1378 |
applicationIconFileNameLinux_code |
1379 |
^ String streamContents:[:s | |
|
23124 | 1380 |
s nextPutLine:'applicationIconFileNameLinux'. |
1381 |
s nextPutLine:' "Return the name (without suffix) of an icon-file (the app''s icon).'. |
|
1382 |
s nextPutLine:' This is currently unused (will be for desktop definitions)"'. |
|
1383 |
s cr; |
|
1384 |
nextPutLine:' ^ nil'; |
|
1385 |
nextPutLine:' " ^ self applicationName "'. |
|
20567 | 1386 |
]. |
1387 |
||
1388 |
" |
|
1389 |
self applicationIconFileNameLinux_code |
|
1390 |
stx_libbasic3 applicationIconFileNameLinux_code |
|
1391 |
" |
|
1392 |
||
1393 |
"Created: / 18-08-2006 / 16:21:01 / cg" |
|
1394 |
! |
|
1395 |
||
1396 |
applicationIconFileNameOSX_code |
|
1397 |
^ String streamContents:[:s | |
|
23124 | 1398 |
s nextPutLine:'applicationIconFileNameOSX'. |
1399 |
s nextPutLine:' "Return the name (without suffix) of an icon-file (the app''s icon).'. |
|
1400 |
s nextPutLine:' This is used to create the osx/Info.plist file"'. |
|
1401 |
s cr; |
|
1402 |
nextPutLine:' ^ nil'; |
|
1403 |
nextPutLine:' " ^ self applicationName "'. |
|
20567 | 1404 |
]. |
1405 |
||
1406 |
" |
|
1407 |
self applicationIconFileNameOSX_code |
|
1408 |
stx_libbasic3 applicationIconFileNameOSX_code |
|
1409 |
" |
|
1410 |
||
1411 |
"Created: / 18-08-2006 / 16:21:01 / cg" |
|
21569 | 1412 |
"Modified: / 24-02-2017 / 11:55:32 / cg" |
20567 | 1413 |
! |
1414 |
||
1415 |
applicationIconFileNameWindows_code |
|
1416 |
^ String streamContents:[:s | |
|
23124 | 1417 |
s nextPutLine:'applicationIconFileNameWindows'. |
1418 |
s nextPutLine:' "Return the name (without suffix) of an icon-file (the app''s icon).'. |
|
1419 |
s nextPutLine:' This will be included in the rc-resource file for Windowsdeployment"'. |
|
1420 |
s cr; |
|
1421 |
nextPutLine:' ^ nil'; |
|
1422 |
nextPutLine:' " ^ self applicationName "'. |
|
20567 | 1423 |
]. |
1424 |
||
1425 |
" |
|
1426 |
self applicationIconFileNameWindows_code |
|
1427 |
stx_libbasic3 applicationIconFileNameWindows_code |
|
1428 |
" |
|
1429 |
||
1430 |
"Created: / 18-08-2006 / 16:21:01 / cg" |
|
1431 |
! |
|
1432 |
||
11072 | 1433 |
applicationIconFileName_code |
20567 | 1434 |
"obsolete - replaced by three separate methods as-per-OS" |
23124 | 1435 |
|
11072 | 1436 |
^ String streamContents:[:s | |
23124 | 1437 |
s nextPutLine:'applicationIconFileName'. |
1438 |
s nextPutLine:' "Return the name (without suffix) of an icon-file (the app''s icon);'. |
|
1439 |
s nextPutLine:' "will be included in the rc-resource file"'. |
|
1440 |
s cr; |
|
1441 |
nextPutLine:' ^ nil'; |
|
1442 |
nextPutLine:' " ^ self applicationName "'. |
|
11072 | 1443 |
]. |
1444 |
||
1445 |
" |
|
13873 | 1446 |
self applicationIconFileName_code |
1447 |
stx_libbasic3 applicationIconFileName_code |
|
11072 | 1448 |
" |
1449 |
||
1450 |
"Created: / 18-08-2006 / 16:21:01 / cg" |
|
1451 |
! |
|
1452 |
||
23179 | 1453 |
checkForBadReferences:prerequisiteList |
23125 | 1454 |
"check, that there are no 'illegal' references to prerequisites. |
1455 |
If there is a bad prrequisite, ask the user whether to abort." |
|
1456 |
||
23179 | 1457 |
prerequisiteList keysDo:[:eachPackageSymbol| |
23125 | 1458 |
|defClass| |
1459 |
||
24567 | 1460 |
defClass := (self definitionClassForPackage:eachPackageSymbol) theNonMetaclass. |
23125 | 1461 |
(defClass isProjectDefinition and:[defClass isPluginDefinition]) ifTrue:[ |
1462 |
(self confirm:('Bad cross-plugin requirement to: %1%<cr>%<cr>Proceed?' bindWith:eachPackageSymbol)) ifFalse:[ |
|
1463 |
AbortOperationRequest raiseRequest. |
|
1464 |
]. |
|
1465 |
]. |
|
1466 |
] |
|
23179 | 1467 |
|
1468 |
"Modified (format): / 02-07-2018 / 18:56:29 / cg" |
|
23125 | 1469 |
! |
1470 |
||
10393 | 1471 |
classNamesAndAttributes_codeFor:aSpecArray |
1472 |
"generate method code returning all classes of the project from the given spec." |
|
1473 |
||
1474 |
^ String streamContents:[:s | |
|
23124 | 1475 |
s nextPutLine:'classNamesAndAttributes'. |
1476 |
s nextPutLine:' "lists the classes which are to be included in the project.'. |
|
1477 |
s nextPutLine:' Each entry in the list may be: a single class-name (symbol),'. |
|
1478 |
s nextPutLine:' or an array-literal consisting of class name and attributes.'. |
|
1479 |
s nextPutLine:' Attributes are: #autoload or #<os> where os is one of win32, unix,..."'. |
|
1480 |
s nextPutLine:''. |
|
1481 |
s nextPutLine:' ^ #('. |
|
1482 |
s nextPutLine:' "<className> or (<className> attributes...) in load order"'. |
|
1483 |
||
1484 |
(self classNamesAndAttributesFromSpecArray:aSpecArray) do:[:entry | |
|
1485 |
s spaces:8. |
|
1486 |
entry storeArrayElementOn:s. |
|
1487 |
s cr. |
|
1488 |
]. |
|
1489 |
s nextPutLine:' )' |
|
10393 | 1490 |
]. |
1491 |
||
1492 |
" |
|
1493 |
stx_libbasic3 classNamesAndAttributes_codeFor:(stx_libbasic3 classNamesAndAttributes) |
|
1494 |
exept_expecco classNamesAndAttributes_codeFor:(exept_expecco classNamesAndAttributes) |
|
1495 |
" |
|
1496 |
||
1497 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
1498 |
"Created: / 19-02-2007 / 15:43:27 / cg" |
|
1499 |
! |
|
1500 |
||
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1501 |
classNamesAndAttributes_code_ignoreOldEntries:ignoreOldEntries ignoreOldDefinition:ignoreOldDefinition |
10010 | 1502 |
"generate method code returning all classes of the project. |
1503 |
Platform attributes are kept from the old definition. |
|
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1504 |
If ignoreOldEntries is true, the list is completely recreated; |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1505 |
if false, existing entries are preserved. |
10010 | 1506 |
If ignoreOldDefinition is true, the autoload attribute is set/reset if |
13419 | 1507 |
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
|
1508 |
If false, it is taken from an existing definition in #classNamesAndAttributes" |
10010 | 1509 |
|
20673 | 1510 |
|newSpec oldSpec ignored| |
10393 | 1511 |
|
1512 |
oldSpec := self classNamesAndAttributesAsSpecArray. |
|
1513 |
ignored := self ignoredClassNames asSet. |
|
1514 |
newSpec := OrderedCollection new. |
|
1515 |
||
1516 |
ignoreOldEntries ifFalse:[ |
|
23124 | 1517 |
oldSpec do:[:oldEntry | |
1518 |
|newEntry className cls | |
|
1519 |
||
1520 |
newEntry := oldEntry copy. |
|
1521 |
className := newEntry first. |
|
1522 |
||
1523 |
(ignored includes:className) ifFalse:[ |
|
1524 |
cls := Smalltalk classNamed:className. |
|
1525 |
cls notNil ifTrue:[ |
|
1526 |
ignoreOldDefinition ifTrue:[ |
|
1527 |
cls isLoaded ifFalse:[ |
|
1528 |
(newEntry includes:#autoload) ifFalse:[ |
|
1529 |
newEntry := newEntry copyWith:#autoload. |
|
1530 |
]. |
|
1531 |
]. |
|
1532 |
]. |
|
1533 |
"JV @ 2010-06-19 |
|
1534 |
Force merge default class attributes with existing ones" |
|
1535 |
newEntry := self mergeDefaultClassAttributesFor: cls with: newEntry. |
|
1536 |
newSpec add:newEntry. |
|
1537 |
] |
|
1538 |
]. |
|
1539 |
]. |
|
10393 | 1540 |
]. |
1541 |
self searchForClasses do:[:eachClass | |
|
23124 | 1542 |
|className attributes oldSpecEntry oldAttributes newEntry| |
1543 |
||
1544 |
eachClass isJavaClass ifFalse:[ |
|
1545 |
className := eachClass name. |
|
1546 |
(ignored includes:className) ifFalse:[ |
|
1547 |
oldSpecEntry := oldSpec detect:[:entry | entry first = className] ifNone:nil. |
|
1548 |
||
1549 |
(ignoreOldEntries or:[oldSpecEntry isNil]) ifTrue:[ |
|
1550 |
(eachClass isLoaded not or:[eachClass isPrivate not]) ifTrue:[ |
|
1551 |
(self additionalClassNamesAndAttributes includes:className) ifFalse:[ |
|
1552 |
(oldSpecEntry size > 1) ifTrue:[ |
|
1553 |
oldAttributes := oldSpecEntry copyFrom:2. |
|
1554 |
]. |
|
1555 |
||
1556 |
ignoreOldDefinition ifTrue:[ |
|
1557 |
"take autoload attribute from classes state in the image" |
|
1558 |
oldAttributes notNil ifTrue:[ |
|
1559 |
attributes := oldAttributes copyWithout:#autoload. |
|
1560 |
] ifFalse:[ |
|
1561 |
attributes := #() |
|
1562 |
]. |
|
1563 |
eachClass isLoaded ifFalse:[ |
|
1564 |
attributes := attributes copyWith:#autoload. |
|
1565 |
]. |
|
1566 |
] ifFalse:[ |
|
1567 |
"keep any existing attribute" |
|
1568 |
oldAttributes notNil ifTrue:[ |
|
1569 |
attributes := oldAttributes. |
|
1570 |
] ifFalse:[ |
|
1571 |
attributes := eachClass isLoaded ifTrue:[ #() ] ifFalse:[ #(autoload) ]. |
|
1572 |
]. |
|
1573 |
]. |
|
1574 |
"JV @ 2010-06-19 |
|
1575 |
Support for additional class attributes and programming language attribute" |
|
1576 |
attributes := self mergeDefaultClassAttributesFor: eachClass with: attributes. |
|
1577 |
||
1578 |
newEntry := Array with:className. |
|
1579 |
attributes notEmptyOrNil ifTrue:[ |
|
1580 |
newEntry := newEntry , attributes. |
|
1581 |
]. |
|
1582 |
newSpec add:newEntry. |
|
1583 |
] |
|
1584 |
] |
|
1585 |
] |
|
1586 |
] |
|
1587 |
] |
|
9998 | 1588 |
]. |
17109 | 1589 |
^ self classNamesAndAttributes_codeFor:newSpec |
10393 | 1590 |
|
13419 | 1591 |
" |
10393 | 1592 |
stx_libbasic3 classNamesAndAttributes_code_ignoreOldEntries:false ignoreOldDefinition:true |
1593 |
exept_expecco classNamesAndAttributes_code_ignoreOldEntries:false ignoreOldDefinition:true |
|
1594 |
" |
|
9998 | 1595 |
|
1596 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1597 |
"Created: / 10-10-2006 / 22:00:50 / cg" |
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
1598 |
"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
|
1599 |
"Modified: / 30-07-2014 / 20:40:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
22333 | 1600 |
"Modified (comment): / 08-11-2017 / 17:59:04 / mawalch" |
9998 | 1601 |
! |
1602 |
||
1603 |
companyName_code |
|
20567 | 1604 |
"generate code that answers the company name." |
1605 |
||
12541 | 1606 |
^ self companyName_codeFor:self companyName |
1607 |
||
1608 |
" |
|
1609 |
self companyName_code |
|
1610 |
stx_libbasic3 companyName_code |
|
1611 |
" |
|
1612 |
||
1613 |
"Created: / 18-08-2006 / 16:20:42 / cg" |
|
1614 |
! |
|
1615 |
||
1616 |
companyName_codeFor:aString |
|
20567 | 1617 |
"generate code that answers aString as the company name." |
1618 |
||
9998 | 1619 |
^ String streamContents:[:s | |
23124 | 1620 |
s nextPutLine:'companyName'. |
1621 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #companyName) comment; nextPutLine:'"'. |
|
1622 |
s cr; nextPutLine:' ^ ',aString storeString. |
|
9998 | 1623 |
]. |
1624 |
||
1625 |
" |
|
1626 |
self companyName_code |
|
1627 |
stx_libbasic3 companyName_code |
|
1628 |
" |
|
1629 |
||
1630 |
"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
|
1631 |
"Modified: / 05-03-2014 / 17:00:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9998 | 1632 |
! |
1633 |
||
1634 |
compileDescriptionMethods |
|
16682 | 1635 |
(self isAbstract) ifTrue:[ |
23124 | 1636 |
self error:'I am abstract - must be a subclass of Libray- or ApplicationDefinition.' |
9998 | 1637 |
]. |
1638 |
||
13419 | 1639 |
self |
23124 | 1640 |
forEachMethodsCodeToCompileDo:[:code :category | |
1641 |
self compile:code categorized:category |
|
1642 |
]. |
|
9998 | 1643 |
|
1644 |
"/ self instAndClassMethodsDo:[:m | m package:self package]. |
|
1645 |
||
1646 |
" |
|
1647 |
DapasXProject compileDescriptionMethods |
|
1648 |
DapasX_Datenbasis compileDescriptionMethods |
|
1649 |
bosch_dapasx_interactiver_editor compileDescriptionMethods |
|
1650 |
stx_libbasic compileDescriptionMethods |
|
1651 |
" |
|
1652 |
||
1653 |
"Created: / 09-08-2006 / 18:00:31 / fm" |
|
1654 |
"Modified: / 05-09-2006 / 13:46:29 / cg" |
|
1655 |
! |
|
1656 |
||
1657 |
description_code |
|
1658 |
^ String streamContents:[:s | |
|
23124 | 1659 |
s nextPutLine:'description'. |
1660 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #description) comment; nextPutLine:'"'. |
|
1661 |
s cr; nextPutLine:' ^ ',self description asString storeString. |
|
9998 | 1662 |
]. |
1663 |
||
1664 |
" |
|
13419 | 1665 |
self description_code |
1666 |
stx_libbasic3 description_code |
|
9998 | 1667 |
" |
1668 |
||
1669 |
"Created: / 17-08-2006 / 21:24:01 / cg" |
|
1670 |
"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
|
1671 |
"Modified: / 05-03-2014 / 17:00:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9998 | 1672 |
! |
1673 |
||
11386
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1674 |
effectiveSubProjects |
21259 | 1675 |
"get the subProjects for the current OS platform, that are not excluded" |
1676 |
||
1677 |
^ self effectiveSubProjects:OperatingSystem platformName |
|
1678 |
||
1679 |
"Modified: / 17-01-2017 / 16:31:42 / stefan" |
|
1680 |
! |
|
1681 |
||
1682 |
effectiveSubProjects:osSymbol |
|
1683 |
"get the subProjects, that are not excluded. |
|
1684 |
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
|
1685 |
|
23629 | 1686 |
|prereqs subProjects| |
1687 |
||
1688 |
prereqs := self allPreRequisites. |
|
1689 |
||
1690 |
subProjects := (self subProjects, self includedInSubProjects) |
|
1691 |
collect:[:eachLine| |
|
1692 |
|prj| |
|
1693 |
||
1694 |
eachLine isString ifTrue:[ |
|
1695 |
prj := eachLine |
|
1696 |
] ifFalse:[ |
|
1697 |
eachLine second = osSymbol ifTrue:[ |
|
1698 |
prj := eachLine first. |
|
1699 |
]. |
|
1700 |
]. |
|
1701 |
(prereqs includes:prj) ifTrue:[ prj := nil]. |
|
1702 |
prj. |
|
1703 |
] as:OrderedSet. |
|
21259 | 1704 |
|
1705 |
subProjects remove:self package ifAbsent:[]. |
|
1706 |
subProjects remove:nil ifAbsent:[]. |
|
1707 |
||
1708 |
self excludedFromSubProjects do:[:eachLine| |
|
23629 | 1709 |
eachLine isString ifTrue:[ |
1710 |
subProjects remove:eachLine ifAbsent:[]. |
|
1711 |
] ifFalse:[eachLine second = osSymbol ifTrue:[ |
|
1712 |
subProjects remove:eachLine first ifAbsent:[]. |
|
1713 |
]]. |
|
21259 | 1714 |
]. |
11386
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1715 |
|
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1716 |
^ subProjects |
21259 | 1717 |
|
1718 |
"Created: / 17-01-2017 / 16:16:03 / stefan" |
|
23629 | 1719 |
"Modified: / 22-01-2019 / 14:42:51 / Claus Gittinger" |
11386
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1720 |
! |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1721 |
|
12425 | 1722 |
excludedFromPreRequisites_code |
1723 |
"generate the code of the #excludedFromPreRequisites method" |
|
1724 |
||
1725 |
^ String streamContents:[:s | |
|
23124 | 1726 |
s nextPutLine:'excludedFromPreRequisites'. |
1727 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #excludedFromPreRequisites) comment; nextPutLine:'"'. |
|
1728 |
s nextPutLine:''. |
|
1729 |
s nextPutLine:' ^ #('. |
|
1730 |
s nextPutLine:' )' |
|
12425 | 1731 |
]. |
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
|
1732 |
|
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
1733 |
"Modified: / 05-03-2014 / 17:00:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12425 | 1734 |
! |
1735 |
||
9998 | 1736 |
extensionMethodNames_code |
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1737 |
^ self extensionMethodNames_code_ignoreOldEntries:true |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1738 |
|
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1739 |
" |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1740 |
self extensionMethodNames_code |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1741 |
" |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1742 |
|
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1743 |
"Created: / 17-08-2006 / 21:21:48 / cg" |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1744 |
"Modified: / 10-10-2006 / 22:02:42 / cg" |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1745 |
! |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1746 |
|
15005 | 1747 |
extensionMethodNames_code_For:extensionMethodNames |
1748 |
^ String streamContents:[:s | |
|
23124 | 1749 |
|spec| |
1750 |
||
1751 |
s nextPutLine:'extensionMethodNames'. |
|
1752 |
s nextPutLine:' "lists the extension methods which are to be included in the project.'. |
|
1753 |
s nextPutLine:' Entries are pairwise elements, consisting of class-name and selector."'. |
|
1754 |
s nextPutLine:''. |
|
1755 |
s nextPutLine:' ^ #('. |
|
1756 |
||
1757 |
spec := extensionMethodNames pairWiseCollect:[:className :selector | className -> selector ]. |
|
1758 |
spec do:[:entry | |
|
1759 |
|mclassName mselector| |
|
1760 |
||
1761 |
mclassName := entry key asSymbol. |
|
1762 |
(mclassName endsWith:' class') ifTrue:[ |
|
1763 |
mclassName := mclassName asString. |
|
1764 |
]. |
|
1765 |
mselector := entry value asSymbol. |
|
1766 |
||
1767 |
s spaces:8. |
|
1768 |
mclassName storeArrayElementOn:s. |
|
1769 |
s space. |
|
1770 |
mselector storeArrayElementOn:s. |
|
1771 |
s cr. |
|
1772 |
]. |
|
1773 |
s nextPutLine:' )' |
|
15005 | 1774 |
]. |
1775 |
! |
|
1776 |
||
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1777 |
extensionMethodNames_code_ignoreOldEntries:ignoreOldEntries |
9998 | 1778 |
^ String streamContents:[:s | |
23124 | 1779 |
|oldSpec| |
1780 |
||
1781 |
s nextPutLine:'extensionMethodNames'. |
|
1782 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #extensionMethodNames) comment; nextPutLine:'"'. |
|
1783 |
s nextPutLine:''. |
|
1784 |
s nextPutLine:' ^ #('. |
|
1785 |
||
1786 |
oldSpec := self extensionMethodNames pairWiseCollect:[:className :selector | className -> selector ]. |
|
1787 |
||
1788 |
ignoreOldEntries ifFalse:[ |
|
1789 |
oldSpec do:[:entry | |
|
1790 |
|mclassName mselector| |
|
1791 |
||
1792 |
mclassName := entry key asSymbol. |
|
1793 |
(mclassName endsWith:' class') ifTrue:[ |
|
1794 |
mclassName := mclassName asString. |
|
1795 |
]. |
|
1796 |
mselector := entry value asSymbol. |
|
1797 |
||
1798 |
s spaces:8. |
|
1799 |
mclassName storeArrayElementOn:s. |
|
1800 |
s space. |
|
1801 |
mselector storeArrayElementOn:s. |
|
1802 |
s cr. |
|
1803 |
]. |
|
1804 |
]. |
|
1805 |
||
1806 |
self searchForExtensions do:[:eachMethod | |
|
1807 |
|attributes oldSpecEntry mclassName mselector| |
|
1808 |
||
1809 |
mclassName := eachMethod mclass name. |
|
1810 |
mselector := eachMethod selector. |
|
1811 |
"JV@2012-09-07: Do not list Java methods in extensionMethodNames. |
|
1812 |
They are loaded lazily by JavaClassReader and if listed here, |
|
1813 |
they would cause an error if the package is loaded from source. |
|
1814 |
Sort of a HACK, indeed" |
|
1815 |
eachMethod mclass theNonMetaclass isJavaClass ifFalse:[ |
|
1816 |
oldSpecEntry := oldSpec detect:[:entry | entry key = mclassName and:[ entry value = mselector]] ifNone:nil. |
|
1817 |
(ignoreOldEntries or:[ oldSpecEntry isNil]) ifTrue:[ |
|
1818 |
s spaces:8. |
|
1819 |
mclassName storeArrayElementOn:s. |
|
1820 |
s space. |
|
1821 |
mselector storeArrayElementOn:s. |
|
1822 |
s cr. |
|
1823 |
] |
|
1824 |
]. |
|
1825 |
]. |
|
1826 |
||
1827 |
s nextPutLine:' )' |
|
9998 | 1828 |
]. |
1829 |
||
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1830 |
" |
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1831 |
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
|
1832 |
stx_libjava extensionMethodNames_code_ignoreOldEntries:false |
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1833 |
stx_libtool extensionMethodNames_code_ignoreOldEntries:true |
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1834 |
" |
9998 | 1835 |
|
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1836 |
"Created: / 10-10-2006 / 22:02:36 / cg" |
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1837 |
"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
|
1838 |
"Modified: / 05-03-2014 / 17:00:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9998 | 1839 |
! |
1840 |
||
1841 |
forEachContentsMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition |
|
15052 | 1842 |
"generate code for each contents-specifying method |
1843 |
(classesAndAttributes, extensionMethodNames, etc.), |
|
1844 |
and evaluate aTwoArgBlock on it, passing in the code and the method's category. |
|
1845 |
If ignoreOldDefinition is true, new code is generated (class/method scan); |
|
1846 |
otherwise, new items are added to the existing lists" |
|
1847 |
||
13419 | 1848 |
aTwoArgBlock |
23124 | 1849 |
value:(self classNamesAndAttributes_code_ignoreOldEntries:ignoreOldDefinition ignoreOldDefinition:ignoreOldDefinition) |
1850 |
value:'description - contents'. |
|
13419 | 1851 |
|
1852 |
aTwoArgBlock |
|
23124 | 1853 |
value: (self extensionMethodNames_code_ignoreOldEntries:ignoreOldDefinition) |
1854 |
value: 'description - contents'. |
|
13419 | 1855 |
|
1856 |
aTwoArgBlock |
|
23124 | 1857 |
value: self mandatoryPreRequisites_code |
1858 |
value: 'description'. |
|
14843 | 1859 |
|
1860 |
aTwoArgBlock |
|
23124 | 1861 |
value: self referencedPreRequisites_code |
1862 |
value: 'description'. |
|
13419 | 1863 |
|
16571 | 1864 |
(self class includesSelector:#excludedFromPreRequisites) ifFalse:[ |
23124 | 1865 |
aTwoArgBlock |
1866 |
value: self excludedFromPreRequisites_code |
|
1867 |
value: 'description'. |
|
14812 | 1868 |
]. |
13411 | 1869 |
|
15950 | 1870 |
"/ JV: No, subProjects **should not** be automatically generated. |
1871 |
"/ Remember, they are not required to be loaded!! So, generate |
|
1872 |
"/ subProjects only if there's no such method yet. |
|
1873 |
(self class methodDictionary includesKey: #subProjects) ifFalse:[ |
|
23124 | 1874 |
aTwoArgBlock |
1875 |
value: self subProjects_code |
|
1876 |
value: 'description'. |
|
15950 | 1877 |
]. |
14988 | 1878 |
|
13411 | 1879 |
(self monticelloPackageName notNil and:[self respondsTo:#monticelloTimestamps_code]) ifTrue:[ |
23124 | 1880 |
aTwoArgBlock |
1881 |
value: self monticelloTimestamps_code |
|
1882 |
value: 'description - monticello'. |
|
13411 | 1883 |
]. |
1884 |
||
15950 | 1885 |
"Modified: / 25-11-2013 / 13:56:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13411 | 1886 |
! |
1887 |
||
16682 | 1888 |
forEachDescriptionMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition |
1889 |
"generate code for descriptive methods, |
|
15052 | 1890 |
and evaluate aTwoArgBlock on it, passing in the code and the method's category. |
1891 |
If ignoreOldDefinition is true, new code is generated (class/method scan); |
|
1892 |
otherwise, new items are added to the existing lists" |
|
1893 |
||
13873 | 1894 |
"/ code like: |
1895 |
"/ |
|
1896 |
"/ (self class includesSelector:#productName) ifFalse:[ |
|
1897 |
"/ aTwoArgBlock |
|
1898 |
"/ value: self productName_code |
|
1899 |
"/ value: 'description - project information'. |
|
1900 |
"/ ]. |
|
1901 |
||
1902 |
#( |
|
23124 | 1903 |
(productName productName_code) |
1904 |
(description description_code) |
|
1905 |
(companyName companyName_code) |
|
1906 |
(legalCopyright legalCopyright_code) |
|
13873 | 1907 |
) pairsDo:[:selector :codeMethodSelector | |
23124 | 1908 |
(self class includesSelector:selector) ifFalse:[ |
1909 |
aTwoArgBlock |
|
1910 |
value: (self perform:codeMethodSelector) |
|
1911 |
value: 'description - project information'. |
|
1912 |
]. |
|
11072 | 1913 |
]. |
16682 | 1914 |
! |
1915 |
||
1916 |
forEachMethodsCodeToCompileDo:aTwoArgBlock |
|
1917 |
"update code for each method (contents plus version info), |
|
1918 |
and evaluate aTwoArgBlock on it, passing in the code and the method's category. |
|
1919 |
New items are added to the existing lists" |
|
1920 |
||
1921 |
self forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:false |
|
1922 |
! |
|
1923 |
||
1924 |
forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition |
|
1925 |
"generate code for each method (contents plus version info), |
|
1926 |
and evaluate aTwoArgBlock on it, passing in the code and the method's category. |
|
1927 |
If ignoreOldDefinition is true, new code is generated (class/method scan); |
|
1928 |
otherwise, new items are added to the existing lists" |
|
1929 |
||
1930 |
self |
|
23124 | 1931 |
forEachContentsMethodsCodeToCompileDo:aTwoArgBlock |
1932 |
ignoreOldDefinition:ignoreOldDefinition. |
|
16682 | 1933 |
|
1934 |
self |
|
23124 | 1935 |
forEachDescriptionMethodsCodeToCompileDo:aTwoArgBlock |
1936 |
ignoreOldDefinition:ignoreOldDefinition. |
|
9998 | 1937 |
|
13411 | 1938 |
(self monticelloPackageName notNil and:[self respondsTo:#monticelloTimestamps_code]) ifTrue:[ |
23124 | 1939 |
aTwoArgBlock |
1940 |
value: self monticelloTimestamps_code |
|
1941 |
value: 'description - monticello'. |
|
13411 | 1942 |
]. |
1943 |
||
9998 | 1944 |
"Created: / 18-08-2006 / 16:22:37 / cg" |
13411 | 1945 |
"Modified: / 09-11-2010 / 18:41:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13873 | 1946 |
"Modified: / 21-12-2011 / 16:42:41 / cg" |
9998 | 1947 |
! |
1948 |
||
1949 |
legalCopyright_code |
|
1950 |
^ String streamContents:[:s | |
|
23124 | 1951 |
s nextPutLine:'legalCopyright'. |
1952 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #legalCopyright) comment; nextPutLine:'"'. |
|
1953 |
s cr; nextPutLine:' ^ ', self legalCopyright storeString. |
|
9998 | 1954 |
]. |
1955 |
||
1956 |
" |
|
13419 | 1957 |
self legalCopyright_code |
1958 |
stx_libbasic3 legalCopyright_code |
|
9998 | 1959 |
" |
1960 |
||
1961 |
"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
|
1962 |
"Modified: / 05-03-2014 / 17:00:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9998 | 1963 |
! |
1964 |
||
14843 | 1965 |
mandatoryPreRequisites_code |
1966 |
"generate the code of the #mandatoryPreRequisites method" |
|
1967 |
||
1968 |
|preRequisites| |
|
1969 |
||
1970 |
preRequisites := self searchForPreRequisites first. |
|
23125 | 1971 |
preRequisites |
1972 |
removeAllKeys:self excludedFromMandatoryPreRequisites ifAbsent:[]; |
|
1973 |
removeAllKeys:self excludedFromPreRequisites ifAbsent:[]. |
|
1974 |
||
1975 |
self checkForBadReferences:preRequisites. |
|
14843 | 1976 |
|
1977 |
^ String streamContents:[:s | |
|
23125 | 1978 |
s nextPutLine:'mandatoryPreRequisites'. |
1979 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #mandatoryPreRequisites) comment; nextPutLine:'"'. |
|
1980 |
s nextPutLine:''. |
|
1981 |
s nextPutLine:' ^ #('. |
|
1982 |
preRequisites keys asSortedCollection do:[:eachPackageID | |
|
1983 |
|reason| |
|
1984 |
||
1985 |
s spaces:8. |
|
1986 |
eachPackageID asSymbol storeOn:s. |
|
1987 |
reason := preRequisites at:eachPackageID ifAbsent:[nil]. |
|
1988 |
reason notEmptyOrNil ifTrue:[ |
|
1989 |
s nextPutAll:' "'; nextPutAll:reason anElement; nextPut:$". |
|
1990 |
]. |
|
1991 |
s cr. |
|
1992 |
]. |
|
1993 |
s nextPutLine:' )' |
|
14843 | 1994 |
]. |
1995 |
||
1996 |
" |
|
1997 |
demo_demoApp1 mandatoryPreRequisites_code |
|
1998 |
stx_libbasic3 mandatoryPreRequisites_code |
|
1999 |
stx_libtool2 mandatoryPreRequisites_code |
|
2000 |
" |
|
2001 |
||
2002 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
2003 |
"Created: / 17-08-2006 / 21:28:09 / cg" |
|
2004 |
"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
|
2005 |
"Modified: / 05-03-2014 / 17:00:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14843 | 2006 |
! |
2007 |
||
13873 | 2008 |
productInstallDirBaseName_code |
2009 |
^ String streamContents:[:s | |
|
23124 | 2010 |
s nextPutLine:'productInstallDirBaseName'. |
2011 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #productInstallDirBaseName) comment; nextPutLine:'"'. |
|
2012 |
s cr; |
|
2013 |
nextPutLine:' ^ (self package asCollectionOfSubstringsSeparatedByAny:'':/'') last'. |
|
13873 | 2014 |
]. |
2015 |
||
2016 |
" |
|
20567 | 2017 |
ApplicationDefinition productInstallDirBaseName_code |
13873 | 2018 |
stx_libbasic3 productInstallDirBaseName_code |
2019 |
stx_clients_Clock_QlockTwoWatchApplication productInstallDirBaseName_code |
|
2020 |
" |
|
2021 |
||
2022 |
"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
|
2023 |
"Modified: / 05-03-2014 / 17:00:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13873 | 2024 |
! |
2025 |
||
9998 | 2026 |
productName_code |
20567 | 2027 |
"generate code that answers the product name." |
2028 |
||
12541 | 2029 |
^ self productName_codeFor:(self productName) |
2030 |
||
2031 |
" |
|
2032 |
self productName_code |
|
2033 |
stx_libbasic3 productName_code |
|
2034 |
" |
|
2035 |
||
2036 |
"Created: / 18-08-2006 / 16:14:19 / cg" |
|
2037 |
! |
|
2038 |
||
2039 |
productName_codeFor:aString |
|
20567 | 2040 |
"generate code that answers aString as the product name." |
2041 |
||
9998 | 2042 |
^ String streamContents:[:s | |
23124 | 2043 |
s nextPutLine:'productName'. |
2044 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #productName) comment; nextPutLine:'"'. |
|
2045 |
s cr; nextPutLine:' ^ ',aString storeString. |
|
9998 | 2046 |
]. |
2047 |
||
2048 |
" |
|
2049 |
self productName_code |
|
2050 |
stx_libbasic3 productName_code |
|
2051 |
" |
|
2052 |
||
2053 |
"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
|
2054 |
"Modified: / 05-03-2014 / 17:00:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12028 | 2055 |
! |
2056 |
||
14843 | 2057 |
referencedPreRequisites_code |
2058 |
"generate the code of the #referencedPreRequisites method" |
|
2059 |
||
2060 |
|preRequisitesColl preRequisites| |
|
2061 |
||
2062 |
preRequisitesColl := self searchForPreRequisites. |
|
14885 | 2063 |
preRequisites := preRequisitesColl second. |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
2064 |
preRequisites |
23125 | 2065 |
removeAllKeys:self excludedFromPreRequisites ifAbsent:[]; |
2066 |
removeAllKeys:self excludedFromRequiredPreRequisites ifAbsent:[]; |
|
2067 |
removeAllKeys:preRequisitesColl first keys ifAbsent:[]. "remove the mandatory prerequisites" |
|
2068 |
||
2069 |
self checkForBadReferences:preRequisites. |
|
14843 | 2070 |
|
2071 |
^ String streamContents:[:s | |
|
23125 | 2072 |
s nextPutLine:'referencedPreRequisites'. |
2073 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #referencedPreRequisites) comment; nextPutLine:'"'. |
|
2074 |
s nextPutLine:''. |
|
2075 |
s nextPutLine:' ^ #('. |
|
2076 |
preRequisites keys asSortedCollection do:[:eachPackageID | |
|
2077 |
|reason| |
|
2078 |
||
2079 |
s spaces:8. |
|
2080 |
eachPackageID asSymbol storeOn:s. |
|
2081 |
reason := preRequisites at:eachPackageID ifAbsent:[nil]. |
|
2082 |
reason notEmptyOrNil ifTrue:[ |
|
2083 |
s nextPutAll:' "'; nextPutAll:reason anElement; nextPut:$". |
|
2084 |
]. |
|
2085 |
s cr. |
|
2086 |
]. |
|
2087 |
s nextPutLine:' )' |
|
14843 | 2088 |
]. |
2089 |
||
2090 |
" |
|
2091 |
demo_demoApp1 referencedPreRequisites_code |
|
2092 |
stx_libbasic3 referencedPreRequisites_code |
|
2093 |
stx_libtool2 referencedPreRequisites_code |
|
2094 |
" |
|
2095 |
||
2096 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
2097 |
"Created: / 17-08-2006 / 21:28:09 / cg" |
|
2098 |
"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
|
2099 |
"Modified: / 05-03-2014 / 17:00:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14843 | 2100 |
! |
2101 |
||
14988 | 2102 |
subProjects_code |
2103 |
"generate the code of the #subProjects method. |
|
2104 |
Returns nil if no such code is needed (because there are none)" |
|
2105 |
||
2106 |
^ String streamContents:[:s | |
|
23124 | 2107 |
s nextPutLine:'subProjects'. |
2108 |
s nextPutAll: ' "'; nextPutAll: (self class superclass lookupMethodFor: #subProjects) comment; nextPutLine:'"'. |
|
2109 |
s nextPutLine:''. |
|
2110 |
s nextPutLine:' ^ #('. |
|
2111 |
ProjectDefinition allSubclassesDo:[:each | |
|
2112 |
(each package startsWith:(self package,'/')) ifTrue:[ |
|
2113 |
s nextPutLine:' #''',each package,''''. |
|
2114 |
] |
|
2115 |
]. |
|
2116 |
s nextPutLine:' )' |
|
14988 | 2117 |
]. |
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
|
2118 |
|
15aa39f0f5cb
Fix in ProjectDefinition - use up-to-date comment when (re)generating methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16213
diff
changeset
|
2119 |
"Modified: / 05-03-2014 / 17:00:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14988 | 2120 |
! |
2121 |
||
12028 | 2122 |
svnRevisionNr_code: revisionNrOrNil |
2123 |
^ String streamContents:[:s | |
|
23124 | 2124 |
s nextPutLine:'svnRevisionNr'. |
2125 |
s nextPutLine:' "Return a SVN revision number of myself.'. |
|
2126 |
s nextPutLine:' This number is updated after a commit"'. |
|
2127 |
s cr; |
|
2128 |
nextPutLine:' ^ "$SVN-Revision:"''', ('%-16s' printf: (Array with: revisionNrOrNil printString)) , '''"$"'. |
|
12028 | 2129 |
]. |
2130 |
||
2131 |
" |
|
2132 |
self svnRevisionNr_code |
|
2133 |
stx_libbasic3 svnRevisionNr_code |
|
2134 |
" |
|
2135 |
||
2136 |
"Created: / 16-06-2009 / 12:12:37 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
2137 |
"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
|
2138 |
"Modified: / 29-03-2012 / 18:43:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9998 | 2139 |
! ! |
2140 |
||
9569 | 2141 |
!ProjectDefinition class methodsFor:'defaults'! |
9536 | 2142 |
|
9664 | 2143 |
applicationTypes |
9714 | 2144 |
GUIApplicationType isNil ifTrue:[self initialize]. |
2145 |
^ Array with:GUIApplicationType with:NonGUIApplicationType |
|
9664 | 2146 |
|
9714 | 2147 |
" |
13419 | 2148 |
self applicationTypes |
9714 | 2149 |
" |
9664 | 2150 |
! |
2151 |
||
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
2152 |
defaultCategory |
10466 | 2153 |
^'* Projects & Packages *' |
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
2154 |
|
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
2155 |
"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
|
2156 |
! |
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
2157 |
|
9714 | 2158 |
defaultProjectType |
9745 | 2159 |
^ self libraryTypes first |
2160 |
"/ ^ self applicationTypes first |
|
9714 | 2161 |
|
2162 |
"Created: / 23-08-2006 / 14:27:32 / cg" |
|
2163 |
! |
|
2164 |
||
2165 |
defaultProjectTypeForGUIApplication |
|
2166 |
^ GUIApplicationType |
|
2167 |
! |
|
2168 |
||
2169 |
defaultProjectTypeForNonGUIApplication |
|
2170 |
^ NonGUIApplicationType |
|
2171 |
! |
|
9664 | 2172 |
|
16541 | 2173 |
folderForSubApplicationsType |
2174 |
^ FolderForSubApplicationsType |
|
2175 |
! |
|
2176 |
||
9714 | 2177 |
guiApplicationType |
2178 |
^ GUIApplicationType |
|
2179 |
! |
|
2180 |
||
2181 |
libraryType |
|
2182 |
^ LibraryType |
|
2183 |
! |
|
2184 |
||
13419 | 2185 |
libraryTypes |
9714 | 2186 |
LibraryType isNil ifTrue:[self initialize]. |
2187 |
^ Array with:LibraryType |
|
2188 |
||
2189 |
" |
|
13419 | 2190 |
self libraryTypes |
9714 | 2191 |
" |
2192 |
! |
|
2193 |
||
2194 |
nonGuiApplicationType |
|
2195 |
^ NonGUIApplicationType |
|
9664 | 2196 |
! |
2197 |
||
12331 | 2198 |
projectTypeSelectors |
2199 |
"a list of possible project type selectors" |
|
2200 |
||
16541 | 2201 |
^ #( libraryType guiApplicationType nonGuiApplicationType folderForSubApplicationsType ) |
12331 | 2202 |
|
2203 |
" |
|
2204 |
self libraryType |
|
2205 |
self guiApplicationType |
|
2206 |
self nonGuiApplicationType |
|
2207 |
" |
|
2208 |
||
2209 |
"Created: / 23-08-2006 / 14:27:32 / cg" |
|
2210 |
! |
|
2211 |
||
9664 | 2212 |
projectTypes |
16541 | 2213 |
"a list of possible project types (shown in the new-package dialog's combo list)" |
2214 |
||
2215 |
^ self libraryTypes , self applicationTypes , { FolderForSubApplicationsType } |
|
9664 | 2216 |
|
12331 | 2217 |
" |
2218 |
self projectTypes |
|
2219 |
" |
|
2220 |
||
9664 | 2221 |
"Created: / 23-08-2006 / 14:27:32 / cg" |
9536 | 2222 |
! ! |
2223 |
||
9569 | 2224 |
!ProjectDefinition class methodsFor:'description'! |
9536 | 2225 |
|
20527 | 2226 |
excludedFromMandatoryPreRequisites |
9983 | 2227 |
"list packages which are to be explicitely excluded from the automatic constructed |
23124 | 2228 |
mandatory prerequisites list. |
20527 | 2229 |
If empty, everything that is found along the inheritance of any of |
2230 |
my classes is considered to be a prerequisite package." |
|
2231 |
||
2232 |
^ #() |
|
2233 |
! |
|
2234 |
||
2235 |
excludedFromPreRequisites |
|
2236 |
"obsolete; temporarily, this is still called for, but will eventually vanish. |
|
23124 | 2237 |
|
20527 | 2238 |
List packages which are to be explicitely excluded from the automatic constructed |
23124 | 2239 |
prerequisites lists (both). |
20527 | 2240 |
If empty, everything that is found along the inheritance of any of |
2241 |
my classes is considered to be a prerequisite package." |
|
2242 |
||
2243 |
^ #() |
|
2244 |
||
2245 |
"Modified: / 17-08-2006 / 19:48:59 / cg" |
|
2246 |
! |
|
2247 |
||
2248 |
excludedFromRequiredPreRequisites |
|
2249 |
"list packages which are to be explicitely excluded from the automatic constructed |
|
23124 | 2250 |
required prerequisites list. |
20527 | 2251 |
If empty, everything that is found along the inheritance of any of |
9983 | 2252 |
my classes is considered to be a prerequisite package." |
2253 |
||
2254 |
^ #() |
|
2255 |
||
2256 |
"Modified: / 17-08-2006 / 19:48:59 / cg" |
|
2257 |
! |
|
2258 |
||
10380
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
2259 |
excludedFromSubProjects |
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
2260 |
"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
|
2261 |
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
|
2262 |
|
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
2263 |
^ #() |
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
2264 |
|
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
2265 |
"Modified: / 17-08-2006 / 19:49:40 / cg" |
10039 | 2266 |
! |
2267 |
||
14808 | 2268 |
includedInPreRequisites |
17577 | 2269 |
"list packages which are to be implicitely included in the prerequisites list, |
14808 | 2270 |
even if not found by the automatic search. |
2271 |
Redefine this, if classes from other packages are referred to via reflection |
|
2272 |
or by constructing names dynamically (i.e. the search cannot find it)" |
|
2273 |
||
2274 |
^ #() |
|
2275 |
! |
|
2276 |
||
15395 | 2277 |
includedInSubProjects |
2278 |
"list packages which are to be explicitely included in the subproject list, |
|
2279 |
even if not found by the automatic search. |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
2280 |
However: they are not forced to be loaded when a package is loaded; |
15395 | 2281 |
for those, redefine #includedInPreRequisites." |
2282 |
||
2283 |
^ #() |
|
2284 |
||
2285 |
"Modified: / 17-08-2006 / 19:57:46 / cg" |
|
2286 |
! |
|
2287 |
||
14843 | 2288 |
mandatoryPreRequisites |
2289 |
"list packages which are mandatory as a prerequisite. |
|
2290 |
This are packages containing superclasses of my classes and classes which |
|
2291 |
are extended by myself. |
|
16554 | 2292 |
They are mandatory, because we need these packages as a prerequisite for loading and compiling. |
24342 | 2293 |
When loading whole packages, |
2294 |
mandatoryPreRequisites will be automatically loaded |
|
2295 |
BEFORE this packet has been loaded. |
|
14843 | 2296 |
This method is generated automatically, |
20664 | 2297 |
by searching along the inheritance chain of all of my classes. |
2298 |
Please take a look at the #referencedPreRequisites method as well." |
|
9575 | 2299 |
|
2300 |
^ #() |
|
24342 | 2301 |
|
2302 |
"Modified (comment): / 23-06-2019 / 10:40:58 / Claus Gittinger" |
|
14843 | 2303 |
! |
2304 |
||
23850 | 2305 |
nonMandatorySubProjects |
2306 |
"list subprojects which can be ignored if the folder has been removed. |
|
2307 |
Make will give a warning, but proceed. |
|
2308 |
Should be a subset of what is returned by #subProjects" |
|
2309 |
||
2310 |
^ #() |
|
2311 |
||
2312 |
"Created: / 07-03-2019 / 17:31:36 / Claus Gittinger" |
|
2313 |
! |
|
2314 |
||
14843 | 2315 |
preRequisites |
20527 | 2316 |
"list packages which are required as a prerequisite (both mandatory and referenced). |
2317 |
This is used to build dependency chains in makefiles" |
|
14843 | 2318 |
|
2319 |
"use an OrderedSet here, so that mandatory prerequisites come first" |
|
2320 |
||
2321 |
^ OrderedSet new |
|
23124 | 2322 |
addAll:self mandatoryPreRequisites; |
2323 |
addAll:self referencedPreRequisites; |
|
2324 |
addAll:self includedInPreRequisites; |
|
2325 |
removeAllFoundIn:self excludedFromPreRequisites; |
|
2326 |
yourself. |
|
9575 | 2327 |
|
2328 |
"Modified: / 17-08-2006 / 19:54:21 / cg" |
|
2329 |
! |
|
2330 |
||
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
2331 |
preRequisitesFor:packageId |
14843 | 2332 |
|def| |
13411 | 2333 |
|
2334 |
def := self definitionClassForPackage:packageId. |
|
13820
f46f7306eea2
changed: #preRequisitesFor:
Claus Gittinger <cg@exept.de>
parents:
13809
diff
changeset
|
2335 |
def isNil ifTrue:[ |
23124 | 2336 |
"Maybe the package is not loaded? Try to load it..." |
2337 |
[ |
|
2338 |
Smalltalk loadPackage:packageId. |
|
2339 |
def := self definitionClassForPackage:packageId |
|
2340 |
] on:PackageLoadError do:[:ex| def := nil]. |
|
13820
f46f7306eea2
changed: #preRequisitesFor:
Claus Gittinger <cg@exept.de>
parents:
13809
diff
changeset
|
2341 |
]. |
21259 | 2342 |
^ def isNil ifTrue:[ |
23124 | 2343 |
"Still no project definition - maybe it does not exist?" |
2344 |
Transcript showCR:'Warning: no definition class for package: ', packageId. |
|
2345 |
((self searchForPreRequisites:packageId) |
|
2346 |
fold:[:d1 :d2| d1 addAll:d2; yourself]) keys |
|
2347 |
] ifFalse:[ |
|
2348 |
def effectivePreRequisites |
|
21259 | 2349 |
] |
13411 | 2350 |
|
2351 |
"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
|
2352 |
"Modified: / 18-11-2011 / 14:52:43 / cg" |
f46f7306eea2
changed: #preRequisitesFor:
Claus Gittinger <cg@exept.de>
parents:
13809
diff
changeset
|
2353 |
"Modified (format): / 19-11-2011 / 11:25:36 / cg" |
21259 | 2354 |
"Modified: / 17-01-2017 / 16:55:39 / stefan" |
13411 | 2355 |
! |
2356 |
||
14843 | 2357 |
referencedPreRequisites |
16213 | 2358 |
"list packages which are a prerequisite, because they contain |
14843 | 2359 |
classes which are referenced by my classes. |
20664 | 2360 |
These packages are NOT needed as a prerequisite for compiling or loading, |
17472 | 2361 |
however, a class from it may be referenced during execution and having it |
2362 |
unloaded then may lead to a runtime doesNotUnderstand error, unless the caller |
|
2363 |
includes explicit checks for the package being present. |
|
24342 | 2364 |
When loading whole packages, |
2365 |
referencedPreRequisites will be automatically loaded |
|
2366 |
AFTER this packet has been loaded. |
|
14843 | 2367 |
This method is generated automatically, |
20664 | 2368 |
by searching all classes (and their packages) which are referenced by my classes. |
2369 |
Please also take a look at the #mandatoryPreRequisites method" |
|
14843 | 2370 |
|
2371 |
^ #() |
|
24342 | 2372 |
|
2373 |
"Modified (comment): / 23-06-2019 / 10:40:30 / Claus Gittinger" |
|
12186 | 2374 |
! |
2375 |
||
9685 | 2376 |
siblingsAreSubProjects |
2377 |
^ false |
|
2378 |
! |
|
2379 |
||
11377 | 2380 |
splashFileName |
2381 |
"answer the base-name of the splash bitmap. |
|
2382 |
||
2383 |
Default is nil, for no splash. If non-nil, it must be a bmp file's name" |
|
2384 |
||
2385 |
^ nil. |
|
2386 |
! |
|
2387 |
||
9575 | 2388 |
subProjects |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
2389 |
"list packages which are known as subprojects. |
14959 | 2390 |
The generated makefile will enter those and make there as well. |
24425 | 2391 |
However: they are only built, not forced to be loaded when a package is loaded; |
20664 | 2392 |
for those, redefine #referencedPrerequisites or #mandatoryPreRequisites." |
9575 | 2393 |
|
2394 |
^ #() |
|
2395 |
||
2396 |
"Modified: / 17-08-2006 / 19:57:46 / cg" |
|
24425 | 2397 |
"Modified (comment): / 15-07-2019 / 15:31:56 / Claus Gittinger" |
21449 | 2398 |
! |
2399 |
||
2400 |
superProject |
|
2401 |
"return the package which contains me as subProject, |
|
2402 |
or if not found, which contains me under its directory hierarchy, |
|
2403 |
or nil if none found" |
|
2404 |
||
2405 |
|p superPackage idx| |
|
23124 | 2406 |
|
21451 | 2407 |
p := self package. |
21449 | 2408 |
ProjectDefinition allSubclassesDo:[:prjDef | |
23124 | 2409 |
(prjDef subProjects includes:p) ifTrue:[^ prjDef]. |
21451 | 2410 |
]. |
21449 | 2411 |
[ |
23124 | 2412 |
(idx := p lastIndexOf:$/) ~~ 0 |
21449 | 2413 |
] whileTrue:[ |
23124 | 2414 |
|defClass| |
2415 |
||
2416 |
superPackage := p copyTo:idx-1. |
|
2417 |
(defClass := ProjectDefinition definitionClassForPackage:superPackage) notNil ifTrue:[ |
|
2418 |
^ defClass |
|
2419 |
]. |
|
2420 |
p := superPackage. |
|
2421 |
]. |
|
21449 | 2422 |
^ nil |
2423 |
||
2424 |
" |
|
23124 | 2425 |
stx_goodies_refactoryBrowser_lint superProject |
2426 |
exept_expecco_plugin_guiBrowser superProject |
|
21449 | 2427 |
" |
2428 |
||
2429 |
"Created: / 15-02-2017 / 16:49:05 / cg" |
|
9575 | 2430 |
! ! |
2431 |
||
12372 | 2432 |
!ProjectDefinition class methodsFor:'description - actions'! |
2433 |
||
2434 |
postLoadAction |
|
2435 |
"invoked after loading a project" |
|
2436 |
||
2437 |
"/ intentionally left blank, to be redefined by subclasses (i.e. real projects) |
|
2438 |
||
2439 |
"Modified: / 17-08-2006 / 19:59:17 / cg" |
|
2440 |
! |
|
2441 |
||
2442 |
preLoadAction |
|
2443 |
"invoked before loading a project" |
|
2444 |
||
2445 |
"/ intentionally left blank, to be redefined by subclasses (i.e. real projects) |
|
2446 |
! |
|
2447 |
||
2448 |
preUnloadAction |
|
2449 |
"invoked before unloading a project" |
|
2450 |
||
2451 |
"/ intentionally left blank, to be redefined by subclasses (i.e. real projects) |
|
2452 |
||
2453 |
"Modified: / 17-08-2006 / 19:59:26 / cg" |
|
2454 |
! ! |
|
2455 |
||
16256 | 2456 |
|
9575 | 2457 |
!ProjectDefinition class methodsFor:'description - compilation'! |
9536 | 2458 |
|
11940
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2459 |
additionalBaseAddressDefinition_bc_dot_mak |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2460 |
"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
|
2461 |
Subclasses may redefine this to something like |
23124 | 2462 |
LIB_BASE=$(LIBWIDG_BASE) |
11940
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2463 |
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
|
2464 |
" |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2465 |
|
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2466 |
^ nil |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2467 |
! |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2468 |
|
11829
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2469 |
additionalDefinitions |
22657 | 2470 |
"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
|
2471 |
|
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2472 |
^ '' |
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2473 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2474 |
"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
|
2475 |
! |
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2476 |
|
10306 | 2477 |
additionalDefinitions_bc_dot_mak |
2478 |
"allows for additional definitions/rules to be added to the bc.mak file. |
|
10974 | 2479 |
Subclasses may redefine this." |
10306 | 2480 |
|
2481 |
^ self additionalDefinitions_nt_dot_mak |
|
2482 |
||
2483 |
"Created: / 22-08-2006 / 23:59:32 / cg" |
|
2484 |
! |
|
2485 |
||
9625 | 2486 |
additionalDefinitions_make_dot_proto |
2487 |
"allows for additional definitions/rules to be added to the make.proto file." |
|
2488 |
||
11829
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2489 |
^ self additionalDefinitions |
9625 | 2490 |
|
2491 |
"Created: / 22-08-2006 / 23:53:08 / cg" |
|
2492 |
! |
|
2493 |
||
2494 |
additionalDefinitions_nt_dot_mak |
|
10306 | 2495 |
"obsolete - kept for compatibility with old project files" |
9625 | 2496 |
|
11829
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2497 |
^ self additionalDefinitions |
9625 | 2498 |
|
2499 |
"Created: / 22-08-2006 / 23:59:32 / cg" |
|
2500 |
! |
|
2501 |
||
16328 | 2502 |
additionalHeaderRulesUsingTemplate:template withSeparator:pathSeparator |
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2503 |
"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
|
2504 |
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
|
2505 |
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
|
2506 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2507 |
^ String streamContents:[:s | |
23124 | 2508 |
(self extensionClassesWithSuperclasses:true) do:[:eachExtendedClass | |
2509 |
|headerFileDirPath baseFilename| |
|
2510 |
||
2511 |
(eachExtendedClass isLoaded not or:[eachExtendedClass wasAutoloaded]) ifTrue:[ |
|
2512 |
headerFileDirPath := self pathToPackage:eachExtendedClass package withSeparator:pathSeparator. |
|
2513 |
baseFilename := self filenameForClass:eachExtendedClass. |
|
2514 |
||
2515 |
s nextPutAll:(template |
|
2516 |
bindWith:headerFileDirPath |
|
2517 |
with:baseFilename). |
|
2518 |
] |
|
2519 |
]. |
|
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2520 |
]. |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2521 |
|
13688
4f43dc4a3182
added: #additionalHeaderRulesUsingTemplate:pathConverter:
Claus Gittinger <cg@exept.de>
parents:
13687
diff
changeset
|
2522 |
"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
|
2523 |
! |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2524 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2525 |
additionalHeaderRules_bc_dot_mak |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2526 |
"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
|
2527 |
|
13695 | 2528 |
^ self |
23124 | 2529 |
additionalHeaderRulesUsingTemplate:(self singleHeaderRuleTemplate_bc_dot_mak) |
2530 |
withSeparator:'\' |
|
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2531 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2532 |
"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
|
2533 |
! |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2534 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2535 |
additionalHeaderRules_make_dot_proto |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2536 |
"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
|
2537 |
|
13695 | 2538 |
^ self |
23124 | 2539 |
additionalHeaderRulesUsingTemplate:(self singleHeaderRuleTemplate_make_dot_proto) |
2540 |
withSeparator:'/' |
|
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2541 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2542 |
"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
|
2543 |
! |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2544 |
|
10306 | 2545 |
additionalLinkLibraries_bc_dot_mak |
2546 |
"allows for additional static libraries to be added to the bc.mak file. |
|
2547 |
Subclasses may redefine this" |
|
2548 |
||
2549 |
"backward compatibilty with old projects" |
|
2550 |
||
2551 |
^ self additionalLinkLibraries_nt_dot_mak |
|
2552 |
||
2553 |
||
2554 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
|
2555 |
! |
|
2556 |
||
9733 | 2557 |
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
|
2558 |
"allows for additional static libraries to be added to the make.proto file." |
9733 | 2559 |
|
2560 |
^ '' |
|
2561 |
||
2562 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
|
2563 |
! |
|
2564 |
||
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2565 |
additionalLinkLibraries_nt_dot_mak |
10306 | 2566 |
"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
|
2567 |
|
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2568 |
^ '' |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2569 |
|
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2570 |
"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
|
2571 |
! |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2572 |
|
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2573 |
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
|
2574 |
"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
|
2575 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2576 |
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
|
2577 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2578 |
| 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
|
2579 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2580 |
cls := self. |
20503 | 2581 |
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
|
2582 |
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
|
2583 |
[ cls ~~ Object ] whileTrue:[ |
23124 | 2584 |
cls class selectorsAndMethodsDo:[:selector :method | |
2585 |
method annotationsAt: #file:target: orAt:#file:target:extends: do: [ :annotation | |
|
2586 |
(processed includes: selector) ifFalse:[ |
|
2587 |
| file target extends contents | |
|
2588 |
||
2589 |
processed add: selector. |
|
2590 |
file := annotation argumentAt: 1. |
|
2591 |
target := annotation argumentAt: 2. |
|
2592 |
annotation key == #file:target:extends: ifTrue:[ |
|
2593 |
extends := annotation argumentAt: 3. |
|
2594 |
]. |
|
2595 |
(#('Make.proto' 'bc.mak' ) includes: file) ifFalse:[ |
|
2596 |
self error:'Only Make.proto or bc.mak can have extension rules!!' |
|
2597 |
]. |
|
2598 |
extends notNil ifTrue:[ |
|
2599 |
file = 'Make.proto' ifTrue:[ |
|
2600 |
(#('all' 'clean' ) includes: extends) ifFalse:[ |
|
2601 |
self error: ('Rule %1 cannot be extended. Check documentation to see which rules can be extended' bindWith: extends). |
|
2602 |
]. |
|
2603 |
]. |
|
2604 |
file = 'bc.mak' ifTrue:[ |
|
2605 |
(#('ALL' 'clean') includes: extends) ifFalse:[ |
|
2606 |
self error: ('Rule %1 cannot be extended. Check documentation to see which rules can be extended' bindWith: extends). |
|
2607 |
]. |
|
2608 |
]. |
|
2609 |
]. |
|
2610 |
||
2611 |
(fileToGenerateFor = file and:[(contents := self perform: selector) notNil]) ifTrue:[ |
|
2612 |
rules nextPutAll: contents. |
|
2613 |
rules cr. |
|
2614 |
extends notNil ifTrue:[ |
|
2615 |
rules nextPutAll: extends; nextPutAll:'::'; space; nextPutLine: target; cr. |
|
2616 |
]. |
|
2617 |
]. |
|
2618 |
]. |
|
2619 |
] |
|
2620 |
]. |
|
2621 |
cls := cls superclass. |
|
2622 |
]. |
|
2623 |
fileToGenerateFor = 'Make.proto' ifTrue:[ |
|
2624 |
rules nextPutAll: self additionalRules_make_dot_proto. |
|
2625 |
] ifFalse:[ |
|
2626 |
fileToGenerateFor = 'bc.mak' ifTrue:[ |
|
2627 |
rules nextPutAll: self additionalRules_bc_dot_mak |
|
2628 |
] |
|
17366
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2629 |
]. |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2630 |
^ 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
|
2631 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2632 |
" |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2633 |
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
|
2634 |
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
|
2635 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2636 |
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
|
2637 |
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
|
2638 |
" |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2639 |
|
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2640 |
"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
|
2641 |
"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
|
2642 |
! |
ef60968bb4e7
Added annotation-based support to add extra rules to generated makefiles.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17344
diff
changeset
|
2643 |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2644 |
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
|
2645 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2646 |
(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
|
2647 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2648 |
^' |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2649 |
# **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
|
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 |
# 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
|
2652 |
# 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
|
2653 |
# 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
|
2654 |
!!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
|
2655 |
$(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
|
2656 |
!!ENDIF |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2657 |
' 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
|
2658 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2659 |
" |
23124 | 2660 |
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
|
2661 |
" |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2662 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2663 |
"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
|
2664 |
"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
|
2665 |
! |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2666 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2667 |
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
|
2668 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2669 |
(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
|
2670 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2671 |
^' |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2672 |
# 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
|
2673 |
# 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
|
2674 |
# definition class always contains correct binary revision string. |
23310 | 2675 |
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
|
2676 |
ifneq (**NOHG**, $(shell hg root 2> /dev/null || echo -n ''**NOHG**'')) |
23310 | 2677 |
%1.$(O): $(shell hg root)/.hg/dirstate |
2678 |
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
|
2679 |
endif |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2680 |
' 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
|
2681 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2682 |
" |
23310 | 2683 |
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
|
2684 |
" |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2685 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2686 |
"Created: / 28-11-2012 / 10:12:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23310 | 2687 |
"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
|
2688 |
! |
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 |
additionalRulesSvn_make_dot_proto |
2691 |
||
2692 |
(self class includesSelector: #svnRevisionNr) ifFalse:[^'']. |
|
2693 |
||
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2694 |
^' |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2695 |
# 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
|
2696 |
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
|
2697 |
.svnversion: *.st |
23124 | 2698 |
if [ -d .svn ]; then \ |
2699 |
rev=$(shell svnversion -n); \ |
|
2700 |
echo -n $$rev > .svnversion; \ |
|
2701 |
else \ |
|
2702 |
echo -n exported > .svnversion; \ |
|
2703 |
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
|
2704 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2705 |
%1.o: %1.st .svnversion |
23124 | 2706 |
@if [ -d .svn ]; then \ |
2707 |
rev2="$(shell printf "%-16s" $$(cat .svnversion))"; \ |
|
2708 |
echo " [SV] Expanding svnRevisionNo in $1.st"; \ |
|
2709 |
sed -e "s/\"\$$SVN\-Revision:\".*\"\$$\"/\"\$$SVN-Revision:\"\''$$rev2\''\"\$$\"/g" $< > .%1.svn.st; \ |
|
2710 |
fi |
|
2711 |
$(MAKE) CC="$(CLASSLIB_CC)" OPT="$(OPT)" SEPINITCODE="$(SEPINITCODE)" STC="$(STC)" STFILE=.%1.svn $(C_RULE); |
|
2712 |
sed -i -e "s/\".%1.svn.st\");/\"\%1.st\");/g" .%1.svn.c |
|
2713 |
$(MAKE) .%1.svn.$(O) |
|
2714 |
@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
|
2715 |
endif |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2716 |
' 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
|
2717 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2718 |
" |
23124 | 2719 |
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
|
2720 |
" |
12028 | 2721 |
|
2722 |
"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
|
2723 |
"Modified: / 28-11-2012 / 10:12:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12028 | 2724 |
! |
2725 |
||
10306 | 2726 |
additionalRules_bc_dot_mak |
10312
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2727 |
"obsolete - kept for compatibility with old project files" |
13419 | 2728 |
|
10312
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2729 |
^ '' |
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2730 |
|
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2731 |
"Created: / 22-08-2006 / 23:59:24 / cg" |
10306 | 2732 |
! |
2733 |
||
9625 | 2734 |
additionalRules_make_dot_proto |
2735 |
"allows for additional rules to be added to the make.proto file." |
|
2736 |
||
2737 |
^ '' |
|
2738 |
||
2739 |
"Created: / 22-08-2006 / 23:59:16 / cg" |
|
2740 |
! |
|
2741 |
||
9972
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2742 |
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
|
2743 |
"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
|
2744 |
|
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2745 |
^ '' |
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2746 |
! |
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2747 |
|
12028 | 2748 |
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
|
2749 |
"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
|
2750 |
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
|
2751 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2752 |
"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
|
2753 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
2754 |
^'' |
12028 | 2755 |
|
2756 |
"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
|
2757 |
"Modified (comment): / 06-02-2012 / 15:34:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12028 | 2758 |
! |
2759 |
||
10306 | 2760 |
additionalTargets_bc_dot_mak |
23517 | 2761 |
"can list additional bc.mak targets (additional windows support files)" |
13419 | 2762 |
|
10312
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2763 |
^ '' |
10306 | 2764 |
|
2765 |
"Created: / 23-08-2006 / 00:00:35 / cg" |
|
23517 | 2766 |
"Modified (comment): / 07-11-2018 / 19:19:51 / Claus Gittinger" |
10306 | 2767 |
! |
2768 |
||
9625 | 2769 |
additionalTargets_make_dot_proto |
23517 | 2770 |
"can list additional Make.proto targets (additional unix support files)" |
9625 | 2771 |
|
2772 |
^ '' |
|
2773 |
||
2774 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
|
23517 | 2775 |
"Modified (comment): / 07-11-2018 / 19:20:02 / Claus Gittinger" |
9625 | 2776 |
! |
2777 |
||
18428 | 2778 |
additional_post_nsis_rules |
2779 |
"this will be performed after the nsis did build the program installer" |
|
2780 |
^ '' |
|
2781 |
||
2782 |
"Created: / 02-06-2015 / 17:41:37 / gg" |
|
2783 |
! |
|
2784 |
||
19592 | 2785 |
additional_post_nsis_rules64 |
2786 |
"this will be performed after the nsis did build the program installer for 64bit build" |
|
2787 |
^ '' |
|
2788 |
||
2789 |
"Created: / 02-06-2015 / 17:41:37 / gg" |
|
2790 |
! |
|
2791 |
||
10979 | 2792 |
globalDefines |
2793 |
"allow for the specification of additional defines for stc compilation of prerequisite packages |
|
2794 |
an subprojects" |
|
2795 |
||
2796 |
^ '' |
|
2797 |
! |
|
2798 |
||
2799 |
globalDefines_unix |
|
2800 |
"allow for the specification of additional defines for stc compilation of prerequisite packages |
|
2801 |
an subprojects" |
|
2802 |
||
2803 |
^ self globalDefines |
|
2804 |
! |
|
2805 |
||
2806 |
globalDefines_win32 |
|
2807 |
"allow for the specification of additional defines for stc compilation of prerequisite packages |
|
2808 |
an subprojects" |
|
2809 |
||
2810 |
^ self globalDefines |
|
2811 |
! |
|
2812 |
||
10331 | 2813 |
localDefines |
10979 | 2814 |
"allow for the specification of additional defines for stc compilation" |
10331 | 2815 |
|
2816 |
^ '' |
|
2817 |
! |
|
2818 |
||
2819 |
localDefines_unix |
|
10979 | 2820 |
"allow for the specification of additional defines for stc compilation" |
10331 | 2821 |
|
2822 |
^ self localDefines |
|
2823 |
! |
|
2824 |
||
2825 |
localDefines_win32 |
|
10979 | 2826 |
"allow for the specification of additional defines for stc compilation" |
10331 | 2827 |
|
2828 |
^ self localDefines |
|
2829 |
! |
|
2830 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2831 |
localIncludes |
10979 | 2832 |
"allow for the specification of additional include directories" |
9714 | 2833 |
|
2834 |
^ '' |
|
2835 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2836 |
"Created: / 06-09-2006 / 18:14:31 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2837 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2838 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2839 |
localIncludes_unix |
10979 | 2840 |
"allow for the specification of additional include directories" |
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2841 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2842 |
^ self makeUnixIncludes:(self localIncludes) |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2843 |
|
9714 | 2844 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2845 |
"Modified: / 06-09-2006 / 18:15:26 / cg" |
9714 | 2846 |
! |
2847 |
||
2848 |
localIncludes_win32 |
|
10979 | 2849 |
"allow for the specification of additional include directories" |
9714 | 2850 |
|
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2851 |
^ self makeWin32Includes:(self localIncludes) |
9714 | 2852 |
|
2853 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
|
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2854 |
"Modified: / 06-09-2006 / 18:15:37 / cg" |
9714 | 2855 |
! |
2856 |
||
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
|
2857 |
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
|
2858 |
"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
|
2859 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2860 |
^ '' |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2861 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2862 |
"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
|
2863 |
! |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2864 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2865 |
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
|
2866 |
"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
|
2867 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2868 |
^ 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
|
2869 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2870 |
"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
|
2871 |
! |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2872 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2873 |
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
|
2874 |
"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
|
2875 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2876 |
^ 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
|
2877 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2878 |
"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
|
2879 |
! |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2880 |
|
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2881 |
singleHeaderRuleTemplate_bc_dot_mak |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2882 |
"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
|
2883 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2884 |
^ ' |
13688
4f43dc4a3182
added: #additionalHeaderRulesUsingTemplate:pathConverter:
Claus Gittinger <cg@exept.de>
parents:
13687
diff
changeset
|
2885 |
%1\%2.$(H): |
17253 | 2886 |
',Character tab,'pushd %1 \ |
2887 |
',Character tab,'& $(STC) $(FFLAGS) $(STCFLAGS) $(STC_MSGFORMAT) $(DBGFLAGS) $(DEFS) -C -headerOnly %2.st \ |
|
2888 |
',Character tab,'& popd |
|
13687
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2889 |
' |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2890 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2891 |
"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
|
2892 |
! |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2893 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2894 |
singleHeaderRuleTemplate_make_dot_proto |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2895 |
"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
|
2896 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2897 |
^ ' |
13688
4f43dc4a3182
added: #additionalHeaderRulesUsingTemplate:pathConverter:
Claus Gittinger <cg@exept.de>
parents:
13687
diff
changeset
|
2898 |
%1/%2.$(H): |
17253 | 2899 |
',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
|
2900 |
' |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2901 |
|
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2902 |
"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
|
2903 |
! |
1577ea868878
generate rules for header files of extended classes
Claus Gittinger <cg@exept.de>
parents:
13650
diff
changeset
|
2904 |
|
9575 | 2905 |
stcOptimizationOptions |
2906 |
"see the stc reference / stc usage for options. |
|
17070 | 2907 |
Can be redefined in concrete packages. |
9575 | 2908 |
For now, the following variants are useful: |
23124 | 2909 |
+optspace3 most compact code |
2910 |
- use for all gui, application code. |
|
2911 |
||
2912 |
+optinline +optinline2 +inlineNew |
|
2913 |
fastest code |
|
2914 |
- use only for computation-intensive classes" |
|
9575 | 2915 |
|
2916 |
^ '+optspace3' |
|
2917 |
||
2918 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
|
9536 | 2919 |
! |
2920 |
||
9575 | 2921 |
stcWarningOptions |
2922 |
"see the stc reference / stc usage for options. |
|
17070 | 2923 |
Can be redefined in concrete packages. |
9575 | 2924 |
For now, the following variants are useful: |
23124 | 2925 |
-warn no warnings |
2926 |
-warnNonStandard no warnings about non-standard smalltalk features |
|
2927 |
-warnUnused no warnings about unused variables" |
|
9575 | 2928 |
|
9714 | 2929 |
^ '-warnNonStandard' |
9575 | 2930 |
|
2931 |
"Created: / 18-08-2006 / 12:51:38 / cg" |
|
2932 |
! ! |
|
9536 | 2933 |
|
22688 | 2934 |
!ProjectDefinition class methodsFor:'description - contents'! |
2935 |
||
2936 |
additionalClassNamesAndAttributes |
|
2937 |
"a List of classes, that belong to the project, but may not be included |
|
2938 |
in the image (someone may have removed it by purpose)" |
|
2939 |
||
2940 |
^ #() |
|
2941 |
||
2942 |
"Created: / 21-08-2006 / 19:53:04 / cg" |
|
2943 |
! |
|
2944 |
||
2945 |
classNamesAndAttributes |
|
2946 |
"a correponding method with real names must be present in my concrete subclasses" |
|
2947 |
||
2948 |
"/ should this be a subclassResponsibility here ? |
|
2949 |
^ #() |
|
2950 |
||
2951 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
2952 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
2953 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
|
2954 |
! |
|
2955 |
||
2956 |
extensionMethodNames |
|
2957 |
"lists the extension methods which are to be included in the project. |
|
2958 |
Entries are 2-element array literals, consisting of class-name and selector. |
|
2959 |
A correponding method with real names must be present in my concrete subclasses |
|
2960 |
if it has extensions." |
|
2961 |
||
2962 |
"/ should this be a subclassResponsibility here ? |
|
2963 |
^ #() |
|
2964 |
||
2965 |
"Modified: / 17-08-2006 / 20:49:51 / cg" |
|
2966 |
! |
|
2967 |
||
2968 |
ignoredClassNames |
|
2969 |
"can be redefined to suppress some classes from being included in a |
|
2970 |
generated classNamesAndAttributes spec" |
|
2971 |
||
2972 |
^ #() |
|
2973 |
||
2974 |
"Created: / 23-01-2007 / 19:08:27 / cg" |
|
2975 |
! ! |
|
22657 | 2976 |
|
9575 | 2977 |
!ProjectDefinition class methodsFor:'description - project information'! |
2978 |
||
11611
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2979 |
applicationAdditionalIconFileNames |
13419 | 2980 |
"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
|
2981 |
(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
|
2982 |
|
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2983 |
^ #() |
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2984 |
! |
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2985 |
|
20567 | 2986 |
applicationDocumentTypeDescriptions |
2987 |
"Return the OSX document type descriptions. |
|
2988 |
For deployment, some systems can make use of additional information |
|
2989 |
on which documents are handled by the application. |
|
2990 |
This is used eg. for double-clicking on a document in OSX. |
|
2991 |
If the deployed app can/should handle this, redefine this |
|
21562 | 2992 |
to return a collection of instances of ApplicationDocumentTypeDescription." |
20567 | 2993 |
|
2994 |
||
2995 |
^ nil |
|
21562 | 2996 |
|
2997 |
"Modified (comment): / 24-02-2017 / 09:36:42 / cg" |
|
20567 | 2998 |
! |
2999 |
||
11039
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
3000 |
applicationIconFileName |
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
3001 |
"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
|
3002 |
|
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
3003 |
^ nil |
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
3004 |
! |
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
3005 |
|
20567 | 3006 |
applicationIconFileNameLinux |
3007 |
"Return the icon-filename for the application (nil if there is none)" |
|
3008 |
||
3009 |
^ nil |
|
3010 |
! |
|
3011 |
||
3012 |
applicationIconFileNameOSX |
|
3013 |
"Return the OSX icon-filename for the application (nil if there is none). |
|
3014 |
This must be the name of a .icns file, which contains the app-icon in |
|
3015 |
multiple resolutions." |
|
3016 |
||
3017 |
^ nil |
|
3018 |
! |
|
3019 |
||
3020 |
applicationIconFileNameWindows |
|
3021 |
"Return the icon-filename for the application (nil if there is none). |
|
3022 |
This must be the name of a .ico file, which contains the app-icon in |
|
3023 |
single or multiple resolutions." |
|
3024 |
||
3025 |
"/ for backward compatibility |
|
3026 |
^ self applicationIconFileName |
|
3027 |
! |
|
3028 |
||
21571 | 3029 |
applicationReadMeFileNameOSX |
3030 |
"Return the OSX filename for a readme file. |
|
3031 |
If nil, nothing is installed; |
|
3032 |
if non-nil, it is copied into the dmg folder." |
|
3033 |
||
3034 |
^ nil |
|
3035 |
||
3036 |
"Created: / 24-02-2017 / 14:21:57 / cg" |
|
3037 |
! |
|
3038 |
||
9575 | 3039 |
companyName |
9584 | 3040 |
"Returns a company string which will appear in <lib>.rc. |
20564 | 3041 |
Under win32, this is placed into the dll's file-info. |
3042 |
Other systems may put it elsewhere, or ignore it." |
|
9575 | 3043 |
|
20601 | 3044 |
|m| |
23124 | 3045 |
|
20601 | 3046 |
m := self module. |
3047 |
(m = 'stx') ifTrue:[ |
|
23124 | 3048 |
^ 'Claus Gittinger & eXept Software AG' |
20601 | 3049 |
]. |
3050 |
(m = 'exept') ifTrue:[ |
|
23124 | 3051 |
^ 'eXept Software AG' |
20601 | 3052 |
]. |
9575 | 3053 |
^ 'My Company' |
3054 |
||
9584 | 3055 |
"Modified: / 18-08-2006 / 16:08:20 / cg" |
9536 | 3056 |
! |
3057 |
||
3058 |
description |
|
10306 | 3059 |
"Returns a description string which will appear in vc.def / bc.def" |
9536 | 3060 |
|
9803 | 3061 |
^self productName,' ',self packageName |
3062 |
"/ ^ self name |
|
9536 | 3063 |
|
3064 |
"Created: / 08-08-2006 / 11:15:01 / fm" |
|
9575 | 3065 |
"Modified: / 17-08-2006 / 20:53:34 / cg" |
3066 |
! |
|
3067 |
||
3068 |
fileDescription |
|
10416 | 3069 |
"Returns a description string which will appear in libName.rc and the rc-file" |
9575 | 3070 |
|
9803 | 3071 |
^self description |
9575 | 3072 |
|
3073 |
"Modified: / 17-08-2006 / 20:27:07 / cg" |
|
3074 |
! |
|
3075 |
||
3076 |
fileMajorVersionNr |
|
3077 |
"Returns a versionNumber which will appear in libName.rc" |
|
3078 |
||
11100
c9ec12ef4b3b
Set default for fileMajorVersionNumber and fileMajorVersionNumber
Stefan Vogel <sv@exept.de>
parents:
11074
diff
changeset
|
3079 |
^ self majorVersionNr |
9575 | 3080 |
|
3081 |
"Created: / 18-08-2006 / 12:03:32 / cg" |
|
9817 | 3082 |
"Modified: / 30-08-2006 / 18:50:51 / cg" |
9575 | 3083 |
! |
3084 |
||
3085 |
fileMinorVersionNr |
|
3086 |
"Returns a versionNumber which will appear in libName.rc" |
|
3087 |
||
11100
c9ec12ef4b3b
Set default for fileMajorVersionNumber and fileMajorVersionNumber
Stefan Vogel <sv@exept.de>
parents:
11074
diff
changeset
|
3088 |
^ self minorVersionNr |
9575 | 3089 |
|
3090 |
"Created: / 18-08-2006 / 12:03:13 / cg" |
|
9817 | 3091 |
"Modified: / 30-08-2006 / 18:50:46 / cg" |
9575 | 3092 |
! |
3093 |
||
3094 |
fileReleaseNr |
|
3095 |
"Returns a releaseNumber which will appear in libName.rc" |
|
3096 |
||
11035
ff88ec6339a3
Generate valid project.rc files even if the CVS revision string ends with
Stefan Vogel <sv@exept.de>
parents:
10979
diff
changeset
|
3097 |
"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
|
3098 |
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
|
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 |
"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
|
3101 |
|
11035
ff88ec6339a3
Generate valid project.rc files even if the CVS revision string ends with
Stefan Vogel <sv@exept.de>
parents:
10979
diff
changeset
|
3102 |
^ self cvsRevision last upTo:$m |
9575 | 3103 |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3104 |
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
|
3105 |
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
|
3106 |
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
|
3107 |
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
|
3108 |
|
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 | |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3110 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3111 |
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
|
3112 |
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
|
3113 |
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
|
3114 |
^nr |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3115 |
|
9575 | 3116 |
"Created: / 18-08-2006 / 12:02:58 / cg" |
9817 | 3117 |
"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
|
3118 |
"Modified: / 23-11-2012 / 11:24:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9536 | 3119 |
! |
3120 |
||
9575 | 3121 |
fileRevisionNr |
3122 |
"Returns a revisionNumber which will appear in libName.rc" |
|
9536 | 3123 |
|
9817 | 3124 |
"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
|
3125 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3126 |
"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
|
3127 |
|
9618 | 3128 |
^ self cvsRevision first |
9575 | 3129 |
|
14859
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3130 |
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
|
3131 |
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
|
3132 |
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
|
3133 |
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
|
3134 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3135 |
| nr | |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3136 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3137 |
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
|
3138 |
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
|
3139 |
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
|
3140 |
^nr |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3141 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3142 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3143 |
" |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3144 |
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
|
3145 |
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
|
3146 |
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
|
3147 |
" |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
3148 |
|
9575 | 3149 |
"Created: / 18-08-2006 / 12:02:39 / cg" |
9817 | 3150 |
"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
|
3151 |
"Modified: / 23-11-2012 / 11:24:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9536 | 3152 |
! |
3153 |
||
9575 | 3154 |
fileVersion |
3155 |
"Returns a fileVersion string which will appear in libName.rc" |
|
3156 |
||
3157 |
"<major>.<minor>.<rev>.<rel> (such as '1.2.17.1') " |
|
3158 |
||
13419 | 3159 |
^ '%1.%2.%3.%4' |
23124 | 3160 |
bindWith:self fileMajorVersionNr |
3161 |
with:self fileMinorVersionNr |
|
3162 |
with:self fileRevisionNr |
|
3163 |
with:self fileReleaseNr. |
|
9575 | 3164 |
|
3165 |
" |
|
3166 |
self fileVersion |
|
3167 |
" |
|
3168 |
||
9817 | 3169 |
"Modified: / 30-08-2006 / 18:51:49 / cg" |
9575 | 3170 |
! |
9536 | 3171 |
|
9575 | 3172 |
fileVersionCommaSeparated |
3173 |
"Returns a fileVersion string which will appear in libName.rc" |
|
3174 |
||
9817 | 3175 |
"<major>,<minor>,<revision>,<release> (such as '2,17,1,2') " |
3176 |
||
13419 | 3177 |
^ '%1,%2,%3,%4' |
23124 | 3178 |
bindWith:self fileMajorVersionNr |
3179 |
with:self fileMinorVersionNr |
|
3180 |
with:self fileRevisionNr |
|
3181 |
with:self fileReleaseNr. |
|
9575 | 3182 |
|
3183 |
"Created: / 17-08-2006 / 20:16:17 / cg" |
|
9817 | 3184 |
"Modified: / 30-08-2006 / 18:54:20 / cg" |
3185 |
! |
|
3186 |
||
9575 | 3187 |
internalName |
3188 |
"Returns a name string which will appear in libName.rc" |
|
3189 |
||
11041
3bb26d86e616
Fix #description and #internalName
Stefan Vogel <sv@exept.de>
parents:
11039
diff
changeset
|
3190 |
^ self package |
9575 | 3191 |
|
3192 |
"Modified: / 17-08-2006 / 20:27:37 / cg" |
|
9536 | 3193 |
! |
3194 |
||
9575 | 3195 |
legalCopyright |
9584 | 3196 |
"Returns a copyright string which will appear in <lib>.rc. |
20564 | 3197 |
Under win32, this is placed into the dll's file-info. |
3198 |
Other systems may put it elsewhere, or ignore it." |
|
9575 | 3199 |
|
20985 | 3200 |
|m thisYear template| |
23124 | 3201 |
|
20985 | 3202 |
m := self module. |
3203 |
thisYear := Date today year. |
|
3204 |
||
20601 | 3205 |
m = 'stx' ifTrue:[ |
23124 | 3206 |
"hardwired-default" |
3207 |
template := 'Copyright Claus Gittinger %1\nCopyright eXept Software AG %1' |
|
20985 | 3208 |
] ifFalse:[ |
23124 | 3209 |
m = 'exept' ifTrue:[ |
3210 |
"hardwired-default" |
|
3211 |
template := 'Copyright eXept Software AG %1' |
|
3212 |
] ifFalse:[ |
|
3213 |
template := 'My CopyRight or CopyLeft %1' |
|
3214 |
]. |
|
20985 | 3215 |
]. |
3216 |
^ template bindWith:thisYear |
|
3217 |
||
3218 |
" |
|
3219 |
self legalCopyright |
|
3220 |
" |
|
3221 |
||
3222 |
"Modified (comment): / 18-11-2016 / 12:23:36 / cg" |
|
9575 | 3223 |
! |
3224 |
||
3225 |
majorVersionNr |
|
3226 |
"Returns a versionNumber which will appear in libName.rc" |
|
3227 |
||
3228 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
|
3229 |
the default here takes smalltalks version number. |
|
20424 | 3230 |
But that's probably not good for an end-user-app." |
9575 | 3231 |
|
11042 | 3232 |
^ Smalltalk majorVersionNr |
9575 | 3233 |
|
3234 |
"Created: / 17-08-2006 / 20:20:18 / cg" |
|
9817 | 3235 |
"Modified: / 30-08-2006 / 18:52:13 / cg" |
9575 | 3236 |
! |
3237 |
||
3238 |
minorVersionNr |
|
3239 |
"Returns a versionNumber which will appear in libName.rc" |
|
9536 | 3240 |
|
9575 | 3241 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
3242 |
the default here takes smalltalks version number. |
|
20424 | 3243 |
But that's probably not good for an end-user-app." |
9575 | 3244 |
|
11042 | 3245 |
^ Smalltalk minorVersionNr |
9575 | 3246 |
|
3247 |
"Created: / 17-08-2006 / 20:20:32 / cg" |
|
9817 | 3248 |
"Modified: / 30-08-2006 / 18:52:16 / cg" |
9575 | 3249 |
! |
3250 |
||
3251 |
productDate |
|
11043 | 3252 |
"Returns a product-date string which will appear in libName.rc and the installer file" |
9575 | 3253 |
|
3254 |
"take the current date - by default" |
|
9536 | 3255 |
|
9575 | 3256 |
^ Timestamp now printStringRFC1123Format |
3257 |
||
3258 |
"Created: / 17-08-2006 / 20:17:28 / cg" |
|
3259 |
! |
|
3260 |
||
13177 | 3261 |
productDescription |
3262 |
"Returns a description (for autopackage)" |
|
3263 |
||
3264 |
^ self description |
|
3265 |
||
3266 |
"Created: / 21-12-2010 / 09:32:16 / cg" |
|
3267 |
! |
|
3268 |
||
10426 | 3269 |
productFilename |
20546 | 3270 |
"Returns a filename which will be used as linkname, product file name etc. |
3271 |
The final deployable will be named like this (<fn>.dmg / <fn>Setup.ex / <fn>Install.pkg etc.)" |
|
10426 | 3272 |
|
3273 |
^ self productNameAsValidFilename |
|
3274 |
||
3275 |
" |
|
13419 | 3276 |
stx_projects_smalltalk productName |
10426 | 3277 |
stx_projects_smalltalk productFilename |
20546 | 3278 |
stx_libbasic productFilename |
3279 |
stx_doc_coding_demoConsoleApp productFilename |
|
10426 | 3280 |
" |
3281 |
||
3282 |
"Created: / 01-03-2007 / 19:33:06 / cg" |
|
3283 |
! |
|
3284 |
||
9898 | 3285 |
productInstallDir |
13873 | 3286 |
"Returns a default installDir which will appear in <app>.nsi." |
3287 |
||
3288 |
^ '$PROGRAMFILES\',(self productInstallDirBaseName). |
|
3289 |
||
3290 |
" |
|
3291 |
stx_projects_smalltalk productInstallDir |
|
3292 |
stx_clients_Clock_QlockTwoWatchApplication productInstallDir |
|
3293 |
" |
|
9898 | 3294 |
|
3295 |
"Created: / 14-09-2006 / 21:23:01 / cg" |
|
3296 |
! |
|
3297 |
||
13873 | 3298 |
productInstallDirBaseName |
3299 |
"Returns a default installDir which will appear in <app>.nsi. |
|
3300 |
This is usually not the one you want to keep" |
|
3301 |
||
3302 |
^ self module |
|
3303 |
||
3304 |
"Created: / 21-12-2011 / 16:31:38 / cg" |
|
3305 |
! |
|
3306 |
||
13177 | 3307 |
productLicense |
3308 |
"Returns the license (for autopackage)" |
|
3309 |
||
3310 |
^ 'Commercial' |
|
3311 |
||
3312 |
"Created: / 21-12-2010 / 09:31:25 / cg" |
|
3313 |
! |
|
3314 |
||
3315 |
productMaintainer |
|
3316 |
"Returns the maintainer (for autopackage)" |
|
3317 |
||
3318 |
^ self companyName |
|
3319 |
||
3320 |
"Created: / 21-12-2010 / 09:26:16 / cg" |
|
3321 |
! |
|
3322 |
||
9575 | 3323 |
productName |
9584 | 3324 |
"Returns a product name which will appear in <lib>.rc. |
20564 | 3325 |
Under win32, this is placed into the dll's file-info. |
15216 | 3326 |
This method is usually redefined in a concrete application definition" |
3327 |
||
21683 | 3328 |
|m| |
10785
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
3329 |
|
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
3330 |
m := self module. |
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
3331 |
m = 'stx' ifTrue:[ |
23124 | 3332 |
^ 'Smalltalk/X' |
9575 | 3333 |
]. |
10785
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
3334 |
m = 'exept' ifTrue:[ |
23124 | 3335 |
^ 'eXept AddOns' |
10785
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
3336 |
]. |
21683 | 3337 |
^ nil. |
10296 | 3338 |
|
20982 | 3339 |
"Modified: / 18-11-2016 / 11:44:03 / cg" |
21683 | 3340 |
"Modified: / 03-04-2017 / 19:09:22 / stefan" |
9536 | 3341 |
! |
3342 |
||
10426 | 3343 |
productNameAsValidFilename |
20546 | 3344 |
"Returns a filename generated from the product name. |
3345 |
This will be the name of the deployable package (i.e. <fn>.dmg, <fn>Setup.exe, etc.)" |
|
10426 | 3346 |
|
3347 |
|nm| |
|
3348 |
||
3349 |
nm := self productName. |
|
20546 | 3350 |
^ nm copy replaceAny:'/\:;., ' with:$_ |
10426 | 3351 |
|
3352 |
" |
|
3353 |
'Smalltalk/X' replaceAny:'/\:;.,' with:nil |
|
20546 | 3354 |
stx_doc_coding_demoConsoleApp productName |
3355 |
stx_doc_coding_demoConsoleApp productNameAsValidFilename |
|
10426 | 3356 |
" |
3357 |
||
3358 |
"Created: / 01-03-2007 / 19:19:21 / cg" |
|
3359 |
! |
|
3360 |
||
9898 | 3361 |
productPublisher |
3362 |
"Returns a product publisher which will appear in <app>.nsi." |
|
3363 |
||
3364 |
( #('exept' 'stx') includes:self module) ifTrue:[ |
|
23124 | 3365 |
^ 'eXept Software AG' |
9898 | 3366 |
]. |
3367 |
||
11789
8d56dc5fa8a8
Default productPublisher is companyName
Stefan Vogel <sv@exept.de>
parents:
11777
diff
changeset
|
3368 |
^ self companyName |
9898 | 3369 |
|
3370 |
"Created: / 14-09-2006 / 21:12:54 / cg" |
|
3371 |
! |
|
3372 |
||
13177 | 3373 |
productType |
3374 |
"Returns the product type for autopackage" |
|
3375 |
||
3376 |
^ 'Application' |
|
3377 |
||
3378 |
"Created: / 21-12-2010 / 09:28:48 / cg" |
|
3379 |
! |
|
3380 |
||
9575 | 3381 |
productVersion |
11043 | 3382 |
"Returns a product version which will appear in libName.rc and the installer file" |
9575 | 3383 |
|
3384 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1')" |
|
9536 | 3385 |
|
13419 | 3386 |
^ '%1.%2.%3.%4' |
23124 | 3387 |
bindWith:self majorVersionNr |
3388 |
with:self minorVersionNr |
|
3389 |
with:self revisionNr |
|
3390 |
with:self releaseNr. |
|
9536 | 3391 |
|
9575 | 3392 |
" |
3393 |
self productVersion |
|
3394 |
" |
|
3395 |
||
9817 | 3396 |
"Modified: / 30-08-2006 / 18:52:47 / cg" |
9536 | 3397 |
! |
3398 |
||
9575 | 3399 |
productVersionCommaSeparated |
3400 |
"Returns a product version which will appear in libName.rc" |
|
3401 |
||
3402 |
"<major>.<minor>.<revision>.<release> (such as '0,1,1,1') " |
|
9536 | 3403 |
|
13419 | 3404 |
^ '%1,%2,%3,%4' |
23124 | 3405 |
bindWith:self majorVersionNr |
3406 |
with:self minorVersionNr |
|
3407 |
with:self revisionNr |
|
3408 |
with:self releaseNr. |
|
11042 | 3409 |
|
3410 |
" |
|
3411 |
self productVersionCommaSeparated |
|
3412 |
" |
|
9536 | 3413 |
|
9575 | 3414 |
"Created: / 17-08-2006 / 20:13:32 / cg" |
9817 | 3415 |
"Modified: / 30-08-2006 / 18:52:42 / cg" |
9536 | 3416 |
! |
3417 |
||
9898 | 3418 |
productWebSite |
3419 |
"Returns a product webSite which will appear in <app>.nsi." |
|
3420 |
||
3421 |
( #('exept' 'stx') includes:self module) ifTrue:[ |
|
23124 | 3422 |
^ 'http://www.exept.de' |
9898 | 3423 |
]. |
3424 |
||
10426 | 3425 |
"/ should be redefined by concrete ApplicationDefinition |
9898 | 3426 |
^ 'http://www.yoursite.com' |
3427 |
||
3428 |
"Created: / 14-09-2006 / 21:15:05 / cg" |
|
10426 | 3429 |
"Modified: / 01-03-2007 / 18:11:27 / cg" |
9898 | 3430 |
! |
3431 |
||
9575 | 3432 |
releaseNr |
3433 |
"Returns a releaseNr which will appear in libName.rc" |
|
3434 |
||
3435 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
|
3436 |
the default here takes smalltalks version number. |
|
20424 | 3437 |
But that's probably not good for an end-user-app." |
9575 | 3438 |
|
11042 | 3439 |
^ Smalltalk releaseNr |
9536 | 3440 |
|
9575 | 3441 |
"Created: / 17-08-2006 / 20:20:51 / cg" |
9817 | 3442 |
"Modified: / 30-08-2006 / 18:52:22 / cg" |
9575 | 3443 |
! |
3444 |
||
3445 |
revisionNr |
|
3446 |
"Returns a revisionNr which will appear in libName.rc" |
|
9536 | 3447 |
|
9575 | 3448 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
3449 |
the default here takes smalltalks version number. |
|
20424 | 3450 |
But that's probably not good for an end-user-app." |
9575 | 3451 |
|
11042 | 3452 |
^ Smalltalk revisionNr |
9575 | 3453 |
|
3454 |
"Created: / 17-08-2006 / 20:20:40 / cg" |
|
9817 | 3455 |
"Modified: / 30-08-2006 / 18:52:32 / cg" |
9536 | 3456 |
! |
3457 |
||
17236 | 3458 |
supportedLanguages |
3459 |
"Returns a list of languages that (should be / are) supported by this application or library. |
|
23124 | 3460 |
Currently this is only used by lint, to verify that the corresponding languages are |
17236 | 3461 |
present in the resource files." |
3462 |
||
19656 | 3463 |
self module = 'stx' ifTrue:[ |
23124 | 3464 |
^ #(en de) |
3465 |
]. |
|
17236 | 3466 |
^ #(en) |
19656 | 3467 |
|
3468 |
" |
|
3469 |
stx_goodies_rdoit supportedLanguages |
|
3470 |
cg_tools supportedLanguages |
|
3471 |
" |
|
17236 | 3472 |
! |
3473 |
||
9536 | 3474 |
versionNumber |
10306 | 3475 |
"Returns a version string which will appear in bc.def / vc.def " |
9536 | 3476 |
|
9575 | 3477 |
^'' |
9536 | 3478 |
|
3479 |
"Created: / 08-08-2006 / 11:35:52 / fm" |
|
9575 | 3480 |
"Modified: / 17-08-2006 / 19:46:29 / cg" |
9536 | 3481 |
! ! |
3482 |
||
16854 | 3483 |
!ProjectDefinition class methodsFor:'doc generation'! |
3484 |
||
3485 |
autoDocClassNamePatterns |
|
3486 |
"lists patterns for class names for which autodoc html-documentation files |
|
3487 |
are to be built. |
|
3488 |
Return #( '*' ) to get doc files for all classes" |
|
3489 |
||
3490 |
^ #( |
|
23124 | 3491 |
'*' |
16854 | 3492 |
) |
3493 |
! |
|
3494 |
||
3495 |
generate_autoDocFiles |
|
3496 |
"generate html documentation for all classes matching the autoDocNamePatterns. |
|
3497 |
Use this, if you don't want to deliver source code, but still need some documentation |
|
3498 |
to be deployed." |
|
3499 |
||
3500 |
self classes do:[:eachClass | |
|
23124 | 3501 |
(self autoDocClassNamePatterns contains:[:pattern | pattern match:eachClass name]) ifTrue:[ |
3502 |
self generateClassDocumentationFor:eachClass. |
|
3503 |
] |
|
16854 | 3504 |
]. |
3505 |
! ! |
|
3506 |
||
9569 | 3507 |
!ProjectDefinition class methodsFor:'file generation'! |
9536 | 3508 |
|
13177 | 3509 |
apspecFilename |
13968 | 3510 |
"/ for linux |
13177 | 3511 |
^ 'autopackage/default.apspec' |
3512 |
||
3513 |
"Created: / 21-12-2010 / 09:43:13 / cg" |
|
3514 |
! |
|
3515 |
||
9852 | 3516 |
basicFileNamesToGenerate |
22387 | 3517 |
"answer a dictionary (filename -> generator method) with all the build-support files, |
11937 | 3518 |
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
|
3519 |
|
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3520 |
| dict cls | |
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3521 |
|
13419 | 3522 |
dict := OrderedDictionary withKeysAndValues:#( |
23124 | 3523 |
'Make.spec' #'generate_make_dot_spec' |
3524 |
'Make.proto' #'generate_make_dot_proto' |
|
3525 |
"/ cg: changed to generate Makefile.init instead of Makefile, |
|
3526 |
"/ because macosx files are not case sensitive. |
|
3527 |
"/ You will have to execute make -f Makefile.init initially |
|
3528 |
"/ 'Makefile' #'generate_makefile' "/ for unix |
|
3529 |
'Makefile.init' #'generate_makefile' "/ for unix |
|
3530 |
'bc.mak' #'generate_bc_dot_mak' "/ for windows |
|
3531 |
'abbrev.stc' #'generate_abbrev_dot_stc' |
|
3532 |
'bmake.bat' #'generate_bmake_dot_mak' "/ for bcc32 |
|
3533 |
'vcmake.bat' #'generate_vcmake_dot_mak' "/ for msvc |
|
3534 |
"/ 'lccmake.bat' #'generate_lccmake_dot_mak' "/ for lcc - not supported at the moment |
|
3535 |
"/ 'tccmake.bat' #'generate_tccmake_dot_mak' "/ for tcc - cannot link at the moment |
|
3536 |
'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
|
3537 |
). |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3538 |
|
13419 | 3539 |
dict |
23124 | 3540 |
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
|
3541 |
|
22387 | 3542 |
"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
|
3543 |
cls := self. |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3544 |
[ cls ~~ Object ] whileTrue:[ |
23124 | 3545 |
cls class selectorsAndMethodsDo:[:selector :method | |
3546 |
| annotation | |
|
3547 |
||
3548 |
annotation := method annotationAt: #file:overwrite:. |
|
3549 |
annotation notNil ifTrue:[ |
|
3550 |
dict at: (annotation argumentAt: 1) put: selector |
|
3551 |
]. |
|
3552 |
]. |
|
3553 |
cls := cls superclass. |
|
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3554 |
]. |
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3555 |
|
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3556 |
^ dict. |
13154
bac0fcd8a888
make sure that the makefiles are generated before the libInit file
Claus Gittinger <cg@exept.de>
parents:
13148
diff
changeset
|
3557 |
|
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3558 |
" |
22387 | 3559 |
stx_libbasic basicFileNamesToGenerate |
3560 |
stx_libjava basicFileNamesToGenerate |
|
3561 |
" |
|
3562 |
||
17303
70d8ec3051df
Added support for custom build files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17294
diff
changeset
|
3563 |
"Modified: / 19-01-2015 / 16:33:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
22387 | 3564 |
"Modified (comment): / 04-12-2017 / 17:40:03 / cg" |
9852 | 3565 |
! |
3566 |
||
9536 | 3567 |
fileNamesToGenerate |
22387 | 3568 |
"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
|
3569 |
|
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3570 |
^ self basicFileNamesToGenerate removeAllKeys:self protectedFileNames ifAbsent:[] |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3571 |
|
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3572 |
" |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3573 |
stx_libbasic fileNamesToGenerate |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3574 |
" |
22387 | 3575 |
|
3576 |
"Modified (comment): / 04-12-2017 / 17:40:23 / cg" |
|
9536 | 3577 |
! |
3578 |
||
13419 | 3579 |
forEachFileNameAndGeneratedContentsDo:aTwoArgBlock |
14930 | 3580 |
"for build-support file generation, checkin etc., use this common method which |
22387 | 3581 |
enumerates all build-support fileNames with their generated contents to be built." |
14930 | 3582 |
|
9544 | 3583 |
|pairs| |
3584 |
||
3585 |
pairs := OrderedCollection new. |
|
23123 | 3586 |
self fileNamesToGenerate keysDo:[:fileName | |
23434 | 3587 |
|fileContents| |
3588 |
||
3589 |
fileContents := self generateFile:fileName confirmMissingClasses:false. |
|
3590 |
fileContents notNil ifTrue:[ |
|
3591 |
pairs add:(Array with:fileName with:fileContents) |
|
3592 |
]. |
|
9544 | 3593 |
]. |
3594 |
||
3595 |
pairs pairsDo:aTwoArgBlock |
|
3596 |
||
3597 |
"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
|
3598 |
"Modified: / 19-01-2015 / 16:58:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
22387 | 3599 |
"Modified (comment): / 04-12-2017 / 17:40:49 / cg" |
9544 | 3600 |
! |
3601 |
||
9536 | 3602 |
generateFile:filename |
23434 | 3603 |
^ self generateFile:filename confirmMissingClasses:true |
3604 |
! |
|
3605 |
||
3606 |
generateFile:filename confirmMissingClasses:confirmBoolean |
|
23123 | 3607 |
|action missingNames| |
3608 |
||
23434 | 3609 |
confirmBoolean ifTrue:[ |
3610 |
(#('bc.mak' 'Make.proto' 'loadAll') includes:filename) ifTrue:[ |
|
3611 |
"if there are missing classes in image, the dependencies cannot be computed. |
|
3612 |
Warn the user" |
|
3613 |
||
3614 |
missingNames := |
|
3615 |
self allClassNames "compiled_classNames" |
|
3616 |
select:[:aName | |
|
3617 |
|cls| |
|
3618 |
||
3619 |
cls := Smalltalk at:aName asSymbol. |
|
3620 |
cls isNil |
|
3621 |
]. |
|
3622 |
missingNames notEmpty ifTrue:[ |
|
3623 |
(self confirm:(self classResources |
|
3624 |
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?' |
|
3625 |
with:filename |
|
3626 |
with:(missingNames asStringWith:', '))) |
|
3627 |
ifFalse:[^ nil]. |
|
3628 |
]. |
|
3629 |
]. |
|
23123 | 3630 |
]. |
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3631 |
|
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3632 |
action := self basicFileNamesToGenerate at:filename ifAbsent:[]. |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
3633 |
action notNil ifTrue:[ |
23434 | 3634 |
^ self perform:action |
3635 |
]. |
|
3636 |
(filename = 'app.rc' |
|
3637 |
or:[filename = 'lib.rc' |
|
3638 |
or:[filename = self rcFilename]] |
|
3639 |
) ifTrue:[ |
|
3640 |
^ self generate_packageName_dot_rc |
|
9607 | 3641 |
]. |
9850 | 3642 |
(filename = 'loadAll') ifTrue:[ |
23434 | 3643 |
^ self generate_loadAll |
9850 | 3644 |
]. |
13177 | 3645 |
self error:('File "%1" not appropriate (not generated) for this type of project.' bindWith:filename) |
3646 |
||
21569 | 3647 |
"Modified: / 24-02-2017 / 11:53:18 / cg" |
9536 | 3648 |
! |
3649 |
||
13411 | 3650 |
generateFile:filename in: directory |
16257 | 3651 |
|dir| |
3652 |
||
13411 | 3653 |
dir := directory asFilename. |
3654 |
dir exists ifFalse:[self error:'Directory does not exist']. |
|
16257 | 3655 |
|
3656 |
(dir / (filename asFilename baseName)) contents:(self generateFile: filename). |
|
13411 | 3657 |
|
3658 |
" |
|
23124 | 3659 |
stx_projects_smalltalk generateFile:'package.deps.rake' in: '/tmp' |
13411 | 3660 |
" |
3661 |
||
3662 |
"Created: / 26-02-2011 / 10:42:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3663 |
"Modified: / 09-06-2011 / 14:53:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3664 |
! |
|
3665 |
||
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3666 |
generateRemoveShellScriptOn:aStream |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3667 |
"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
|
3668 |
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
|
3669 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3670 |
|firstLine| |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3671 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3672 |
firstLine := true. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3673 |
self searchForClasses do:[:eachClass| |
23124 | 3674 |
eachClass isJavaClass ifFalse:[ |
3675 |
firstLine ifTrue:[ |
|
3676 |
aStream nextPutAll:'cvs rm -f '. |
|
3677 |
firstLine := false. |
|
3678 |
]. |
|
3679 |
eachClass classFilename ~= (eachClass generateClassFilename, '.st') ifTrue:[ |
|
3680 |
aStream nextPutAll:eachClass classBaseFilename; space. |
|
3681 |
] |
|
3682 |
]. |
|
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 |
firstLine ifFalse:[ |
23124 | 3685 |
aStream cr. |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3686 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3687 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3688 |
" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3689 |
stx_goodies_webServer_htmlTree generateRemoveShellScriptOn:Transcript |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3690 |
" |
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
|
3691 |
|
0875f5d7c9ce
Care for Java classes that are part of a Smalltalk/X package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16786
diff
changeset
|
3692 |
"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
|
3693 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3694 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3695 |
generateRenameShellScriptOn:aStream |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3696 |
"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
|
3697 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3698 |
self searchForClasses do:[:eachClass| |
23124 | 3699 |
eachClass isJavaClass ifFalse:[ |
3700 |
eachClass classFilename ~= (eachClass generateClassFilename, '.st') ifTrue:[ |
|
3701 |
aStream nextPutAll:'cp '; |
|
3702 |
nextPutAll:eachClass classBaseFilename; nextPutAll:',v '; |
|
3703 |
nextPutAll:eachClass generateClassFilename; nextPutAll:'.st,v'; cr. |
|
3704 |
] |
|
3705 |
] |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3706 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3707 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3708 |
" |
11981
e479249ba36e
Fix #generateRenameShellScriptOn:
Stefan Vogel <sv@exept.de>
parents:
11980
diff
changeset
|
3709 |
stx_libdb generateRemoveShellScriptOn:Transcript |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3710 |
" |
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
|
3711 |
|
0875f5d7c9ce
Care for Java classes that are part of a Smalltalk/X package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16786
diff
changeset
|
3712 |
"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
|
3713 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3714 |
|
9536 | 3715 |
generate_abbrev_dot_stc |
13968 | 3716 |
"/ 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
|
3717 |
self checkIfClassesArePresent. |
10104
96bce48c03b5
some care for incomplete information bein present when
Claus Gittinger <cg@exept.de>
parents:
10103
diff
changeset
|
3718 |
|
13419 | 3719 |
^ String |
23124 | 3720 |
streamContents:[:s | |
3721 |
|addEntry| |
|
3722 |
||
3723 |
addEntry := |
|
3724 |
[:eachClassName | |
|
3725 |
|cls fn wasLoaded failedToLoad numClassInstvars| |
|
3726 |
||
3727 |
s nextPutAll:eachClassName. |
|
3728 |
s nextPutAll:' '. |
|
3729 |
||
3730 |
cls := Smalltalk classNamed:eachClassName. |
|
3731 |
cls isNil ifTrue:[ |
|
3732 |
fn := self filenameForClass:eachClassName. |
|
3733 |
s nextPutAll:fn. |
|
3734 |
s nextPutAll:' '; nextPutAll:(self package); nextPutAll:' '. |
|
3735 |
s nextPutAll:' '; nextPutAll:'unknownCategory' storeString; nextPutAll:' '. |
|
3736 |
s nextPutAll:' '; nextPutAll:'0'. |
|
3737 |
] ifFalse:[ |
|
3738 |
wasLoaded := cls isLoaded. |
|
3739 |
wasLoaded ifFalse:[ |
|
3740 |
failedToLoad := false. |
|
3741 |
||
3742 |
Error handle:[:ex | |
|
3743 |
failedToLoad := true. |
|
3744 |
] do:[ |
|
3745 |
ParserFlags |
|
3746 |
withSTCCompilation:#never |
|
3747 |
do:[ |
|
3748 |
cls autoload. |
|
3749 |
] |
|
3750 |
]. |
|
3751 |
]. |
|
3752 |
||
3753 |
fn := self filenameForClass:cls. |
|
3754 |
(fn includes:Character space) ifTrue:[ |
|
3755 |
s nextPutAll:fn storeString. |
|
3756 |
] ifFalse:[ |
|
3757 |
s nextPutAll:fn. |
|
3758 |
]. |
|
3759 |
s nextPutAll:' '; nextPutAll:(self package); nextPutAll:' '. |
|
3760 |
s nextPutAll: (cls category asString storeString). |
|
3761 |
failedToLoad ifTrue:[ |
|
3762 |
s nextPutAll:' 0'. |
|
3763 |
] ifFalse:[ |
|
3764 |
numClassInstvars := cls theMetaclass instSize - Class instSize. |
|
3765 |
s nextPutAll:' '; nextPutAll:numClassInstvars printString. |
|
3766 |
]. |
|
3767 |
||
3768 |
wasLoaded ifFalse:[ |
|
3769 |
UserPreferences current autoUnloadAutoloadedClassesInProjectDefinition ifTrue:[ |
|
3770 |
cls unload |
|
3771 |
] |
|
3772 |
] |
|
3773 |
]. |
|
3774 |
s cr. |
|
3775 |
]. |
|
3776 |
||
3777 |
s nextPutLine:'# automagically generated by the project definition'. |
|
3778 |
s nextPutLine:'# this file is needed for stc to be able to compile modules independently.'. |
|
3779 |
s nextPutLine:'# it provides information about a classes filename, category and especially namespace.'. |
|
3780 |
||
3781 |
self allClassNames do:addEntry. |
|
3782 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do: [:nm :attr | |
|
3783 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
|
3784 |
addEntry value:nm |
|
3785 |
]. |
|
3786 |
]. |
|
3787 |
] |
|
3788 |
||
3789 |
" |
|
3790 |
stx_libbasic generate_abbrev_dot_stc |
|
3791 |
DapasXProject generate_abbrev_dot_stc |
|
3792 |
DapasX_Datenbasis generate_abbrev_dot_stc |
|
3793 |
bosch_dapasx_interactiver_editor generate_abbrev_dot_stc |
|
9536 | 3794 |
" |
3795 |
||
3796 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
15916 | 3797 |
"Modified: / 28-01-2014 / 21:43:56 / cg" |
9536 | 3798 |
! |
3799 |
||
13177 | 3800 |
generate_autopackage_default_dot_apspec |
3801 |
||
13419 | 3802 |
^self |
23124 | 3803 |
replaceMappings: self autopackage_default_dot_apspec_mappings |
3804 |
in: self autopackage_default_dot_apspec |
|
13177 | 3805 |
|
3806 |
" |
|
3807 |
stx_projects_smalltalk generate_autopackage_default_dot_apspec |
|
3808 |
" |
|
3809 |
||
3810 |
"Created: / 21-12-2010 / 09:40:04 / cg" |
|
3811 |
! |
|
3812 |
||
13419 | 3813 |
generate_bc_dot_mak |
3814 |
^ (self |
|
23124 | 3815 |
replaceMappings: self bc_dot_mak_mappings |
3816 |
in: self bc_dot_mak) asStringCollection withTabs asString |
|
10306 | 3817 |
|
3818 |
" |
|
3819 |
DapasXProject generate_bc_dot_mak |
|
3820 |
DapasX_Datenbasis generate_bc_dot_mak |
|
3821 |
" |
|
3822 |
||
3823 |
"Modified: / 09-08-2006 / 11:46:14 / fm" |
|
3824 |
! |
|
3825 |
||
13419 | 3826 |
generate_bmake_dot_mak |
3827 |
||
3828 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
23124 | 3829 |
in: self bmake_dot_mak |
9575 | 3830 |
|
3831 |
"Created: / 17-08-2006 / 20:03:43 / cg" |
|
3832 |
! |
|
3833 |
||
13411 | 3834 |
generate_builder_baseline_dot_rbspec |
3835 |
^ self replaceMappings:self builder_baseline_dot_rbspec_mappings |
|
23124 | 3836 |
in:self builder_baseline_dot_rbspec |
13411 | 3837 |
|
3838 |
" |
|
3839 |
stx_projects_smalltalk generate_builder_baseline_dot_rbspec |
|
3840 |
||
3841 |
" |
|
3842 |
||
3843 |
"Created: / 24-02-2011 / 11:38:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3844 |
! |
|
3845 |
||
14334 | 3846 |
generate_lccmake_dot_mak |
13419 | 3847 |
|
3848 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
23124 | 3849 |
in: self lccmake_dot_mak |
14334 | 3850 |
|
3851 |
"Created: / 03-09-2012 / 19:49:56 / cg" |
|
11979 | 3852 |
! |
3853 |
||
9850 | 3854 |
generate_loadAll |
13419 | 3855 |
^ String |
23124 | 3856 |
streamContents:[:s | |
3857 |
|classNames classesLoaded classNamesUnloaded classesSorted| |
|
3858 |
||
3859 |
classNames := self compiled_classNames_common. |
|
3860 |
classesLoaded := classNames |
|
3861 |
collect:[:nm | Smalltalk classNamed:nm] |
|
3862 |
thenSelect:[:cls | cls notNil and:[cls isLoaded] ]. |
|
3863 |
classNamesUnloaded := classNames |
|
3864 |
select:[:nm | |
|
3865 |
|cls| |
|
3866 |
cls := Smalltalk classNamed:nm. |
|
3867 |
cls isNil or:[cls isLoaded not] |
|
3868 |
]. |
|
3869 |
||
3870 |
classesSorted := Class classesSortedByLoadOrder:classesLoaded. |
|
3871 |
||
3872 |
s nextPutAll:'"/ |
|
9850 | 3873 |
"/ $' , 'Header' , '$ |
3874 |
"/ |
|
3875 |
"/ loadAll-file to fileIn code for: ' , self package , ' |
|
3876 |
"/ |
|
3877 |
"/ Automatically generated from the ProjectDefinition. |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
3878 |
"/ DO NOT MODIFY THIS FILE; |
9850 | 3879 |
"/ |
3880 |
"/ |
|
3881 |
"/ Prerequisites: |
|
3882 |
"/ |
|
3883 |
"/ Smalltalk loadPackage:''module:directory''. |
|
3884 |
"/ Smalltalk loadPackage:''....''. |
|
3885 |
!! |
|
3886 |
||
3887 |
"{ package:''' , self package, ''' }" |
|
3888 |
!! |
|
3889 |
||
3890 |
|files| |
|
3891 |
||
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
3892 |
''loading package ' , self package ,'...'' infoPrint. |
9850 | 3893 |
|
3894 |
files := #( |
|
3895 |
'. |
|
3896 |
||
23124 | 3897 |
classesSorted do:[:eachClass | |
3898 |
s nextPutLine:' ''' , (self filenameForClass:eachClass), ''''. |
|
3899 |
]. |
|
3900 |
classNamesUnloaded do:[:nm | |
|
3901 |
s nextPutLine:' ''' , (self filenameForClass:nm), ''''. |
|
3902 |
]. |
|
3903 |
||
3904 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do:[:nm :attr | |
|
3905 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
|
3906 |
s nextPutLine:' ''' , (self filenameForClass:nm), ''''. |
|
3907 |
]. |
|
3908 |
]. |
|
3909 |
||
3910 |
self hasExtensionMethods ifTrue:[ |
|
3911 |
s nextPutLine:' ''extensions.st'''. |
|
3912 |
]. |
|
3913 |
||
3914 |
s nextPutAll:' |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
3915 |
). |
9850 | 3916 |
|
3917 |
"/ see if there is a classLibrary |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
3918 |
(Smalltalk fileInClassLibrary:''' , (self libraryName) , ''') ifTrue:[ |
9850 | 3919 |
|handle loaded| |
3920 |
||
13419 | 3921 |
handle := ObjectFileLoader loadedObjectHandles |
23124 | 3922 |
detect:[:h | h package = ''' , self package , '''] ifNone:nil. |
9850 | 3923 |
handle ifNotNil:[ |
23124 | 3924 |
loaded := Set new:(handle classes size). |
3925 |
handle classes do:[:c| c isMeta ifFalse:[loaded add:c classBaseFilename]]. |
|
3926 |
files := files \ loaded. |
|
9850 | 3927 |
]. |
3928 |
]. |
|
3929 |
||
3930 |
"/ 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
|
3931 |
files notEmpty ifTrue:[ |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
3932 |
'''' infoPrintCR. |
9850 | 3933 |
files do:[:f | |
3934 |
''.'' infoPrint. |
|
3935 |
f asFilename exists ifTrue:[ |
|
23124 | 3936 |
Smalltalk fileIn:f. |
9850 | 3937 |
] ifFalse:[ |
23124 | 3938 |
Smalltalk fileIn:(''source/'' , f) |
9850 | 3939 |
] |
3940 |
]. |
|
3941 |
'' '' infoPrintCR. |
|
3942 |
]. |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
3943 |
''done (' , self package ,').'' infoPrintCR. |
9850 | 3944 |
'. |
23124 | 3945 |
]. |
9850 | 3946 |
|
3947 |
"Created: / 14-09-2006 / 14:21:31 / cg" |
|
10080 | 3948 |
"Modified: / 12-10-2006 / 15:55:00 / cg" |
9850 | 3949 |
! |
3950 |
||
13419 | 3951 |
generate_make_dot_proto |
3952 |
||
3953 |
^ (self |
|
23124 | 3954 |
replaceMappings: self make_dot_proto_mappings |
3955 |
in: self make_dot_proto) asStringCollection withTabs asString |
|
9536 | 3956 |
|
9733 | 3957 |
" |
12428 | 3958 |
stx_libbasic2 generate_make_dot_proto |
9733 | 3959 |
" |
9536 | 3960 |
|
3961 |
"Modified: / 09-08-2006 / 11:31:01 / fm" |
|
3962 |
! |
|
3963 |
||
3964 |
generate_make_dot_spec |
|
13419 | 3965 |
^ (self |
23124 | 3966 |
replaceMappings: self make_dot_spec_mappings |
3967 |
in: self make_dot_spec) asStringCollection withTabs asString |
|
9536 | 3968 |
|
9733 | 3969 |
" |
3970 |
DapasXProject generate_make_dot_spec |
|
3971 |
DapasX_Datenbasis generate_make_dot_spec |
|
3972 |
bosch_dapasx_kernel_Definition generate_make_dot_spec |
|
3973 |
" |
|
9536 | 3974 |
|
3975 |
"Modified: / 09-08-2006 / 11:31:09 / fm" |
|
3976 |
! |
|
3977 |
||
13419 | 3978 |
generate_makefile |
3979 |
||
3980 |
^ (self |
|
23124 | 3981 |
replaceMappings: self makefile_mappings |
3982 |
in: self makefile) asStringCollection withTabs asString |
|
12428 | 3983 |
|
3984 |
" |
|
3985 |
stx_libbasic2 generate_makefile |
|
3986 |
" |
|
3987 |
! |
|
3988 |
||
14345 | 3989 |
generate_mingwmake_dot_mak |
3990 |
||
3991 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
23124 | 3992 |
in: self mingwmake_dot_mak |
14345 | 3993 |
|
3994 |
"Created: / 05-09-2012 / 19:44:07 / cg" |
|
3995 |
! |
|
3996 |
||
9536 | 3997 |
generate_packageName_dot_rc |
3998 |
||
13419 | 3999 |
^self replaceMappings: self packageName_dot_rc_mappings |
23124 | 4000 |
in: self packageName_dot_rc |
9536 | 4001 |
|
4002 |
" |
|
4003 |
bosch_dapasx_datenbasis generate_packageName_dot_rc |
|
4004 |
bosch_dapasx_hw_schnittstellen generate_packageName_dot_rc |
|
9575 | 4005 |
stx_libbasic3 generate_packageName_dot_rc |
9618 | 4006 |
stx_libwidg3 generate_packageName_dot_rc |
13419 | 4007 |
stx_libwidg3 productVersion |
9536 | 4008 |
|
4009 |
" |
|
4010 |
||
4011 |
"Modified: / 09-08-2006 / 11:31:09 / fm" |
|
9618 | 4012 |
"Modified: / 21-08-2006 / 19:33:21 / cg" |
9831 | 4013 |
! |
4014 |
||
13411 | 4015 |
generate_package_dot_deps_dot_rake |
4016 |
^ (self replaceMappings:self package_dot_deps_dot_rake_mappings |
|
23124 | 4017 |
in:self package_dot_deps_dot_rake) asStringCollection |
4018 |
withTabs asString |
|
13411 | 4019 |
|
4020 |
" |
|
4021 |
stx_libjava generate_dependencies_dot_rake" |
|
4022 |
||
4023 |
"Created: / 24-02-2011 / 22:32:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4024 |
! |
|
4025 |
||
14334 | 4026 |
generate_tccmake_dot_mak |
4027 |
||
4028 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
23124 | 4029 |
in: self tccmake_dot_mak |
14334 | 4030 |
|
4031 |
"Created: / 03-09-2012 / 19:50:25 / cg" |
|
4032 |
! |
|
4033 |
||
13419 | 4034 |
generate_vcmake_dot_mak |
4035 |
||
4036 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
23124 | 4037 |
in: self vcmake_dot_mak |
11937 | 4038 |
! |
4039 |
||
23112 | 4040 |
nsiFilename |
4041 |
"only applications define it" |
|
23124 | 4042 |
|
23112 | 4043 |
^ nil. |
4044 |
||
4045 |
"Created: / 18-06-2018 / 14:07:43 / Claus Gittinger" |
|
4046 |
! |
|
4047 |
||
9852 | 4048 |
protectedFileNames |
13178
07e3a9bb37c8
changed: #protectedFileNames
Claus Gittinger <cg@exept.de>
parents:
13177
diff
changeset
|
4049 |
"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
|
4050 |
- redefine this to protect a hand-written Make.proto or other handwritten support files" |
9852 | 4051 |
|
4052 |
^ #() |
|
4053 |
||
4054 |
"Created: / 14-09-2006 / 14:38:40 / cg" |
|
13178
07e3a9bb37c8
changed: #protectedFileNames
Claus Gittinger <cg@exept.de>
parents:
13177
diff
changeset
|
4055 |
"Modified: / 21-12-2010 / 11:36:46 / cg" |
9852 | 4056 |
! |
4057 |
||
9831 | 4058 |
rcFilename |
19996 | 4059 |
^ self fullPackageName,'WINrc.rc'. |
9831 | 4060 |
|
4061 |
"Created: / 07-09-2006 / 17:07:00 / cg" |
|
19996 | 4062 |
! |
4063 |
||
4064 |
resourceFilename |
|
4065 |
^ (self rcFilename asFilename withSuffix:'$(RES)') name |
|
4066 |
||
4067 |
"Created: / 07-09-2006 / 17:12:53 / cg" |
|
9536 | 4068 |
! ! |
4069 |
||
12364 | 4070 |
!ProjectDefinition class methodsFor:'file mappings'! |
9536 | 4071 |
|
13177 | 4072 |
autopackage_default_dot_apspec_mappings |
4073 |
|mappings| |
|
4074 |
||
4075 |
mappings := Dictionary new. |
|
16257 | 4076 |
^ mappings |
23124 | 4077 |
at: 'TOP' put: (self pathToTopWithSeparator:'/'); "/ unix here |
14339 | 4078 |
"/ at: 'MODULE_PATH' put: ( self moduleDirectory ); "/ unix here |
23124 | 4079 |
at: 'DESCRIPTION' put: (self description); |
4080 |
at: 'PRODUCT_NAME' put: (self productName); |
|
4081 |
at: 'PRODUCT_VERSION' put: (self productVersion); |
|
4082 |
at: 'PRODUCT_DATE' put: (self productDate); |
|
4083 |
at: 'PRODUCT_PUBLISHER' put: (self productPublisher); |
|
4084 |
at: 'PRODUCT_WEBSITE' put: (self productWebSite); |
|
4085 |
at: 'PRODUCT_INSTALLDIR' put: (self productInstallDir); |
|
4086 |
at: 'PRODUCT_TYPE' put: (self productType); |
|
4087 |
at: 'PRODUCT_LICENSE' put: (self productLicense); |
|
4088 |
at: 'PRODUCT_DESCRIPTION' put: (self productDescription); |
|
4089 |
at: 'PRODUCT_CPU_VERSIONS' put: 'x86'; |
|
4090 |
at: 'PRODUCT_ROOT_NAME' put: (self productName); |
|
4091 |
at: 'MAINTAINER' put: (self productMaintainer); |
|
4092 |
at: 'PACKAGER' put: (self productPublisher); |
|
4093 |
at: 'ADDITIONAL_SOURCE_DIRS' put: ''; |
|
4094 |
at: 'ADDITIONAL_COPYFILES' put: ''; |
|
4095 |
at: 'ADDITIONAL_INSTALL' put: ''; |
|
4096 |
yourself. |
|
13419 | 4097 |
|
13177 | 4098 |
|
4099 |
"Created: / 21-12-2010 / 09:00:49 / cg" |
|
14339 | 4100 |
"Modified: / 05-09-2012 / 10:09:06 / cg" |
13177 | 4101 |
! |
4102 |
||
10306 | 4103 |
bc_dot_mak_mappings |
4104 |
|d| |
|
4105 |
||
14337 | 4106 |
d := self common_mappings. |
14944 | 4107 |
^ d |
23124 | 4108 |
at: 'TOP' put: ( self pathToTopWithSeparator:'\' ); "/ win32 here |
4109 |
at: 'MODULE_PATH' put: ( self moduleDirectory_win32 ); "/ win32 here |
|
4110 |
at: 'PRIMARY_TARGET' put: (self primaryTarget_bc_dot_mak); |
|
4111 |
at: 'ADDITIONAL_BASE_ADDRESS_DEFINITION' put: (self additionalBaseAddressDefinition_bc_dot_mak ? ''); |
|
4112 |
at: 'ADDITIONAL_DEFINITIONS' put: (self additionalDefinitions_bc_dot_mak ? ''); |
|
4113 |
at: 'ADDITIONAL_HEADERRULES' put: (self additionalHeaderRules_bc_dot_mak); |
|
4114 |
at: 'ADDITIONAL_RULES' put: (self additionalRulesFor: 'bc.mak'); |
|
4115 |
at: 'ADDITIONAL_RULES_HG' put: (self additionalRulesHG_bc_dot_mak ? ''); |
|
4116 |
at: 'ADDITIONAL_TARGETS' put: (self additionalTargets_bc_dot_mak ? ''); |
|
4117 |
at: 'ADDITIONAL_LINK_LIBRARIES' put: (self additionalLinkLibraries_bc_dot_mak ? ''); |
|
4118 |
at: 'ADDITIONAL_POSTNSISRULES' put: (self additional_post_nsis_rules); "/ win32 bc here |
|
4119 |
at: 'ADDITIONAL_POSTNSISRULES64' put: (self additional_post_nsis_rules64); "/ win64 mingw here |
|
4120 |
at: 'LOCAL_INCLUDES' put: (self generateLocalIncludes_win32 ? ''); |
|
4121 |
at: 'LOCAL_DEFINES' put: self localDefines_win32 ? ''; |
|
4122 |
at: 'GLOBAL_DEFINES' put: self globalDefines_win32 ? ''; |
|
4123 |
yourself. |
|
10306 | 4124 |
|
4125 |
"Created: / 18-08-2006 / 11:43:39 / cg" |
|
14339 | 4126 |
"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
|
4127 |
"Modified: / 03-02-2015 / 07:28:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
18428 | 4128 |
"Modified: / 02-06-2015 / 17:44:11 / gg" |
10306 | 4129 |
! |
4130 |
||
9627 | 4131 |
bmake_dot_mak_mappings |
14337 | 4132 |
^ self common_mappings |
23124 | 4133 |
at:'TOP' put: ( self pathToTopWithSeparator:'\' ); |
4134 |
at:'SUBPROJECT_BMAKE_CALLS' put:(self subProjectBmakeCalls); |
|
4135 |
at:'SUBPROJECT_VCMAKE_CALLS' put:(self subProjectVCmakeCalls); |
|
4136 |
at:'SUBPROJECT_LCCMAKE_CALLS' put:(self subProjectLCCmakeCalls); |
|
4137 |
at:'SUBPROJECT_TCCMAKE_CALLS' put:(self subProjectTCCmakeCalls); |
|
4138 |
at:'SUBPROJECT_MINGWMAKE_CALLS' put:(self subProjectMingwmakeCalls); |
|
4139 |
yourself |
|
9627 | 4140 |
|
4141 |
"Created: / 17-08-2006 / 21:41:56 / cg" |
|
14345 | 4142 |
"Modified: / 05-09-2012 / 19:45:36 / cg" |
9575 | 4143 |
! |
4144 |
||
13411 | 4145 |
builder_baseline_dot_rbspec_mappings |
4146 |
|mappings| |
|
4147 |
||
4148 |
mappings := Dictionary new. |
|
16257 | 4149 |
^ mappings |
23124 | 4150 |
at:'APPLICATION' put:(self perform:#applicationName ifNotUnderstood:[self packageName]); |
4151 |
at:'APPLICATION_PACKAGE' put:self package printString; |
|
4152 |
at:'PREAMBLE' put:self builder_baseline_dot_rbspec_preamble; |
|
4153 |
at:'POSTAMBLE' put:self builder_baseline_dot_rbspec_postamble; |
|
4154 |
at:'PACKAGES' put:self builder_baseline_dot_rbspec_packages; |
|
4155 |
yourself. |
|
13411 | 4156 |
|
4157 |
"Modified: / 21-12-2010 / 11:00:22 / cg" |
|
4158 |
"Created: / 24-02-2011 / 11:58:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4159 |
"Modified: / 09-06-2011 / 14:55:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4160 |
! |
|
4161 |
||
4162 |
builder_baseline_dot_rbspec_packages |
|
19955 | 4163 |
^ String streamContents:[:s | |
23124 | 4164 |
self allPreRequisitesSorted do: [:packageId | |
4165 |
s nextPutLine:(' package "%1"' bindWith:packageId). |
|
4166 |
] |
|
19955 | 4167 |
]. |
13411 | 4168 |
|
4169 |
"Created: / 24-02-2011 / 11:59:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
19955 | 4170 |
"Modified: / 06-06-2016 / 14:32:44 / cg" |
13411 | 4171 |
! |
4172 |
||
13419 | 4173 |
classLine_mappings:aClassName |
12545 | 4174 |
^ Dictionary new |
23124 | 4175 |
at:'CLASS' put:(self st2c:aClassName); |
4176 |
yourself |
|
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4177 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4178 |
"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
|
4179 |
"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
|
4180 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4181 |
|
14337 | 4182 |
common_mappings |
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4183 |
^ Dictionary new |
23124 | 4184 |
at: 'TAB' put: ( Character tab asString ); |
4185 |
at: 'TOP' put: ( 'depends-on-file(unix vs. win32)' ); "/ must be in specific mapping |
|
4186 |
at: 'LIBRARY_NAME' put: ( self libraryName ); |
|
4187 |
at: 'SUBDIRECTORIES' put: (self generateSubDirectories); |
|
4188 |
at: 'MODULE' put: ( self module ); |
|
4189 |
at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); "/ always unix format |
|
4190 |
at: 'MODULE_PATH' put: ( 'depends-on-file(unix vs. win32)' ); "/ must be in specific mapping |
|
4191 |
yourself |
|
14337 | 4192 |
|
4193 |
"Created: / 04-09-2012 / 13:04:26 / cg" |
|
4194 |
! |
|
4195 |
||
4196 |
make_dot_proto_mappings |
|
4197 |
^ self common_mappings |
|
23124 | 4198 |
at: 'MODULE' put: ( self module ); |
4199 |
at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); |
|
4200 |
at: 'MODULE_PATH' put: ( self moduleDirectory ); |
|
4201 |
at: 'TOP' put: ( self pathToTopWithSeparator:'/' ); |
|
4202 |
at: 'SUBDIRECTORIES' put: (self generateSubDirectories); |
|
4203 |
at: 'LIBRARY_NAME' put: ( self libraryName ); |
|
4204 |
at: 'LOCAL_INCLUDES' put: (self generateLocalIncludes_unix); |
|
4205 |
at: 'LOCAL_DEFINES' put: self localDefines_unix; |
|
4206 |
at: 'GLOBAL_DEFINES' put: self globalDefines_unix; |
|
4207 |
at: 'COMMONSYMFLAG' put: (self commonSymbolsFlag); |
|
4208 |
at: 'HEADEROUTPUTARG' put: (self headerFileOutputArg); |
|
4209 |
at: 'PRIMARY_TARGET' put: (self primaryTarget_make_dot_proto); |
|
4210 |
at: 'ADDITIONAL_DEFINITIONS' put: (self additionalDefinitions_make_dot_proto); |
|
4211 |
at: 'ADDITIONAL_HEADERRULES' put: (self additionalHeaderRules_make_dot_proto); |
|
4212 |
at: 'ADDITIONAL_RULES' put: (self additionalRulesFor: 'Make.proto'); |
|
4213 |
at: 'ADDITIONAL_RULES_SVN' put: (self additionalRulesSvn_make_dot_proto); |
|
4214 |
at: 'ADDITIONAL_RULES_HG' put: (self additionalRulesHG_make_dot_proto); |
|
4215 |
at: 'ADDITIONAL_TARGETS' put: (self additionalTargets_make_dot_proto); |
|
4216 |
at: 'ADDITIONAL_TARGETS_SVN' put: (self additionalTargetsSvn_make_dot_proto); |
|
4217 |
at: 'ADDITIONAL_LINK_LIBRARIES' put: (self additionalLinkLibraries_make_dot_proto); |
|
4218 |
at: 'ADDITIONAL_SHARED_LINK_LIBRARIES' put: (self additionalSharedLinkLibraries_make_dot_proto); |
|
4219 |
at: 'DEPENDENCIES' put: (self generateDependencies_unix); |
|
4220 |
yourself |
|
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4221 |
|
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4222 |
"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
|
4223 |
"Modified: / 09-08-2006 / 16:44:48 / fm" |
12028 | 4224 |
"Modified: / 24-06-2009 / 21:50:13 / Jan Vrany <vranyj1@fel.cvut.cz>" |
14339 | 4225 |
"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
|
4226 |
"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
|
4227 |
! |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4228 |
|
9627 | 4229 |
make_dot_spec_mappings |
14337 | 4230 |
^ self common_mappings |
23124 | 4231 |
at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); |
4232 |
at: 'STCWARNINGOPTIONS' put: (self stcWarningOptions); |
|
4233 |
at: 'STCOPTIMIZATIONOPTIONS' put: (self stcOptimizationOptions); |
|
4234 |
at: 'CLASSES' put: [self generateClasses_make_dot_spec]; |
|
4235 |
at: 'OBJECTS' put: [self generateObjects_make_dot_spec]; |
|
4236 |
yourself |
|
9627 | 4237 |
|
4238 |
"Created: / 18-08-2006 / 11:44:23 / cg" |
|
14339 | 4239 |
"Modified: / 05-09-2012 / 10:11:02 / cg" |
9575 | 4240 |
! |
4241 |
||
12428 | 4242 |
makefile_mappings |
4243 |
^ Dictionary new |
|
23124 | 4244 |
yourself |
12428 | 4245 |
! |
4246 |
||
9627 | 4247 |
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
|
4248 |
|d s resourceCount| |
9627 | 4249 |
|
9630 | 4250 |
d := Dictionary new. |
4251 |
d |
|
23124 | 4252 |
at: 'PRODUCT_NAME' put: (self productName); |
4253 |
at: 'PRODUCT_VERSION' put: (self productVersion); |
|
4254 |
at: 'PRODUCT_DATE' put: (self productDate); |
|
4255 |
at: 'FILETYPE' put: ( 'VFT_DLL' ); |
|
4256 |
at: 'FILE_VERSION_COMMASEPARATED' put: (self fileVersionCommaSeparated); |
|
4257 |
at: 'PRODUCT_VERSION_COMMASEPARATED' put: (self productVersionCommaSeparated); |
|
4258 |
||
4259 |
at: 'COMPANY_NAME' put: (self companyName); |
|
4260 |
at: 'FILE_DESCRIPTION' put: (self fileDescription); |
|
4261 |
at: 'FILE_VERSION' put: (self fileVersion); |
|
4262 |
at: 'INTERNAL_NAME' put: (self internalName). |
|
11377 | 4263 |
|
9630 | 4264 |
s := self legalCopyright. |
4265 |
s notNil ifTrue:[ |
|
23124 | 4266 |
d at: 'LEGAL_COPYRIGHT_LINE' put: ' VALUE "LegalCopyright", "',s,'\0"' |
9630 | 4267 |
]. |
11611
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
4268 |
s := String streamContents:[:stream| |
23124 | 4269 |
|suff| |
4270 |
||
4271 |
s := self applicationIconFileNameWindows. |
|
4272 |
s notNil ifTrue:[ |
|
4273 |
s asFilename suffix isEmptyOrNil ifTrue:[ |
|
4274 |
suff := '.ico' |
|
4275 |
] ifFalse:[ |
|
4276 |
suff := '' |
|
4277 |
]. |
|
4278 |
'IDR_MAINFRAME ICON DISCARDABLE "%1%2"' |
|
4279 |
expandPlaceholdersWith:(Array with:s with:suff) on:stream. |
|
4280 |
stream cr. |
|
4281 |
]. |
|
4282 |
||
4283 |
s := self splashFileName. |
|
4284 |
s notNil ifTrue:[ |
|
4285 |
s asFilename suffix isEmptyOrNil ifTrue:[ |
|
4286 |
suff := '.bmp' |
|
4287 |
] ifFalse:[ |
|
4288 |
suff := '' |
|
4289 |
]. |
|
4290 |
'IDR_SPLASH BITMAP DISCARDABLE "%1%2"' |
|
4291 |
expandPlaceholdersWith:(Array with:s with:suff) on:stream. |
|
4292 |
stream cr. |
|
4293 |
]. |
|
4294 |
resourceCount := 2. |
|
4295 |
self applicationAdditionalIconFileNames do:[:eachFilename| |
|
4296 |
'IDR_MAINFRAME+%1 ICON DISCARDABLE "%2"' |
|
4297 |
expandPlaceholdersWith:(Array with:resourceCount with:eachFilename) on:stream. |
|
4298 |
stream cr. |
|
4299 |
resourceCount := resourceCount+1. |
|
4300 |
]. |
|
4301 |
]. |
|
11611
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
4302 |
d at: #'ICONDEFINITION_LINE' put:s. |
9817 | 4303 |
|
9630 | 4304 |
^ d |
9627 | 4305 |
|
4306 |
"Created: / 09-08-2006 / 11:21:21 / fm" |
|
13309
27f463f6c0cb
changed: #packageName_dot_rc_mappings
Claus Gittinger <cg@exept.de>
parents:
13285
diff
changeset
|
4307 |
"Modified: / 22-02-2011 / 11:30:36 / cg" |
9536 | 4308 |
! |
4309 |
||
13411 | 4310 |
package_dot_deps_dot_rake_mappings |
14843 | 4311 |
|dependencies| |
4312 |
||
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
4313 |
dependencies := String |
23124 | 4314 |
streamContents:[:s | |
4315 |
self allPreRequisites do:[:package | |
|
4316 |
(self preRequisitesFor:package) do:[:prereq | |
|
4317 |
s |
|
4318 |
nextPutAll:('task "%1" => "%2"' bindWith:package with:prereq); |
|
4319 |
cr |
|
4320 |
]. |
|
4321 |
s cr |
|
4322 |
]. |
|
4323 |
self effectivePreRequisites do:[:prereq | |
|
4324 |
s |
|
4325 |
nextPutAll:('task "%1" => "%2"' bindWith:self package with:prereq); |
|
4326 |
cr |
|
4327 |
]. |
|
4328 |
]. |
|
13411 | 4329 |
|
4330 |
^ (Dictionary new) |
|
23124 | 4331 |
at:'DEPENDENCIES' put:dependencies; |
4332 |
yourself |
|
4333 |
||
4334 |
" |
|
4335 |
stx_libjava generate_package_dot_deps_dot_rake |
|
13411 | 4336 |
" |
4337 |
||
4338 |
"Created: / 24-02-2011 / 22:32:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4339 |
! |
|
4340 |
||
9627 | 4341 |
replaceMappings: mappings in: fileTemplate |
9733 | 4342 |
"Replaces the defined variable mappings found in a file template with the corresponding information" |
9627 | 4343 |
|
9733 | 4344 |
^ fileTemplate bindWithArguments:mappings. |
9627 | 4345 |
|
9733 | 4346 |
" |
13419 | 4347 |
self replaceMappings: (self nt_dot_def_mappingsFor: self) in: self nt_dot_def |
9733 | 4348 |
" |
9627 | 4349 |
|
4350 |
"Created: / 08-08-2006 / 11:44:27 / fm" |
|
4351 |
"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
|
4352 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4353 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4354 |
st2c:aString |
23124 | 4355 |
^ (aString asString |
4356 |
copyReplaceString:'_' withString:('_',($_ codePoint printStringRadix:8))) |
|
4357 |
replaceAny:':' with:$_ |
|
9536 | 4358 |
! ! |
4359 |
||
12364 | 4360 |
!ProjectDefinition class methodsFor:'file mappings support'! |
9817 | 4361 |
|
12545 | 4362 |
classNamesByCategory |
4363 |
"answer a dictionary |
|
23124 | 4364 |
category -> classNames topological sorted" |
12545 | 4365 |
|
15916 | 4366 |
|classes classNames mapping alreadyWarned| |
12545 | 4367 |
|
4368 |
mapping := Dictionary new. |
|
4369 |
||
15126 | 4370 |
classes := Class classesSortedByLoadOrder:self compiled_classes_common. |
15124 | 4371 |
classNames := classes collect:[:eachClass| eachClass name]. |
4372 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do: [:nm :attr | |
|
23124 | 4373 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
4374 |
classNames add:nm. |
|
4375 |
]. |
|
15124 | 4376 |
]. |
4377 |
mapping at:'COMMON' put:classNames. |
|
4378 |
||
15916 | 4379 |
alreadyWarned := false. |
12545 | 4380 |
OperatingSystem knownPlatformNames do:[:platformID | |
23124 | 4381 |
|platformClasses platformClassNames| |
4382 |
||
4383 |
platformClasses := self compiled_classesForPlatform:platformID. |
|
4384 |
platformClasses notEmpty ifTrue:[ |
|
4385 |
(platformClasses contains:[:each| each isNil or:[each isLoaded not]]) ifTrue:[ |
|
4386 |
"win32 classes are not present in linux..." |
|
4387 |
Transcript show:'Missing classes for platform: '. Transcript showCR:platformID. |
|
4388 |
platformClassNames := self compiled_classNamesForPlatform:platformID. |
|
4389 |
platformClassNames |
|
4390 |
select:[:nm | |cls| cls := Smalltalk classNamed:nm. cls isNil or:[cls isLoaded not]] |
|
4391 |
thenDo:[:nm | Transcript tab; showCR:nm]. |
|
4392 |
UserPreferences current suppressProjectDefinitionWarnings ifFalse:[ |
|
4393 |
alreadyWarned ifFalse:[ |
|
4394 |
(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)) |
|
4395 |
ifFalse:[ |
|
4396 |
AbortOperationRequest raise. |
|
4397 |
]. |
|
4398 |
]. |
|
4399 |
alreadyWarned := true |
|
4400 |
]. |
|
4401 |
] ifFalse:[ |
|
4402 |
classes := Class classesSortedByLoadOrder:platformClasses. |
|
4403 |
platformClassNames := platformClasses collect:[:eachClass| eachClass name]. |
|
4404 |
]. |
|
4405 |
mapping at:platformID asUppercase put:platformClassNames. |
|
4406 |
]. |
|
12545 | 4407 |
]. |
4408 |
^ mapping |
|
4409 |
||
4410 |
" |
|
4411 |
stx_libbasic classNamesByCategory |
|
4412 |
stx_libbasic3 classNamesByCategory |
|
4413 |
stx_libview classNamesByCategory |
|
15124 | 4414 |
stx_libjava classNamesByCategory |
12545 | 4415 |
" |
4416 |
||
4417 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
15916 | 4418 |
"Modified: / 28-01-2014 / 21:40:23 / cg" |
12545 | 4419 |
! |
4420 |
||
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4421 |
commonSymbolsFlag |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4422 |
"only for libraries" |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4423 |
|
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4424 |
^ '' |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4425 |
! |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
4426 |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4427 |
filenameForClass:classNameOrClass |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4428 |
"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
|
4429 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4430 |
"/ "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
|
4431 |
"/ See also: #generateRemoveShellScriptOn: and #generateRenamShellScriptOn:" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4432 |
"/ classNameOrClass isBehavior ifTrue:[ |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4433 |
"/ ^ classNameOrClass generateClassFilename. |
13419 | 4434 |
"/ ] ifFalse:[ |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4435 |
"/ |cls| |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4436 |
"/ |
13419 | 4437 |
"/ cls := Smalltalk classNamed:classNameOrClass. |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4438 |
"/ cls notNil ifTrue:[ |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4439 |
"/ ^ cls generateClassFilename. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4440 |
"/ ]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4441 |
"/ ]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4442 |
"/ "end special code" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4443 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4444 |
^ Smalltalk fileNameForClass:classNameOrClass. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4445 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4446 |
" |
23124 | 4447 |
self filenameForClass:HTML::Encoder |
4448 |
Smalltalk fileNameForClass:HTML::Encoder |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4449 |
" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4450 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4451 |
"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
|
4452 |
"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
|
4453 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4454 |
|
13419 | 4455 |
generateClassLines:classLineTemplate |
12771
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4456 |
"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
|
4457 |
|
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4458 |
^ 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
|
4459 |
! |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4460 |
|
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4461 |
generateClassLines:classLineTemplate forClasses:classNames |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4462 |
"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
|
4463 |
|
13419 | 4464 |
^ self generateClassLines:classLineTemplate forClasses:classNames includeAdditionalClasses:true |
12804
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4465 |
! |
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4466 |
|
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4467 |
generateClassLines:classLineTemplate forClasses:classNames includeAdditionalClasses:includeAdditionalClasses |
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4468 |
"for the init-file: generate class-init-lines for a collection of classes" |
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4469 |
|
13419 | 4470 |
^ String |
23124 | 4471 |
streamContents:[:s | |
4472 |
|classesLoaded classNamesUnloaded classNamesSorted putLineForClassName| |
|
4473 |
||
4474 |
putLineForClassName := |
|
4475 |
[:className | |
|
4476 |
|newClassLine mappings| |
|
4477 |
||
4478 |
mappings := self classLine_mappings:className. |
|
4479 |
newClassLine := self replaceMappings:mappings in:classLineTemplate. |
|
4480 |
s nextPutLine:newClassLine |
|
4481 |
]. |
|
4482 |
classesLoaded := classNames collect:[:eachClassName | Smalltalk classNamed:eachClassName] |
|
4483 |
thenSelect:[:eachClass | eachClass notNil and:[eachClass isLoaded]]. |
|
4484 |
classNamesUnloaded := classNames |
|
4485 |
select:[:nm | |
|
4486 |
|cls| |
|
4487 |
||
4488 |
cls := Smalltalk classNamed:nm. |
|
4489 |
cls isNil or:[ cls isLoaded not ] |
|
4490 |
]. |
|
4491 |
classNamesSorted := (Class classesSortedByLoadOrder:classesLoaded) collect:[:cls | cls name]. |
|
4492 |
classNamesSorted do:putLineForClassName. |
|
4493 |
classNamesUnloaded do:putLineForClassName. |
|
4494 |
||
4495 |
includeAdditionalClasses ifTrue:[ |
|
4496 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) |
|
4497 |
do:[:nm :attr | |
|
4498 |
(attr isEmptyOrNil or:[ (attr includes:#autoload) not ]) ifTrue:[ |
|
4499 |
putLineForClassName value:nm. |
|
4500 |
]. |
|
4501 |
]. |
|
4502 |
#( ('UNIX' unix) |
|
4503 |
('WIN32' win32) |
|
4504 |
('OSX' osx) |
|
4505 |
('VMS' vms) |
|
4506 |
('BEOS' beos) ) |
|
4507 |
pairsDo:[:ifdef :platformName | |
|
4508 |
|archClassNames archClassesLoaded| |
|
4509 |
||
4510 |
archClassNames := self compiled_classNamesForPlatform:platformName. |
|
4511 |
archClassNames notEmpty ifTrue:[ |
|
4512 |
s nextPutLine:'#ifdef ' , ifdef. |
|
4513 |
archClassNames do:[:clsName | |
|
4514 |
putLineForClassName value:clsName |
|
4515 |
]. |
|
4516 |
s nextPutLine:'#endif /* ' , ifdef , ' */'. |
|
4517 |
]. |
|
4518 |
]. |
|
4519 |
] |
|
4520 |
] |
|
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4521 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4522 |
" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4523 |
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
|
4524 |
bosch_dapasx_kernel generateClassLines_libInit_dot_cc |
10010 | 4525 |
stx_libbasic3 generateClassLines_libInit_dot_cc |
4526 |
" |
|
4527 |
||
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4528 |
"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
|
4529 |
"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
|
4530 |
"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
|
4531 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4532 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4533 |
generateClassLines_libInit_dot_cc |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4534 |
^ 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
|
4535 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4536 |
" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4537 |
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
|
4538 |
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
|
4539 |
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
|
4540 |
" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4541 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4542 |
"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
|
4543 |
"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
|
4544 |
"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
|
4545 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
4546 |
|
13419 | 4547 |
generateClasses_make_dot_spec |
12545 | 4548 |
|classNamesDict| |
4549 |
||
4550 |
classNamesDict := self classNamesByCategory. |
|
4551 |
||
4552 |
^ String streamContents:[:s | |
|
23124 | 4553 |
classNamesDict keysAndValuesDo:[:eachCategory :classNames| |
4554 |
s nextPutLine:eachCategory,'_CLASSES= \'. |
|
4555 |
classNames do:[:eachClassName| |
|
4556 |
s tab; nextPutAll:eachClassName; nextPutLine:' \'. |
|
4557 |
]. |
|
4558 |
s cr. |
|
4559 |
]. |
|
4560 |
s cr. |
|
12545 | 4561 |
]. |
4562 |
||
4563 |
" |
|
4564 |
stx_libbasic generateClasses_make_dot_spec |
|
4565 |
stx_libbasic3 generateClasses_make_dot_spec |
|
4566 |
stx_libview generateClasses_make_dot_spec |
|
4567 |
stx_libboss generateClasses_make_dot_spec |
|
4568 |
" |
|
4569 |
||
4570 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
4571 |
"Modified: / 20-10-2006 / 16:18:54 / cg" |
|
4572 |
! |
|
4573 |
||
19309 | 4574 |
generateDefinitionClassLine_libInit_dot_cc |
4575 |
"for the init-file: generate a single class-init-line for the definition class itself" |
|
4576 |
||
4577 |
^ self |
|
23124 | 4578 |
generateClassLines:(self classLine_libInit_dot_cc) |
4579 |
forClasses:(Array with:self name) |
|
4580 |
includeAdditionalClasses:false |
|
19309 | 4581 |
|
4582 |
" |
|
4583 |
stx_libbasic generateDefinitionClassLine_libInit_dot_cc |
|
4584 |
" |
|
4585 |
! |
|
4586 |
||
13419 | 4587 |
generateDependencies:whichArchitecture |
4588 |
^ String |
|
23124 | 4589 |
streamContents:[:s | |
4590 |
|classNames classesPresent classesLoaded clsBaseName putDependencyForClassBlock |
|
4591 |
putDependencyForClassBaseNameBlock |
|
4592 |
archClassNames archClassesPresent archClassesLoaded |
|
4593 |
putSingleClassDependencyEntryBlock putDependencyForExtensionsBlock classSortBlock| |
|
4594 |
||
4595 |
classSortBlock := [ :a :b| |
|
4596 |
a package == b package ifTrue:[ |
|
4597 |
a name < b name |
|
4598 |
] ifFalse:[ |
|
4599 |
a package < b package |
|
4600 |
]. |
|
4601 |
]. |
|
4602 |
||
4603 |
putSingleClassDependencyEntryBlock := [:cls | |
|
4604 |
|sclsBaseName| |
|
4605 |
||
4606 |
s nextPutAll:' $(INCLUDE_TOP)'. |
|
4607 |
s nextPutAll:(self pathSeparator:whichArchitecture). |
|
4608 |
sclsBaseName := self filenameForClass:cls. |
|
4609 |
s nextPutAll:(self |
|
4610 |
topRelativePathTo:sclsBaseName |
|
4611 |
inPackage:cls package |
|
4612 |
architecture:whichArchitecture). |
|
4613 |
s nextPutAll:'.$(H)'. |
|
4614 |
]. |
|
4615 |
||
4616 |
putDependencyForClassBaseNameBlock := [:clsBaseName | |
|
4617 |
s nextPutAll:('$(OUTDIR)',clsBaseName,'.$(O)'). |
|
4618 |
s nextPutAll:' '. |
|
4619 |
s nextPutAll:(clsBaseName,'.$(C)'). |
|
4620 |
s nextPutAll:' '. |
|
4621 |
s nextPutAll:clsBaseName. |
|
4622 |
s nextPutAll:'.$(H)'. |
|
4623 |
s nextPutAll:': '. |
|
4624 |
s nextPutAll:clsBaseName. |
|
4625 |
s nextPutAll:'.st'. |
|
4626 |
]. |
|
4627 |
||
4628 |
||
4629 |
putDependencyForClassBlock := [:cls | |
|
4630 |
|clsBaseName classes| |
|
4631 |
||
4632 |
clsBaseName := self filenameForClass:cls. |
|
4633 |
putDependencyForClassBaseNameBlock value:clsBaseName. |
|
4634 |
cls isLoaded ifTrue:[ |
|
4635 |
classes := IdentitySet new. |
|
4636 |
cls |
|
4637 |
sharedPools do:[:poolClass | |
|
4638 |
poolClass isNil ifTrue:[ |
|
4639 |
Dialog warn:'At least one pool class is missing.\\Dependencies are incomplete.' withCRs |
|
4640 |
] ifFalse:[ |
|
4641 |
classes add:poolClass. |
|
4642 |
] |
|
4643 |
]. |
|
4644 |
||
4645 |
cls |
|
4646 |
allSuperclassesDo:[:scls | |
|
4647 |
classes add:scls. |
|
4648 |
]. |
|
4649 |
cls |
|
4650 |
allPrivateClassesDo:[:eachPrivateClass | |
|
4651 |
eachPrivateClass |
|
4652 |
allSuperclassesDo:[:scls | |
|
4653 |
|sclsBaseName| |
|
4654 |
||
4655 |
scls ~~ cls ifTrue:[ |
|
4656 |
scls isPrivate ifFalse:[ |
|
4657 |
(classes includes:scls) ifFalse:[ |
|
4658 |
classes add:scls. |
|
4659 |
]. |
|
4660 |
]. |
|
4661 |
]. |
|
4662 |
] |
|
4663 |
]. |
|
4664 |
"/ Sort them to get stable order to avoid false conflicts |
|
4665 |
classes := classes asSortedCollection:classSortBlock. |
|
4666 |
classes do:[:each | putSingleClassDependencyEntryBlock value:each]. |
|
4667 |
]. |
|
4668 |
s nextPutLine:' $(STCHDR)'. |
|
4669 |
]. |
|
4670 |
||
4671 |
putDependencyForExtensionsBlock := [ |
|
4672 |
| classes | |
|
4673 |
||
4674 |
s nextPutAll:'$(OUTDIR)extensions.$(O): extensions.st'. |
|
4675 |
classes := Set new. |
|
4676 |
self extensionMethodNames pairWiseDo:[:className :selector | |
|
4677 |
|mthdCls cls| |
|
4678 |
||
4679 |
((mthdCls := Smalltalk classNamed:className) notNil |
|
4680 |
and:[ mthdCls isLoaded ]) |
|
4681 |
ifTrue:[ |
|
4682 |
cls := mthdCls theNonMetaclass. |
|
4683 |
(classes includes:cls) ifFalse:[ |
|
4684 |
cls |
|
4685 |
withAllSuperclassesDo:[:scls | |
|
4686 |
(classes includes:scls) ifFalse:[ |
|
4687 |
classes add:scls. |
|
4688 |
]. |
|
4689 |
]. |
|
4690 |
]. |
|
4691 |
]. |
|
4692 |
]. |
|
4693 |
"/ Sort them to get stable order to avoid false conflicts |
|
4694 |
classes := classes asSortedCollection:classSortBlock. |
|
4695 |
classes do:[:each | putSingleClassDependencyEntryBlock value:each]. |
|
4696 |
s nextPutLine:' $(STCHDR)'. |
|
4697 |
]. |
|
4698 |
||
4699 |
classNames := self compiled_classNames_common. |
|
4700 |
classesPresent := classNames |
|
4701 |
collect:[:className | Smalltalk classNamed:className] |
|
4702 |
thenSelect:[:cls | cls notNil]. |
|
4703 |
classesLoaded := classesPresent select:[:cls | cls isLoaded]. |
|
4704 |
||
4705 |
(Class classesSortedByLoadOrder:classesLoaded) do:putDependencyForClassBlock. |
|
4706 |
classesPresent reject:[:cls | cls isLoaded] thenDo:putDependencyForClassBlock. |
|
4707 |
||
4708 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) |
|
4709 |
do:[:className :attr | |
|
4710 |
|cls| |
|
4711 |
||
4712 |
(attr isEmptyOrNil or:[ (attr includes:#autoload) not ]) ifTrue:[ |
|
4713 |
((cls := Smalltalk classNamed:className) notNil) ifTrue:[ |
|
4714 |
putDependencyForClassBlock value:cls. |
|
4715 |
] |
|
4716 |
]. |
|
4717 |
]. |
|
4718 |
archClassNames := self compiled_classNamesForPlatform:whichArchitecture. |
|
4719 |
archClassesPresent := archClassNames |
|
4720 |
collect:[:className | Smalltalk classNamed:className] |
|
4721 |
thenSelect:[:cls | cls notNil]. |
|
4722 |
||
4723 |
archClassesLoaded := archClassesPresent select:[:cls | cls isLoaded]. |
|
4724 |
||
4725 |
(Class classesSortedByLoadOrder:archClassesLoaded) |
|
4726 |
do:putDependencyForClassBlock. |
|
4727 |
||
4728 |
"some classes are not loaded - probably this is the wrong architecture. |
|
4729 |
Sorry, but for these classes, we do not know the superclass chain" |
|
4730 |
archClassesPresent |
|
4731 |
select:[:cls | cls isLoaded not] |
|
4732 |
thenDo:putDependencyForClassBlock. |
|
4733 |
||
4734 |
"for the following classes, we do not know the superclass chain |
|
4735 |
and neither the real class file name" |
|
4736 |
archClassNames |
|
4737 |
select:[:eachClassName | (Smalltalk classNamed:eachClassName) isNil] |
|
4738 |
thenDo:[:eachClassName | |
|
4739 |
putDependencyForClassBaseNameBlock value:(self filenameForClass:eachClassName). |
|
4740 |
s nextPutLine:' $(STCHDR)'. |
|
4741 |
]. |
|
4742 |
||
4743 |
self hasExtensionMethods ifTrue:putDependencyForExtensionsBlock. |
|
4744 |
] |
|
9887 | 4745 |
|
4746 |
" |
|
4747 |
stx_libbasic3 generateDependencies:#unix |
|
10010 | 4748 |
stx_libbasic3 generateDependencies:#win32 |
4749 |
" |
|
4750 |
||
9887 | 4751 |
"Created: / 14-09-2006 / 12:38:57 / cg" |
13798
894c48237cd5
changed: #generateDependencies:
Claus Gittinger <cg@exept.de>
parents:
13797
diff
changeset
|
4752 |
"Modified: / 27-10-2011 / 16:35:59 / cg" |
16163 | 4753 |
"Modified: / 27-02-2014 / 22:34:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9887 | 4754 |
! |
4755 |
||
4756 |
generateDependencies_unix |
|
4757 |
^ self generateDependencies:#unix |
|
4758 |
||
4759 |
" |
|
4760 |
stx_libbasic3 generateDependencies:#unix |
|
4761 |
stx_libbasic3 generateDependencies:#win32 |
|
4762 |
" |
|
4763 |
||
4764 |
"Modified: / 14-09-2006 / 13:32:34 / cg" |
|
4765 |
! |
|
4766 |
||
4767 |
generateDependencies_win32 |
|
4768 |
^ self generateDependencies:#win32 |
|
4769 |
||
4770 |
"Created: / 14-09-2006 / 12:39:18 / cg" |
|
4771 |
! |
|
4772 |
||
19309 | 4773 |
generateExternalDeclarationLines_libInit_dot_cc |
4774 |
"for the init-file: generate a single external definition for a single class for the definition class itself" |
|
4775 |
||
4776 |
^ self |
|
23124 | 4777 |
generateClassLines:(self classExternalDeclarationLine_libInit_dot_cc) |
19309 | 4778 |
|
4779 |
" |
|
4780 |
stx_libbasic generateExternalDeclarationLines_libInit_dot_cc |
|
4781 |
" |
|
4782 |
! |
|
4783 |
||
9956 | 4784 |
generateLocalIncludes_unix |
4785 |
^ String streamContents:[:s | |
|
23124 | 4786 |
s nextPutAll:(self localIncludes_unix). |
4787 |
self searchForProjectsWhichProvideHeaderFiles asSortedCollection |
|
4788 |
do:[:includeProject | |
|
4789 |
s nextPutAll:' -I$(INCLUDE_TOP)/',(self topRelativePathToPackage:includeProject withSeparator:'/') |
|
4790 |
] |
|
9956 | 4791 |
] |
4792 |
||
4793 |
" |
|
4794 |
bosch_dapasx generateLocalIncludes_unix |
|
13419 | 4795 |
bosch_dapasx_datenbasis generateLocalIncludes_unix |
4796 |
stx_libbasic generateLocalIncludes_unix |
|
4797 |
stx_libview generateLocalIncludes_unix |
|
4798 |
stx_libtool2 generateLocalIncludes_unix |
|
4799 |
stx_libui generateLocalIncludes_unix |
|
14939 | 4800 |
cg_demos_helloWorld localIncludes_unix |
9956 | 4801 |
" |
4802 |
||
4803 |
"Created: / 09-08-2006 / 16:46:49 / fm" |
|
10251 | 4804 |
"Modified: / 07-12-2006 / 17:47:06 / cg" |
15950 | 4805 |
"Modified: / 25-11-2013 / 16:40:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9956 | 4806 |
! |
4807 |
||
9887 | 4808 |
generateLocalIncludes_win32 |
4809 |
^ String streamContents:[:s | |
|
23124 | 4810 |
s nextPutAll:(self localIncludes_win32). |
4811 |
self searchForProjectsWhichProvideHeaderFiles asSortedCollection |
|
4812 |
do:[:includeProject | |
|
4813 |
s nextPutAll:' -I$(INCLUDE_TOP)\',(self topRelativePathToPackage:includeProject withSeparator:'\') |
|
4814 |
] |
|
9887 | 4815 |
] |
4816 |
||
4817 |
" |
|
4818 |
bosch_dapasx_application generateLocalIncludes_win32 |
|
13419 | 4819 |
bosch_dapasx_datenbasis generateLocalIncludes_win32 |
4820 |
stx_libbasic generateLocalIncludes_win32 |
|
4821 |
stx_libview generateLocalIncludes_win32 |
|
4822 |
stx_libtool2 generateLocalIncludes_win32 |
|
9887 | 4823 |
" |
4824 |
||
4825 |
"Created: / 09-08-2006 / 16:46:49 / fm" |
|
10251 | 4826 |
"Modified: / 07-12-2006 / 17:47:10 / cg" |
15950 | 4827 |
"Modified: / 25-11-2013 / 16:40:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9887 | 4828 |
! |
4829 |
||
13419 | 4830 |
generateObjects_make_dot_spec |
12545 | 4831 |
|classNamesDict| |
4832 |
||
4833 |
classNamesDict := self classNamesByCategory. |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
4834 |
|
9817 | 4835 |
^ String streamContents:[:s | |
23124 | 4836 |
|putLineForClassName| |
4837 |
||
4838 |
putLineForClassName := |
|
4839 |
[:eachClassName | |
|
4840 |
|mappings newObjectLine| |
|
4841 |
mappings := self objectLine_make_dot_spec_mappings: eachClassName. |
|
4842 |
newObjectLine := self replaceMappings: mappings in: self objectLine_make_dot_spec. |
|
4843 |
s nextPutLine:newObjectLine. |
|
4844 |
]. |
|
4845 |
||
4846 |
classNamesDict keysAndValuesDo:[:eachCategory :classNames| |
|
4847 |
s nextPutLine:eachCategory,'_OBJS= \'. |
|
4848 |
classNames do:putLineForClassName. |
|
4849 |
(eachCategory = 'COMMON' and:[self hasExtensionMethods]) ifTrue:[ |
|
4850 |
s nextPutLine:' $(OUTDIR)extensions.$(O) \'. |
|
4851 |
]. |
|
4852 |
||
4853 |
s cr. |
|
4854 |
]. |
|
4855 |
s cr. |
|
12545 | 4856 |
]. |
9817 | 4857 |
|
4858 |
" |
|
12545 | 4859 |
stx_libbasic generateObjects_make_dot_spec |
9817 | 4860 |
stx_libbasic3 generateObjects_make_dot_spec |
12545 | 4861 |
stx_libview generateObjects_make_dot_spec |
4862 |
stx_libboss generateObjects_make_dot_spec |
|
9817 | 4863 |
" |
4864 |
||
4865 |
"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
|
4866 |
"Modified: / 20-10-2006 / 16:18:54 / cg" |
9887 | 4867 |
! |
4868 |
||
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4869 |
generateRequiredMakePrerequisites_bc_dot_mak |
11380
ac50ce4321b5
Fix prerequisite makes (pushd)
Stefan Vogel <sv@exept.de>
parents:
11377
diff
changeset
|
4870 |
|myProjectId| |
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4871 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4872 |
^ String streamContents:[:s | |
23124 | 4873 |
myProjectId := self package. |
4874 |
"Note: the trailing blank in 'CFLAGS_LOCAL=$(GLOBALDEFINES) ' |
|
4875 |
is required!! |
|
4876 |
Use 'pushd' instead of 'cd', since cd is executed by borland make directly. |
|
4877 |
'popd' is not needed, since each line is executed in |
|
4878 |
an own cmd.exe process. |
|
4879 |
'popd' is not desireable, since it masks a possible |
|
4880 |
error return from the 'bmake'. |
|
4881 |
" |
|
4882 |
||
4883 |
"cg: changed to not go and remake librun" |
|
4884 |
(self allPreRequisitesSorted:#effectiveMandatoryPreRequisites "#effectivePreRequisites") do:[:eachProjectId | |
|
4885 |
s tab; nextPutAll:'pushd '; |
|
4886 |
nextPutAll:(self msdosPathToPackage:eachProjectId from:myProjectId); |
|
4887 |
nextPutLine:' & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "'. |
|
4888 |
]. |
|
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4889 |
]. |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4890 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4891 |
" |
13419 | 4892 |
exept_expecco_application generateRequiredMakePrerequisites_bc_dot_mak |
4893 |
alspa_batch_application generateRequiredMakePrerequisites_bc_dot_mak |
|
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4894 |
" |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4895 |
! |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4896 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4897 |
generateRequiredMakePrerequisites_make_dot_proto |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4898 |
|libPath| |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4899 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4900 |
^ String streamContents:[:s | |
23858 | 4901 |
"cg: changed to not go and remake librun" |
4902 |
(self allPreRequisitesSorted:#effectiveMandatoryPreRequisites "#effectivePreRequisites") do:[:projectID | |
|
4903 |
libPath := self pathToPackage:projectID withSeparator:'/'. |
|
4904 |
s tab; nextPutAll: 'cd ', libPath; nextPutLine:' && $(MAKE) $(MAKE_ARGS) "CFLAGS_LOCAL=$(GLOBALDEFINES) "'. |
|
4905 |
]. |
|
4906 |
||
4907 |
s cr. |
|
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4908 |
]. |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4909 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4910 |
" |
13419 | 4911 |
exept_expecco_application generateRequiredMakePrerequisites_make_dot_proto |
4912 |
alspa_batch_application generateRequiredMakePrerequisites_make_dot_proto |
|
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4913 |
" |
19290 | 4914 |
|
4915 |
"Modified: / 03-03-2016 / 21:23:31 / cg" |
|
23858 | 4916 |
"Modified: / 08-03-2019 / 12:12:43 / Claus Gittinger" |
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4917 |
! |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
4918 |
|
14882 | 4919 |
generateRequiredMakeReferences_bc_dot_mak |
4920 |
|myProjectId preRequisites| |
|
4921 |
||
4922 |
myProjectId := self package. |
|
4923 |
"Note: the trailing blank in 'CFLAGS_LOCAL=$(GLOBALDEFINES) ' |
|
4924 |
is required!! |
|
4925 |
Use 'pushd' instead of 'cd', since cd is executed by borland make directly. |
|
4926 |
'popd' is not needed, since each line is executed in |
|
23124 | 4927 |
an own cmd.exe process. |
14882 | 4928 |
'popd' is not desierable, since it masks a possible |
23124 | 4929 |
error return from the 'bmake'. |
14882 | 4930 |
" |
4931 |
||
4932 |
preRequisites := self allPreRequisitesSorted:#effectivePreRequisites. |
|
4933 |
"these have been already built in preReq" |
|
4934 |
preRequisites removeAllFoundIn:(self allPreRequisites:#mandatoryPreRequisites). |
|
4935 |
||
4936 |
^ String streamContents:[:s | |
|
23124 | 4937 |
preRequisites do:[:eachProjectId | |
4938 |
s tab; nextPutAll:'pushd '; |
|
4939 |
nextPutAll:(self msdosPathToPackage:eachProjectId from:myProjectId); |
|
4940 |
nextPutLine:' & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "'. |
|
4941 |
]. |
|
14882 | 4942 |
]. |
4943 |
||
4944 |
" |
|
4945 |
exept_expecco_application generateRequiredMakeReferences_bc_dot_mak |
|
4946 |
alspa_batch_application generateRequiredMakeReferences_bc_dot_mak |
|
4947 |
" |
|
4948 |
! |
|
4949 |
||
4950 |
generateRequiredMakeReferences_make_dot_proto |
|
4951 |
|libPath preRequisites| |
|
4952 |
||
4953 |
preRequisites := self allPreRequisitesSorted:#effectivePreRequisites. |
|
4954 |
"these have been already built in preReq" |
|
4955 |
preRequisites removeAllFoundIn:(self allPreRequisites:#mandatoryPreRequisites). |
|
4956 |
||
4957 |
^ String streamContents:[:s | |
|
23858 | 4958 |
preRequisites do:[:projectID | |
4959 |
libPath := self pathToPackage:projectID withSeparator:'/'. |
|
4960 |
s tab; nextPutAll: 'cd ', libPath; nextPutLine:' && $(MAKE) $(MAKE_ARGS) "CFLAGS_LOCAL=$(GLOBALDEFINES) "'. |
|
4961 |
]. |
|
4962 |
||
4963 |
s cr. |
|
14882 | 4964 |
]. |
4965 |
||
4966 |
" |
|
4967 |
exept_expecco_application generateRequiredMakeReferences_make_dot_proto |
|
4968 |
alspa_batch_application generateRequiredMakeReferences_make_dot_proto |
|
4969 |
" |
|
19290 | 4970 |
|
4971 |
"Modified: / 03-03-2016 / 21:23:45 / cg" |
|
23858 | 4972 |
"Modified: / 08-03-2019 / 12:12:52 / Claus Gittinger" |
14882 | 4973 |
! |
4974 |
||
10022 | 4975 |
generateSubDirectories |
4976 |
^ String streamContents:[:s | |
|
23124 | 4977 |
self subProjects |
4978 |
do:[:eachProjectID | |
|
4979 |
s space; nextPutAll:(self pathToPackage:eachProjectID from:self package withSeparator:'/') |
|
4980 |
] |
|
10022 | 4981 |
] |
4982 |
||
4983 |
" |
|
10380
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
4984 |
exept_expecco generateSubDirectories |
10022 | 4985 |
" |
4986 |
||
4987 |
"Created: / 09-08-2006 / 11:26:59 / fm" |
|
4988 |
"Modified: / 14-09-2006 / 18:46:18 / cg" |
|
4989 |
! |
|
4990 |
||
12771
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4991 |
generate_definitionClassLine_libInit_dot_cc |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
4992 |
"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
|
4993 |
|
13419 | 4994 |
^ self |
23124 | 4995 |
generateClassLines:(self classLine_libInit_dot_cc) |
4996 |
forClasses:(Array with:self name) |
|
4997 |
includeAdditionalClasses:false |
|
12804
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4998 |
|
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
4999 |
" |
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
5000 |
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
|
5001 |
" |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
5002 |
! |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
5003 |
|
10022 | 5004 |
headerFileOutputArg |
20590 | 5005 |
"Every header file is left locally in its lib-dir" |
5006 |
||
13875
2e01d09fa4c4
-headerDir= instead of --headerDir=
Claus Gittinger <cg@exept.de>
parents:
13873
diff
changeset
|
5007 |
^ '-headerDir=.' |
10022 | 5008 |
! |
5009 |
||
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5010 |
objectLine_make_dot_spec_mappings: aClassName |
13419 | 5011 |
^ Dictionary new |
23124 | 5012 |
at: 'CLASSFILE' put:(self filenameForClass:aClassName); |
5013 |
yourself |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5014 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5015 |
"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
|
5016 |
"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
|
5017 |
"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
|
5018 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5019 |
|
9887 | 5020 |
subProjectBmakeCalls |
12439 | 5021 |
"generate submake-calls for borland bcc" |
5022 |
||
13419 | 5023 |
^ self subProjectMakeCallsUsing:'call bmake %1 %2'. |
12438
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
5024 |
! |
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
5025 |
|
14334 | 5026 |
subProjectLCCmakeCalls |
5027 |
"generate submake-calls for lcc" |
|
5028 |
||
5029 |
^ self subProjectMakeCallsUsing:'call lccmake %1 %2'. |
|
5030 |
||
5031 |
"Created: / 03-09-2012 / 19:49:08 / cg" |
|
12438
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
5032 |
! |
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
5033 |
|
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
5034 |
subProjectMakeCallsUsing:callString |
20703 | 5035 |
"for xxxmake.bat files" |
23124 | 5036 |
|
9887 | 5037 |
^ String streamContents:[:s | |
23850 | 5038 |
(self effectiveSubProjects:#win32) do:[:packageID | |
5039 |
|pkgLabel skipLabel joinLabel| |
|
5040 |
||
5041 |
pkgLabel := (packageID copyReplaceAll:$: with:$_) copyReplaceAll:$/ with:$_. |
|
5042 |
skipLabel := 'skip_',pkgLabel. |
|
5043 |
joinLabel := 'done_',pkgLabel. |
|
5044 |
s nextPutLine:'@if not exist ',(self msdosPathToPackage:packageID from:(self package)),' goto ',skipLabel. |
|
5045 |
s nextPutLine:'@echo "***********************************"'. |
|
5046 |
s nextPutLine:'@echo "Building ',(packageID copyReplaceAll:$: with:$/),'"'. |
|
5047 |
s nextPutLine:'@echo "***********************************"'. |
|
5048 |
s nextPutLine:'@pushd ', (self msdosPathToPackage:packageID from:(self package)). |
|
5049 |
s nextPutAll:'@'; nextPutAll:callString; nextPutLine:' || exit /b "%errorlevel%"'. |
|
5050 |
s nextPutLine:'@popd'. |
|
5051 |
s nextPutLine:'@goto ',joinLabel. |
|
5052 |
s nextPutLine:':',skipLabel. |
|
5053 |
s nextPutLine:'@echo "###################################"'. |
|
5054 |
s nextPutLine:'@echo "FOLDER MISSING: ',(packageID copyReplaceAll:$: with:$/),'"'. |
|
5055 |
s nextPutLine:'@echo "###################################"'. |
|
5056 |
(self nonMandatorySubProjects includes:packageID) ifTrue:[ |
|
5057 |
s nextPutLine:'@REM exit /b 1'. |
|
5058 |
s nextPutLine:'@echo "subproject is not mandatory; continue."'. |
|
5059 |
] ifFalse:[ |
|
5060 |
s nextPutLine:'exit /b 1'. |
|
5061 |
]. |
|
5062 |
s nextPutLine:':',joinLabel. |
|
5063 |
s cr. |
|
5064 |
] |
|
9887 | 5065 |
] |
5066 |
||
5067 |
"Created: / 14-09-2006 / 18:40:09 / cg" |
|
13734 | 5068 |
"Modified: / 27-09-2011 / 19:36:12 / cg" |
21259 | 5069 |
"Modified: / 17-01-2017 / 16:32:45 / stefan" |
23850 | 5070 |
"Modified: / 07-03-2019 / 17:30:46 / Claus Gittinger" |
11937 | 5071 |
! |
5072 |
||
14345 | 5073 |
subProjectMingwmakeCalls |
5074 |
"generate submake-calls for mingw" |
|
5075 |
||
5076 |
^ self subProjectMakeCallsUsing:'call mingwmake %1 %2'. |
|
5077 |
||
5078 |
"Created: / 05-09-2012 / 19:45:53 / cg" |
|
5079 |
! |
|
5080 |
||
14334 | 5081 |
subProjectTCCmakeCalls |
5082 |
"generate submake-calls for tcc" |
|
5083 |
||
5084 |
^ self subProjectMakeCallsUsing:'call tccmake %1 %2'. |
|
5085 |
||
5086 |
"Created: / 03-09-2012 / 19:50:53 / cg" |
|
5087 |
! |
|
5088 |
||
11937 | 5089 |
subProjectVCmakeCalls |
12439 | 5090 |
"generate submake-calls for visual-C" |
5091 |
||
13419 | 5092 |
^ self subProjectMakeCallsUsing:'call vcmake %1 %2'. |
9817 | 5093 |
! ! |
5094 |
||
12364 | 5095 |
!ProjectDefinition class methodsFor:'file templates'! |
5096 |
||
13177 | 5097 |
autopackage_default_dot_apspec |
5098 |
"for linux's autopackage" |
|
5099 |
||
5100 |
^ |
|
5101 |
'# -*- shell-script -*- |
|
5102 |
[Meta] |
|
5103 |
ShortName: %(APPLICATION) |
|
5104 |
SoftwareVersion: %(PRODUCT_VERSION) |
|
5105 |
DisplayName: %(DESCRIPTION) |
|
20550 | 5106 |
RootName: %(PRODUCT_ROOT_NAME) |
13177 | 5107 |
Summary: %(DESCRIPTION) |
5108 |
Maintainer: %(MAINTAINER) |
|
5109 |
Packager: %(PACKAGER) |
|
5110 |
PackageVersion: 1 |
|
20550 | 5111 |
CPUArchitectures: %(PRODUCT_CPU_VERSIONS) |
13177 | 5112 |
AutopackageTarget: 1.0 |
5113 |
Type: %(PRODUCT_TYPE) |
|
13419 | 5114 |
License: %(PRODUCT_LICENSE) |
13177 | 5115 |
|
5116 |
[Description] |
|
5117 |
%(PRODUCT_DESCRIPTION) |
|
5118 |
||
5119 |
[BuildPrepare] |
|
5120 |
# If you''re using autotools, the default should be enough. |
|
5121 |
# prepareBuild will set up apbuild and run configure for you. If you |
|
5122 |
# need to pass arguments to configure, just add them to prepareBuild: |
|
5123 |
# prepareBuild --enable-foo --disable-bar |
|
5124 |
#prepareBuild |
|
5125 |
||
5126 |
[BuildUnprepare] |
|
5127 |
# If you''re using prepareBuild above, there is no need to change this!! |
|
5128 |
#unprepareBuild |
|
5129 |
||
5130 |
[Globals] |
|
5131 |
# Variables declared in this section will be available in all other sections |
|
5132 |
export APKG_BUILD_SKIP_CONFIGURE=1 |
|
5133 |
export APKG_BUILD_SKIP_MAKE=1 |
|
5134 |
export MYPREFIX=/opt/%(APPLICATION) |
|
5135 |
||
5136 |
[Prepare] |
|
5137 |
#recommend ''@autopackage.org/autopackage-gtk'' 1 |
|
5138 |
||
5139 |
[Imports] |
|
5140 |
import <<EOF |
|
5141 |
$source_dir/%(APPLICATION) |
|
20550 | 5142 |
%(ADDITIONAL_SOURCE_DIRS) |
13177 | 5143 |
EOF |
5144 |
||
5145 |
for i in $source_dir/*.so |
|
5146 |
do |
|
5147 |
echo $source_dir/$(readlink $i) |
|
5148 |
done | import |
|
5149 |
||
5150 |
[Install] |
|
5151 |
if [ "$PREFIX" !!= "/usr" ] |
|
5152 |
then |
|
5153 |
export MYPREFIX=$PREFIX |
|
5154 |
fi |
|
5155 |
||
5156 |
find . -type d \( -name CVS -or -name ''not_*'' \) -print | xargs rm -rf |
|
5157 |
mkdir -p $MYPREFIX |
|
23440 | 5158 |
copyFiles %(PRODUCT_NAME) *.rc resources $MYPREFIX/bin |
20550 | 5159 |
%(ADDITIONAL_COPYFILES) |
5160 |
||
5161 |
#installExe %(PRODUCT_NAME) |
|
13177 | 5162 |
#installLib *.so |
20550 | 5163 |
%(ADDITIONAL_INSTALL) |
13177 | 5164 |
|
5165 |
[Uninstall] |
|
5166 |
# Leaving this at the default is safe unless you use custom commands in |
|
5167 |
# "Install" to create files. All autopackage API functions |
|
5168 |
# that installs files are logged. |
|
5169 |
uninstallFromLog |
|
5170 |
' |
|
5171 |
||
5172 |
"Created: / 21-12-2010 / 09:06:21 / cg" |
|
5173 |
! |
|
5174 |
||
12364 | 5175 |
bc_dot_mak |
5176 |
"answer a template for the bc.mak makefile. |
|
5177 |
Any variable definition %(Variable) will be later replaced by the mapping. |
|
5178 |
$% characters have to be duplicated. |
|
5179 |
Only needed for WIN" |
|
5180 |
||
5181 |
^ self subclassResponsibility |
|
5182 |
! |
|
5183 |
||
5184 |
bmake_dot_mak |
|
17186 | 5185 |
"the template code for the bmake.bat file |
5186 |
Notice: duplicate %'s if they are needed as such in the generated file" |
|
12364 | 5187 |
|
13419 | 5188 |
^ |
12364 | 5189 |
'@REM ------- |
14336 | 5190 |
@REM make using Borland bcc32 |
12364 | 5191 |
@REM type bmake, and wait... |
5192 |
@REM do not edit - automatically generated from ProjectDefinition |
|
5193 |
@REM ------- |
|
15950 | 5194 |
@SET DEFINES= |
18521 | 5195 |
|
17186 | 5196 |
make.exe -N -f bc.mak %%DEFINES%% %%* |
5197 |
||
19627 | 5198 |
%(SKIP_IF_ARG_IS_APP_TARGET) |
19594 | 5199 |
|
12364 | 5200 |
%(SUBPROJECT_BMAKE_CALLS) |
5201 |
' |
|
5202 |
||
5203 |
"Created: / 17-08-2006 / 20:04:14 / cg" |
|
14336 | 5204 |
"Modified: / 04-09-2012 / 11:46:22 / cg" |
12364 | 5205 |
! |
5206 |
||
13411 | 5207 |
builder_baseline_dot_rbspec |
5208 |
"For rake-base automatic builder" |
|
13419 | 5209 |
|
13411 | 5210 |
^ ' |
5211 |
# generated from project definition |
|
5212 |
||
5213 |
# load package dependencies |
|
5214 |
load ''package.deps.rake'' |
|
5215 |
||
5216 |
# kludge: clear some invalid dependencies of libwidg |
|
5217 |
# (should be fixed in baseline) |
|
5218 |
clear "stx:libwidg" => "stx:libui" |
|
5219 |
clear "stx:libwidg2" => "stx:libui" |
|
5220 |
||
5221 |
project :''%(APPLICATION):baseline'' do |
|
5222 |
# preamble |
|
5223 |
%(PREAMBLE) |
|
5224 |
# -------- |
|
5225 |
||
5226 |
%(PACKAGES) |
|
5227 |
||
5228 |
application "%(APPLICATION_PACKAGE)" |
|
5229 |
||
5230 |
# postamble |
|
5231 |
%(POSTABLE) |
|
5232 |
# --------- |
|
5233 |
||
5234 |
end |
|
5235 |
' |
|
5236 |
||
5237 |
"Created: / 24-02-2011 / 11:39:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5238 |
"Modified: / 27-02-2011 / 12:42:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5239 |
! |
|
5240 |
||
5241 |
builder_baseline_dot_rbspec_postamble |
|
5242 |
^ '' |
|
5243 |
||
5244 |
"Created: / 24-02-2011 / 11:58:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5245 |
! |
|
5246 |
||
5247 |
builder_baseline_dot_rbspec_preamble |
|
5248 |
^ '' |
|
5249 |
||
5250 |
"Created: / 24-02-2011 / 11:58:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5251 |
! |
|
5252 |
||
19309 | 5253 |
classExternalDeclarationLine_libInit_dot_cc |
5254 |
||
5255 |
^'extern void _%(CLASS)_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);' |
|
5256 |
! |
|
5257 |
||
12364 | 5258 |
classLine_libInit_dot_cc |
5259 |
||
19309 | 5260 |
^' _%(CLASS)_Init(pass,__pRT__,snd);' |
12364 | 5261 |
|
5262 |
"Created: / 08-08-2006 / 12:51:44 / fm" |
|
5263 |
"Modified: / 08-08-2006 / 15:46:05 / fm" |
|
5264 |
! |
|
5265 |
||
20582 | 5266 |
generate_osx_info_dot_plist |
20567 | 5267 |
"template for the info.plist file, which is included in an OS X deployment" |
23124 | 5268 |
|
20567 | 5269 |
|plist| |
5270 |
||
20582 | 5271 |
(plist := self osx_info_dot_plist_dictionary) isNil ifTrue:[^ nil]. |
20586 | 5272 |
MacPlistXMLCoder isNil ifTrue:[ |
23124 | 5273 |
Smalltalk loadPackage:'stx:goodies/xml/stx'. |
5274 |
Smalltalk loadPackage:'stx:goodies/fileformats/plist'. |
|
5275 |
]. |
|
5276 |
^ MacPlistXMLCoder encode:plist |
|
20567 | 5277 |
|
5278 |
" |
|
5279 |
exept_expecco_application info_dot_plist |
|
5280 |
" |
|
5281 |
! |
|
5282 |
||
14334 | 5283 |
lccmake_dot_mak |
5284 |
"the template code for the lccmake.bat file" |
|
12364 | 5285 |
|
13419 | 5286 |
^ |
12364 | 5287 |
'@REM ------- |
5288 |
@REM make using lcc compiler |
|
14334 | 5289 |
@REM type lccmake, and wait... |
12364 | 5290 |
@REM do not edit - automatically generated from ProjectDefinition |
5291 |
@REM ------- |
|
14361 | 5292 |
make.exe -N -f bc.mak -DUSELCC=1 %%* |
12364 | 5293 |
|
19627 | 5294 |
%(SKIP_IF_ARG_IS_APP_TARGET) |
19595 | 5295 |
|
12364 | 5296 |
%(SUBPROJECT_LCCMAKE_CALLS) |
5297 |
' |
|
14334 | 5298 |
|
5299 |
"Created: / 03-09-2012 / 19:49:23 / cg" |
|
12364 | 5300 |
! |
5301 |
||
5302 |
make_dot_proto |
|
5303 |
"the template code for the make.proto file" |
|
5304 |
||
5305 |
^ self subclassResponsibility |
|
5306 |
! |
|
5307 |
||
5308 |
make_dot_spec |
|
5309 |
||
13419 | 5310 |
^ |
12364 | 5311 |
'# $','Header','$ |
5312 |
# |
|
13419 | 5313 |
# DO NOT EDIT |
14248 | 5314 |
# automagically generated from the projectDefinition: ',self name,"' at ',Timestamp now printString,"'. |
12364 | 5315 |
# |
5316 |
# Warning: once you modify this file, do not rerun |
|
5317 |
# stmkmp or projectDefinition-build again - otherwise, your changes are lost. |
|
5318 |
# |
|
5319 |
# This file contains specifications which are common to all platforms. |
|
5320 |
# |
|
5321 |
||
5322 |
# Do NOT CHANGE THESE DEFINITIONS |
|
5323 |
# (otherwise, ST/X will have a hard time to find out the packages location from its packageID, |
|
5324 |
# to find the source code of a class and to find the library for a package) |
|
5325 |
MODULE=%(MODULE) |
|
5326 |
MODULE_DIR=%(MODULE_DIRECTORY) |
|
5327 |
PACKAGE=$(MODULE):$(MODULE_DIR) |
|
5328 |
||
5329 |
||
5330 |
# Argument(s) to the stc compiler (stc --usage). |
|
13875
2e01d09fa4c4
-headerDir= instead of --headerDir=
Claus Gittinger <cg@exept.de>
parents:
13873
diff
changeset
|
5331 |
# -headerDir=. : create header files locally |
12364 | 5332 |
# (if removed, they will be created as common |
5333 |
# -Pxxx : defines the package |
|
5334 |
# -Zxxx : a prefix for variables within the classLib |
|
20152 | 5335 |
# -Dxxx : defines passed to CC for inline C-code |
12364 | 5336 |
# -Ixxx : include path passed to CC for inline C-code |
5337 |
# +optspace : optimized for space |
|
5338 |
# +optspace2 : optimized more for space |
|
5339 |
# +optspace3 : optimized even more for space |
|
5340 |
# +optinline : generate inline code for some ST constructs |
|
5341 |
# +inlineNew : additionally inline new |
|
5342 |
# +inlineMath : additionally inline some floatPnt math stuff |
|
5343 |
# |
|
5344 |
# ********** OPTIONAL: MODIFY the next line(s) *** |
|
5345 |
# STCLOCALOPTIMIZATIONS=+optinline +inlineNew |
|
5346 |
# STCLOCALOPTIMIZATIONS=+optspace3 |
|
5347 |
STCLOCALOPTIMIZATIONS=%(STCOPTIMIZATIONOPTIONS) |
|
5348 |
||
5349 |
||
5350 |
# Argument(s) to the stc compiler (stc --usage). |
|
5351 |
# -warn : no warnings |
|
5352 |
# -warnNonStandard : no warnings about ST/X extensions |
|
5353 |
# -warnEOLComments : no warnings about EOL comment extension |
|
5354 |
# -warnPrivacy : no warnings about privateClass extension |
|
17070 | 5355 |
# -warnUnused : no warnings about unused variables |
12364 | 5356 |
# |
5357 |
# ********** OPTIONAL: MODIFY the next line(s) *** |
|
5358 |
# STCWARNINGS=-warn |
|
5359 |
# STCWARNINGS=-warnNonStandard |
|
5360 |
# STCWARNINGS=-warnEOLComments |
|
5361 |
STCWARNINGS=%(STCWARNINGOPTIONS) |
|
5362 |
||
12545 | 5363 |
%(CLASSES) |
5364 |
||
12364 | 5365 |
%(OBJECTS) |
5366 |
' |
|
5367 |
||
5368 |
"Created: / 08-08-2006 / 19:31:29 / fm" |
|
5369 |
"Modified: / 09-08-2006 / 15:10:57 / fm" |
|
14248 | 5370 |
"Modified: / 26-07-2012 / 00:56:03 / cg" |
12364 | 5371 |
! |
5372 |
||
12428 | 5373 |
makefile |
13419 | 5374 |
^ |
12428 | 5375 |
'# |
13419 | 5376 |
# DO NOT EDIT |
12428 | 5377 |
# |
13419 | 5378 |
# make uses this file (Makefile) only, if there is no |
12428 | 5379 |
# file named "makefile" (lower-case m) in the same directory. |
5380 |
# My only task is to generate the real makefile and call make again. |
|
5381 |
# Thereafter, I am no longer used and needed. |
|
5382 |
# |
|
15201 | 5383 |
# MACOSX caveat: |
5384 |
# as filenames are not case sensitive (in a default setup), |
|
15385 | 5385 |
# we cannot use the above trick. Therefore, this file is now named |
15201 | 5386 |
# "Makefile.init", and you have to execute "make -f Makefile.init" to |
5387 |
# get the initial makefile. This is now also done by the toplevel CONFIG |
|
5388 |
# script. |
|
12428 | 5389 |
|
5390 |
.PHONY: run |
|
5391 |
||
5392 |
run: makefile |
|
23124 | 5393 |
$(MAKE) -f makefile |
12428 | 5394 |
|
5395 |
#only needed for the definition of $(TOP) |
|
5396 |
include Make.proto |
|
5397 |
||
14665 | 5398 |
makefile: mf |
5399 |
||
5400 |
mf: |
|
23124 | 5401 |
$(TOP)/rules/stmkmf |
12428 | 5402 |
' |
5403 |
! |
|
5404 |
||
14345 | 5405 |
mingwmake_dot_mak |
5406 |
"the template code for the mingwmake.bat file" |
|
5407 |
||
5408 |
^ |
|
5409 |
'@REM ------- |
|
5410 |
@REM make using mingw gnu compiler |
|
5411 |
@REM type mingwmake, and wait... |
|
5412 |
@REM do not edit - automatically generated from ProjectDefinition |
|
5413 |
@REM ------- |
|
15950 | 5414 |
@SET DEFINES= |
14642 | 5415 |
|
14850 | 5416 |
@pushd %(TOP)\rules |
5417 |
@call find_mingw.bat |
|
5418 |
@popd |
|
15950 | 5419 |
make.exe -N -f bc.mak %DEFINES% %%USEMINGW_ARG%% %%* |
14345 | 5420 |
|
19627 | 5421 |
%(SKIP_IF_ARG_IS_APP_TARGET) |
19595 | 5422 |
|
14345 | 5423 |
%(SUBPROJECT_MINGWMAKE_CALLS) |
5424 |
' |
|
5425 |
||
5426 |
"Created: / 05-09-2012 / 19:44:51 / cg" |
|
15950 | 5427 |
"Modified: / 19-03-2013 / 08:54:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14345 | 5428 |
! |
5429 |
||
12364 | 5430 |
objectLine_make_dot_spec |
5431 |
||
21236 | 5432 |
^' $(OUTDIR)%(CLASSFILE).$(O) \' |
12364 | 5433 |
|
5434 |
"Created: / 08-08-2006 / 20:16:46 / fm" |
|
5435 |
"Modified: / 23-08-2006 / 11:11:38 / cg" |
|
5436 |
! |
|
5437 |
||
20582 | 5438 |
osx_info_dot_plist_dictionary |
5439 |
"template for the info.plist file, which is included in an OS X deployment" |
|
23124 | 5440 |
|
20582 | 5441 |
|plist pkg icnFilename docTypeDescriptions| |
23124 | 5442 |
|
20582 | 5443 |
plist := Dictionary new. |
5444 |
plist at:'CFBundleInfoDictionaryVersion' put:'6.0'. |
|
5445 |
pkg := self package copyReplaceAny:':/' with:$.. |
|
5446 |
(pkg endsWith:'.application') ifTrue:[ |
|
23124 | 5447 |
pkg := pkg copyButLast:'.application' size. |
5448 |
]. |
|
20582 | 5449 |
plist at:'CFBundleIdentifier' put:pkg. |
5450 |
plist at:'CFBundleShortVersionString' put:(self fileVersion asString). |
|
5451 |
plist at:'CFBundleVersion' put:(self fileVersion asString). |
|
5452 |
plist at:'LSMinimumSystemVersion' put:'10.6'. |
|
5453 |
"/ plist at:'CFBundleDevelopmentRegion' put:'English'. |
|
20601 | 5454 |
plist at:'CFBundleExecutable' put:(self applicationName). |
23124 | 5455 |
|
20582 | 5456 |
self isLibraryDefinition ifTrue:[ |
23124 | 5457 |
plist at:'CFBundleName' put:(self package copyReplaceAny:':/' with:$.). |
20582 | 5458 |
] ifFalse:[ |
23124 | 5459 |
plist at:'CFBundleName' put:(self applicationName). |
5460 |
plist at:'CFBundlePackageType' put:'APPL'. |
|
5461 |
]. |
|
5462 |
||
5463 |
(icnFilename := self applicationIconFileNameOSX) notNil ifTrue:[ |
|
5464 |
plist at:'CFBundleIconFile' put:icnFilename. |
|
20582 | 5465 |
]. |
5466 |
(docTypeDescriptions := self applicationDocumentTypeDescriptions) notNil ifTrue:[ |
|
23124 | 5467 |
plist at:'CFBundleDocumentTypes' put: |
5468 |
(docTypeDescriptions collect:[:each | |
|
5469 |
|d| |
|
5470 |
d := Dictionary new. |
|
5471 |
d at:'CFBundleTypeExtensions' put:{ each extension }. |
|
5472 |
d at:'CFBundleTypeIconFile' put:{ each iconFileOSX }. |
|
5473 |
d at:'CFBundleTypeMimeTypes' put:{ each mimeType }. |
|
5474 |
d at:'CFBundleTypeName' put:(each documentTypeName). |
|
5475 |
d at:'CFBundleTypeRole' put:'Editor'. |
|
5476 |
d |
|
5477 |
]). |
|
5478 |
]. |
|
20582 | 5479 |
^ plist |
5480 |
||
5481 |
" |
|
5482 |
exept_expecco_application info_dot_plist |
|
5483 |
" |
|
21562 | 5484 |
|
5485 |
"Modified (format): / 24-02-2017 / 09:35:09 / cg" |
|
20582 | 5486 |
! |
5487 |
||
12364 | 5488 |
packageName_dot_rc |
5489 |
"the template code for the <libName>.rc file. |
|
5490 |
Only used for WIN" |
|
5491 |
||
13419 | 5492 |
^ |
12364 | 5493 |
'// |
13419 | 5494 |
// DO NOT EDIT |
12364 | 5495 |
// automagically generated from the projectDefinition: ',self name,'. |
5496 |
// |
|
5497 |
VS_VERSION_INFO VERSIONINFO |
|
5498 |
FILEVERSION %(FILE_VERSION_COMMASEPARATED) |
|
5499 |
PRODUCTVERSION %(PRODUCT_VERSION_COMMASEPARATED) |
|
13769
8259f3bf7fa2
changed: #packageName_dot_rc
Claus Gittinger <cg@exept.de>
parents:
13763
diff
changeset
|
5500 |
#if (__BORLANDC__) |
12364 | 5501 |
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE |
5502 |
FILEFLAGS VS_FF_PRERELEASE | VS_FF_SPECIALBUILD |
|
5503 |
FILEOS VOS_NT_WINDOWS32 |
|
5504 |
FILETYPE %(FILETYPE) |
|
5505 |
FILESUBTYPE VS_USER_DEFINED |
|
13769
8259f3bf7fa2
changed: #packageName_dot_rc
Claus Gittinger <cg@exept.de>
parents:
13763
diff
changeset
|
5506 |
#endif |
12364 | 5507 |
|
5508 |
BEGIN |
|
5509 |
BLOCK "StringFileInfo" |
|
5510 |
BEGIN |
|
5511 |
BLOCK "040904E4" |
|
5512 |
BEGIN |
|
5513 |
VALUE "CompanyName", "%(COMPANY_NAME)\0" |
|
5514 |
VALUE "FileDescription", "%(FILE_DESCRIPTION)\0" |
|
5515 |
VALUE "FileVersion", "%(FILE_VERSION)\0" |
|
5516 |
VALUE "InternalName", "%(INTERNAL_NAME)\0" |
|
5517 |
%(LEGAL_COPYRIGHT_LINE) |
|
5518 |
VALUE "ProductName", "%(PRODUCT_NAME)\0" |
|
5519 |
VALUE "ProductVersion", "%(PRODUCT_VERSION)\0" |
|
5520 |
VALUE "ProductDate", "%(PRODUCT_DATE)\0" |
|
5521 |
END |
|
5522 |
||
5523 |
END |
|
5524 |
||
5525 |
BLOCK "VarFileInfo" |
|
5526 |
BEGIN // Language | Translation |
|
5527 |
VALUE "Translation", 0x409, 0x4E4 // U.S. English, Windows Multilingual |
|
5528 |
END |
|
5529 |
END |
|
5530 |
' |
|
5531 |
" |
|
5532 |
stx_libbasic3 packageName_dot_rc |
|
5533 |
stx_libbasic3 generate_packageName_dot_rc |
|
5534 |
" |
|
5535 |
||
5536 |
"Created: / 08-08-2006 / 19:31:29 / fm" |
|
5537 |
"Modified: / 09-08-2006 / 15:10:57 / fm" |
|
13769
8259f3bf7fa2
changed: #packageName_dot_rc
Claus Gittinger <cg@exept.de>
parents:
13763
diff
changeset
|
5538 |
"Modified: / 07-10-2011 / 10:51:34 / cg" |
12364 | 5539 |
! |
5540 |
||
13411 | 5541 |
package_dot_deps_dot_rake |
5542 |
^ ' |
|
5543 |
# Package dependencies. |
|
21753 | 5544 |
# Automatically generated by project definition. |
13411 | 5545 |
|
5546 |
%(DEPENDENCIES) |
|
5547 |
||
5548 |
' |
|
5549 |
||
5550 |
"Created: / 24-02-2011 / 22:32:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
21753 | 5551 |
"Modified: / 17-05-2017 / 12:35:21 / mawalch" |
13411 | 5552 |
! |
5553 |
||
14334 | 5554 |
tccmake_dot_mak |
5555 |
"the template code for the tccmake.bat file" |
|
5556 |
||
5557 |
^ |
|
5558 |
'@REM ------- |
|
14336 | 5559 |
@REM make using tcc compiler (Tiny-C) |
14334 | 5560 |
@REM type tccmake, and wait... |
5561 |
@REM do not edit - automatically generated from ProjectDefinition |
|
5562 |
@REM ------- |
|
14361 | 5563 |
make.exe -N -f bc.mak -DUSETCC=1 %%* |
14334 | 5564 |
|
19627 | 5565 |
%(SKIP_IF_ARG_IS_APP_TARGET) |
19596 | 5566 |
|
5567 |
||
14334 | 5568 |
%(SUBPROJECT_TCCMAKE_CALLS) |
5569 |
' |
|
5570 |
||
5571 |
"Created: / 03-09-2012 / 19:50:41 / cg" |
|
5572 |
! |
|
5573 |
||
12364 | 5574 |
vcmake_dot_mak |
5575 |
"the template code for the vcmake.bat file" |
|
5576 |
||
13419 | 5577 |
^ |
12364 | 5578 |
'@REM ------- |
14336 | 5579 |
@REM make using Microsoft Visual C compiler |
12364 | 5580 |
@REM type vcmake, and wait... |
5581 |
@REM do not edit - automatically generated from ProjectDefinition |
|
5582 |
@REM ------- |
|
13789 | 5583 |
|
5584 |
@if not defined VSINSTALLDIR ( |
|
14850 | 5585 |
pushd %(TOP)\rules |
5586 |
call vcsetup.bat |
|
5587 |
popd |
|
13789 | 5588 |
) |
15950 | 5589 |
@SET DEFINES= |
18521 | 5590 |
|
15950 | 5591 |
make.exe -N -f bc.mak -DUSEVC=1 %DEFINES% %* |
5592 |
||
19627 | 5593 |
%(SKIP_IF_ARG_IS_APP_TARGET) |
15950 | 5594 |
|
12364 | 5595 |
%(SUBPROJECT_VCMAKE_CALLS) |
5596 |
' |
|
12966 | 5597 |
|
14336 | 5598 |
"Modified: / 04-09-2012 / 11:45:49 / cg" |
12364 | 5599 |
! ! |
5600 |
||
5601 |
!ProjectDefinition class methodsFor:'loading'! |
|
5602 |
||
19905 | 5603 |
checkForLoad |
21563 | 5604 |
"raise an error, if the package is not suitable for loading" |
19905 | 5605 |
|
23746 | 5606 |
|m| |
5607 |
||
19905 | 5608 |
self supportedOnPlatform ifFalse:[ |
23681 | 5609 |
PackageNotCompatibleError |
5610 |
raiseRequestWith:self package |
|
5611 |
errorString:(self reasonForNotSupportedOnPlatform) |
|
19905 | 5612 |
]. |
21563 | 5613 |
|
23746 | 5614 |
"/ check for an uncompiled method in the dictionary |
5615 |
"/ happens if an incompatible library is loaded. |
|
5616 |
(m := self class compiledMethodAt:#mandatoryPreRequisites) notNil ifTrue:[ |
|
5617 |
m isExecutable ifFalse:[ |
|
5618 |
PackageNotCompatibleError |
|
5619 |
raiseRequestWith:self package |
|
5620 |
errorString:'package is incompatible (needs recompilation)' |
|
5621 |
]. |
|
5622 |
]. |
|
5623 |
||
21563 | 5624 |
"Modified (comment): / 24-02-2017 / 10:06:44 / cg" |
23746 | 5625 |
"Modified: / 19-02-2019 / 16:24:25 / Claus Gittinger" |
19905 | 5626 |
! |
5627 |
||
12397 | 5628 |
ensureFullyLoaded |
5629 |
"ensure that all classes and extensions are loaded properly. |
|
5630 |
This is normally no problem for compiled classLibs - however, if a package |
|
5631 |
has only be installedAsAutoloaded, some classes might want to ensure that |
|
5632 |
when being loaded themself." |
|
5633 |
||
16892 | 5634 |
self supportedOnPlatform ifFalse:[^ self]. |
5635 |
||
12397 | 5636 |
self hasAllExtensionsLoaded ifFalse:[ |
23124 | 5637 |
self breakPoint:#cg. |
12397 | 5638 |
]. |
5639 |
self hasAllClassesFullyLoaded ifFalse:[ |
|
23124 | 5640 |
self hasAllClassesLoaded ifFalse:[ |
5641 |
self breakPoint:#cg. |
|
5642 |
]. |
|
5643 |
self installAutoloadedClasses. |
|
5644 |
self classes do:[:cls | cls autoload ]. |
|
12397 | 5645 |
]. |
5646 |
||
5647 |
" |
|
5648 |
stx_libbasic ensureFullyLoaded |
|
5649 |
" |
|
12731 | 5650 |
"Verbose := true |
5651 |
stx_libjavascript hasAllExtensionsLoaded |
|
5652 |
" |
|
12735
215f7514f56b
comment/format in: #ensureFullyLoaded
Claus Gittinger <cg@exept.de>
parents:
12731
diff
changeset
|
5653 |
"Verbose := true |
215f7514f56b
comment/format in: #ensureFullyLoaded
Claus Gittinger <cg@exept.de>
parents:
12731
diff
changeset
|
5654 |
stx_goodies_soap_xe hasAllExtensionsLoaded |
215f7514f56b
comment/format in: #ensureFullyLoaded
Claus Gittinger <cg@exept.de>
parents:
12731
diff
changeset
|
5655 |
" |
13689
9d93d5e56029
changed: #ensureFullyLoaded
Claus Gittinger <cg@exept.de>
parents:
13688
diff
changeset
|
5656 |
|
9d93d5e56029
changed: #ensureFullyLoaded
Claus Gittinger <cg@exept.de>
parents:
13688
diff
changeset
|
5657 |
"Modified: / 12-09-2011 / 16:57:53 / cg" |
12397 | 5658 |
! |
5659 |
||
12364 | 5660 |
load |
5661 |
"load the project |
|
13419 | 5662 |
Answer true, if new classes have been installed for this package, |
12364 | 5663 |
false if the package's classes have been already present." |
5664 |
||
5665 |
^ self loadAsAutoloaded:false. |
|
5666 |
! |
|
5667 |
||
5668 |
loadAsAutoloaded:asAutoloaded |
|
5669 |
"load the project. |
|
5670 |
If asAutoloaded == true, install all new classes as autoloaded. |
|
5671 |
Answer true, if new classes have been installed for this package, |
|
5672 |
false if the package's classes have been already present." |
|
5673 |
||
5674 |
|newStuffHasBeenLoaded meOrMySecondIncarnation| |
|
5675 |
||
16892 | 5676 |
self supportedOnPlatform ifFalse:[^ false]. |
5677 |
||
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5678 |
self projectIsLoaded ifTrue:[ |
23124 | 5679 |
asAutoloaded ifFalse:[ |
5680 |
"/ to be considered !! |
|
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5681 |
"/ self isFullyLoaded ifFalse:[ |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5682 |
"/ self hasAllExtensionsLoaded ifFalse:[ |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5683 |
"/ self loadExtensions. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5684 |
"/ ]. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5685 |
"/ self loadAllAutoloadedClasses |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5686 |
"/ ]. |
23124 | 5687 |
]. |
5688 |
^ false |
|
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5689 |
]. |
17587 | 5690 |
|
5691 |
"/ the following prevents us from crshing if a project definition's prerequisites |
|
5692 |
"/ are wrong and circular/recursive |
|
5693 |
||
12749 | 5694 |
thisContext isRecursive ifTrue:[self breakPoint:#cg. ^ false]. "/ avoid endless loops |
15172 | 5695 |
(PackagesBeingLoaded includes:self package) ifTrue:[ |
23124 | 5696 |
"/ seems to be a recursive call |
5697 |
^ false |
|
14851 | 5698 |
]. |
12364 | 5699 |
|
15172 | 5700 |
PackagesBeingLoaded add:self package. |
17587 | 5701 |
PackageLoadInProgressQuery |
23124 | 5702 |
answerNotifyLoading:self package |
5703 |
do:[ |
|
5704 |
||
5705 |
[ |
|
5706 |
newStuffHasBeenLoaded := false. |
|
5707 |
||
5708 |
Smalltalk silentLoading ifFalse:[ |
|
5709 |
"/ thisContext fullPrintAll. |
|
5710 |
Logger info:('loading %1%2...' |
|
5711 |
bindWith:(asAutoloaded ifTrue:['as autoloaded '] ifFalse:['']) |
|
5712 |
with:self name). |
|
5713 |
]. |
|
5714 |
||
5715 |
self rememberOverwrittenExtensionMethods. |
|
5716 |
||
5717 |
self activityNotification:'Executing pre-load action'. |
|
5718 |
self executeHooks: #preLoad. |
|
5719 |
self preLoadAction. |
|
5720 |
||
5721 |
meOrMySecondIncarnation := self. |
|
5722 |
||
5723 |
Class withoutUpdatingChangesDo:[ |
|
5724 |
self activityNotification:'Loading prerequisities'. |
|
5725 |
self loadMandatoryPreRequisitesAsAutoloaded:asAutoloaded. |
|
5726 |
||
5727 |
self checkPrerequisitesForLoading. |
|
5728 |
||
5729 |
asAutoloaded ifFalse:[ |
|
5730 |
"ignore binary class library load failure - try is the hard way (loading classes)" |
|
5731 |
PackageLoadError ignoreIn:[ |
|
5732 |
self loadClassLibrary. |
|
5733 |
"/ could have overloaded my first incarnation |
|
5734 |
meOrMySecondIncarnation := (Smalltalk at:(self name)) ? self. |
|
5735 |
meOrMySecondIncarnation ~~ self ifTrue:[ |
|
5736 |
meOrMySecondIncarnation fetchSlotsFrom:self. |
|
5737 |
]. |
|
5738 |
]. |
|
5739 |
]. |
|
5740 |
||
5741 |
self hasAllExtensionsLoaded ifFalse:[ |
|
5742 |
self activityNotification:'Loading extensions'. |
|
5743 |
"/ evaluating or here - want extensions to be loaded |
|
5744 |
newStuffHasBeenLoaded := newStuffHasBeenLoaded | meOrMySecondIncarnation loadExtensions. |
|
5745 |
]. |
|
5746 |
(self hasAllClassesLoaded:asAutoloaded not) ifFalse:[ |
|
5747 |
self activityNotification:'Loading classes'. |
|
5748 |
"/ evaluating or here - want autoloaded classes to be loaded |
|
5749 |
newStuffHasBeenLoaded := newStuffHasBeenLoaded | (meOrMySecondIncarnation loadAllClassesAsAutoloaded:asAutoloaded). |
|
5750 |
]. |
|
5751 |
"/ no, don't load subProjects here - will lead to a recursion, which leads |
|
5752 |
"/ to some classes being loaded from source (soap) |
|
5753 |
"/ self activityNotification:'Loading sub projects'. |
|
5754 |
"/ meOrMySecondIncarnation loadSubProjectsAsAutoloaded:asAutoloaded. |
|
5755 |
]. |
|
5756 |
self activityNotification:('Executing post-load action for %1' bindWith:self package). |
|
5757 |
||
5758 |
"/ mhmh - already done for dll-loaded packages |
|
5759 |
"/ meOrMySecondIncarnation initializeAllClasses. |
|
5760 |
||
5761 |
meOrMySecondIncarnation projectIsLoaded:true. |
|
5762 |
meOrMySecondIncarnation ~~ self ifTrue:[ |
|
5763 |
self projectIsLoaded:true. |
|
5764 |
]. |
|
5765 |
] ensure:[ |
|
5766 |
PackagesBeingLoaded remove:self package ifAbsent:[]. |
|
5767 |
]. |
|
5768 |
"/ load the other prerequisites |
|
5769 |
self loadPreRequisitesAsAutoloaded:asAutoloaded. |
|
5770 |
]. |
|
13194
8e451f8ff654
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13178
diff
changeset
|
5771 |
self activityNotification:('Done (%1).' bindWith:self package). |
12364 | 5772 |
^ newStuffHasBeenLoaded |
5773 |
||
5774 |
"Created: / 17-08-2006 / 01:01:41 / cg" |
|
5775 |
"Modified: / 30-10-2008 / 08:16:21 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
5776 |
"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
|
5777 |
"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
|
5778 |
"Modified: / 20-11-2012 / 23:06:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12364 | 5779 |
! |
5780 |
||
5781 |
unloadPackage |
|
5782 |
"unload the project. |
|
5783 |
Fails if there are still instances of any of my classes in the system" |
|
5784 |
||
5785 |
self projectIsLoaded ifFalse:[^ false]. |
|
5786 |
thisContext isRecursive ifTrue:[^ false]. |
|
5787 |
||
20952 | 5788 |
Smalltalk silentLoading ifFalse:[ |
23124 | 5789 |
"/ thisContext fullPrintAll. |
5790 |
Logger info:'unloading %1' with:self name. |
|
12364 | 5791 |
]. |
5792 |
||
5793 |
self activityNotification:'Executing pre-unload action'. |
|
5794 |
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
|
5795 |
self executeHooks: #preUnload. |
12364 | 5796 |
|
5797 |
self activityNotification:'Restoring original methods'. |
|
5798 |
self restoreOverwrittenExtensionMethods. |
|
5799 |
||
5800 |
Class withoutUpdatingChangesDo:[ |
|
23124 | 5801 |
self activityNotification:'Unloading subprojects'. |
5802 |
self unloadSubProjects. |
|
5803 |
||
5804 |
self activityNotification:'Unloading classes'. |
|
5805 |
self unloadClassLibrary. |
|
5806 |
self unloadAllClasses. |
|
12364 | 5807 |
]. |
5808 |
self projectIsLoaded:false. |
|
5809 |
^ 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
|
5810 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
5811 |
"Modified: / 20-11-2012 / 23:06:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12364 | 5812 |
! ! |
5813 |
||
12086 | 5814 |
|
9575 | 5815 |
!ProjectDefinition class methodsFor:'private'! |
9536 | 5816 |
|
13411 | 5817 |
abbrevs |
13592 | 5818 |
"return a dictionary containing my abbreviations; |
5819 |
this dictionary is read from my project-directory's abbrev.stc file, |
|
5820 |
and cached for future use" |
|
5821 |
||
5822 |
|abbrevs| |
|
5823 |
||
5824 |
AccessLock critical:[ |
|
23124 | 5825 |
|mustRead file myPackageDirectory| |
5826 |
||
5827 |
AbbrevDictionary isNil ifTrue:[ |
|
5828 |
AbbrevDictionary := WeakIdentityDictionary new. |
|
5829 |
]. |
|
5830 |
||
5831 |
mustRead := false. |
|
5832 |
abbrevs := AbbrevDictionary at:self ifAbsent:[ mustRead := true. Dictionary new ]. |
|
5833 |
||
5834 |
mustRead ifTrue:[ |
|
5835 |
myPackageDirectory := self packageDirectory. |
|
5836 |
myPackageDirectory isNil ifTrue:[ |
|
5837 |
] ifFalse:[ |
|
5838 |
file := myPackageDirectory / 'abbrev.stc'. |
|
5839 |
file exists ifTrue: [ |
|
5840 |
file readingFileDo:[:stream | |
|
5841 |
Smalltalk |
|
5842 |
withAbbreviationsFromStream:stream |
|
5843 |
do:[:nm :fn :pkg :cat :sz| |
|
5844 |
abbrevs at: nm put: (AbbrevEntry new className:nm fileName:fn category:cat numClassInstVars:sz) |
|
5845 |
] |
|
5846 |
] |
|
5847 |
]. |
|
5848 |
]. |
|
5849 |
]. |
|
13419 | 5850 |
]. |
13695 | 5851 |
|
13411 | 5852 |
^abbrevs |
5853 |
||
5854 |
"Created: / 06-03-2011 / 18:25:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13959 | 5855 |
"Modified: / 20-01-2012 / 15:42:47 / cg" |
13411 | 5856 |
! |
5857 |
||
12368 | 5858 |
additionalClassAttributesFor: aClass |
5859 |
"Answers additional set of class attributes for given class |
|
5860 |
Individual project definitions may override this method, but |
|
5861 |
overriding method should always merge its attributes with result |
|
5862 |
of 'super additionalClassAttributesFor: aClass'. |
|
5863 |
||
5864 |
Here, we add #autoload attributes to all test cases and |
|
21102 | 5865 |
test resources, as they are not necessary for the package |
12368 | 5866 |
and should not be compiled (because of unwanted dependency |
5867 |
on stx:goodies/sunit package) |
|
15950 | 5868 |
|
5869 |
But not make them autoloaded when the package is separate |
|
5870 |
test-package - by conventions such package should by named |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
5871 |
#'module:package/subpackage/tests' |
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
5872 |
" |
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
5873 |
((self package endsWith: '/tests') or:[(self package endsWith: '/test')]) ifFalse:[ |
23124 | 5874 |
(TestCase notNil and:[aClass inheritsFrom: TestCase]) ifTrue:[^#(autoload)]. |
5875 |
(TestResource notNil and:[aClass inheritsFrom: TestResource]) ifTrue:[^#(autoload)]. |
|
15950 | 5876 |
]. |
12368 | 5877 |
|
5878 |
"No additional attributes" |
|
5879 |
^#() |
|
5880 |
||
5881 |
" |
|
23124 | 5882 |
stx_libbasic additionalClassAttributesFor: Object |
5883 |
stx_libtool additionalClassAttributesFor: Tools::NavigationHistoryTests |
|
5884 |
stx_goodies_sunit additionalClassAttributesFor: TestCase |
|
5885 |
stx_goodies_petitparser_tests additionalClassAttributesFor: PPAbstractParseTest |
|
5886 |
||
5887 |
||
5888 |
stx_libtool classNamesAndAttributes_code_ignoreOldEntries:true ignoreOldDefinition: true |
|
12368 | 5889 |
|
5890 |
" |
|
5891 |
||
5892 |
"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
|
5893 |
"Modified (comment): / 01-11-2014 / 00:27:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12368 | 5894 |
! |
5895 |
||
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5896 |
checkIfClassesArePresent |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5897 |
"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
|
5898 |
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
|
5899 |
|
18684 | 5900 |
|check nonExistentClasses| |
5901 |
||
5902 |
nonExistentClasses := Set new. |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5903 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5904 |
check := |
24416 | 5905 |
[:eachClassName | |
5906 |
|cls fn wasLoaded failedToLoad numClassInstvars| |
|
5907 |
||
5908 |
cls := Smalltalk classNamed:eachClassName. |
|
5909 |
cls isNil ifTrue:[ |
|
5910 |
Transcript showCR:eachClassName. |
|
5911 |
nonExistentClasses add:eachClassName. |
|
5912 |
]. |
|
5913 |
]. |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5914 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5915 |
self allClassNames do:check. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5916 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do:[:nm :attr | |
24416 | 5917 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
5918 |
check value:nm |
|
5919 |
]. |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5920 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5921 |
|
18684 | 5922 |
nonExistentClasses notEmpty ifTrue:[ |
24416 | 5923 |
Transcript showCR:'"%1" and possibly more classes are missing.\Cannot generate a correct "abbrev.stc" file.' with:nonExistentClasses. |
5924 |
UserPreferences current suppressProjectDefinitionWarnings ifFalse:[ |
|
5925 |
(Dialog confirm:(Dialog classResources |
|
5926 |
stringWithCRs:'"%1" and possibly more classes are missing.\Cannot generate a correct "abbrev.stc" file.\\Continue anyway?' |
|
5927 |
with:nonExistentClasses anElement allBold)) ifFalse:[ |
|
5928 |
AbortOperationRequest raise. |
|
5929 |
]. |
|
5930 |
]. |
|
5931 |
^ false. |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5932 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5933 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5934 |
^ true |
15916 | 5935 |
|
5936 |
"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
|
5937 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
5938 |
|
12368 | 5939 |
classNamesAndAttributesAsSpecArray |
13419 | 5940 |
"given a classNamesAndAttributes array, make this a spec array (array of arrays). |
12368 | 5941 |
This decompresses class-name entries into a one-element array for easier processing" |
5942 |
||
5943 |
^ self classNamesAndAttributes |
|
23124 | 5944 |
collect:[:entry | |
5945 |
entry isArray ifTrue:[ |
|
5946 |
entry first isSymbol ifTrue:[ |
|
5947 |
entry |
|
5948 |
] ifFalse:[ |
|
5949 |
(Array with:entry first asSymbol) , (entry copyFrom:2) |
|
5950 |
]. |
|
5951 |
] ifFalse:[ |
|
5952 |
Array with:entry asSymbol. |
|
5953 |
]]. |
|
12368 | 5954 |
|
5955 |
"Created: / 19-02-2007 / 16:11:53 / cg" |
|
5956 |
! |
|
5957 |
||
9627 | 5958 |
classNamesAndAttributesDo: aBlock |
5959 |
self namesAndAttributesIn:(self classNamesAndAttributes) do: aBlock |
|
5960 |
||
5961 |
"Modified: / 22-08-2006 / 18:20:21 / cg" |
|
9607 | 5962 |
! |
5963 |
||
12368 | 5964 |
classNamesAndAttributesFromSpecArray:aSpecArray |
5965 |
"given a spec array (array of arrays), make this a classNamesAndAttributes array |
|
5966 |
as stored literally in the method. |
|
5967 |
This compresses single element array-elements into plain names |
|
16572 | 5968 |
(to save code in the compiled binaries) and especially sorts them by load/compile order" |
5969 |
||
5970 |
|newSpec loadedClasses loadedClassNames itemsForUnloadedClasses |
|
5971 |
entriesByName| |
|
5972 |
||
5973 |
entriesByName := Dictionary new. |
|
16024 | 5974 |
|
5975 |
newSpec := |
|
23124 | 5976 |
aSpecArray |
5977 |
collect:[:entry | |
|
5978 |
|nm newEntry| |
|
5979 |
||
5980 |
(entry isArray and:[entry size == 1]) ifTrue:[ |
|
5981 |
nm := newEntry := entry first. |
|
5982 |
entriesByName at:nm put:nm. |
|
5983 |
] ifFalse:[ |
|
5984 |
newEntry := entry. |
|
5985 |
(entry isArray and:[entry size > 1]) ifTrue:[ |
|
5986 |
nm := entry first. |
|
5987 |
entriesByName at:nm put:entry. |
|
5988 |
] ifFalse:[ |
|
5989 |
nm := entry. |
|
5990 |
entriesByName at:nm put:entry. |
|
5991 |
]. |
|
5992 |
]. |
|
5993 |
newEntry |
|
5994 |
]. |
|
16024 | 5995 |
|
5996 |
"/ extract loaded and unloaded classes. |
|
5997 |
loadedClasses := OrderedCollection new. |
|
5998 |
itemsForUnloadedClasses := OrderedCollection new. |
|
5999 |
||
6000 |
newSpec do:[:entry | |
|
23124 | 6001 |
|clsName clsOrNil| |
6002 |
||
6003 |
(entry isArray and:[entry includes:#autoload]) ifTrue:[ |
|
6004 |
itemsForUnloadedClasses add:entry. |
|
6005 |
] ifFalse:[ |
|
6006 |
clsName := entry isArray ifTrue:[ entry first ] ifFalse:[ entry ]. |
|
6007 |
clsOrNil := Smalltalk classNamed:clsName. |
|
6008 |
(clsOrNil notNil and:[clsOrNil isLoaded]) ifTrue:[ |
|
6009 |
loadedClasses add:clsOrNil. |
|
6010 |
] ifFalse:[ |
|
6011 |
itemsForUnloadedClasses add:entry. |
|
6012 |
] |
|
6013 |
] |
|
16024 | 6014 |
]. |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
6015 |
"/ and sort by load order |
16024 | 6016 |
loadedClassNames := (Class classesSortedByLoadOrder:loadedClasses) collect:[:cls | cls name]. |
16619 | 6017 |
newSpec := loadedClassNames collect:[:nm | entriesByName at:nm ifAbsent:[ { nm . #autoload }]]. |
16572 | 6018 |
|
16024 | 6019 |
"/ reconstruct contents array, unloaded classes last. |
16572 | 6020 |
^ newSpec asArray , itemsForUnloadedClasses asArray. |
12368 | 6021 |
! |
6022 |
||
9664 | 6023 |
compile:someCode categorized:category |
15006 | 6024 |
^ self compile:someCode categorized:category using:nil |
6025 |
! |
|
6026 |
||
6027 |
compile:someCode categorized:category using:compilerOrNil |
|
6028 |
^ Class packageQuerySignal |
|
23124 | 6029 |
answer:self package |
6030 |
do:[ |
|
6031 |
(compilerOrNil ? self theMetaclass compilerClass) |
|
6032 |
compile:someCode |
|
6033 |
forClass:self theMetaclass |
|
6034 |
inCategory:category |
|
6035 |
] |
|
9664 | 6036 |
|
6037 |
"Created: / 23-08-2006 / 14:36:53 / cg" |
|
6038 |
! |
|
6039 |
||
9627 | 6040 |
compiled_classes |
13419 | 6041 |
^ self compiled_classNames |
23124 | 6042 |
collect: |
6043 |
[:eachName| |
|
6044 |
|cls| |
|
6045 |
||
6046 |
cls := (Smalltalk at:eachName asSymbol). |
|
6047 |
(cls isNil or:[cls isBehavior not]) ifTrue:[ |
|
6048 |
Transcript showCR:('ProjectDefinition: missing/invalid class: ', eachName). |
|
6049 |
cls := nil. |
|
6050 |
]. |
|
6051 |
cls. |
|
6052 |
] |
|
6053 |
thenSelect:[:cls | cls notNil] |
|
9627 | 6054 |
|
6055 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
6056 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
10251 | 6057 |
"Modified: / 07-12-2006 / 17:48:11 / cg" |
9536 | 6058 |
! |
6059 |
||
9627 | 6060 |
compiled_classesDo:aBlock |
6061 |
self compiled_classes do:aBlock. |
|
6062 |
||
6063 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
6064 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
6065 |
! |
|
6066 |
||
15124 | 6067 |
compiled_classesForPlatform:arch |
13419 | 6068 |
^ (self compiled_classNamesForPlatform:arch) |
23124 | 6069 |
collect:[:eachName | (Smalltalk classNamed:eachName)] |
9627 | 6070 |
|
10251 | 6071 |
" |
6072 |
stx_libbasic compiled_classesForArchitecture:#win32 |
|
6073 |
stx_libbasic compiled_classesForArchitecture:#macos |
|
6074 |
stx_libbasic compiled_classesForArchitecture:#unix |
|
6075 |
" |
|
6076 |
||
9627 | 6077 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
6078 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
10251 | 6079 |
"Modified: / 07-12-2006 / 17:43:17 / cg" |
9627 | 6080 |
! |
6081 |
||
6082 |
compiled_classes_common |
|
13419 | 6083 |
^ self |
23124 | 6084 |
compiled_classNames_common |
6085 |
collect:[:eachName | |
|
6086 |
|cls| |
|
6087 |
||
6088 |
cls := Smalltalk classNamed:eachName. |
|
6089 |
cls isNil ifTrue:[ |
|
6090 |
Transcript showCR:('Warning: Missing/invalid class: %1 - the class is skipped in the list of compiled classes.'). |
|
6091 |
UserPreferences current suppressProjectDefinitionWarnings ifFalse:[ |
|
6092 |
self warn:('Missing/invalid class: %1\\%2' |
|
6093 |
bindWith:eachName |
|
6094 |
with:('Warning: The class is skipped in the list of compiled classes.' allBold)) withCRs. |
|
6095 |
]. |
|
6096 |
cls := nil. |
|
6097 |
]. |
|
6098 |
cls |
|
6099 |
] |
|
6100 |
thenSelect:[:cls| cls notNil "isBehavior"] |
|
9627 | 6101 |
|
6102 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
6103 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
15916 | 6104 |
"Modified: / 28-01-2014 / 21:45:08 / cg" |
9607 | 6105 |
! |
6106 |
||
9627 | 6107 |
cvsRevision |
6108 |
|rev| |
|
6109 |
||
6110 |
rev := self revision. |
|
6111 |
rev isNil ifTrue:[ |
|
23124 | 6112 |
"not yet pubplished" |
6113 |
^ #( '0' '1' ) |
|
9627 | 6114 |
]. |
6115 |
^ rev asCollectionOfSubstringsSeparatedBy:$. . |
|
6116 |
||
6117 |
" |
|
6118 |
self cvsRevision |
|
13419 | 6119 |
stx_libbasic3 cvsRevision |
9627 | 6120 |
" |
6121 |
||
6122 |
"Created: / 17-08-2006 / 20:19:03 / cg" |
|
9575 | 6123 |
! |
6124 |
||
13411 | 6125 |
defaultClassAttributesFor: aClass |
6126 |
"Answers default set of class attributes for given class. |
|
6127 |
This is internal method only, to per-project customization |
|
6128 |
please override either #additionalClassAttributes or |
|
6129 |
#additional classAttributesFor:" |
|
6130 |
||
6131 |
| attrs | |
|
6132 |
||
6133 |
"JV @ 2010-06-19 |
|
6134 |
Add a programming language attribute for non-smalltalk classes. |
|
6135 |
Used by multi-lang enabled loading mechanism" |
|
13419 | 6136 |
attrs := aClass programmingLanguage isSmalltalk |
23124 | 6137 |
ifTrue:[#()] |
6138 |
ifFalse:[Array with: (Array with: #lang with: aClass programmingLanguage name asSymbol)]. |
|
13419 | 6139 |
|
13411 | 6140 |
|
6141 |
"JV @ 2009-10-26 |
|
6142 |
Give a project definition to specify additional attributes for given class." |
|
6143 |
attrs := attrs , (self additionalClassAttributesFor: aClass). |
|
6144 |
||
6145 |
^attrs |
|
6146 |
||
6147 |
"Created: / 19-06-2010 / 10:44:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6148 |
! |
|
6149 |
||
9627 | 6150 |
inconsistency:message |
6151 |
Dialog warn:message |
|
9536 | 6152 |
|
9627 | 6153 |
" |
6154 |
self searchForNeverCompiledSuperclasses |
|
13419 | 6155 |
DapasX_Datenbasis searchForNeverCompiledSuperclasses |
9627 | 6156 |
" |
6157 |
||
6158 |
"Created: / 09-08-2006 / 16:32:31 / fm" |
|
9536 | 6159 |
! |
6160 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6161 |
makeOSIncludesWith:fileSeparator from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6162 |
^ aString copy replaceAny:'/\' with:fileSeparator |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6163 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6164 |
" |
13419 | 6165 |
self makeOSIncludesWith:$/ from:'-I$(TOP)/foo/bar' |
6166 |
self makeOSIncludesWith:$\ from:'-I$(TOP)/foo/bar' |
|
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6167 |
" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6168 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6169 |
"Created: / 06-09-2006 / 18:17:03 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6170 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6171 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6172 |
makeUnixIncludes:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6173 |
^ self makeOSIncludesWith:$/ from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6174 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6175 |
"Created: / 06-09-2006 / 18:16:19 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6176 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6177 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6178 |
makeWin32Includes:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6179 |
^ self makeOSIncludesWith:$\ from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6180 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6181 |
"Created: / 06-09-2006 / 18:16:13 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6182 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
6183 |
|
13411 | 6184 |
mergeClassAttributes: attr1 with: attr2 |
6185 |
||
6186 |
^attr1 , (attr2 reject:[:each|attr1 includes: each]) |
|
6187 |
||
6188 |
"Created: / 19-06-2010 / 10:50:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6189 |
! |
|
6190 |
||
6191 |
mergeDefaultClassAttributesFor: aClass with: attributes |
|
6192 |
||
6193 |
^self mergeClassAttributes: attributes with: (self defaultClassAttributesFor: aClass) |
|
6194 |
||
6195 |
"Created: / 19-06-2010 / 10:51:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6196 |
! |
|
6197 |
||
9627 | 6198 |
namesAndAttributesIn:aCollection do: aBlock |
18988 | 6199 |
aCollection isNil ifTrue:[^ self]. |
6200 |
||
9627 | 6201 |
aCollection do:[:entry | |
23124 | 6202 |
|className attributes| |
6203 |
||
6204 |
entry isArray ifFalse:[ |
|
6205 |
className := entry. |
|
6206 |
attributes := #(). |
|
6207 |
] ifTrue:[ |
|
6208 |
className := entry first. |
|
6209 |
attributes := entry copyFrom:2. |
|
6210 |
]. |
|
6211 |
aBlock value: className value: attributes |
|
9627 | 6212 |
]. |
6213 |
||
6214 |
"Created: / 22-08-2006 / 18:20:09 / cg" |
|
9621 | 6215 |
! |
6216 |
||
9627 | 6217 |
searchForClasses |
10010 | 6218 |
"answer all non-private classes that belong to this project. |
10005 | 6219 |
They are sorted in load order" |
6220 |
||
13419 | 6221 |
^ Class classesSortedByLoadOrder:(self searchForClassesWithProject: self package) |
9627 | 6222 |
|
6223 |
" |
|
10010 | 6224 |
stx_libbasic3 searchForClasses |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
6225 |
stx_goodies_webServer_htmlTree searchForClasses |
9627 | 6226 |
" |
6227 |
||
6228 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
6229 |
"Created: / 17-08-2006 / 21:18:30 / cg" |
|
9536 | 6230 |
! |
6231 |
||
9627 | 6232 |
searchForClassesWithProject: aProjectID |
15098 | 6233 |
"answer all public and private classes belonging to aProjectID" |
9627 | 6234 |
|
13419 | 6235 |
^ Smalltalk allClasses |
23124 | 6236 |
select:[:cls | cls package = aProjectID]. |
9627 | 6237 |
|
6238 |
" |
|
15098 | 6239 |
self searchForClassesWithProject: #'exept:ctypes' |
9627 | 6240 |
" |
6241 |
||
6242 |
"Created: / 07-08-2006 / 20:42:39 / fm" |
|
9536 | 6243 |
! |
6244 |
||
9627 | 6245 |
searchForExtensions |
6246 |
^ self searchForExtensionsWithProject:self package |
|
6247 |
||
6248 |
" |
|
13419 | 6249 |
self searchForExtensions |
9627 | 6250 |
DapasXProject searchForExtensions |
6251 |
DapasX_Datenbasis searchForExtensions |
|
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
6252 |
stx_libtool searchForExtensions |
9627 | 6253 |
" |
6254 |
||
6255 |
"Modified: / 09-08-2006 / 13:01:26 / fm" |
|
6256 |
"Created: / 17-08-2006 / 21:17:46 / cg" |
|
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
6257 |
"Modified: / 23-10-2006 / 11:03:07 / cg" |
9575 | 6258 |
! |
6259 |
||
9627 | 6260 |
searchForExtensionsWithProject:aProjectID |
6261 |
"search for any class which has extensions from aProjectID. |
|
10086
024ea420d1a6
extension method stuff refactored
Claus Gittinger <cg@exept.de>
parents:
10080
diff
changeset
|
6262 |
Return the extension-methods sorted by classname-selector" |
9627 | 6263 |
|
6264 |
|methods| |
|
6265 |
||
11152 | 6266 |
methods := Smalltalk allExtensionsForPackage:aProjectID. |
13419 | 6267 |
methods |
23124 | 6268 |
sort:[:m1 :m2 | |
6269 |
|c1 c2| |
|
6270 |
||
6271 |
c1 := m1 mclass. |
|
6272 |
c2 := m2 mclass. |
|
6273 |
c1 == c2 ifTrue:[ |
|
6274 |
m1 selector < m2 selector |
|
6275 |
] ifFalse:[ |
|
6276 |
(c2 isMeta and:[c1 isMeta not]) ifTrue:[ |
|
6277 |
true |
|
6278 |
] ifFalse:[ |
|
6279 |
(c1 isMeta and:[c2 isMeta not]) ifTrue:[ |
|
6280 |
false |
|
6281 |
] ifFalse:[ |
|
6282 |
c1 name < c2 name |
|
9908
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6283 |
"/ (c2 isSubclassOf:c1) ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6284 |
"/ true |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6285 |
"/ ] ifFalse:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6286 |
"/ (c1 isSubclassOf:c2) ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6287 |
"/ false |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6288 |
"/ ] ifFalse:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6289 |
"/ "/ leave as is |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6290 |
"/ true |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6291 |
"/ ]. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
6292 |
"/ ]. |
23124 | 6293 |
]. |
6294 |
]. |
|
6295 |
]. |
|
6296 |
]. |
|
9627 | 6297 |
^ methods |
6298 |
||
6299 |
" |
|
6300 |
self searchForExtensionsWithProject:#'bosch:dapasx' |
|
6301 |
self searchForExtensionsWithProject:#'cg:oyster' |
|
10086
024ea420d1a6
extension method stuff refactored
Claus Gittinger <cg@exept.de>
parents:
10080
diff
changeset
|
6302 |
self searchForExtensionsWithProject:#'stx:libboss' |
9627 | 6303 |
" |
6304 |
||
6305 |
"Created: / 17-08-2006 / 21:19:04 / cg" |
|
10086
024ea420d1a6
extension method stuff refactored
Claus Gittinger <cg@exept.de>
parents:
10080
diff
changeset
|
6306 |
"Modified: / 12-10-2006 / 20:45:39 / cg" |
9536 | 6307 |
! |
6308 |
||
9627 | 6309 |
searchForProjectsWhichProvideHeaderFiles |
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6310 |
|addPackage myPackageID requiredPackages| |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6311 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6312 |
myPackageID := self package. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6313 |
requiredPackages := Set new. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6314 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6315 |
addPackage := |
24342 | 6316 |
[:package | |
6317 |
(package ~= myPackageID) ifTrue:[ |
|
6318 |
true "(package startsWith:'stx:') not" ifTrue:[ |
|
6319 |
package ~= PackageId noProjectID ifTrue:[ |
|
6320 |
requiredPackages add:package. |
|
6321 |
] |
|
6322 |
] |
|
6323 |
] |
|
6324 |
]. |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6325 |
|
12555
9924562388ed
changed: #searchForProjectsWhichProvideHeaderFiles
Claus Gittinger <cg@exept.de>
parents:
12554
diff
changeset
|
6326 |
"/ need them also... |
14886 | 6327 |
self mandatoryPreRequisites do:[:eachPreRequisitePackage | |
24342 | 6328 |
addPackage value:eachPreRequisitePackage |
12555
9924562388ed
changed: #searchForProjectsWhichProvideHeaderFiles
Claus Gittinger <cg@exept.de>
parents:
12554
diff
changeset
|
6329 |
]. |
9924562388ed
changed: #searchForProjectsWhichProvideHeaderFiles
Claus Gittinger <cg@exept.de>
parents:
12554
diff
changeset
|
6330 |
|
16554 | 6331 |
"/ cg: also need include lines for all referenced packages, |
6332 |
"/ because otherwise, a reference to a symbol in a namespace |
|
6333 |
"/ is not resolved correctly by stc (which would not know, if the |
|
6334 |
"/ symbol is in Smalltalk or the NameSpace. |
|
6335 |
"/ This happens eg. when referring to a class Foo in namespace N |
|
6336 |
"/ as Foo from within the same namespace, but Foo is in another package. |
|
6337 |
"/ It is then only in the referencedPreRequisites's, not the mandatory prereqs. |
|
24342 | 6338 |
"/ Actually, the question is, if then the package should not be listed in the |
16554 | 6339 |
"/ mandatoryPrereqs right away. Discuss this with sv. |
6340 |
self referencedPreRequisites do:[:eachPreRequisitePackage | |
|
24342 | 6341 |
addPackage value:eachPreRequisitePackage |
16554 | 6342 |
]. |
6343 |
||
10788 | 6344 |
self compiled_classesDo:[:cls | |
24342 | 6345 |
cls allSuperclassesDo:[:eachSuperClass | |
6346 |
addPackage value:(eachSuperClass package) |
|
6347 |
]. |
|
6348 |
||
6349 |
cls allPrivateClassesDo:[:eachPrivateClass | |
|
6350 |
eachPrivateClass allSuperclassesDo:[:eachSuperClass | |
|
6351 |
eachSuperClass isPrivate ifFalse:[ |
|
6352 |
addPackage value:(eachSuperClass package) |
|
6353 |
]. |
|
6354 |
] |
|
6355 |
]. |
|
6356 |
||
6357 |
cls sharedPoolNames do:[:eachPoolName | |
|
6358 |
|eachPoolClass| |
|
6359 |
||
6360 |
eachPoolClass := Smalltalk classNamed:eachPoolName. |
|
6361 |
eachPoolClass isNil ifTrue:[ |
|
6362 |
Transcript showCR:('Warning: missing pool: %1 (required by %2)' bindWith:eachPoolName with:cls name) |
|
6363 |
] ifFalse:[ |
|
6364 |
eachPoolClass withAllSuperclassesDo:[:eachPoolSuperClass | |
|
6365 |
addPackage value:(eachPoolSuperClass package) |
|
6366 |
] |
|
6367 |
] |
|
6368 |
]. |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6369 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6370 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6371 |
self extensionMethodNames pairWiseDo:[:className :selector | |
24342 | 6372 |
|cls| |
6373 |
((cls := Smalltalk classNamed:className) notNil and:[cls isLoaded]) ifTrue:[ |
|
6374 |
cls withAllSuperclassesDo:[:eachSuperClass | |
|
6375 |
addPackage value:(eachSuperClass package) |
|
6376 |
] |
|
6377 |
] |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6378 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
6379 |
^ requiredPackages |
9627 | 6380 |
|
9880 | 6381 |
" |
13419 | 6382 |
stx_libtool searchForProjectsWhichProvideHeaderFiles |
14939 | 6383 |
cg_demos_helloWorld searchForProjectsWhichProvideHeaderFiles |
16554 | 6384 |
cg_tools_emulators_freecell searchForProjectsWhichProvideHeaderFiles |
9880 | 6385 |
" |
9627 | 6386 |
|
10251 | 6387 |
"Created: / 07-12-2006 / 17:46:38 / cg" |
13216 | 6388 |
"Modified: / 18-01-2011 / 17:58:33 / cg" |
24342 | 6389 |
"Modified (comment): / 23-06-2019 / 10:36:23 / Claus Gittinger" |
9664 | 6390 |
! |
6391 |
||
9667 | 6392 |
searchForSiblingProjects |
10132 | 6393 |
"answer all the packages (package names) having the my parent package" |
6394 |
||
9667 | 6395 |
|myPackage myParentPackage| |
6396 |
||
6397 |
myPackage := self package asPackageId. |
|
6398 |
myParentPackage := myPackage parentPackage. |
|
6399 |
myParentPackage isNil ifTrue:[^ #() ]. |
|
6400 |
||
19476 | 6401 |
^ Smalltalk allPackageIDs |
23124 | 6402 |
select:[:projectID | |
6403 |
|thisPackage| |
|
6404 |
thisPackage := projectID asPackageId. |
|
6405 |
(thisPackage parentPackage = myParentPackage) |
|
6406 |
and:[ thisPackage ~= myPackage ]. |
|
6407 |
] |
|
9667 | 6408 |
|
6409 |
" |
|
6410 |
self searchForSiblingProjects |
|
6411 |
bosch_dapasx_Application searchForSiblingProjects |
|
6412 |
stx_goodies_refactoryBrowser_changes searchForSiblingProjects |
|
6413 |
" |
|
6414 |
||
6415 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
6416 |
"Created: / 23-08-2006 / 15:06:12 / cg" |
|
6417 |
! |
|
6418 |
||
9664 | 6419 |
searchForSubProjects |
10132 | 6420 |
"answer all packages (package names), that are my subProjects" |
6421 |
||
9664 | 6422 |
|myPackage| |
6423 |
||
6424 |
myPackage := self package. |
|
19476 | 6425 |
^ Smalltalk allPackageIDs |
23124 | 6426 |
select:[:projectID | |
6427 |
projectID ~= PackageId noProjectID |
|
6428 |
and:[ (projectID asPackageId parentPackage) = myPackage ]]. |
|
13419 | 6429 |
|
6430 |
" |
|
6431 |
self searchForSubProjects |
|
9664 | 6432 |
bosch_dapasx_Application searchForSubProjects |
6433 |
stx_goodies_refactoryBrowser_changes searchForSubProjects |
|
6434 |
" |
|
6435 |
||
6436 |
"Created: / 07-08-2006 / 20:42:39 / fm" |
|
6437 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
10215 | 6438 |
"Modified: / 05-12-2006 / 18:04:27 / cg" |
9664 | 6439 |
! |
6440 |
||
6441 |
setupForType:typeOrNil |
|
9714 | 6442 |
typeOrNil = GUIApplicationType ifTrue:[ |
23124 | 6443 |
self compile: |
12425 | 6444 |
'isGUIApplication |
6445 |
"return true, if this is a GUI application. |
|
6446 |
(these need more libraries and use a different startup procedure)" |
|
6447 |
||
6448 |
^ true |
|
6449 |
' |
|
23124 | 6450 |
categorized:'description'. |
6451 |
self setSuperclass: ApplicationDefinition. |
|
6452 |
^ self |
|
9664 | 6453 |
]. |
12856
1651184275a2
comment/format in: #setupForType:
Claus Gittinger <cg@exept.de>
parents:
12804
diff
changeset
|
6454 |
|
9714 | 6455 |
typeOrNil = NonGUIApplicationType ifTrue:[ |
23124 | 6456 |
self compile: |
12425 | 6457 |
'isGUIApplication |
6458 |
"return true, if this is a GUI application. |
|
6459 |
(these need more libraries and use a different startup procedure)" |
|
6460 |
||
6461 |
^ false |
|
6462 |
' |
|
23124 | 6463 |
categorized:'description'. |
6464 |
self setSuperclass: ApplicationDefinition. |
|
6465 |
^ self |
|
13419 | 6466 |
]. |
12856
1651184275a2
comment/format in: #setupForType:
Claus Gittinger <cg@exept.de>
parents:
12804
diff
changeset
|
6467 |
|
12349 | 6468 |
self theMetaclass removeSelector: #isGUIApplication. |
15070 | 6469 |
self setSuperclass: LibraryDefinition. |
9664 | 6470 |
^ self. |
6471 |
||
6472 |
"Created: / 23-08-2006 / 14:26:10 / cg" |
|
13411 | 6473 |
! |
6474 |
||
6475 |
shouldExcludeTest: test |
|
16257 | 6476 |
^ self excludedFromTestSuite contains:[:spec| |
23124 | 6477 |
(spec isSymbol and:[test class name == spec]) |
6478 |
or:[spec isArray and:[test class name == spec first and:[test selector == spec second]]] |
|
6479 |
]. |
|
13411 | 6480 |
|
6481 |
"Created: / 03-06-2011 / 17:01:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
18323 | 6482 |
! |
6483 |
||
6484 |
verbose:aBoolean |
|
6485 |
"enable/disable diagnostic output, which gives more detail on why package loading fails" |
|
6486 |
||
6487 |
Verbose := aBoolean |
|
6488 |
||
6489 |
" |
|
6490 |
self verbose:true |
|
6491 |
self verbose:false |
|
6492 |
" |
|
9536 | 6493 |
! ! |
6494 |
||
12210 | 6495 |
!ProjectDefinition class methodsFor:'private-extension handling'! |
6496 |
||
15057 | 6497 |
extensionOverwriteInfo |
6498 |
^ extensionOverwriteInfo |
|
6499 |
! |
|
6500 |
||
6501 |
fetchSlotsFrom:myFirstIncarnation |
|
6502 |
"this is invoked in a just loaded instance of myself, |
|
6503 |
to fetch the safe and extensionInfo from my first incarnation" |
|
6504 |
||
6505 |
safeForOverwrittenMethods := myFirstIncarnation safeForOverwrittenMethods. |
|
6506 |
extensionOverwriteInfo := myFirstIncarnation extensionOverwriteInfo. |
|
6507 |
! |
|
6508 |
||
12210 | 6509 |
hasSavedOverwrittenMethods |
6510 |
"true, if any of my methods was overwritten by another loaded package. |
|
6511 |
These methods are now in my safe" |
|
6512 |
||
12208
0b65ddcb68f2
added: #hasSafedOverwrittenMethods
Michael Beyl <mb@exept.de>
parents:
12202
diff
changeset
|
6513 |
^ safeForOverwrittenMethods notEmptyOrNil |
0b65ddcb68f2
added: #hasSafedOverwrittenMethods
Michael Beyl <mb@exept.de>
parents:
12202
diff
changeset
|
6514 |
! |
0b65ddcb68f2
added: #hasSafedOverwrittenMethods
Michael Beyl <mb@exept.de>
parents:
12202
diff
changeset
|
6515 |
|
14984 | 6516 |
methodOverwrittenBy:anExtensionMethod |
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6517 |
"return the (hidden) original method, which was located in another package |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6518 |
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
|
6519 |
|
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6520 |
|mclass selector oldPackage| |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6521 |
|
12218
a3662ecd1438
changed: #methodOverwrittenBy:
Claus Gittinger <cg@exept.de>
parents:
12213
diff
changeset
|
6522 |
extensionOverwriteInfo isNil ifTrue:[^ nil]. |
a3662ecd1438
changed: #methodOverwrittenBy:
Claus Gittinger <cg@exept.de>
parents:
12213
diff
changeset
|
6523 |
|
14984 | 6524 |
mclass := anExtensionMethod mclass. |
6525 |
selector := anExtensionMethod selector. |
|
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6526 |
oldPackage := extensionOverwriteInfo at:(mclass name,'>>',selector) ifAbsent:nil. |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6527 |
oldPackage isNil ifTrue:[^ nil]. |
13419 | 6528 |
^ oldPackage asPackageId projectDefinitionClass |
23124 | 6529 |
savedOverwrittenMethodForClass:mclass selector:selector. |
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6530 |
! |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6531 |
|
12210 | 6532 |
rememberOverwrittenExtensionMethods |
6533 |
"before loading, tell other packages to keep a safe reference to any method |
|
23851 | 6534 |
which gets overloaded by me, and also remember here, whom I have overloaded. |
12210 | 6535 |
This allows for two things: |
23851 | 6536 |
a) correct fileout of the other base-package (for example, when checking in any of its class) |
6537 |
b) correct unloading of myself" |
|
12210 | 6538 |
|
6539 |
self extensionMethodNames pairWiseDo:[:className :selector | |
|
23851 | 6540 |
|class oldMethod oldPackage defClass| |
6541 |
||
6542 |
class := Smalltalk classNamed:className. |
|
6543 |
class notNil ifTrue:[ |
|
6544 |
oldMethod := class compiledMethodAt:selector. |
|
6545 |
]. |
|
6546 |
oldMethod notNil ifTrue:[ |
|
6547 |
oldPackage := oldMethod package. |
|
6548 |
oldPackage ~= PackageId noProjectID ifTrue:[ |
|
6549 |
defClass := oldPackage asPackageId projectDefinitionClass. |
|
6550 |
defClass notNil ifTrue:[ |
|
6551 |
defClass rememberOverwrittenMethod:oldMethod inClass:class. |
|
6552 |
extensionOverwriteInfo isNil ifTrue:[ |
|
6553 |
extensionOverwriteInfo := Dictionary new. |
|
6554 |
]. |
|
6555 |
extensionOverwriteInfo at:(className,'>>',selector) put:oldPackage. |
|
6556 |
] |
|
6557 |
]. |
|
6558 |
]. |
|
6559 |
]. |
|
6560 |
||
6561 |
"Modified (comment): / 07-03-2019 / 18:02:46 / Stefan Vogel" |
|
12210 | 6562 |
! |
6563 |
||
6564 |
rememberOverwrittenMethod:oldMethod inClass:aClass |
|
6565 |
"invoked from another projectDefinition, when that package is about to be loaded |
|
13419 | 6566 |
and about to overwrite one of my methods. |
6567 |
I will save the method locally, to allow for correct fileout of this class/project or |
|
12210 | 6568 |
to correctly reestablish my methods when the other package is unloaded later." |
6569 |
||
6570 |
|thisIsOneOfMyMethods selector| |
|
6571 |
||
6572 |
selector := oldMethod selector. |
|
6573 |
||
12293
983b9555f6e8
changed: #rememberOverwrittenMethod:inClass:
Claus Gittinger <cg@exept.de>
parents:
12286
diff
changeset
|
6574 |
thisIsOneOfMyMethods := (self classNames includes:aClass theNonMetaclass name) |
23124 | 6575 |
or:[ aClass isPrivate and:[ self classNames includes: aClass topOwningClass theNonMetaclass name ]]. |
12210 | 6576 |
thisIsOneOfMyMethods ifFalse:[ |
23124 | 6577 |
self extensionMethodNames pairWiseDo:[:extClassName :extSelector | |
6578 |
extClassName = aClass name ifTrue:[ |
|
6579 |
selector = extSelector ifTrue:[ |
|
6580 |
thisIsOneOfMyMethods := true |
|
6581 |
]. |
|
6582 |
]. |
|
6583 |
] |
|
12210 | 6584 |
]. |
6585 |
thisIsOneOfMyMethods ifFalse:[ |
|
23124 | 6586 |
"/ self error:'oops - this is not one of my methods' mayProceed:true. |
6587 |
Transcript showCR:self name,' [warning]:not one of my methods in rememberOverwritten'. |
|
6588 |
^ self |
|
12210 | 6589 |
]. |
6590 |
||
6591 |
safeForOverwrittenMethods isNil ifTrue:[ |
|
23124 | 6592 |
safeForOverwrittenMethods := Dictionary new. |
12210 | 6593 |
]. |
14984 | 6594 |
safeForOverwrittenMethods at:(aClass name,'>>',selector) put:oldMethod. |
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6595 |
! |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6596 |
|
12624 | 6597 |
restoreOverwrittenExtensionMethods |
23851 | 6598 |
<resource: #todo> |
21764 | 6599 |
"after unloading, tell other packages to restore any saved reference to any method |
14981 | 6600 |
which got overloaded by me. |
6601 |
Unfinished!!" |
|
12624 | 6602 |
|
16786 | 6603 |
extensionOverwriteInfo notEmptyOrNil ifTrue:[ |
23124 | 6604 |
self extensionMethodNames pairWiseDo:[:className :selector | |
6605 |
|class oldMethod oldPackage| |
|
6606 |
||
6607 |
oldPackage := extensionOverwriteInfo at:(className,'>>',selector). |
|
6608 |
oldPackage notNil ifTrue:[ |
|
6609 |
class := Smalltalk classNamed:className. |
|
6610 |
class notNil ifTrue:[ |
|
6611 |
oldMethod := oldPackage savedOverwrittenMethodForClass:class selector:selector. |
|
6612 |
oldMethod notNil ifTrue:[ |
|
6613 |
self breakPoint:#cg. |
|
6614 |
]. |
|
6615 |
] |
|
6616 |
]. |
|
6617 |
]. |
|
12624 | 6618 |
]. |
21764 | 6619 |
|
6620 |
"Modified (comment): / 18-05-2017 / 14:49:39 / mawalch" |
|
12624 | 6621 |
! |
6622 |
||
15057 | 6623 |
safeForOverwrittenMethods |
6624 |
^ safeForOverwrittenMethods |
|
6625 |
! |
|
6626 |
||
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6627 |
savedOverwrittenMethodForClass:aClass selector:aSelector |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6628 |
"return one of my saved original methods" |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
6629 |
|
13692
2dffef08a4ac
changed: #savedOverwrittenMethodForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
13689
diff
changeset
|
6630 |
safeForOverwrittenMethods isNil ifTrue:[^ nil]. |
12274 | 6631 |
^ safeForOverwrittenMethods at:(aClass name,'>>',aSelector) ifAbsent:nil |
14981 | 6632 |
! |
6633 |
||
6634 |
savedOverwrittenMethods |
|
6635 |
"return my saved original methods" |
|
6636 |
||
6637 |
^ safeForOverwrittenMethods ? #() |
|
12210 | 6638 |
! ! |
6639 |
||
6640 |
!ProjectDefinition class methodsFor:'private-loading'! |
|
6641 |
||
12262
24861bbf25fc
added: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12251
diff
changeset
|
6642 |
checkPrerequisitesForLoading |
14957 | 6643 |
"check if I can be loaded - i.e. if all classes to be extended are already loaded. |
6644 |
Raise an error if not" |
|
6645 |
||
12264 | 6646 |
|classesAlreadyWarned| |
6647 |
||
6648 |
classesAlreadyWarned := Set new. |
|
6649 |
||
13419 | 6650 |
self extensionMethodNames |
23124 | 6651 |
pairWiseDo:[:className :selector | |
6652 |
|class errMsg| |
|
6653 |
||
6654 |
class := Smalltalk classNamed:className. |
|
6655 |
class isNil ifTrue:[ |
|
6656 |
(classesAlreadyWarned includes:className) ifFalse:[ |
|
6657 |
(self classNames includes:className) ifTrue:[ |
|
6658 |
errMsg := 'extension for a class in myself: ',className. |
|
6659 |
] ifFalse:[ |
|
6660 |
errMsg := 'missing class for extension: ',className. |
|
6661 |
]. |
|
6662 |
Logger error:errMsg. |
|
6663 |
self proceedableError:errMsg. |
|
6664 |
classesAlreadyWarned add:className. |
|
6665 |
]. |
|
6666 |
]. |
|
6667 |
] |
|
12263
c6d50824fbba
comment/format in: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12262
diff
changeset
|
6668 |
|
c6d50824fbba
comment/format in: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12262
diff
changeset
|
6669 |
"/ todo: more needed here... |
12731 | 6670 |
|
6671 |
" |
|
6672 |
stx_libjavascript checkPrerequisitesForLoading |
|
6673 |
" |
|
23013 | 6674 |
|
6675 |
"Modified: / 24-05-2018 / 21:04:56 / Claus Gittinger" |
|
12262
24861bbf25fc
added: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12251
diff
changeset
|
6676 |
! |
24861bbf25fc
added: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12251
diff
changeset
|
6677 |
|
15760 | 6678 |
executeHooks: hookSymbol |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
6679 |
"Execute all hooks annotated by the given hook-symbol. |
15760 | 6680 |
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
|
6681 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6682 |
| cls | |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6683 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6684 |
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
|
6685 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6686 |
[ cls notNil ] whileTrue:[ |
24751 | 6687 |
cls class selectorsAndMethodsDo:[:selector :method| |
6688 |
(method annotationAt: hookSymbol) notNil ifTrue:[ |
|
6689 |
method argumentCount == 0 ifTrue:[ |
|
6690 |
self perform: selector |
|
6691 |
] ifFalse:[ |
|
6692 |
self proceedableError:'Hook for %1 may not have arguments'. |
|
6693 |
] |
|
6694 |
] |
|
6695 |
]. |
|
6696 |
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
|
6697 |
]. |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6698 |
|
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6699 |
"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
|
6700 |
"Modified: / 27-11-2012 / 16:15:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23013 | 6701 |
"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
|
6702 |
! |
1511cfd924cd
Merged ProjectDefinition fixes & tweaks required for stx:libjava and mercurial support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14851
diff
changeset
|
6703 |
|
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
6704 |
loadAllAutoloadedClasses |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
6705 |
self allClasses do:[:cls | cls autoload] |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
6706 |
|
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
6707 |
"Created: / 21-08-2011 / 17:24:13 / cg" |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
6708 |
! |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
6709 |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6710 |
loadAllClassesAsAutoloaded:asAutoloaded |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6711 |
"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
|
6712 |
install as autoloaded classes marked to be autoloaded. |
10401 | 6713 |
If asAutoloaded == true, all classes will be installed as autoloaded, even if not marked. |
6714 |
||
6715 |
Answer true, if classes have been loaded" |
|
12028 | 6716 |
|
13411 | 6717 |
^self loadAllClassesAsAutoloaded:asAutoloaded languages: ProgrammingLanguage all |
6718 |
||
6719 |
"Created: / 17-08-2006 / 01:01:14 / cg" |
|
6720 |
"Modified: / 26-10-2006 / 12:30:01 / cg" |
|
6721 |
"Modified: / 16-08-2009 / 13:31:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
6722 |
"Modified: / 19-06-2010 / 11:37:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6723 |
! |
|
6724 |
||
6725 |
loadAllClassesAsAutoloaded:asAutoloaded languages: langs |
|
6726 |
"load (fileIn) classes in given languages that should be present - |
|
6727 |
install as autoloaded classes marked to be autoloaded. |
|
6728 |
If asAutoloaded == true, all classes will be installed as autoloaded, even if not marked. |
|
6729 |
langs should be collection of ProgrammingLanguage available in the system. |
|
6730 |
||
6731 |
Answer true, if classes have been loaded" |
|
6732 |
||
6733 |
|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
|
6734 |
classesWhichFailedToLoad| |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6735 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6736 |
platformName := OperatingSystem platformName. |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6737 |
classNamesToLoad := OrderedCollection new. |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6738 |
classNamesToAutoload := OrderedCollection new. |
13411 | 6739 |
classNamesToLangs := Dictionary new. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6740 |
|
12315
71599fb91dcf
comment/format in: #packageDirectory
Claus Gittinger <cg@exept.de>
parents:
12314
diff
changeset
|
6741 |
hasClassesToLoad := false. |
13419 | 6742 |
self classNamesAndAttributesDo:[:eachClassname :eachAttributes | |
23124 | 6743 |
|eachClassnameSym isAutoload clsLangAttr clsLang cls | |
6744 |
||
6745 |
eachClassnameSym := eachClassname asSymbol. |
|
6746 |
isAutoload := asAutoloaded or:[eachAttributes includes:#autoload]. |
|
6747 |
clsLangAttr := eachAttributes detect:[:a| a isArray and: [a size == 2 and:[a first == #lang]]] ifNone:[nil]. |
|
6748 |
clsLang := clsLangAttr |
|
6749 |
ifNil:[SmalltalkLanguage instance] |
|
6750 |
ifNotNil:[ProgrammingLanguage named: clsLangAttr second ifNone:[nil]]. |
|
6751 |
classNamesToLangs at: eachClassname put: clsLang. |
|
6752 |
||
6753 |
"no need to (re-)load an existing class, but install if should be loaded" |
|
6754 |
cls := Smalltalk loadedClassNamed:eachClassnameSym. |
|
6755 |
((cls isNil or:[cls isLoaded not and:[isAutoload not]]) and:[clsLang notNil and:[langs includes: clsLang]]) ifTrue:[ |
|
6756 |
(eachAttributes isEmpty |
|
6757 |
or:[(eachAttributes size == 1 and:[isAutoload]) |
|
6758 |
or:[(eachAttributes includes:platformName) |
|
6759 |
or:[eachAttributes contains:[:a| a isArray]]]]) "/FIXME: Hack." |
|
6760 |
ifTrue:[ |
|
6761 |
hasClassesToLoad := true. |
|
6762 |
isAutoload ifTrue:[ |
|
6763 |
classNamesToAutoload add:eachClassnameSym. |
|
6764 |
] ifFalse:[ |
|
6765 |
classNamesToLoad add:eachClassnameSym. |
|
6766 |
]. |
|
6767 |
]. |
|
6768 |
]. |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6769 |
]. |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6770 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6771 |
hasClassesToLoad ifTrue:[ |
23124 | 6772 |
loadedClasses := OrderedCollection new. |
6773 |
||
6774 |
self packageDirectory isNil ifTrue:[ |
|
6775 |
classNamesToLoad notEmpty ifTrue:[ |
|
6776 |
"required classes are missing. |
|
6777 |
Autoloaded classes are considered as optional..." |
|
6778 |
self |
|
6779 |
error:(self name,'[error] cannot install because packageDirectory is unknown for missing classes: ', classNamesToLoad printString) |
|
6780 |
mayProceed:true. |
|
6781 |
^ false. |
|
6782 |
]. |
|
6783 |
(self name,'[info] cannot install autoloaded classes because packageDirectory is unknown') infoPrintCR. |
|
6784 |
^ true. |
|
6785 |
]. |
|
6786 |
||
6787 |
"we need the abbreviations, since sometimes there is no 1-to-1 mapping |
|
6788 |
of class name to file name" |
|
6789 |
||
6790 |
Smalltalk recursiveReadAllAbbreviationsFrom:self packageDirectory maxLevels:1. |
|
6791 |
||
6792 |
"install autoloaded classes first, |
|
6793 |
some others may depend on them" |
|
6794 |
||
6795 |
classNamesToAutoload withIndexDo:[:eachClassName :index| |
|
6796 |
ActivityNotification |
|
6797 |
raiseRequestWith: ((100 / classNamesToAutoload size ) * index) rounded |
|
6798 |
errorString: 'Autoloading class ', eachClassName. |
|
6799 |
||
6800 |
self loadClass: eachClassName asAutoloaded: true language: (classNamesToLangs at: eachClassName) . |
|
6801 |
]. |
|
6802 |
||
6803 |
classesWhichFailedToLoad := OrderedCollection new. |
|
6804 |
classNamesToLoad notEmpty ifTrue:[ |
|
6805 |
Verbose ifTrue:[ |
|
6806 |
Transcript showCR:(' %1: filing in missing classes (%2) individually...' |
|
6807 |
bindWith:self name with:classNamesToLoad size). |
|
6808 |
] |
|
6809 |
]. |
|
6810 |
classNamesToLoad withIndexDo:[:eachClassName :index| |
|
6811 |
|cls| |
|
6812 |
ActivityNotification |
|
6813 |
raiseRequestWith: ((100 / classNamesToLoad size) * index) rounded |
|
6814 |
errorString: 'Loading class ', eachClassName. |
|
6815 |
||
6816 |
Error handle:[:ex | |
|
6817 |
"maybe, fileIn failed, because the load order is wrong. |
|
6818 |
Work around this by installing the class as autoloaded and |
|
6819 |
loading it" |
|
6820 |
||
6821 |
classesWhichFailedToLoad add:eachClassName. |
|
6822 |
self loadClass: eachClassName asAutoloaded: true language: (classNamesToLangs at: eachClassName). |
|
6823 |
] do:[ |
|
6824 |
Verbose ifTrue:[ |
|
6825 |
Transcript showCR:(' %1: filing in %2...' bindWith:self name with:eachClassName). |
|
6826 |
]. |
|
6827 |
cls := self loadClass: eachClassName asAutoloaded: false language: (classNamesToLangs at: eachClassName). |
|
6828 |
cls notNil ifTrue:[ |
|
6829 |
loadedClasses add:cls |
|
6830 |
]. |
|
6831 |
]. |
|
6832 |
]. |
|
6833 |
||
6834 |
classesWhichFailedToLoad do:[:eachClassName | |
|
6835 |
(Smalltalk at:eachClassName) autoload. |
|
6836 |
]. |
|
6837 |
||
6838 |
loadedClasses do:[:eachLoadedClass | |
|
6839 |
"do not initialize, if initialize method is inherited" |
|
6840 |
(eachLoadedClass theMetaclass includesSelector:#initialize) ifTrue:[ |
|
6841 |
eachLoadedClass initialize |
|
6842 |
]. |
|
6843 |
]. |
|
6844 |
^ true. |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6845 |
]. |
10401 | 6846 |
^ false. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6847 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6848 |
"Modified: / 26-10-2006 / 12:30:01 / cg" |
12028 | 6849 |
"Modified: / 16-08-2009 / 13:31:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
13411 | 6850 |
"Created: / 19-06-2010 / 11:35:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6851 |
"Modified: / 19-06-2010 / 15:06:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6852 |
! |
|
6853 |
||
6854 |
loadClass: className asAutoloaded: asAutoloaded language: lang |
|
13592 | 6855 |
| packageDir classFile entry category numClassInstVars cls| |
6856 |
||
6857 |
"Handle smalltalk classes specially to provide backward compatibility" |
|
13411 | 6858 |
lang isSmalltalk ifTrue:[ |
23124 | 6859 |
entry := self abbrevs at: className ifAbsent:[nil]. |
6860 |
||
6861 |
asAutoloaded ifTrue:[ |
|
6862 |
category := entry isNil ifTrue:[#autoloaded] ifFalse:[entry category]. |
|
6863 |
numClassInstVars := entry isNil ifTrue:[0] ifFalse:[entry numClassInstVars]. |
|
6864 |
cls := Smalltalk |
|
6865 |
installAutoloadedClassNamed: className |
|
6866 |
category: category |
|
6867 |
package: self package |
|
6868 |
revision: nil |
|
6869 |
numClassInstVars:numClassInstVars. |
|
6870 |
entry notNil ifTrue:[ |
|
6871 |
cls setClassFilename:(entry fileName,'.st'). |
|
6872 |
]. |
|
6873 |
^ cls. |
|
6874 |
]. |
|
6875 |
^ Smalltalk |
|
6876 |
fileInClass:className |
|
6877 |
package:self package |
|
6878 |
initialize:false |
|
6879 |
lazy:false |
|
6880 |
silent:true |
|
13411 | 6881 |
]. |
6882 |
||
6883 |
"For non-smalltalk language do" |
|
6884 |
asAutoloaded ifTrue:[^self error:'Only Smalltalk classes may be autoloaded (yet)']. |
|
6885 |
||
6886 |
packageDir := self packageDirectory asFilename. |
|
6887 |
classFile := packageDir / ((Smalltalk fileNameForClass: className) , '.' , lang sourceFileSuffix). |
|
6888 |
classFile exists ifFalse:[^nil]. |
|
6889 |
lang fileIn: classFile. |
|
6890 |
^nil "FIXME: should return the class" |
|
6891 |
||
6892 |
"Created: / 19-06-2010 / 09:11:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6893 |
"Modified: / 06-03-2011 / 18:29:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13592 | 6894 |
"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
|
6895 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6896 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6897 |
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
|
6898 |
"try to load a binary class library |
16146 | 6899 |
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
|
6900 |
|
12295 | 6901 |
|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
|
6902 |
|
16894 | 6903 |
self supportedOnPlatform ifFalse:[^ false]. |
6904 |
||
10430
fc34b59eca00
Don not try to load a class library already linked to the executable
Stefan Vogel <sv@exept.de>
parents:
10426
diff
changeset
|
6905 |
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
|
6906 |
|
fc34b59eca00
Don not try to load a class library already linked to the executable
Stefan Vogel <sv@exept.de>
parents:
10426
diff
changeset
|
6907 |
(Smalltalk isClassLibraryLoaded:libraryName) ifTrue:[ |
24416 | 6908 |
"already loaded" |
6909 |
^ true |
|
13419 | 6910 |
]. |
14021 | 6911 |
Verbose ifTrue:[ |
24416 | 6912 |
Transcript showCR:' %1: loading classLibrary...' with:self name. |
13419 | 6913 |
]. |
12743 | 6914 |
self activityNotification:'Loading classLibrary'. |
6915 |
||
12295 | 6916 |
^ 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
|
6917 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6918 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6919 |
loadExtensions |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6920 |
"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
|
6921 |
|
16894 | 6922 |
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
|
6923 |
self hasAllExtensionsLoaded ifFalse:[ |
24416 | 6924 |
self breakPoint:#cg. |
6925 |
Verbose ifTrue:[ |
|
6926 |
Transcript showCR:' %1: filing in extensions...' with:self name. |
|
6927 |
]. |
|
6928 |
Smalltalk loadExtensionsForPackage:self package. |
|
6929 |
^ true. |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6930 |
]. |
10401 | 6931 |
^ false. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6932 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6933 |
"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
|
6934 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6935 |
|
15950 | 6936 |
loadExtensionsForLanguage: lang |
6937 |
"load extension methods for given programming language" |
|
6938 |
||
6939 |
| filename file | |
|
16894 | 6940 |
|
6941 |
self supportedOnPlatform ifFalse:[^ self]. |
|
6942 |
||
15950 | 6943 |
filename := 'extensions.' , lang sourceFileSuffix. |
6944 |
file := self packageDirectory / filename. |
|
6945 |
file exists ifTrue:[ |
|
23124 | 6946 |
lang fileIn: file. |
15950 | 6947 |
] |
6948 |
||
6949 |
"Created: / 17-08-2006 / 00:21:39 / cg" |
|
6950 |
"Created: / 25-11-2011 / 18:13:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6951 |
! |
|
6952 |
||
15372 | 6953 |
loadMandatoryPreRequisitesAsAutoloaded:asAutoloaded |
6954 |
"load those packages which are required for loading. |
|
6955 |
Called after my definition has been loaded, but before the rest of the |
|
6956 |
package is." |
|
6957 |
||
6958 |
|prereq| |
|
6959 |
||
23681 | 6960 |
self supportedOnPlatform ifFalse:[^ self]. |
22186 | 6961 |
|
6962 |
prereq := self effectiveMandatoryPreRequisites. |
|
15372 | 6963 |
prereq notEmpty ifTrue:[ |
23681 | 6964 |
Verbose ifTrue:[ |
24416 | 6965 |
Transcript showCR:' %1 loading mandatory prerequisites...' with:self name. |
23681 | 6966 |
]. |
6967 |
self loadPackages:prereq asAutoloaded:asAutoloaded |
|
6968 |
]. |
|
6969 |
||
6970 |
"Modified (format): / 07-02-2019 / 14:23:00 / Claus Gittinger" |
|
15372 | 6971 |
! |
6972 |
||
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6973 |
loadPackages:aListOfPackages asAutoloaded:asAutoloaded |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6974 |
"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
|
6975 |
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
|
6976 |
|
14764
2497dc2ff1ab
tuned prereq-package loading
Claus Gittinger <cg@exept.de>
parents:
14748
diff
changeset
|
6977 |
Class withoutUpdatingChangesDo:[ |
23124 | 6978 |
aListOfPackages do:[:eachPackageID | |
6979 |
|cls| |
|
6980 |
||
6981 |
cls := self definitionClassForPackage:eachPackageID. |
|
6982 |
(cls isNil or:[cls isLoaded not or:[cls projectIsLoaded not]]) ifTrue:[ |
|
6983 |
Smalltalk loadPackage:eachPackageID asAutoloaded:asAutoloaded. |
|
6984 |
]. |
|
6985 |
]. |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6986 |
]. |
13166
aa93e348e5d3
changed: #loadPackages:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13154
diff
changeset
|
6987 |
|
13167 | 6988 |
"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
|
6989 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6990 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6991 |
loadPreRequisitesAsAutoloaded:asAutoloaded |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
6992 |
"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
|
6993 |
|
12743 | 6994 |
|prereq| |
6995 |
||
6996 |
prereq := self effectivePreRequisites. |
|
14843 | 6997 |
prereq notEmpty ifTrue:[ |
24416 | 6998 |
Verbose ifTrue:[ |
6999 |
Transcript showCR:' %1 loading prerequisites...' with:self name. |
|
7000 |
]. |
|
7001 |
self loadPackages:prereq asAutoloaded:asAutoloaded |
|
12743 | 7002 |
]. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
7003 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
7004 |
|
12596 | 7005 |
loadSubProjects |
7006 |
"load other packages (at least the projectDefinitions and their extensions)" |
|
7007 |
||
7008 |
self loadSubProjectsAsAutoloaded:false. |
|
15395 | 7009 |
self effectiveSubProjects do:[:p | |
23124 | 7010 |
|subDef| |
7011 |
||
7012 |
subDef := self definitionClassForPackage:p. |
|
7013 |
subDef notNil ifTrue:[ |
|
7014 |
subDef loadSubProjects |
|
7015 |
]. |
|
12596 | 7016 |
]. |
7017 |
! |
|
7018 |
||
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
7019 |
loadSubProjectsAsAutoloaded:asAutoloaded |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
7020 |
"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
|
7021 |
|
15395 | 7022 |
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
|
7023 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
7024 |
"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
|
7025 |
! |
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
7026 |
|
13411 | 7027 |
old_loadAllClassesAsAutoloaded:asAutoloaded |
7028 |
"load (fileIn) classes that should be present - |
|
7029 |
install as autoloaded classes marked to be autoloaded. |
|
7030 |
If asAutoloaded == true, all classes will be installed as autoloaded, even if not marked. |
|
7031 |
||
7032 |
Answer true, if classes have been loaded" |
|
7033 |
||
7034 |
|classNamesToLoad classNamesToAutoload hasClassesToLoad loadedClasses platformName |
|
7035 |
classesWhichFailedToLoad| |
|
7036 |
||
7037 |
platformName := OperatingSystem platformName. |
|
7038 |
classNamesToLoad := OrderedCollection new. |
|
7039 |
classNamesToAutoload := OrderedCollection new. |
|
7040 |
||
7041 |
hasClassesToLoad := false. |
|
13419 | 7042 |
self classNamesAndAttributesDo:[:eachClassname :eachAttributes | |
23124 | 7043 |
|eachClassnameSym isAutoload cls| |
7044 |
||
7045 |
eachClassnameSym := eachClassname asSymbol. |
|
7046 |
isAutoload := asAutoloaded or:[eachAttributes includes:#autoload]. |
|
7047 |
||
7048 |
"no need to (re-)load an existing class, but install if should be loaded" |
|
7049 |
cls := Smalltalk loadedClassNamed:eachClassnameSym. |
|
7050 |
(cls isNil or:[cls isLoaded not and:[isAutoload not]]) ifTrue:[ |
|
7051 |
(eachAttributes isEmpty |
|
7052 |
or:[(eachAttributes size == 1 and:[isAutoload]) |
|
7053 |
or:[eachAttributes includes:platformName]]) ifTrue:[ |
|
7054 |
hasClassesToLoad := true. |
|
7055 |
isAutoload ifTrue:[ |
|
7056 |
classNamesToAutoload add:eachClassnameSym. |
|
7057 |
] ifFalse:[ |
|
7058 |
classNamesToLoad add:eachClassnameSym. |
|
7059 |
]. |
|
7060 |
]. |
|
7061 |
]. |
|
13411 | 7062 |
]. |
7063 |
||
7064 |
hasClassesToLoad ifTrue:[ |
|
23124 | 7065 |
loadedClasses := OrderedCollection new. |
7066 |
||
7067 |
self packageDirectory isNil ifTrue:[ |
|
7068 |
self |
|
7069 |
error:(self name,'[error] cannot install because packageDirectory is unknown') |
|
7070 |
mayProceed:true. |
|
7071 |
^ false. |
|
7072 |
]. |
|
7073 |
||
7074 |
"we need the abbreviations, since sometimes there is no 1-to-1 mapping |
|
7075 |
of class name to file name" |
|
7076 |
||
7077 |
Smalltalk recursiveReadAllAbbreviationsFrom:self packageDirectory maxLevels:1. |
|
7078 |
||
7079 |
"install autoloaded classes first, |
|
7080 |
some others may depend on them" |
|
7081 |
||
7082 |
classNamesToAutoload withIndexDo:[:eachClassName :index| |
|
7083 |
ActivityNotification |
|
7084 |
raiseRequestWith: ((100 / classNamesToAutoload size ) * index) rounded |
|
7085 |
errorString: 'Autoloading class ', eachClassName. |
|
7086 |
||
7087 |
Smalltalk |
|
7088 |
installAutoloadedClassNamed:eachClassName |
|
7089 |
category:#autoloaded "FIXME" |
|
7090 |
package:self package |
|
7091 |
revision:nil |
|
7092 |
numClassInstVars:0. "FIXME" |
|
7093 |
]. |
|
7094 |
||
7095 |
classesWhichFailedToLoad := OrderedCollection new. |
|
7096 |
classNamesToLoad notEmpty ifTrue:[ |
|
7097 |
Verbose ifTrue:[ |
|
7098 |
Transcript showCR:(' %1: filing in missing classes (%2) individually...' |
|
7099 |
bindWith:self name with:classNamesToLoad size). |
|
7100 |
] |
|
7101 |
]. |
|
7102 |
classNamesToLoad withIndexDo:[:eachClassName :index| |
|
7103 |
|cls| |
|
7104 |
ActivityNotification |
|
7105 |
raiseRequestWith: ((100 / classNamesToLoad size) * index) rounded |
|
7106 |
errorString: 'Loading class ', eachClassName. |
|
7107 |
||
7108 |
Error handle:[:ex | |
|
7109 |
"maybe, fileIn failed, because the load order is wrong. |
|
7110 |
Work around this by installing the class as autoloaded and |
|
7111 |
loading it" |
|
7112 |
||
7113 |
classesWhichFailedToLoad add:eachClassName. |
|
7114 |
Smalltalk |
|
7115 |
installAutoloadedClassNamed:eachClassName |
|
7116 |
category:#autoloaded "FIXME" |
|
7117 |
package:self package |
|
7118 |
revision:nil |
|
7119 |
numClassInstVars:0. "FIXME" |
|
7120 |
] do:[ |
|
7121 |
Verbose ifTrue:[ |
|
7122 |
Transcript showCR:(' %1: filing in %2...' bindWith:self name with:eachClassName). |
|
7123 |
]. |
|
7124 |
cls := Smalltalk |
|
7125 |
fileInClass:eachClassName |
|
7126 |
package:self package |
|
7127 |
initialize:false |
|
7128 |
lazy:false |
|
7129 |
silent:true. |
|
7130 |
cls notNil ifTrue:[ |
|
7131 |
loadedClasses add:cls |
|
7132 |
]. |
|
7133 |
]. |
|
7134 |
]. |
|
7135 |
||
7136 |
classesWhichFailedToLoad do:[:eachClassName | |
|
7137 |
(Smalltalk at:eachClassName) autoload. |
|
7138 |
]. |
|
7139 |
||
7140 |
loadedClasses do:[:eachLoadedClass | |
|
7141 |
"do not initialize, if initialize method is inherited" |
|
7142 |
(eachLoadedClass theMetaclass includesSelector:#initialize) ifTrue:[ |
|
7143 |
eachLoadedClass initialize |
|
7144 |
]. |
|
7145 |
]. |
|
7146 |
^ true. |
|
13411 | 7147 |
]. |
7148 |
^ false. |
|
7149 |
||
7150 |
"Modified: / 26-10-2006 / 12:30:01 / cg" |
|
7151 |
"Modified: / 16-08-2009 / 13:31:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
7152 |
"Created: / 19-06-2010 / 11:36:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
7153 |
! |
|
7154 |
||
12624 | 7155 |
unloadAllClasses |
20605 | 7156 |
Logger warning:'unloading not yet fully supported' |
12624 | 7157 |
! |
7158 |
||
7159 |
unloadClassLibrary |
|
20604 | 7160 |
Logger warning:'unloading not yet fully supported' |
12624 | 7161 |
! |
7162 |
||
7163 |
unloadSubProjects |
|
7164 |
"unload other packages" |
|
7165 |
||
15395 | 7166 |
self effectiveSubProjects do:[:p | |
23124 | 7167 |
|subDef| |
7168 |
||
7169 |
subDef := self definitionClassForPackage:p. |
|
7170 |
subDef notNil ifTrue:[ |
|
7171 |
subDef unloadSubProjects. |
|
7172 |
subDef unloadPackage. |
|
7173 |
]. |
|
12624 | 7174 |
]. |
7175 |
! |
|
7176 |
||
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
7177 |
update:anAspectSymbol with:argument from:changedObject |
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
7178 |
"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
|
7179 |
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
|
7180 |
|
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
7181 |
(changedObject == self class and:[anAspectSymbol == #methodDictionary]) ifTrue:[ |
23124 | 7182 |
self projectIsLoaded:false. |
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
7183 |
] |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
7184 |
! ! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
7185 |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7186 |
!ProjectDefinition class methodsFor:'private-prerequisites'! |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7187 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7188 |
addReferencesToClassesFromGlobalsIn:aSetOfClasses to:usedClassReasons |
12371 | 7189 |
"helper for searchForPreRequisites" |
7190 |
||
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7191 |
aSetOfClasses |
23124 | 7192 |
do:[:aClass | |
7193 |
self |
|
7194 |
addReferencesToClassesFromGlobalsInMethods: |
|
7195 |
(aClass theNonMetaclass methodDictionary values |
|
7196 |
reject:[:m | m isExtension]) |
|
7197 |
to:usedClassReasons. |
|
7198 |
||
7199 |
self |
|
7200 |
addReferencesToClassesFromGlobalsInMethods: |
|
7201 |
(aClass theMetaclass methodDictionary values |
|
7202 |
reject:[:m | m isExtension]) |
|
7203 |
to:usedClassReasons. |
|
7204 |
]. |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7205 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7206 |
"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
|
7207 |
! |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7208 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7209 |
addReferencesToClassesFromGlobalsInMethods:someMethods to:usedClassReasons |
12371 | 7210 |
"helper for searchForPreRequisites" |
7211 |
||
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7212 |
someMethods do:[:method | |
23124 | 7213 |
|resources| |
7214 |
||
7215 |
resources := method resources. |
|
7216 |
(resources isNil |
|
7217 |
or:[ ((resources includesKey:#'ignoreInPrerequisites') not |
|
7218 |
and:[(resources includesKey:#'example') not])]) |
|
7219 |
ifTrue:[ |
|
7220 |
method usedGlobals |
|
7221 |
do:[:global | |
|
7222 |
|globalsName usedClass| |
|
7223 |
||
7224 |
globalsName := global asSymbol. |
|
7225 |
usedClass := Smalltalk at:globalsName. |
|
7226 |
(usedClass notNil and:[usedClass isClass and:[usedClass isNameSpace not]]) ifTrue:[ |
|
7227 |
usedClass name == globalsName ifTrue:[ "/ skip aliases |
|
7228 |
(usedClassReasons at:usedClass ifAbsentPut:[Set new]) |
|
7229 |
add:(usedClass name, ' - referenced by ', method mclass name,'>>',method selector) |
|
7230 |
] |
|
7231 |
] |
|
7232 |
] |
|
7233 |
] |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7234 |
] |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7235 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7236 |
"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
|
7237 |
"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
|
7238 |
! |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7239 |
|
15066 | 7240 |
addReferencesToExtensionMethodsIn:someClasses to:usedMethodReasons |
7241 |
"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
|
7242 |
is defined in an extension method (in the set of passed-in methods). |
15066 | 7243 |
If found, add the extension method and a reason string to usedReasons. |
7244 |
This should find especially sends to extension methods from libcompat." |
|
7245 |
||
16257 | 7246 |
|allRealExtensions| |
7247 |
||
15066 | 7248 |
"/ 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
|
7249 |
allRealExtensions := Smalltalk allExtensions |
23124 | 7250 |
select:[:mthd | |
7251 |
|superClass| |
|
7252 |
superClass := mthd mclass superclass. |
|
7253 |
(superClass isNil or:[superClass whichClassIncludesSelector:mthd selector]) isNil |
|
7254 |
]. |
|
15066 | 7255 |
|
7256 |
someClasses do:[:eachClass | |
|
23124 | 7257 |
eachClass instAndClassMethodsDo:[:method | |
7258 |
|resources extensionsSent| |
|
7259 |
||
7260 |
resources := method resources. |
|
7261 |
(resources isNil |
|
7262 |
or:[ ((resources includesKey:#'ignoreInPrerequisites') not |
|
7263 |
and:[(resources includesKey:#'example') not])]) |
|
7264 |
ifTrue:[ |
|
7265 |
extensionsSent := allRealExtensions select:[:ext | method messagesSent includes:ext selector]. |
|
7266 |
extensionsSent do:[:eachExtensionMethod | |
|
7267 |
(usedMethodReasons at:eachExtensionMethod ifAbsentPut:[Set new]) |
|
7268 |
add:(eachExtensionMethod selector, ' - sent by ', method mclass name,'>>',method selector) |
|
7269 |
] |
|
7270 |
] |
|
7271 |
] |
|
15066 | 7272 |
] |
7273 |
! |
|
7274 |
||
19955 | 7275 |
allMandatoryPreRequisites |
7276 |
"answer all (recursive) mandatory prerequisite project ids of myself - in random order." |
|
7277 |
||
7278 |
^ self allPreRequisites:#effectiveMandatoryPreRequisites. |
|
7279 |
||
7280 |
" |
|
23124 | 7281 |
stx_libbasic allMandatoryPreRequisites |
19955 | 7282 |
stx_libbasic2 allMandatoryPreRequisites |
23124 | 7283 |
stx_libview2 allMandatoryPreRequisites |
7284 |
stx_libcomp allMandatoryPreRequisites |
|
19955 | 7285 |
" |
7286 |
||
7287 |
"Created: / 06-06-2016 / 12:19:39 / cg" |
|
7288 |
! |
|
7289 |
||
7290 |
allMandatoryPreRequisitesSorted |
|
7291 |
[ |
|
23124 | 7292 |
^ self allPreRequisitesSorted:#effectiveMandatoryPreRequisites |
19955 | 7293 |
] on:Error do:[:ex | |
23124 | 7294 |
(self confirm:(self name,' [warning]: cycle in prerequisites:' ,, Character cr, ' ', (ex parameter printStringWithSeparator:' -> ') ,, Character cr, 'Proceed with incomplete (mandatory) prerequites?')) |
7295 |
ifFalse:[ |
|
7296 |
AbortOperationRequest raise |
|
7297 |
]. |
|
7298 |
^ self allPreRequisitesSorted:#mandatoryPreRequisites |
|
19955 | 7299 |
]. |
7300 |
||
7301 |
"Created: / 06-06-2016 / 12:20:40 / cg" |
|
7302 |
! |
|
7303 |
||
14843 | 7304 |
allPreRequisites |
7305 |
"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
|
7306 |
|
14885 | 7307 |
^ self allPreRequisites:#effectivePreRequisites. |
14843 | 7308 |
|
7309 |
" |
|
7310 |
stx_libbasic allPreRequisites |
|
7311 |
stx_libbasic2 allPreRequisites |
|
7312 |
stx_libview2 allPreRequisites |
|
7313 |
ubs_application allPreRequisites |
|
7314 |
ubs_application allPreRequisitesSorted |
|
7315 |
exept_expecco_application allPreRequisites |
|
7316 |
exept_expeccoNET_application allPreRequisites |
|
7317 |
alspa_batch_application allPreRequisites" |
|
7318 |
"Modified: / 13-04-2011 / 15:30:45 / sr" |
|
7319 |
"Modified (comment): / 06-09-2011 / 08:26:06 / cg" |
|
7320 |
! |
|
7321 |
||
14882 | 7322 |
allPreRequisites:aSelector |
7323 |
"answer all (recursive) prerequisite project ids of myself - in random order." |
|
7324 |
||
7325 |
|result| |
|
7326 |
||
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7327 |
result := self |
24416 | 7328 |
allPreRequisites:aSelector withParentDo:[:parent :prereq | |
7329 |
prereq = self package ifTrue:[ |
|
7330 |
Transcript showCR:'oops: %1 depends on itself' with:prereq |
|
7331 |
]. |
|
7332 |
]. |
|
14882 | 7333 |
result remove:self package ifAbsent:[]. |
7334 |
^ result. |
|
7335 |
||
7336 |
" |
|
7337 |
stx_libbasic allPreRequisites |
|
7338 |
stx_libbasic2 allPreRequisites |
|
7339 |
stx_libview2 allPreRequisites |
|
7340 |
ubs_application allPreRequisites |
|
7341 |
ubs_application allPreRequisitesSorted |
|
7342 |
exept_expecco_application allPreRequisites |
|
7343 |
exept_expeccoNET_application allPreRequisites |
|
7344 |
alspa_batch_application allPreRequisites" |
|
7345 |
"Modified: / 13-04-2011 / 15:30:45 / sr" |
|
7346 |
"Modified (comment): / 06-09-2011 / 08:26:06 / cg" |
|
7347 |
! |
|
7348 |
||
7349 |
allPreRequisites:aSelector withParentDo:aBlock |
|
7350 |
"answer all (recursive) prerequisite project ids of myself - in random order. |
|
7351 |
If we exclude a project, but one of our prerequisite projects depends on it, |
|
7352 |
then what ????" |
|
7353 |
||
7354 |
|setOfAllPreRequisites toAdd| |
|
7355 |
||
7356 |
setOfAllPreRequisites := Set new. |
|
7357 |
toAdd := Set withAll:(self perform:aSelector). |
|
7358 |
||
7359 |
"is a subproject really a prerequisite?? |
|
7360 |
No, it works the other way: parent projects are prerequisites of sub projects, |
|
7361 |
so the following line has been deleted. |
|
7362 |
Unfortunately the meaning of 'subproject' has never been well defined. SV." |
|
7363 |
"/ toAdd addAll:self effectiveSubProjects. |
|
7364 |
||
7365 |
[toAdd notEmpty] whileTrue:[ |
|
23124 | 7366 |
|aPreRequisiteProjectID def| |
7367 |
||
7368 |
aPreRequisiteProjectID := toAdd removeFirst. |
|
7369 |
(setOfAllPreRequisites includes:aPreRequisiteProjectID) ifFalse:[ |
|
7370 |
setOfAllPreRequisites add:aPreRequisiteProjectID. |
|
7371 |
||
7372 |
def := self definitionClassForPackage:aPreRequisiteProjectID. |
|
7373 |
def isNil ifTrue:[ |
|
7374 |
Transcript showCR:'ProjectDefinition ', aPreRequisiteProjectID, ' is missing - cannot find its preRequisites.'. |
|
7375 |
] ifFalse:[ |
|
7376 |
(def perform:aSelector) |
|
7377 |
select:[:eachSubPreRequisite | (setOfAllPreRequisites includes:eachSubPreRequisite) not] |
|
7378 |
thenDo:[:eachSubPreRequisite | |
|
7379 |
Verbose == true ifTrue:[ |
|
7380 |
Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' requires ', eachSubPreRequisite). |
|
7381 |
]. |
|
7382 |
aBlock value:def value:eachSubPreRequisite. |
|
7383 |
toAdd add:eachSubPreRequisite |
|
7384 |
]. |
|
7385 |
||
7386 |
"but subprojects of our prerequisites are also prerequisites" |
|
14994 | 7387 |
"/ SV: - I don't think so. Either we need them, because they have classes being superclasses |
19587 | 7388 |
"/ or referenced. Or we include the explicitly. In both cases we do not need this code. |
14994 | 7389 |
"/ But we do not want them only because there is a subProject with examples or tests!! |
7390 |
||
7391 |
"/ def effectiveSubProjects |
|
7392 |
"/ select:[:eachSubSubRequisite | eachSubSubRequisite ~= self package and:[ (setOfAllPreRequisites includes:eachSubSubRequisite) not ]] |
|
7393 |
"/ thenDo:[:eachSubSubRequisite | |
|
7394 |
"/ Verbose == true ifTrue:[ |
|
7395 |
"/ Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' hasSub ', eachSubSubRequisite). |
|
7396 |
"/ ]. |
|
7397 |
"/ aBlock value:def value:eachSubSubRequisite. |
|
7398 |
"/ toAdd add:eachSubSubRequisite |
|
7399 |
"/ ]. |
|
23124 | 7400 |
]. |
7401 |
] |
|
14882 | 7402 |
]. |
7403 |
^ setOfAllPreRequisites. |
|
7404 |
||
7405 |
" |
|
7406 |
stx_libbasic allPreRequisites |
|
7407 |
stx_libbasic2 allPreRequisites |
|
7408 |
stx_libview2 allPreRequisites |
|
7409 |
ubs_application allPreRequisites |
|
7410 |
ubs_application allPreRequisitesSorted |
|
7411 |
exept_expecco_application allPreRequisites |
|
7412 |
exept_expeccoNET_application allPreRequisites |
|
7413 |
alspa_batch_application allPreRequisites |
|
7414 |
" |
|
7415 |
||
7416 |
"Created: / 13-04-2011 / 15:23:21 / sr" |
|
7417 |
"Modified: / 20-07-2012 / 18:29:31 / cg" |
|
7418 |
! |
|
7419 |
||
14843 | 7420 |
allPreRequisitesSorted |
18178 | 7421 |
[ |
23124 | 7422 |
^ self allPreRequisitesSorted:#effectivePreRequisites |
18178 | 7423 |
] on:Error do:[:ex | |
23124 | 7424 |
(self confirm:(self name,' [warning]: cycle in prerequisites:' ,, Character cr, ' ', (ex parameter printStringWithSeparator:' -> ') ,, Character cr, 'Proceed with incomplete (only mandatory) prerequites?')) |
7425 |
ifFalse:[ |
|
7426 |
AbortOperationRequest raise |
|
7427 |
]. |
|
7428 |
^ self allPreRequisitesSorted:#mandatoryPreRequisites |
|
18178 | 7429 |
]. |
21509 | 7430 |
|
7431 |
"Modified: / 21-02-2017 / 17:53:35 / cg" |
|
14843 | 7432 |
! |
7433 |
||
14882 | 7434 |
allPreRequisitesSorted:aSelector |
7435 |
"answer all the prerequisites of this projects sorted in |
|
7436 |
the order they are needed. |
|
7437 |
Use this to e.g. compile packages in the dependency order" |
|
7438 |
||
7439 |
|allPreRequisites orderedTuples sortedPackages| |
|
7440 |
||
7441 |
orderedTuples := OrderedCollection new. |
|
7442 |
allPreRequisites := self allPreRequisites:aSelector. |
|
16540
12807abd853b
Use stable topological sort when sorting prerequisites.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16328
diff
changeset
|
7443 |
allPreRequisites := allPreRequisites collect:[ :e | e asString ]. |
14882 | 7444 |
|
7445 |
"/JV@2013-03-13: Added asSortedCollection to make the order of packages |
|
7446 |
"/as stable as possible. Makes merging of makefiles a lot easier. |
|
7447 |
allPreRequisites asSortedCollection do:[:eachPackageID | |
|
23124 | 7448 |
|def preRequisites| |
7449 |
||
7450 |
self assert:(eachPackageID ~= self package). |
|
7451 |
orderedTuples add:(Array with:eachPackageID with:self package). |
|
7452 |
||
7453 |
def := self definitionClassForPackage:eachPackageID. |
|
7454 |
def isNil ifTrue:[ |
|
7455 |
Transcript showCR:'Warning: no definition class for package: ', eachPackageID. |
|
7456 |
((self searchForPreRequisites: eachPackageID) |
|
7457 |
fold:[:d1 :d2| d1 addAll:d2; yourself]) keys |
|
7458 |
] ifFalse:[ |
|
7459 |
preRequisites := def perform:aSelector. |
|
7460 |
preRequisites := preRequisites copyWithoutAll:def excludedFromPreRequisites. |
|
7461 |
preRequisites do:[:eachPrerequisitePackageID| |
|
7462 |
self assert:(eachPrerequisitePackageID ~= eachPackageID). |
|
7463 |
orderedTuples add:(Array with:eachPrerequisitePackageID with:eachPackageID). |
|
7464 |
]. |
|
7465 |
]. |
|
14882 | 7466 |
]. |
7467 |
||
16812 | 7468 |
(orderedTuples contains:[:el | el first = el second]) ifTrue:[ |
23124 | 7469 |
self halt:'something seems to depend upon itself' |
14882 | 7470 |
]. |
16540
12807abd853b
Use stable topological sort when sorting prerequisites.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16328
diff
changeset
|
7471 |
sortedPackages := orderedTuples topologicalSortStable: true. |
14882 | 7472 |
|
7473 |
"packages which only result from extension methods are used for computing the sort order, |
|
7474 |
but they are not added, if not present in the first place" |
|
7475 |
^ sortedPackages select:[:eachProject| allPreRequisites includes:eachProject] |
|
7476 |
||
7477 |
" |
|
7478 |
stx_libbasic allPreRequisitesSorted |
|
7479 |
stx_libbasic2 allPreRequisitesSorted |
|
7480 |
stx_libwidg2 allPreRequisitesSorted |
|
7481 |
exept_expecco allPreRequisitesSorted |
|
7482 |
alspa_batch_application allPreRequisitesSorted |
|
7483 |
ubs_application allPreRequisitesSorted |
|
7484 |
" |
|
7485 |
||
7486 |
"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
|
7487 |
"Modified: / 05-06-2014 / 12:22:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14882 | 7488 |
! |
7489 |
||
19955 | 7490 |
allPreRequisitesWithMandatorySorted |
7491 |
"a list of all prerequisites (mandatory and non-mandatory, |
|
7492 |
with the mandatory ones coming first and being sorted by dependency" |
|
7493 |
||
7494 |
|pre mandatory| |
|
7495 |
||
7496 |
mandatory := self allMandatoryPreRequisitesSorted. |
|
7497 |
pre := OrderedSet withAll:mandatory. |
|
7498 |
self allPreRequisites do:[:each | |
|
23124 | 7499 |
(mandatory includes:each) ifFalse:[ pre add: each ] |
19955 | 7500 |
]. |
7501 |
^ pre |
|
7502 |
||
7503 |
"Created: / 06-06-2016 / 14:30:25 / cg" |
|
7504 |
! |
|
7505 |
||
14882 | 7506 |
allReferences |
7507 |
"answer all (recursive) projects to which I refer - in random order." |
|
7508 |
||
7509 |
|result| |
|
7510 |
||
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7511 |
result := self |
24416 | 7512 |
allPreRequisites:#referencedPreRequisites withParentDo:[:parent :prereq | |
7513 |
prereq = self package ifTrue:[ |
|
7514 |
Transcript showCR:'oops: %1 depends on itself' with:prereq |
|
7515 |
]. |
|
7516 |
]. |
|
14882 | 7517 |
result remove:self package ifAbsent:[]. |
7518 |
^ result. |
|
7519 |
||
7520 |
" |
|
7521 |
stx_libbasic allReferences |
|
7522 |
stx_libbasic2 allReferences |
|
7523 |
stx_libview2 allReferences |
|
7524 |
ubs_application allReferences |
|
7525 |
ubs_application allReferences |
|
7526 |
exept_expecco_application allReferences |
|
7527 |
exept_expeccoNET_application allReferences |
|
7528 |
alspa_batch_application allReferences |
|
7529 |
" |
|
7530 |
! |
|
7531 |
||
15082 | 7532 |
effectiveMandatoryPreRequisites |
15372 | 7533 |
"get the preRequisites, that are not excluded, which are needed for loading |
7534 |
and compiling (i.e. which must be present BEFORE)" |
|
15082 | 7535 |
|
7536 |
self mandatoryPreRequisites notEmpty ifTrue:[ |
|
23124 | 7537 |
"this is a new subclass - avoid overhead" |
7538 |
^ OrderedSet new |
|
7539 |
addAll:self mandatoryPreRequisites; |
|
7540 |
"/ addAll:self includedInPreRequisites; |
|
7541 |
removeAllFoundIn:self excludedFromMandatoryPreRequisites; |
|
7542 |
removeAllFoundIn:self excludedFromPreRequisites; |
|
7543 |
yourself. |
|
15082 | 7544 |
]. |
7545 |
||
7546 |
"I am an old subclass, where #preRequisites returns a plain array" |
|
7547 |
^ Set new |
|
23124 | 7548 |
addAll:self preRequisites; |
7549 |
addAll:self includedInPreRequisites; |
|
7550 |
removeAllFoundIn:self excludedFromMandatoryPreRequisites; |
|
7551 |
removeAllFoundIn:self excludedFromPreRequisites; |
|
7552 |
remove:self package ifAbsent:[]; |
|
7553 |
yourself. |
|
15082 | 7554 |
! |
7555 |
||
14843 | 7556 |
effectivePreRequisites |
7557 |
"get the preRequisites, that are not excluded. |
|
7558 |
This method appears to be obsolete, because its functionality |
|
7559 |
is now included in #preRequisites. |
|
20527 | 7560 |
But is to be kept for backward compatibilty with old existing subclasses." |
14843 | 7561 |
|
7562 |
self mandatoryPreRequisites notEmpty ifTrue:[ |
|
23124 | 7563 |
"this is a new subclass - avoid overhead" |
7564 |
^ self preRequisites. |
|
14843 | 7565 |
]. |
7566 |
||
15082 | 7567 |
"I am an old subclass, where #preRequisites returns a plain array" |
14843 | 7568 |
^ Set new |
23124 | 7569 |
addAll:self preRequisites; |
7570 |
addAll:self includedInPreRequisites; |
|
7571 |
removeAllFoundIn:self excludedFromPreRequisites; |
|
7572 |
remove:self package ifAbsent:[]; |
|
7573 |
yourself. |
|
14843 | 7574 |
! |
7575 |
||
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7576 |
searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7577 |
"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
|
7578 |
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
|
7579 |
|
15024 | 7580 |
^ self searchForPreRequisites:self package |
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7581 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7582 |
" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7583 |
self searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7584 |
stx_libbasic3 searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7585 |
bosch_dapasx_Application searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7586 |
bosch_dapasx_pav_browser searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7587 |
" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7588 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7589 |
"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
|
7590 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7591 |
"Modified: / 06-09-2011 / 08:30:43 / cg" |
13411 | 7592 |
! |
7593 |
||
7594 |
searchForPreRequisites: packageId |
|
14860 | 7595 |
"answer an array containing two Dictionaries where the keys are the prerequisite package for the given package |
7596 |
and the values are a Set of reasons, why each key package is required. |
|
7597 |
The first entry in the array are the mandatory prereqs (required for compilation), |
|
7598 |
the second entry are the referenced prereqs (required for loading). |
|
7599 |
Referenced prereqs are due to elements accessed at execution time (such as globals)" |
|
13411 | 7600 |
|
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7601 |
^ self searchForPreRequisites: packageId withSubProjects:false |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7602 |
|
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7603 |
" |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7604 |
self searchForPreRequisites |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7605 |
self searchForPreRequisites:#'stx:libwidg3' |
14860 | 7606 |
self searchForPreRequisites:#'stx:libtool' |
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7607 |
bosch_dapasx_Application searchForPreRequisites |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7608 |
bosch_dapasx_pav_browser searchForPreRequisites |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7609 |
" |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7610 |
|
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7611 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7612 |
"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
|
7613 |
"Modified: / 06-09-2011 / 08:30:20 / cg" |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7614 |
! |
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7615 |
|
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7616 |
searchForPreRequisites:packageId withSubProjects:withSubProjectsBoolean |
14860 | 7617 |
"answer an array containing two Dictionaries where the keys are the prerequisite package for the given package |
7618 |
and the values are a Set of reasons, why each key package is required. |
|
7619 |
The first entry in the array are the mandatory prereqs (required for compilation), |
|
7620 |
the second entry are the referenced prereqs (required for loading). |
|
7621 |
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
|
7622 |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7623 |
|requiredClasses mandatoryClassesForLoadingWithReasons referencedClassesWithReasons |
15066 | 7624 |
ignoredPackages packageExtractionBlock mandatoryPackageReasons referencedPackageReasons referencedMethodsWithReasons| |
14843 | 7625 |
|
7626 |
mandatoryClassesForLoadingWithReasons := Dictionary new. |
|
7627 |
referencedClassesWithReasons := Dictionary new. |
|
15066 | 7628 |
referencedMethodsWithReasons := Dictionary new. |
13411 | 7629 |
|
7630 |
"my classes are required" |
|
15098 | 7631 |
requiredClasses := self searchForClassesWithProject: packageId. |
13411 | 7632 |
|
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7633 |
withSubProjectsBoolean ifTrue:[ |
23124 | 7634 |
"my subproject's classes are required" |
7635 |
self effectiveSubProjects do:[:eachProjectName | |
|
7636 |
requiredClasses addAll:(self searchForClassesWithProject:eachProjectName asSymbol) |
|
7637 |
]. |
|
13635
b07e00f94949
searchForPreRequisites:withSubProjects:
Claus Gittinger <cg@exept.de>
parents:
13623
diff
changeset
|
7638 |
]. |
13411 | 7639 |
|
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
|
7640 |
"/ ..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
|
7641 |
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
|
7642 |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7643 |
"all superclasses of my classes |
15098 | 7644 |
and my subProject's classes (if required) are mandatory. |
7645 |
All shared pools used by my classes are required as well" |
|
13419 | 7646 |
requiredClasses do:[:cls | |
23124 | 7647 |
(self autoloaded_classNames includes:cls name) ifFalse:[ |
7648 |
cls allSuperclassesDo:[:eachSuperclass | |
|
7649 |
(mandatoryClassesForLoadingWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new]) |
|
7650 |
add: (eachSuperclass name, ' - superclass of ', cls name). |
|
7651 |
]. |
|
7652 |
]. |
|
7653 |
cls sharedPools do:[:eachSharedPool | |
|
7654 |
(mandatoryClassesForLoadingWithReasons at: eachSharedPool ifAbsentPut:[OrderedSet new]) |
|
7655 |
add: (eachSharedPool name, ' - shared pool used by ', cls name). |
|
7656 |
eachSharedPool allSuperclassesDo:[:eachSuperclass | |
|
7657 |
(mandatoryClassesForLoadingWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new]) |
|
7658 |
add: (eachSuperclass name, ' - superclass of shared pool ', eachSharedPool name). |
|
7659 |
] |
|
7660 |
] |
|
13411 | 7661 |
]. |
14843 | 7662 |
"all classes for which I define extensions are mandatory" |
7663 |
self allExtensionClasses do:[:eachExtendedClass | |
|
23124 | 7664 |
(mandatoryClassesForLoadingWithReasons at:eachExtendedClass ifAbsentPut:[OrderedSet new]) |
7665 |
add: (eachExtendedClass name, ' - extended'). |
|
7666 |
eachExtendedClass allSuperclassesDo:[:eachSuperclass | |
|
7667 |
(mandatoryClassesForLoadingWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new]) |
|
7668 |
add: (eachSuperclass name, ' - superclass of extended ', eachExtendedClass name). |
|
7669 |
] |
|
14843 | 7670 |
]. |
13411 | 7671 |
|
7672 |
"all classes referenced by my classes or my subproject's classes |
|
7673 |
are required. But: |
|
23124 | 7674 |
only search for locals refered to by my methods (assuming that superclasses' |
7675 |
prerequisites are specified in their package)." |
|
13411 | 7676 |
|
14843 | 7677 |
self addReferencesToClassesFromGlobalsIn:requiredClasses to:referencedClassesWithReasons. |
7678 |
self addReferencesToClassesFromGlobalsInMethods:(self searchForExtensionsWithProject:self package) to:referencedClassesWithReasons. |
|
15066 | 7679 |
self addReferencesToExtensionMethodsIn:requiredClasses to:referencedMethodsWithReasons. |
14843 | 7680 |
|
13411 | 7681 |
"now map classes to packages and collect the reasons" |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7682 |
packageExtractionBlock := |
23124 | 7683 |
[:classesWithReasons| |
7684 |
|requiredPackageReasons| |
|
7685 |
requiredPackageReasons := Dictionary new. |
|
7686 |
classesWithReasons keysAndValuesDo:[:usedClass :reasonsPerClass| |
|
7687 |
(requiredPackageReasons at:usedClass package ifAbsentPut:[Set new]) |
|
7688 |
addAll:reasonsPerClass. |
|
7689 |
]. |
|
7690 |
"sort, to avoid differences from one generation to the next one" |
|
7691 |
requiredPackageReasons |
|
7692 |
]. |
|
14843 | 7693 |
|
15066 | 7694 |
mandatoryPackageReasons := packageExtractionBlock value:mandatoryClassesForLoadingWithReasons. |
15126 | 7695 |
|
15066 | 7696 |
referencedPackageReasons := packageExtractionBlock value:referencedClassesWithReasons. |
7697 |
||
7698 |
"and map extension method invocations to packages and collect the reasons" |
|
7699 |
referencedMethodsWithReasons keysAndValuesDo:[:usedMethod :reasonsPerMethod | |
|
23124 | 7700 |
(referencedPackageReasons at:usedMethod package ifAbsentPut:[Set new]) |
7701 |
addAll:reasonsPerMethod. |
|
15066 | 7702 |
]. |
14885 | 7703 |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7704 |
ignoredPackages := Set |
23124 | 7705 |
with:packageId |
7706 |
with:PackageId noProjectID. |
|
14885 | 7707 |
|
15066 | 7708 |
referencedPackageReasons removeAllKeys:ignoredPackages ifAbsent:[]. |
15126 | 7709 |
"sort, to avoid differences from one generation to the next one" |
7710 |
referencedPackageReasons keysAndValuesDo:[:eachPackageId :eachReasons | referencedPackageReasons at:eachPackageId put:eachReasons asSortedCollection]. |
|
14885 | 7711 |
|
7712 |
"don't put classes from subProjects into the required list" |
|
7713 |
ignoredPackages addAll:(self siblingsAreSubProjects |
|
23124 | 7714 |
ifTrue:[ self searchForSiblingProjects ] |
7715 |
ifFalse:[ self searchForSubProjects ]) asSet. |
|
14885 | 7716 |
|
15066 | 7717 |
mandatoryPackageReasons removeAllKeys:ignoredPackages ifAbsent:[]. |
15126 | 7718 |
"sort, to avoid differences from one generation to the next one" |
7719 |
mandatoryPackageReasons keysAndValuesDo:[:eachPackageId :eachReasons | mandatoryPackageReasons at:eachPackageId put:eachReasons asSortedCollection]. |
|
14843 | 7720 |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7721 |
^ Array |
23124 | 7722 |
with:mandatoryPackageReasons |
7723 |
with:referencedPackageReasons. |
|
14885 | 7724 |
|
7725 |
" |
|
13411 | 7726 |
self searchForPreRequisites:#'stx:libwidg3' |
7727 |
bosch_dapasx_Application searchForPreRequisites |
|
7728 |
bosch_dapasx_pav_browser searchForPreRequisites |
|
15066 | 7729 |
self searchForPreRequisites:#'stx:goodies/json' withSubProjects:false |
13411 | 7730 |
" |
7731 |
||
7732 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
7733 |
"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
|
7734 |
"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
|
7735 |
"Modified: / 30-07-2014 / 20:33:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
21509 | 7736 |
"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
|
7737 |
! ! |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
7738 |
|
9585 | 7739 |
!ProjectDefinition class methodsFor:'queries'! |
7740 |
||
13419 | 7741 |
allClassNames |
12368 | 7742 |
^ self classNamesForWhich:[:nm :attr | true ]. |
7743 |
! |
|
7744 |
||
13559 | 7745 |
allClasses |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
7746 |
^ self allClassNames |
23124 | 7747 |
collect:[:nm | |
7748 |
|cls| |
|
7749 |
||
7750 |
cls := Smalltalk classNamed:nm. |
|
7751 |
cls isNil ifTrue:[ |
|
7752 |
Logger warning:'%1: failed to autoload class %2' with:self name with:nm |
|
7753 |
]. |
|
7754 |
cls |
|
7755 |
] |
|
7756 |
thenSelect:[:cls | cls notNil ]. |
|
13559 | 7757 |
|
7758 |
"Created: / 06-08-2011 / 15:47:36 / cg" |
|
7759 |
! |
|
7760 |
||
13636 | 7761 |
allExtensionClasses |
7762 |
"answer the set of classes, which are extended by the package. |
|
7763 |
includes all superclasses of the extended classes" |
|
7764 |
||
7765 |
^ self extensionClassesWithSuperclasses:true |
|
7766 |
||
7767 |
" |
|
7768 |
stx_libboss allExtensionClasses |
|
7769 |
" |
|
7770 |
||
7771 |
"Created: / 06-09-2011 / 10:15:54 / cg" |
|
7772 |
! |
|
7773 |
||
13419 | 7774 |
autoloaded_classNames |
14042
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
7775 |
"the opposite of compiled class names" |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
7776 |
|
12368 | 7777 |
^ self classNamesForWhich:[:nm :attr | attr notEmptyOrNil and:[attr includes:#autoload]]. |
7778 |
||
7779 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
7780 |
"Created: / 30-08-2007 / 18:48:09 / cg" |
|
7781 |
! |
|
7782 |
||
14978 | 7783 |
canHaveExtensions |
7784 |
"return true, if this class allows extensions from other packages. |
|
7785 |
Private classes, namespaces and projectDefinitions don't allow this" |
|
7786 |
||
7787 |
^ self isAbstract |
|
7788 |
||
7789 |
" |
|
7790 |
Smalltalk allClasses select:[:each | each canHaveExtensions not] |
|
7791 |
" |
|
7792 |
||
7793 |
"Created: / 30-08-2006 / 15:29:49 / cg" |
|
7794 |
! |
|
7795 |
||
24680 | 7796 |
classNamed:aClassName |
7797 |
"answer one of my classes. |
|
7798 |
This makes me look a bit like a namespace (which I am not currently); |
|
7799 |
in preparation for a future require package mechanism..." |
|
7800 |
||
7801 |
^ Smalltalk classNamed:aClassName |
|
7802 |
||
7803 |
" |
|
7804 |
stx_libhtml classNames |
|
7805 |
stx_libhtml classNamesAndAttributesAsSpecArray |
|
7806 |
" |
|
7807 |
! |
|
7808 |
||
13419 | 7809 |
classNames |
12368 | 7810 |
"answer an array containing all the class names of the project's classes" |
7811 |
||
7812 |
^ self classNamesAndAttributesAsSpecArray collect:[:entry | entry first]. |
|
7813 |
||
7814 |
" |
|
7815 |
stx_libhtml classNames |
|
7816 |
stx_libhtml classNamesAndAttributesAsSpecArray |
|
7817 |
" |
|
7818 |
! |
|
7819 |
||
13419 | 7820 |
classNamesForWhich:aBlock |
12368 | 7821 |
"a correponding method with real names is generated in my subclasses" |
7822 |
||
7823 |
|coll| |
|
7824 |
||
7825 |
coll := OrderedCollection new. |
|
7826 |
self classNamesAndAttributesDo:[:nm :attributes | |
|
23124 | 7827 |
(aBlock value:nm value:attributes) ifTrue:[ |
7828 |
coll add:nm. |
|
7829 |
]. |
|
12368 | 7830 |
]. |
7831 |
^ coll |
|
7832 |
||
7833 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
7834 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
7835 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
|
7836 |
! |
|
7837 |
||
7838 |
classes |
|
7839 |
"list my classes. |
|
7840 |
Project must be loaded - otherwise an error is reported here. |
|
7841 |
Use #classNames if you are only interested in the names" |
|
7842 |
||
13728 | 7843 |
^ self classNames collect:[:nm | Smalltalk at:nm ifAbsent:[self error:'Missing class: ',nm]] |
12368 | 7844 |
|
7845 |
" |
|
7846 |
stx_libbasic3 classNames |
|
7847 |
stx_libbasic3 classes |
|
7848 |
" |
|
13728 | 7849 |
|
7850 |
"Modified: / 27-09-2011 / 18:12:33 / cg" |
|
12368 | 7851 |
! |
7852 |
||
13419 | 7853 |
compiled_classNames |
14042
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
7854 |
"the opposite of autoloaded class names" |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
7855 |
|
12368 | 7856 |
^ self classNamesForWhich:[:nm :attr | attr isEmptyOrNil or:[(attr includes:#autoload) not]]. |
7857 |
||
7858 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
7859 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
7860 |
"Modified: / 21-08-2006 / 18:48:31 / cg" |
|
14042
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
7861 |
"Modified (comment): / 05-03-2012 / 12:21:23 / cg" |
12368 | 7862 |
! |
7863 |
||
7864 |
compiled_classNamesForPlatform |
|
7865 |
"answer the classes to be compiled only for the current platformName" |
|
7866 |
||
7867 |
^ self compiled_classNamesForPlatform:OperatingSystem platformName |
|
7868 |
! |
|
7869 |
||
7870 |
compiled_classNamesForPlatform:platformName |
|
7871 |
"answer the classes to be compiled only for platformName |
|
17638 | 7872 |
platformName is one of #unix, #win32, #vms or #osx (OperatingSystem platformName)" |
12368 | 7873 |
|
13419 | 7874 |
^ self |
23124 | 7875 |
classNamesForWhich:[:nm :attr | |
7876 |
(attr includes:#autoload) not and:[attr includes:platformName] |
|
7877 |
]. |
|
12368 | 7878 |
|
7879 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
7880 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
7881 |
"Modified: / 09-10-2006 / 13:30:08 / cg" |
|
7882 |
! |
|
7883 |
||
7884 |
compiled_classNames_common |
|
7885 |
"classes to be compiled for any platform" |
|
7886 |
||
13419 | 7887 |
^ self |
23124 | 7888 |
classNamesForWhich:[:nm :attr | |
7889 |
attr isEmptyOrNil |
|
7890 |
]. |
|
12368 | 7891 |
|
7892 |
"Created: / 18-08-2006 / 13:37:51 / cg" |
|
7893 |
! |
|
7894 |
||
7895 |
compiled_classNames_unix |
|
7896 |
"class, only to be compiled under unix" |
|
13419 | 7897 |
|
12368 | 7898 |
^ self compiled_classNamesForPlatform:#unix. |
7899 |
||
7900 |
"Created: / 18-08-2006 / 13:37:51 / cg" |
|
7901 |
! |
|
7902 |
||
7903 |
compiled_classNames_windows |
|
7904 |
"class, only to be compiled under windows" |
|
13419 | 7905 |
|
12368 | 7906 |
^ self compiled_classNamesForPlatform:#win32. |
7907 |
||
7908 |
"Created: / 18-08-2006 / 13:37:56 / cg" |
|
7909 |
! |
|
7910 |
||
17500 | 7911 |
compiled_classesForPlatform |
7912 |
"list my classes for the current platform. |
|
7913 |
Project must be loaded - otherwise an error is reported here. |
|
7914 |
Use #classNames if you are only interested in the names" |
|
7915 |
||
23124 | 7916 |
^ self compiled_classNamesForPlatform collect:[:nm | |
7917 |
Smalltalk at:nm ifAbsent:[self error:'Missing class: ',nm]] |
|
17500 | 7918 |
|
7919 |
" |
|
7920 |
stx_libbasic compiled_classesForPlatform |
|
7921 |
stx_libbasic classes |
|
7922 |
" |
|
7923 |
! |
|
7924 |
||
13081 | 7925 |
extensionClasses |
7926 |
"answer the set of classes, which are extended by the package" |
|
7927 |
||
13636 | 7928 |
^ self extensionClassesWithSuperclasses:false |
7929 |
||
7930 |
" |
|
7931 |
stx_libboss extensionClasses |
|
7932 |
" |
|
7933 |
||
7934 |
"Modified: / 06-09-2011 / 10:21:44 / cg" |
|
7935 |
! |
|
7936 |
||
7937 |
extensionClassesWithSuperclasses:withSuperclassesBoolean |
|
7938 |
"answer the set of classes, which are extended by the package" |
|
7939 |
||
13081 | 7940 |
|classes| |
7941 |
||
7942 |
classes := IdentitySet new. |
|
7943 |
||
13419 | 7944 |
self extensionMethodNames pairWiseDo:[:className :selector | |
23124 | 7945 |
|mthdCls extendedClass| |
7946 |
||
7947 |
mthdCls := Smalltalk classNamed:className. |
|
7948 |
(mthdCls notNil and:[mthdCls isLoaded]) ifTrue:[ |
|
7949 |
extendedClass := mthdCls theNonMetaclass. |
|
7950 |
(classes includes:extendedClass) ifFalse:[ |
|
7951 |
withSuperclassesBoolean ifTrue:[ |
|
7952 |
extendedClass withAllSuperclassesDo:[:eachClass | |
|
7953 |
classes add:eachClass. |
|
7954 |
]. |
|
7955 |
] ifFalse:[ |
|
7956 |
classes add:extendedClass. |
|
7957 |
]. |
|
7958 |
]. |
|
7959 |
]. |
|
13081 | 7960 |
]. |
7961 |
^ classes. |
|
7962 |
||
7963 |
" |
|
23124 | 7964 |
stx_libboss extensionClasses |
13636 | 7965 |
" |
7966 |
||
7967 |
"Created: / 06-09-2011 / 10:17:06 / cg" |
|
13081 | 7968 |
! |
7969 |
||
12368 | 7970 |
extensionMethods |
7971 |
"list my extension methods. |
|
7972 |
Project must be loaded - otherwise an error is reported here. |
|
7973 |
Use #extensionMethodsNames if you are only interested in the names" |
|
7974 |
||
13419 | 7975 |
^ self extensionMethodNames |
23124 | 7976 |
pairWiseCollect:[:className :selector | |
7977 |
(Smalltalk classNamed:className) compiledMethodAt:selector. |
|
7978 |
]. |
|
12368 | 7979 |
|
7980 |
" |
|
7981 |
stx_libbasic2 extensionMethodNames |
|
7982 |
stx_libbasic2 extensionMethods |
|
7983 |
" |
|
7984 |
! |
|
7985 |
||
13081 | 7986 |
extensionPackages |
7987 |
"answer the set of packages, which are extended by this package" |
|
7988 |
||
13636 | 7989 |
^ self allExtensionClasses collect:[:eachClass| eachClass package] |
7990 |
||
7991 |
" |
|
23124 | 7992 |
stx_libboss extensionPackages |
13636 | 7993 |
" |
7994 |
||
7995 |
"Modified: / 06-09-2011 / 10:20:47 / cg" |
|
13081 | 7996 |
! |
7997 |
||
10144 | 7998 |
hasAllClassesFullyLoaded |
14957 | 7999 |
"return true, if all classes are present and loaded (not autoloaded)" |
10144 | 8000 |
|
8001 |
^ self hasAllClassesLoaded:true |
|
8002 |
||
8003 |
"Created: / 25-10-2006 / 16:08:25 / cg" |
|
8004 |
! |
|
8005 |
||
9627 | 8006 |
hasAllClassesLoaded |
10205 | 8007 |
"return true, if all classes are present (although, some might be autoloaded)" |
10144 | 8008 |
|
8009 |
^ self hasAllClassesLoaded:false |
|
8010 |
||
8011 |
"Modified: / 25-10-2006 / 16:08:11 / cg" |
|
8012 |
! |
|
8013 |
||
8014 |
hasAllClassesLoaded:checkIfFullyLoaded |
|
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
8015 |
"check if all classes for this platform are present. |
12421
67898c88eceb
comment/format in: #hasAllClassesLoaded:
Claus Gittinger <cg@exept.de>
parents:
12416
diff
changeset
|
8016 |
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
|
8017 |
|
13419 | 8018 |
^ (self |
23124 | 8019 |
hasClasses:(self classNamesForWhich:[:nm :attr | attr isEmptyOrNil or:[ attr includes:#autoload]]) |
8020 |
loaded:checkIfFullyLoaded) |
|
10154 | 8021 |
and:[ |
23124 | 8022 |
self |
8023 |
hasClasses:(self compiled_classNamesForPlatform:OperatingSystem platformName) |
|
8024 |
loaded:checkIfFullyLoaded ] |
|
10154 | 8025 |
|
8026 |
"Modified: / 07-11-2006 / 11:47:30 / cg" |
|
8027 |
! |
|
8028 |
||
8029 |
hasAllCompiledClassesFullyLoaded |
|
8030 |
"return true, if all compiled classes are present and loaded" |
|
8031 |
||
8032 |
^ self hasAllCompiledClassesLoaded:true |
|
8033 |
||
8034 |
"Created: / 07-11-2006 / 11:48:02 / cg" |
|
8035 |
! |
|
8036 |
||
8037 |
hasAllCompiledClassesLoaded:checkIfFullyLoaded |
|
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
8038 |
"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
|
8039 |
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
|
8040 |
|
13419 | 8041 |
^ (self |
23124 | 8042 |
hasClasses:(self classNamesForWhich:[:nm :attr | attr isEmptyOrNil]) |
8043 |
loaded:checkIfFullyLoaded) |
|
10154 | 8044 |
and:[ |
13419 | 8045 |
self |
23124 | 8046 |
hasClasses:(self compiled_classNamesForPlatform:OperatingSystem platformName) |
8047 |
loaded:checkIfFullyLoaded |
|
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
8048 |
] |
9585 | 8049 |
! |
8050 |
||
9627 | 8051 |
hasAllExtensionsLoaded |
10203
b210e7832fe1
Do not autoload when checking for extensions
Stefan Vogel <sv@exept.de>
parents:
10200
diff
changeset
|
8052 |
"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
|
8053 |
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
|
8054 |
|
18988 | 8055 |
(self extensionMethodNames ? #()) pairWiseDo:[:className :selector | |
23124 | 8056 |
|cls| |
8057 |
||
8058 |
cls := Smalltalk loadedClassNamed:className. |
|
8059 |
cls isNil ifTrue:[ |
|
8060 |
Verbose ifTrue:[ |
|
8061 |
Transcript showCR:(self name,' missing extension class "',className,'".'). |
|
8062 |
]. |
|
8063 |
^ false |
|
8064 |
]. |
|
8065 |
"there is no possibility that we installed an extension method in an unloaded class" |
|
8066 |
(cls isLoaded not or:[(cls compiledMethodAt:selector) isNil]) ifTrue:[ |
|
8067 |
Verbose ifTrue:[ |
|
8068 |
Transcript showCR:(self name,' missing extension method "',className,'>>',selector,'".'). |
|
8069 |
]. |
|
8070 |
^ false |
|
8071 |
]. |
|
9627 | 8072 |
]. |
8073 |
^ true. |
|
8074 |
||
8075 |
"Created: / 17-08-2006 / 00:50:01 / cg" |
|
10140 | 8076 |
"Modified: / 25-10-2006 / 00:01:10 / cg" |
9850 | 8077 |
! |
8078 |
||
10369
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8079 |
hasClasses:classNames loaded:checkIfFullyLoaded |
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8080 |
"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
|
8081 |
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
|
8082 |
are not considered" |
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8083 |
|
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8084 |
classNames do:[:eachClassName | |
23124 | 8085 |
|cls| |
8086 |
||
8087 |
cls := Smalltalk loadedClassNamed:eachClassName. |
|
8088 |
cls isNil ifTrue:[ |
|
8089 |
Verbose ifTrue:[ |
|
8090 |
(self name, ' [info]: missing class: ', eachClassName) infoPrintCR. |
|
8091 |
]. |
|
8092 |
^ false |
|
8093 |
]. |
|
8094 |
(checkIfFullyLoaded and:[cls isLoaded not]) ifTrue:[ |
|
8095 |
Verbose ifTrue:[ |
|
8096 |
(self name,' [info]: unloaded class: ', eachClassName) infoPrintCR. |
|
8097 |
]. |
|
8098 |
^ false. |
|
8099 |
]. |
|
10369
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8100 |
]. |
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8101 |
|
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
8102 |
^ true |
10154 | 8103 |
! |
8104 |
||
9906
9efd21c9b1b6
hasExtensions is a bad name (conflicts with the other query)
Claus Gittinger <cg@exept.de>
parents:
9904
diff
changeset
|
8105 |
hasExtensionMethods |
9850 | 8106 |
^ self extensionMethodNames notEmpty |
8107 |
||
8108 |
"Created: / 14-09-2006 / 14:19:35 / cg" |
|
10005 | 8109 |
! |
8110 |
||
12369 | 8111 |
hasPostLoadAction |
8112 |
"/ true if postLoadAction has been redefined |
|
8113 |
^ (self class whichClassIncludesSelector:#postLoadAction) theNonMetaclass isAbstract not |
|
8114 |
! |
|
8115 |
||
8116 |
hasPostUnloadAction |
|
8117 |
"/ true if postUnloadAction has been redefined |
|
8118 |
^ (self class whichClassIncludesSelector:#postUnloadAction) theNonMetaclass isAbstract not |
|
8119 |
! |
|
8120 |
||
8121 |
hasPreLoadAction |
|
8122 |
"/ true if preLoadAction has been redefined |
|
8123 |
^ (self class whichClassIncludesSelector:#preLoadAction) theNonMetaclass isAbstract not |
|
8124 |
! |
|
8125 |
||
8126 |
hasPreUnloadAction |
|
8127 |
"/ true if preUnloadAction has been redefined |
|
8128 |
^ (self class whichClassIncludesSelector:#preUnloadAction) theNonMetaclass isAbstract not |
|
8129 |
! |
|
8130 |
||
13609 | 8131 |
isAbstract |
8132 |
^ self == ProjectDefinition |
|
8133 |
||
8134 |
"Modified (format): / 20-08-2011 / 22:47:46 / cg" |
|
8135 |
! |
|
8136 |
||
17461 | 8137 |
isAutoloaded:aClassOrClassName |
8138 |
|className| |
|
8139 |
||
23124 | 8140 |
className := aClassOrClassName isBehavior |
8141 |
ifTrue:[ aClassOrClassName theNonMetaclass name ] |
|
8142 |
ifFalse:[ aClassOrClassName ]. |
|
17461 | 8143 |
^ self autoloaded_classNames includes:className |
8144 |
||
8145 |
" |
|
8146 |
'stx:goodies/soap/xe/tests' asPackageId projectDefinitionClass |
|
23124 | 8147 |
isAutoloaded:#'SOAP::XeAllTests' |
17461 | 8148 |
" |
8149 |
! |
|
8150 |
||
10140 | 8151 |
isFullyLoaded |
16160 | 8152 |
"as the inherited query isLoaded only refers to a single classes load status, |
8153 |
this one returns true iff the whole project (all classes plus all extensions) is loaded" |
|
8154 |
||
13419 | 8155 |
^ self hasAllCompiledClassesFullyLoaded |
13167 | 8156 |
and:[self hasAllClassesLoaded and:[self hasAllExtensionsLoaded]] |
10140 | 8157 |
|
8158 |
"Created: / 24-10-2006 / 23:52:23 / cg" |
|
13609 | 8159 |
"Modified: / 20-08-2011 / 22:47:16 / cg" |
12331 | 8160 |
! |
8161 |
||
8162 |
projectType |
|
8163 |
^ self subclassResponsibility |
|
16812 | 8164 |
! |
8165 |
||
23681 | 8166 |
reasonForNotSupportedOnPlatform |
23866 | 8167 |
"answer a reason string, why the package is not supported on this platform |
8168 |
(if it is not, i.e. if supportedByPlatform returns false)" |
|
8169 |
||
8170 |
^ 'not supported by this OS-platform' |
|
23681 | 8171 |
|
8172 |
"Created: / 07-02-2019 / 14:21:54 / Claus Gittinger" |
|
8173 |
! |
|
8174 |
||
16892 | 8175 |
supportedOnPlatform |
8176 |
"answer false, if this package is not suitable for |
|
8177 |
the current platform. The default here returns true. |
|
8178 |
Only to be redefined in packages which are definitely not valid |
|
23124 | 8179 |
for the given platform. For example, the OLE package is only |
16892 | 8180 |
usable under windows" |
8181 |
||
23866 | 8182 |
^ true |
16892 | 8183 |
! |
8184 |
||
16812 | 8185 |
whoReferences:aPackageString |
8186 |
"answer, which package references directly or indirectly a package defined by aPackageString" |
|
8187 |
||
22160 | 8188 |
|referrers| |
8189 |
||
8190 |
referrers := OrderedCollection new. |
|
16812 | 8191 |
|
8192 |
self allSubclassesDo:[:eachPackageDefinitionClass| |
|
23124 | 8193 |
(eachPackageDefinitionClass allPreRequisites includes:aPackageString) ifTrue:[ |
8194 |
referrers add:eachPackageDefinitionClass. |
|
8195 |
] |
|
16812 | 8196 |
]. |
8197 |
||
22160 | 8198 |
^ referrers. |
16812 | 8199 |
|
8200 |
" |
|
8201 |
self whoReferences:'stx:libview3' |
|
8202 |
self whoReferences:'stx:libwidg3' |
|
8203 |
self whoReferences:'stx:libbasic' |
|
8204 |
" |
|
22160 | 8205 |
|
8206 |
"Modified (format): / 02-08-2017 / 18:38:27 / cg" |
|
16812 | 8207 |
! |
8208 |
||
8209 |
whoReferencesSorted:aPackageString |
|
8210 |
"answer, which package references directly or indirectly a package define by aPackageString. |
|
22160 | 8211 |
Sort the result, so that the most direct referrers are at the top" |
16812 | 8212 |
|
8213 |
|referers orderedTuples sortedPackages| |
|
8214 |
||
8215 |
referers := self whoReferences:aPackageString. |
|
8216 |
orderedTuples := OrderedCollection new. |
|
8217 |
||
8218 |
referers do:[:eachProjectDefinition | |
|
23124 | 8219 |
|preRequisites| |
8220 |
||
8221 |
preRequisites := eachProjectDefinition effectivePreRequisites. |
|
8222 |
preRequisites do:[:eachPrerequisitePackageID| |
|
8223 |
|eachPrerequisitePackage| |
|
8224 |
||
8225 |
eachPrerequisitePackage := self definitionClassForPackage:eachPrerequisitePackageID. |
|
8226 |
(referers includes:eachPrerequisitePackage) ifTrue:[ |
|
8227 |
orderedTuples add:(Array with:eachPrerequisitePackage with:eachProjectDefinition). |
|
8228 |
]. |
|
8229 |
]. |
|
16812 | 8230 |
]. |
8231 |
||
8232 |
(orderedTuples contains:[:el | el first = el second]) ifTrue:[ |
|
23124 | 8233 |
self halt:'something seems to depend upon itself' |
16812 | 8234 |
]. |
8235 |
sortedPackages := orderedTuples topologicalSortStable: true. |
|
8236 |
||
8237 |
^ sortedPackages. |
|
8238 |
||
8239 |
" |
|
8240 |
self whoReferencesSorted:'stx:libview3' |
|
8241 |
self whoReferencesSorted:'stx:libwidg3' |
|
8242 |
self whoReferencesSorted:'stx:libbasic' |
|
8243 |
" |
|
22160 | 8244 |
|
8245 |
"Modified (comment): / 02-08-2017 / 18:38:03 / cg" |
|
9585 | 8246 |
! ! |
8247 |
||
10774 | 8248 |
!ProjectDefinition class methodsFor:'queries-privacy'! |
8249 |
||
8250 |
showClassDocumentationOf:aClass |
|
12198
f3f15cc6a32e
changed: #showClassDocumentationOf:
Claus Gittinger <cg@exept.de>
parents:
12192
diff
changeset
|
8251 |
"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
|
8252 |
or hidden. |
f3f15cc6a32e
changed: #showClassDocumentationOf:
Claus Gittinger <cg@exept.de>
parents:
12192
diff
changeset
|
8253 |
(used for expecco, to suppress documentation of workflow- and expecco classes |
f3f15cc6a32e
changed: #showClassDocumentationOf:
Claus Gittinger <cg@exept.de>
parents:
12192
diff
changeset
|
8254 |
in the expecco-class browser)" |
10774 | 8255 |
|
8256 |
^ true |
|
8257 |
||
8258 |
"Created: / 05-11-2007 / 16:44:16 / cg" |
|
8259 |
! ! |
|
8260 |
||
9726 | 8261 |
!ProjectDefinition class methodsFor:'sanity checks'! |
8262 |
||
8263 |
validateDescription |
|
13808 | 8264 |
"perform some consistency checks (set of classes in project same as those listed in description); |
14981 | 8265 |
called before checking in build support files. |
8266 |
Somewhat obsolete: use the ProjectChecker, which does more checks" |
|
13808 | 8267 |
|
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
8268 |
|emptyProjects nonProjects emptyOrNonProjects classesInImage |
14510 | 8269 |
classesInDescription onlyInImage onlyInDescription missingPools myPackage| |
9956 | 8270 |
|
15395 | 8271 |
emptyProjects := Set withAll:self effectiveSubProjects. |
9956 | 8272 |
Smalltalk allClassesDo:[:cls | |
23124 | 8273 |
emptyProjects remove:(cls package) ifAbsent:[]. |
9956 | 8274 |
]. |
15395 | 8275 |
nonProjects := self effectiveSubProjects select:[:p | |
23124 | 8276 |
(self definitionClassForPackage: p) isNil |
8277 |
]. |
|
9956 | 8278 |
|
8279 |
emptyOrNonProjects := Set withAll:emptyProjects. |
|
8280 |
emptyOrNonProjects addAll:nonProjects. |
|
8281 |
||
8282 |
emptyOrNonProjects notEmpty ifTrue:[ |
|
23124 | 8283 |
(Dialog |
8284 |
confirm:('The following subprojects are non-existent, empty or without description:\\ ' |
|
8285 |
, ((emptyOrNonProjects |
|
8286 |
asSortedCollection |
|
8287 |
collect:[:p | p allBold]) |
|
8288 |
asStringWith:'\ ') |
|
8289 |
, '\\Continue ?') withCRs |
|
8290 |
yesLabel:'OK' noLabel:'Cancel') |
|
8291 |
ifFalse:[ |
|
8292 |
AbortSignal raise |
|
8293 |
]. |
|
9956 | 8294 |
]. |
8295 |
||
14510 | 8296 |
myPackage := self package. |
8297 |
classesInImage := Smalltalk allClasses select:[:cls | (cls package == myPackage) and:[cls isPrivate not]]. |
|
13728 | 8298 |
"/ classesInDescription := self classes asIdentitySet. |
8299 |
classesInDescription := IdentitySet new. |
|
8300 |
((self compiled_classNamesForPlatform:(OperatingSystem platformName)) |
|
8301 |
, (self compiled_classNames_common) |
|
8302 |
, (self autoloaded_classNames)) do:[:nm | |
|
23124 | 8303 |
|cls| |
8304 |
||
8305 |
cls := Smalltalk at:nm asSymbol. |
|
8306 |
cls isNil ifTrue:[ |
|
8307 |
(self autoloaded_classNames includes:nm) ifTrue:[ |
|
8308 |
Transcript showCR:'missing autoloaded class: ',nm. |
|
8309 |
] ifFalse:[ |
|
8310 |
self proceedableError:('missing class: ',nm). |
|
8311 |
] |
|
8312 |
] ifFalse:[ |
|
8313 |
classesInDescription add:cls. |
|
8314 |
] |
|
13728 | 8315 |
]. |
8316 |
||
13809
da77d6869c9c
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13808
diff
changeset
|
8317 |
missingPools := Set new. |
da77d6869c9c
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13808
diff
changeset
|
8318 |
classesInDescription do:[:eachClass | |
23124 | 8319 |
eachClass sharedPoolNames do:[:eachPoolName | |
8320 |
|pool| |
|
8321 |
||
8322 |
pool := eachClass nameSpace classNamed:eachPoolName. |
|
8323 |
pool isNil ifTrue:[ |
|
8324 |
eachClass nameSpace ~~ Smalltalk ifTrue:[ |
|
8325 |
pool := Smalltalk classNamed:eachPoolName. |
|
8326 |
] |
|
8327 |
]. |
|
8328 |
pool isNil ifTrue:[ |
|
8329 |
Transcript showCR:'missing pool: ',eachPoolName. |
|
8330 |
missingPools add:eachPoolName. |
|
8331 |
] ifFalse:[ |
|
8332 |
pool isSharedPool ifFalse:[ |
|
8333 |
Transcript showCR:'not a shared pool: ',eachPoolName. |
|
8334 |
missingPools add:eachPoolName. |
|
8335 |
]. |
|
8336 |
]. |
|
8337 |
]. |
|
13809
da77d6869c9c
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13808
diff
changeset
|
8338 |
]. |
14981 | 8339 |
|
13809
da77d6869c9c
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13808
diff
changeset
|
8340 |
missingPools notEmpty ifTrue:[ |
23124 | 8341 |
(Dialog |
8342 |
confirm:('The following sharedpools are non-existent, or not pools:\\ ' |
|
8343 |
, ((missingPools |
|
8344 |
asSortedCollection |
|
8345 |
collect:[:p | p allBold]) |
|
8346 |
asStringWith:'\ ') |
|
8347 |
, '\\Continue ?') withCRs |
|
8348 |
yesLabel:'OK' noLabel:'Cancel') |
|
8349 |
ifFalse:[ |
|
8350 |
AbortOperationRequest raise |
|
8351 |
]. |
|
13809
da77d6869c9c
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13808
diff
changeset
|
8352 |
]. |
da77d6869c9c
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13808
diff
changeset
|
8353 |
|
14981 | 8354 |
"/ also found by ProjectChecker... |
13694
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8355 |
classesInImage ~= classesInDescription ifTrue:[ |
23124 | 8356 |
onlyInImage := (classesInImage reject:[:cls | classesInDescription includes:cls]). |
8357 |
onlyInImage notEmpty ifTrue:[ |
|
8358 |
Transcript show:self name; show:': only in image: '; showCR:onlyInImage |
|
8359 |
]. |
|
8360 |
onlyInDescription := (classesInDescription reject:[:cls | classesInImage includes:cls]). |
|
8361 |
onlyInDescription notEmpty ifTrue:[ |
|
8362 |
Transcript show:self name; show:': only in description: '; showCR:onlyInDescription |
|
8363 |
]. |
|
8364 |
(Dialog confirm:'The set of classes in the image is different from the listed classes in the project definition.\\Proceed?' withCRs) ifFalse:[ |
|
8365 |
AbortOperationRequest raiseRequest |
|
8366 |
] |
|
13694
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8367 |
]. |
14981 | 8368 |
|
14045 | 8369 |
"/ self validateOrderOfClasses |
13694
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8370 |
|
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8371 |
" |
15395 | 8372 |
exept_expecco_application validateDescription |
13694
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8373 |
squeak_vmMaker validateDescription |
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8374 |
" |
ff3118874df3
changed: #validateDescription
Claus Gittinger <cg@exept.de>
parents:
13692
diff
changeset
|
8375 |
|
14045 | 8376 |
"Modified: / 06-03-2012 / 11:31:37 / cg" |
21259 | 8377 |
"Modified: / 17-01-2017 / 16:33:56 / stefan" |
23013 | 8378 |
"Modified: / 24-05-2018 / 21:05:15 / Claus Gittinger" |
14042
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8379 |
! |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8380 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8381 |
validateOrderOfClasses |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8382 |
"check if the project's classes are listed in the correct dependency order in the classList. |
14045 | 8383 |
This would be required, if the generated makefile would compile files in that order, |
8384 |
and superclasses must be compiled before subclasses (for the header files). |
|
8385 |
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
|
8386 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8387 |
|classesInDescriptionInOrder classesInProject already| |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8388 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8389 |
classesInDescriptionInOrder := OrderedCollection new. |
16911
e8a8231b0be1
class: ProjectDefinition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16894
diff
changeset
|
8390 |
classesInDescriptionInOrder := |
23124 | 8391 |
self compiled_classNames |
8392 |
collect:[:eachName | |
|
8393 |
|cls| |
|
8394 |
||
8395 |
cls := Smalltalk at:eachName. |
|
8396 |
self assert:cls notNil message:'missing class: ',eachName. |
|
8397 |
cls |
|
8398 |
]. |
|
14042
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8399 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8400 |
classesInProject := classesInDescriptionInOrder asSet. |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8401 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8402 |
already := Set new. |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8403 |
classesInDescriptionInOrder do:[:eachClass | |
23124 | 8404 |
eachClass allSuperclassesDo:[:superclass | |
8405 |
(classesInProject includes:superclass) ifTrue:[ |
|
8406 |
"/ if in the set, it must have been already listed |
|
8407 |
self |
|
8408 |
assert:(already includes:superclass) |
|
8409 |
message:('superclass "%1" not compiled before "%2"' |
|
8410 |
bindWith:superclass name |
|
8411 |
with:eachClass name). |
|
8412 |
]. |
|
8413 |
]. |
|
8414 |
already add:eachClass. |
|
14042
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8415 |
]. |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8416 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8417 |
" |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8418 |
stx_goodies_refactoryBrowser_lint validateOrderOfClasses |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8419 |
squeak_vmMaker validateOrderOfClasses |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8420 |
" |
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8421 |
|
05b7b61d7e59
added: #validateOrderOfClasses
Claus Gittinger <cg@exept.de>
parents:
14021
diff
changeset
|
8422 |
"Created: / 05-03-2012 / 12:18:45 / cg" |
9726 | 8423 |
! ! |
8424 |
||
9585 | 8425 |
!ProjectDefinition class methodsFor:'testing'! |
8426 |
||
9664 | 8427 |
isApplicationDefinition |
23294 | 8428 |
"true iff an application-package (i.e. not a library). |
8429 |
Applications have a main and startup for standalon start" |
|
8430 |
||
9664 | 8431 |
^ false |
8432 |
||
8433 |
"Created: / 23-08-2006 / 15:17:32 / cg" |
|
9983 | 8434 |
"Modified: / 20-09-2006 / 14:59:56 / cg" |
8435 |
! |
|
8436 |
||
12309
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
8437 |
isConsoleApplication |
23051 | 8438 |
"Used with WIN32 only (i.e. affects bc.mak). |
23124 | 8439 |
Return true, if this is a console application. |
23051 | 8440 |
Console applications have stdout and stderr and open up a command-window |
8441 |
when started. Only console applications can interact with the user in the |
|
8442 |
command line window." |
|
8443 |
||
12309
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
8444 |
^ false |
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
8445 |
|
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
8446 |
"Created: / 20-09-2006 / 14:59:49 / cg" |
23051 | 8447 |
"Modified (comment): / 06-06-2018 / 15:17:21 / Claus Gittinger" |
12309
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
8448 |
! |
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
8449 |
|
16682 | 8450 |
isFolderForProjectsDefinition |
23294 | 8451 |
"true iff an 'empty' project which only holds subprojects, |
8452 |
but no own classes. Examples are stx, exept, etc." |
|
8453 |
||
16682 | 8454 |
^ false |
8455 |
! |
|
8456 |
||
9983 | 8457 |
isGUIApplication |
23294 | 8458 |
"true iff a GUI application. |
8459 |
Will include startup code to open a display" |
|
8460 |
||
9983 | 8461 |
^ false |
8462 |
||
8463 |
"Created: / 20-09-2006 / 14:59:49 / cg" |
|
9664 | 8464 |
! |
8465 |
||
8466 |
isLibraryDefinition |
|
23294 | 8467 |
"true iff a library. |
8468 |
Will NOT include startup code, and can only be loaded into or |
|
8469 |
linked with an application" |
|
8470 |
||
9664 | 8471 |
^ false |
8472 |
||
8473 |
"Created: / 23-08-2006 / 15:17:46 / cg" |
|
9983 | 8474 |
"Modified: / 20-09-2006 / 15:00:00 / cg" |
9664 | 8475 |
! |
8476 |
||
24840 | 8477 |
isPluginDefinition |
8478 |
"for expecco" |
|
8479 |
||
8480 |
^ false |
|
8481 |
! |
|
8482 |
||
9627 | 8483 |
isProjectDefinition |
9664 | 8484 |
"concrete i.e. not abstract" |
8485 |
||
14978 | 8486 |
^ self isAbstract not |
9627 | 8487 |
|
8488 |
"Created: / 10-08-2006 / 16:24:02 / cg" |
|
13285 | 8489 |
"Modified: / 08-02-2011 / 10:03:49 / cg" |
9585 | 8490 |
! ! |
8491 |
||
13592 | 8492 |
!ProjectDefinition::AbbrevEntry methodsFor:'accessing'! |
8493 |
||
8494 |
category |
|
8495 |
^ category |
|
8496 |
! |
|
8497 |
||
8498 |
className |
|
8499 |
^ className |
|
8500 |
! |
|
8501 |
||
13695 | 8502 |
className:classNameArg fileName:fileNameArg category:categoryArg numClassInstVars:numClassInstVarsArg |
13592 | 8503 |
className := classNameArg. |
8504 |
fileName := fileNameArg. |
|
8505 |
category := categoryArg. |
|
8506 |
numClassInstVars := numClassInstVarsArg. |
|
8507 |
||
8508 |
"Created: / 18-08-2011 / 14:18:30 / cg" |
|
8509 |
! |
|
8510 |
||
8511 |
fileName |
|
8512 |
^ fileName |
|
8513 |
! |
|
8514 |
||
8515 |
numClassInstVars |
|
8516 |
^ numClassInstVars |
|
8517 |
||
8518 |
"Created: / 18-08-2011 / 14:18:37 / cg" |
|
8519 |
! ! |
|
8520 |
||
20567 | 8521 |
!ProjectDefinition::ApplicationDocumentTypeDescription class methodsFor:'documentation'! |
8522 |
||
8523 |
documentation |
|
8524 |
" |
|
8525 |
for deployment, some systems can make use of additional information |
|
8526 |
on which documents are handled by the application. |
|
8527 |
This is used eg. for double-clicking on a document in OSX. |
|
8528 |
If the deployed app can/should handle this, redefine the |
|
8529 |
applicatinDocumentTypeDescriptions / applicatinDocumentTypeDescriptionsOSX |
|
8530 |
methods in the projectDefinition to return a collection of instances of me. |
|
8531 |
||
8532 |
[author:] |
|
23124 | 8533 |
cg |
20567 | 8534 |
|
8535 |
For example: |
|
23124 | 8536 |
mimeType: 'application/x-expecco-testsuite |
8537 |
extension: 'ets' |
|
8538 |
typeName: 'expecco test suite' |
|
8539 |
iconFileWindows: 'expeccoSuite.ico' |
|
8540 |
iconFileOSX: 'expeccoSuite.icns' |
|
8541 |
roleOSX: 'Editor' |
|
20567 | 8542 |
" |
8543 |
! ! |
|
8544 |
||
8545 |
!ProjectDefinition::ApplicationDocumentTypeDescription methodsFor:'accessing'! |
|
8546 |
||
8547 |
extension |
|
8548 |
"the extension of the document" |
|
23124 | 8549 |
|
20567 | 8550 |
^ extension |
8551 |
! |
|
8552 |
||
8553 |
extension:aString |
|
8554 |
"the extension of the document" |
|
8555 |
||
8556 |
extension := aString. |
|
8557 |
! |
|
8558 |
||
8559 |
iconFileLinux |
|
8560 |
^ iconFileLinux |
|
8561 |
! |
|
8562 |
||
8563 |
iconFileLinux:aString |
|
8564 |
iconFileLinux := aString. |
|
8565 |
! |
|
8566 |
||
8567 |
iconFileOSX |
|
8568 |
^ iconFileOSX |
|
8569 |
! |
|
8570 |
||
8571 |
iconFileOSX:aString |
|
8572 |
iconFileOSX := aString. |
|
8573 |
! |
|
8574 |
||
8575 |
iconFileWindows |
|
8576 |
^ iconFileWindows |
|
8577 |
! |
|
8578 |
||
8579 |
iconFileWindows:aString |
|
8580 |
iconFileWindows := aString. |
|
8581 |
! |
|
8582 |
||
8583 |
mimeType |
|
8584 |
^ mimeType |
|
8585 |
! |
|
8586 |
||
8587 |
mimeType:aString |
|
8588 |
mimeType := aString. |
|
8589 |
! |
|
8590 |
||
8591 |
roleOSX |
|
8592 |
^ roleOSX |
|
8593 |
! |
|
8594 |
||
8595 |
roleOSX:aString |
|
8596 |
roleOSX := aString. |
|
8597 |
! |
|
8598 |
||
8599 |
typeName |
|
8600 |
"something like 'foo Document'; |
|
8601 |
eg. 'expecco test suite', 'expecco log file', etc." |
|
8602 |
||
8603 |
^ typeName |
|
8604 |
! |
|
8605 |
||
21562 | 8606 |
typeName:aString |
8607 |
"aString like 'foo Document'; |
|
20567 | 8608 |
eg. 'expecco test suite', 'expecco log file', etc." |
8609 |
||
21562 | 8610 |
typeName := aString. |
8611 |
||
8612 |
"Modified (comment): / 24-02-2017 / 09:37:26 / cg" |
|
20567 | 8613 |
! ! |
8614 |
||
9569 | 8615 |
!ProjectDefinition class methodsFor:'documentation'! |
9536 | 8616 |
|
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
8617 |
version |
18477 | 8618 |
^ '$Header$' |
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
8619 |
! |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
8620 |
|
12086 | 8621 |
version_CVS |
18477 | 8622 |
^ '$Header$' |
13411 | 8623 |
! |
8624 |
||
8625 |
version_SVN |
|
15221 | 8626 |
^ '$ Id: ProjectDefinition.st 10645 2011-06-09 15:28:45Z vranyj1 $' |
9536 | 8627 |
! ! |
9714 | 8628 |
|
14642 | 8629 |
|
9714 | 8630 |
ProjectDefinition initialize! |