author | Claus Gittinger <cg@exept.de> |
Sun, 04 Sep 2011 11:15:48 +0200 | |
changeset 13623 | 46625f58d8ee |
parent 13614 | 5606bfa8cbec |
child 13635 | b07e00f94949 |
permissions | -rw-r--r-- |
9553 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
13419 | 3 |
All Rights Reserved |
9553 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
9671 | 12 |
"{ Package: 'stx:libbasic' }" |
9536 | 13 |
|
9569 | 14 |
Object subclass:#ProjectDefinition |
12741
2e5f250f5426
changed: #loadAllClassesAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
12740
diff
changeset
|
15 |
instanceVariableNames:'' |
2e5f250f5426
changed: #loadAllClassesAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
12740
diff
changeset
|
16 |
classVariableNames:'LibraryType GUIApplicationType NonGUIApplicationType |
13592 | 17 |
PackagesBeingLoaded Verbose AbbrevDictionary AccessLock' |
12741
2e5f250f5426
changed: #loadAllClassesAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
12740
diff
changeset
|
18 |
poolDictionaries:'' |
2e5f250f5426
changed: #loadAllClassesAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
12740
diff
changeset
|
19 |
category:'System-Support-Projects' |
9536 | 20 |
! |
21 |
||
13419 | 22 |
ProjectDefinition class instanceVariableNames:'safeForOverwrittenMethods extensionOverwriteInfo projectIsLoaded' |
9607 | 23 |
|
24 |
" |
|
25 |
No other class instance variables are inherited by this class. |
|
26 |
" |
|
27 |
! |
|
28 |
||
13592 | 29 |
Object subclass:#AbbrevEntry |
30 |
instanceVariableNames:'className fileName category numClassInstVars' |
|
31 |
classVariableNames:'' |
|
32 |
poolDictionaries:'' |
|
33 |
privateIn:ProjectDefinition |
|
34 |
! |
|
35 |
||
9569 | 36 |
!ProjectDefinition class methodsFor:'documentation'! |
9553 | 37 |
|
12210 | 38 |
buildingMakefiles |
39 |
" |
|
40 |
You can define additional rules and flag settings for use in the makeFile generation: |
|
41 |
||
42 |
redefinable build-file attributes: |
|
13419 | 43 |
stcOptimizationOptions -> STCLOCALOPT |
44 |
stcWarningOptions -> STCLOCALOPT |
|
45 |
localIncludes_unix -> LOCALINCLUDES (Make.proto) |
|
46 |
localIncludes_win32 -> LOCALINCLUDES (bc.mak) |
|
47 |
||
48 |
for applications: |
|
49 |
startupClassName |
|
50 |
startupSelector |
|
51 |
||
52 |
for libraries: |
|
12210 | 53 |
|
54 |
" |
|
55 |
! |
|
56 |
||
9553 | 57 |
copyright |
58 |
" |
|
59 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
13419 | 60 |
All Rights Reserved |
9553 | 61 |
|
62 |
This software is furnished under a license and may be used |
|
63 |
only in accordance with the terms of that license and with the |
|
64 |
inclusion of the above copyright notice. This software may not |
|
65 |
be provided or otherwise made available to, or used by, any |
|
66 |
other person. No title to or ownership of the software is |
|
67 |
hereby transferred. |
|
68 |
" |
|
9714 | 69 |
! |
70 |
||
71 |
documentation |
|
72 |
" |
|
12210 | 73 |
As ST/X is (still) very tightly bound with stc, we keep the package and project information |
74 |
in a class-object (instead of some Project-object). This has the advantage, that it can be |
|
75 |
compiled and included in a compiled class library just like any other class. |
|
76 |
Every package includes an subclass of me (an instance of my meta), which provides useful |
|
77 |
information about the versioning and packaging. Me myself, I know how to generate dependency |
|
78 |
information and can generate makefiles and other build-support files for compilation. |
|
79 |
||
80 |
Some special notes about extension methods: |
|
81 |
if a package is loaded (Smalltalk loadPackage:'foo:bar/baz'), any already loaded package of which |
|
82 |
methods are overwritten by an extension of this package, the other package is asked to safe those |
|
83 |
methods in its safe(ForOverwrittenMethods). Thus, if the other package or any of its classes is asked |
|
84 |
to file itself out, it can do so using the safe (otherwise, you'D not be able to checkin a class while |
|
85 |
it has an overriding extension loaded). |
|
86 |
Also, the information about which other package was in charge when a method is overwritten is recorded in |
|
87 |
extensionOverwriteInfo. This is used to correctly reinstall an overwritten method, whenever a package is |
|
88 |
unloaded. |
|
9714 | 89 |
|
90 |
" |
|
9553 | 91 |
! ! |
9536 | 92 |
|
9569 | 93 |
!ProjectDefinition class methodsFor:'instance creation'! |
9559 | 94 |
|
12371 | 95 |
definitionClassForMonticelloPackage:aMonicelloPackagename |
96 |
^ self definitionClassForMonticelloPackage:aMonicelloPackagename createIfAbsent:false |
|
97 |
||
98 |
" |
|
99 |
self definitionClassForMonticelloPackage:'foobar' |
|
100 |
" |
|
101 |
! |
|
102 |
||
103 |
definitionClassForMonticelloPackage:aMonicelloPackagename createIfAbsent:createIfAbsent |
|
13419 | 104 |
^ self allSubclasses |
105 |
detect:[:eachProjectDefinition | |
|
106 |
eachProjectDefinition monticelloPackageName = aMonicelloPackagename ] |
|
107 |
ifNone:[ |
|
108 |
|dfn squeakPackageInfo| |
|
109 |
||
110 |
createIfAbsent ifTrue:[ |
|
111 |
dfn := ApplicationDefinition |
|
112 |
definitionClassForPackage:'mc:',aMonicelloPackagename createIfAbsent:true projectType:GUIApplicationType. |
|
113 |
||
114 |
"/ if the squeak-stuff is loaded, use it. |
|
115 |
PackageInfo notNil ifTrue:[ |
|
116 |
squeakPackageInfo := PackageInfo allSubclasses |
|
117 |
detect:[:pi | pi new packageName = aMonicelloPackagename] ifNone:nil. |
|
118 |
]. |
|
119 |
||
120 |
squeakPackageInfo notNil ifTrue:[ |
|
121 |
dfn classNames:(squeakPackageInfo new classes collect:[:each | each name]). |
|
122 |
]. |
|
123 |
] ifFalse:[ |
|
124 |
nil |
|
125 |
] |
|
126 |
] |
|
12371 | 127 |
|
128 |
" |
|
129 |
self definitionClassForMonticelloPackage:'foobar' |
|
130 |
self definitionClassForMonticelloPackage:'foobar' createIfAbsent:true |
|
131 |
" |
|
13118
06c6d0c09bb2
changed: #definitionClassForMonticelloPackage:createIfAbsent:
Claus Gittinger <cg@exept.de>
parents:
13090
diff
changeset
|
132 |
|
06c6d0c09bb2
changed: #definitionClassForMonticelloPackage:createIfAbsent:
Claus Gittinger <cg@exept.de>
parents:
13090
diff
changeset
|
133 |
"Modified: / 30-10-2010 / 00:26:07 / cg" |
12371 | 134 |
! |
135 |
||
136 |
definitionClassForPackage:aPackageID |
|
137 |
^ self definitionClassForPackage:aPackageID createIfAbsent:false |
|
138 |
||
139 |
"Modified: / 17-08-2006 / 14:33:35 / cg" |
|
140 |
! |
|
141 |
||
142 |
definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent |
|
143 |
^ self definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent projectType:nil |
|
144 |
||
145 |
"Modified: / 23-08-2006 / 14:29:15 / cg" |
|
146 |
! |
|
147 |
||
148 |
definitionClassForPackage: aPackageID createIfAbsent: doCreateIfAbsent projectType:typeOrNil |
|
149 |
|packageDefinitionClassName class| |
|
150 |
||
151 |
packageDefinitionClassName := ProjectDefinition initialClassNameForDefinitionOf:aPackageID. |
|
152 |
class := Smalltalk classNamed:packageDefinitionClassName. |
|
153 |
class isNil ifTrue:[ |
|
13419 | 154 |
doCreateIfAbsent ifTrue:[ |
155 |
class := self newForPackage:aPackageID. |
|
156 |
"setup before prerequisites are defined" |
|
157 |
class setupForType:typeOrNil. |
|
158 |
"/ look what is there and include it; is this ok ? |
|
159 |
class compileDescriptionMethods |
|
160 |
]. |
|
12371 | 161 |
] ifFalse:[ |
13419 | 162 |
typeOrNil notNil ifTrue:[ |
163 |
class projectType == typeOrNil ifFalse: [ |
|
164 |
class setupForType:typeOrNil. |
|
165 |
]. |
|
166 |
]. |
|
12371 | 167 |
]. |
168 |
^ class |
|
169 |
||
170 |
"Created: / 23-08-2006 / 14:29:21 / cg" |
|
171 |
"Modified: / 23-08-2006 / 15:35:26 / cg" |
|
172 |
! |
|
173 |
||
174 |
definitionClassForPackage:newProjectID projectType:typeOrNil createIfAbsent:createIfAbsent |
|
175 |
^ (self definitionClassForType:typeOrNil) |
|
13419 | 176 |
definitionClassForPackage:newProjectID |
177 |
createIfAbsent:createIfAbsent |
|
178 |
projectType:typeOrNil |
|
12371 | 179 |
|
180 |
"Created: / 23-08-2006 / 14:28:53 / cg" |
|
181 |
! |
|
182 |
||
183 |
definitionClassForType: type |
|
184 |
"answer the class that describes a give project type" |
|
185 |
||
186 |
(type = LibraryType) ifTrue:[ ^ LibraryDefinition ]. |
|
187 |
(type = GUIApplicationType) ifTrue:[ ^ ApplicationDefinition ]. |
|
188 |
(type = NonGUIApplicationType) ifTrue:[ ^ ApplicationDefinition ]. |
|
189 |
(type = 'Application') ifTrue:[ ^ ApplicationDefinition ]. "/ temporary - for backward compat. |
|
190 |
self error:'unknown project type'. |
|
191 |
||
192 |
"Created: / 17-08-2006 / 14:46:28 / cg" |
|
193 |
"Modified: / 23-08-2006 / 13:49:27 / cg" |
|
194 |
! |
|
195 |
||
9559 | 196 |
newForPackage:packageID |
13419 | 197 |
^ self |
198 |
newNamed:(self initialClassNameForDefinitionOf:packageID) |
|
199 |
package:packageID. |
|
9559 | 200 |
|
201 |
"Created: / 11-08-2006 / 14:27:19 / cg" |
|
202 |
! |
|
203 |
||
204 |
newNamed:newName package:packageID |
|
205 |
|newClass| |
|
206 |
||
207 |
"/ for now, we are strict. |
|
208 |
self assert:(self initialClassNameForDefinitionOf:packageID) = newName. |
|
9569 | 209 |
self assert:(self ~~ ProjectDefinition). "ProjectDefinition is abstract" |
9559 | 210 |
|
211 |
newClass := self |
|
13419 | 212 |
subclass:(newName asSymbol) |
213 |
instanceVariableNames:'' |
|
214 |
classVariableNames:'' |
|
215 |
poolDictionaries:'' |
|
216 |
category:(self defaultCategory). |
|
9559 | 217 |
|
218 |
newClass package:packageID asSymbol. |
|
219 |
^ newClass |
|
220 |
||
221 |
"Created: / 09-08-2006 / 17:57:37 / fm" |
|
222 |
"Modified: / 09-08-2006 / 19:27:53 / fm" |
|
9569 | 223 |
"Modified: / 17-08-2006 / 17:24:23 / cg" |
9559 | 224 |
! ! |
225 |
||
9569 | 226 |
!ProjectDefinition class methodsFor:'accessing'! |
9536 | 227 |
|
10716 | 228 |
allPreRequisites |
11386
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
229 |
"answer all (recursive) prerequisite project ids of myself - in random order. |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
230 |
If we exclude a project, but one of our prerequisite projects depends on it, " |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
231 |
|
13336 | 232 |
^ self allPreRequisitesWithParentDo:[:parent :prereq | |
13419 | 233 |
prereq = self package ifTrue:[ Transcript showCR:('oops: %1 depends on itself' bindWith:prereq) ]. |
13336 | 234 |
] |
235 |
||
236 |
" |
|
237 |
stx_libbasic allPreRequisites |
|
238 |
stx_libbasic2 allPreRequisites |
|
239 |
stx_libview2 allPreRequisites |
|
13419 | 240 |
ubs_application allPreRequisites |
241 |
ubs_application allPreRequisitesSorted |
|
242 |
exept_expecco_application allPreRequisites |
|
243 |
exept_expeccoNET_application allPreRequisites |
|
13336 | 244 |
alspa_batch_application allPreRequisites |
245 |
" |
|
246 |
||
247 |
"Modified: / 13-04-2011 / 15:30:45 / sr" |
|
248 |
! |
|
249 |
||
250 |
allPreRequisitesSorted |
|
251 |
"answer all the prerequisites of this projects sorted in |
|
252 |
the order they are needed. |
|
253 |
Use this to e.g. compile packages in the dependency order" |
|
13419 | 254 |
|
13336 | 255 |
|allPreRequisites orderedTuples effective allPreRequisitesWithExtensions sortedPackages| |
256 |
||
257 |
orderedTuples := OrderedCollection new. |
|
258 |
||
259 |
allPreRequisites := self allPreRequisites. |
|
260 |
allPreRequisitesWithExtensions := allPreRequisites union:self extensionPackages. |
|
261 |
||
262 |
allPreRequisites do:[:eachPackageID | |
|
13419 | 263 |
|def| |
264 |
||
265 |
self assert:(eachPackageID ~= self package). |
|
266 |
orderedTuples add:(Array with:eachPackageID with:self package). |
|
267 |
||
268 |
def := self definitionClassForPackage:eachPackageID. |
|
269 |
def isNil ifTrue:[ |
|
270 |
Transcript showCR:'Warning: no definition class for package: ', eachPackageID. |
|
271 |
effective := (self searchForPreRequisites: eachPackageID) keys. |
|
272 |
] ifFalse:[ |
|
273 |
effective := def effectivePreRequisites union:def extensionPackages. |
|
274 |
effective notEmptyOrNil ifTrue:[ |
|
275 |
effective do:[:eachPrerequisitePackageID| |
|
276 |
self assert:(eachPrerequisitePackageID ~= eachPackageID). |
|
277 |
orderedTuples add:(Array with:eachPrerequisitePackageID with:eachPackageID). |
|
278 |
]. |
|
279 |
]. |
|
280 |
]. |
|
13336 | 281 |
]. |
282 |
||
283 |
(orderedTuples detect:[:el | el first = el second] ifNone:nil) notNil ifTrue:[self halt]. |
|
284 |
sortedPackages := orderedTuples topologicalSort. |
|
285 |
||
286 |
"packages which only result from extension methods are used for computing the sort order, |
|
287 |
but they are not added, if not present in the first place" |
|
288 |
^ sortedPackages select:[:eachProject| allPreRequisites includes:eachProject] |
|
289 |
||
290 |
" |
|
291 |
stx_libbasic allPreRequisitesSorted |
|
292 |
stx_libbasic2 allPreRequisitesSorted |
|
293 |
stx_libwidg2 allPreRequisitesSorted |
|
294 |
exept_expecco_application allPreRequisitesSorted |
|
295 |
alspa_batch_application allPreRequisitesSorted |
|
296 |
ubs_application allPreRequisitesSorted |
|
297 |
" |
|
298 |
||
299 |
"Modified: / 13-04-2011 / 15:19:13 / sr" |
|
13411 | 300 |
"Modified: / 28-06-2011 / 14:04:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13336 | 301 |
! |
302 |
||
303 |
allPreRequisitesWithParentDo:aBlock |
|
304 |
"answer all (recursive) prerequisite project ids of myself - in random order. |
|
305 |
If we exclude a project, but one of our prerequisite projects depends on it, " |
|
306 |
||
11386
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
307 |
|setOfAllPreRequisites toAdd| |
10716 | 308 |
|
309 |
setOfAllPreRequisites := Set new. |
|
11386
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
310 |
toAdd := Set new. |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
311 |
toAdd addAll:self effectivePreRequisites. |
10810 | 312 |
|
11752
484d542ad43f
subProjects are no prerequisites
Stefan Vogel <sv@exept.de>
parents:
11713
diff
changeset
|
313 |
"is a subproject really a prerequisite?? |
484d542ad43f
subProjects are no prerequisites
Stefan Vogel <sv@exept.de>
parents:
11713
diff
changeset
|
314 |
No, it works the other way: parent projects are prerequisites of sub projects, |
484d542ad43f
subProjects are no prerequisites
Stefan Vogel <sv@exept.de>
parents:
11713
diff
changeset
|
315 |
so the following line has been deleted. |
484d542ad43f
subProjects are no prerequisites
Stefan Vogel <sv@exept.de>
parents:
11713
diff
changeset
|
316 |
Unfortunately the meaning of 'subproject' has never been well defined. SV." |
484d542ad43f
subProjects are no prerequisites
Stefan Vogel <sv@exept.de>
parents:
11713
diff
changeset
|
317 |
"/ toAdd addAll:self effectiveSubProjects. |
10716 | 318 |
|
319 |
[toAdd notEmpty] whileTrue:[ |
|
13419 | 320 |
|aPreRequisiteProjectID def| |
321 |
||
322 |
aPreRequisiteProjectID := toAdd removeFirst. |
|
323 |
(setOfAllPreRequisites includes:aPreRequisiteProjectID) ifFalse:[ |
|
324 |
setOfAllPreRequisites add:aPreRequisiteProjectID. |
|
325 |
||
326 |
def := self definitionClassForPackage:aPreRequisiteProjectID. |
|
327 |
def isNil ifTrue:[ |
|
328 |
Transcript showCR:'ProjectDefinition ', aPreRequisiteProjectID, ' is missing - cannot find its preRequisites.'. |
|
329 |
] ifFalse:[ |
|
330 |
def effectivePreRequisites |
|
331 |
select:[:eachSubPreRequisite | (setOfAllPreRequisites includes:eachSubPreRequisite) not] |
|
332 |
thenDo:[:eachSubPreRequisite | |
|
333 |
Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' requires ', eachSubPreRequisite). |
|
334 |
aBlock value:def value:eachSubPreRequisite. |
|
335 |
toAdd add:eachSubPreRequisite |
|
336 |
]. |
|
337 |
||
338 |
"but subprojects of our prerequisites are also prerequisites" |
|
339 |
def effectiveSubProjects |
|
340 |
select:[:eachSubSubRequisite | eachSubSubRequisite ~= self package and:[ (setOfAllPreRequisites includes:eachSubSubRequisite) not ]] |
|
341 |
thenDo:[:eachSubSubRequisite | |
|
342 |
Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' hasSub ', eachSubSubRequisite). |
|
343 |
aBlock value:def value:eachSubSubRequisite. |
|
344 |
toAdd add:eachSubSubRequisite |
|
345 |
]. |
|
346 |
]. |
|
347 |
] |
|
10716 | 348 |
]. |
11386
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
349 |
^ setOfAllPreRequisites. |
10716 | 350 |
|
351 |
" |
|
11386
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
352 |
stx_libbasic allPreRequisites |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
353 |
stx_libbasic2 allPreRequisites |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
354 |
stx_libview2 allPreRequisites |
13419 | 355 |
ubs_application allPreRequisites |
356 |
ubs_application allPreRequisitesSorted |
|
357 |
exept_expecco_application allPreRequisites |
|
358 |
exept_expeccoNET_application allPreRequisites |
|
10716 | 359 |
alspa_batch_application allPreRequisites |
360 |
" |
|
13336 | 361 |
|
362 |
"Created: / 13-04-2011 / 15:23:21 / sr" |
|
10810 | 363 |
! |
364 |
||
12575 | 365 |
directory |
366 |
"for packageId compatibility" |
|
367 |
||
368 |
^ self moduleDirectory |
|
369 |
||
370 |
" |
|
371 |
bosch_dapasx_datenbasis_Definition moduleDirectory |
|
372 |
bosch_dapasx_parameter_system_Definition moduleDirectory |
|
13419 | 373 |
stx_libbasic3 moduleDirectory |
374 |
cg_croquet moduleDirectory |
|
375 |
cg_croquet package asPackageId module |
|
376 |
cg_croquet moduleDirectory |
|
377 |
stx_goodies_xml_vw moduleDirectory |
|
12575 | 378 |
" |
379 |
||
380 |
"Created: / 08-08-2006 / 20:25:39 / fm" |
|
381 |
"Modified: / 18-08-2006 / 12:18:33 / cg" |
|
382 |
! |
|
383 |
||
9536 | 384 |
initialClassNameForDefinitionOf:aPackageId |
12360
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
385 |
"given a package-ID, return an appropriate class name for this package" |
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
386 |
|
9536 | 387 |
|s| |
388 |
||
389 |
s := aPackageId asString copy replaceAny:':/' with:$_. |
|
390 |
(s endsWith:$_) ifTrue:[ |
|
13419 | 391 |
s := s copyWithoutLast:1 |
9536 | 392 |
]. |
393 |
^ s |
|
394 |
||
12186 | 395 |
" |
13419 | 396 |
DapasXProject initialClassNameForDefinitionOf:'bosch:dapasx/interactiver_editor' |
397 |
DapasXProject initialClassNameForDefinitionOf:'stx:libbasic' |
|
398 |
DapasXProject initialClassNameForDefinitionOf:'stx:goodies/xml' |
|
12186 | 399 |
" |
9536 | 400 |
|
401 |
"Created: / 09-08-2006 / 17:44:47 / fm" |
|
402 |
"Modified: / 11-08-2006 / 14:00:05 / cg" |
|
403 |
! |
|
404 |
||
405 |
libraryName |
|
9575 | 406 |
^ self package asPackageId libraryName |
9536 | 407 |
|
9559 | 408 |
" |
9688 | 409 |
bosch_dapasx_datenbasis libraryName |
9575 | 410 |
stx_libbasic3 libraryName |
9559 | 411 |
" |
9536 | 412 |
|
413 |
"Modified: / 09-08-2006 / 18:20:29 / fm" |
|
9575 | 414 |
"Modified: / 18-08-2006 / 12:36:45 / cg" |
9536 | 415 |
! |
416 |
||
13419 | 417 |
libraryNameFor:aProjectID |
9575 | 418 |
^ aProjectID asPackageId libraryName |
9536 | 419 |
|
9559 | 420 |
" |
9575 | 421 |
bosch_dapasx_datenbasis libraryName |
422 |
stx_libbasic3 libraryNameFor:'stx:libbasic' |
|
13419 | 423 |
stx_libbasic3 libraryNameFor:'bosch:dapasx/datenbasis' |
9559 | 424 |
" |
9536 | 425 |
|
426 |
"Modified: / 09-08-2006 / 18:20:29 / fm" |
|
9575 | 427 |
"Modified: / 18-08-2006 / 12:37:02 / cg" |
9536 | 428 |
! |
429 |
||
430 |
module |
|
9559 | 431 |
^ self moduleOfClass:self |
9536 | 432 |
|
9559 | 433 |
" |
434 |
bosch_dapasx_datenbasis_Definition module |
|
435 |
DapasX_Datenbasis module |
|
13419 | 436 |
stx_libbasic3 module |
437 |
stx_libbasic3 directory |
|
9559 | 438 |
" |
9536 | 439 |
|
440 |
"Created: / 08-08-2006 / 20:24:53 / fm" |
|
441 |
"Modified: / 09-08-2006 / 16:16:37 / fm" |
|
9575 | 442 |
"Modified: / 17-08-2006 / 20:50:46 / cg" |
9536 | 443 |
! |
444 |
||
445 |
moduleDirectory |
|
9575 | 446 |
^ (PackageId from:self package) directory |
9536 | 447 |
|
9559 | 448 |
" |
9575 | 449 |
bosch_dapasx_datenbasis_Definition moduleDirectory |
450 |
bosch_dapasx_parameter_system_Definition moduleDirectory |
|
13419 | 451 |
stx_libbasic3 moduleDirectory |
452 |
cg_croquet moduleDirectory |
|
453 |
cg_croquet package asPackageId module |
|
454 |
cg_croquet moduleDirectory |
|
455 |
stx_goodies_xml_vw moduleDirectory |
|
9559 | 456 |
" |
9536 | 457 |
|
458 |
"Created: / 08-08-2006 / 20:25:39 / fm" |
|
9575 | 459 |
"Modified: / 18-08-2006 / 12:18:33 / cg" |
9536 | 460 |
! |
461 |
||
13419 | 462 |
moduleDirectoryFor:aProjectID |
9559 | 463 |
^ (aProjectID subStrings:$:) last |
9536 | 464 |
|
9559 | 465 |
" |
13419 | 466 |
bosch_dapasx_datenbasis_Definition moduleDirectory |
467 |
bosch_dapasx_parameter_system_Definition moduleDirectory |
|
9559 | 468 |
" |
9536 | 469 |
|
470 |
"Created: / 08-08-2006 / 20:25:39 / fm" |
|
9559 | 471 |
"Modified: / 17-08-2006 / 14:13:41 / cg" |
9536 | 472 |
! |
473 |
||
9891 | 474 |
moduleDirectory_win32 |
475 |
^ (PackageId from:self package) directory copy replaceAll:$/ with:$\ |
|
476 |
||
477 |
" |
|
478 |
bosch_dapasx_datenbasis moduleDirectory_win32 |
|
479 |
bosch_dapasx_parameter_system moduleDirectory_win32 |
|
13419 | 480 |
stx_libbasic3 moduleDirectory_win32 |
9891 | 481 |
" |
482 |
||
483 |
"Created: / 14-09-2006 / 20:19:17 / cg" |
|
484 |
! |
|
485 |
||
10562 | 486 |
moduleDirectory_win32For: projectID |
487 |
||
488 |
^(self moduleDirectoryFor:projectID) copy replaceAll:$/ with:$\ |
|
489 |
||
490 |
" |
|
491 |
self moduleDirectory_win32For: #'bosch:dapasx/pav_vergleich' |
|
492 |
self moduleDirectory_win32For: #'stx:goodies/xml/stx' |
|
493 |
self moduleDirectory_win32For: #'stx:libbasic2' |
|
494 |
" |
|
495 |
! |
|
496 |
||
13419 | 497 |
moduleFor:aProjectID |
9559 | 498 |
^ (aProjectID subStrings:$:) first |
9536 | 499 |
|
9559 | 500 |
" |
501 |
DapasXProject module |
|
502 |
DapasX_Datenbasis module |
|
503 |
" |
|
9536 | 504 |
|
505 |
"Created: / 09-08-2006 / 16:16:16 / fm" |
|
9559 | 506 |
"Modified: / 17-08-2006 / 14:13:46 / cg" |
9536 | 507 |
! |
508 |
||
13419 | 509 |
moduleOfClass:aClass |
9559 | 510 |
^ self moduleFor:aClass package |
9536 | 511 |
|
9559 | 512 |
" |
513 |
DapasXProject module |
|
514 |
DapasX_Datenbasis module |
|
515 |
" |
|
9536 | 516 |
|
517 |
"Created: / 09-08-2006 / 16:16:16 / fm" |
|
9559 | 518 |
"Modified: / 17-08-2006 / 14:13:51 / cg" |
9536 | 519 |
! |
520 |
||
12360
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
521 |
monticelloPackageName |
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
522 |
"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
|
523 |
|
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
524 |
^ nil |
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
525 |
! |
18b9a4b30466
preps to allow for monticello packages to be loaded
Claus Gittinger <cg@exept.de>
parents:
12357
diff
changeset
|
526 |
|
9559 | 527 |
msdosPathToPackage:toPackageID from:fromPackageID |
528 |
"Returns the path to the package defined by aPackageID relative to my path" |
|
13419 | 529 |
|
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
|
530 |
|parts1 parts2 common up down| |
9852 | 531 |
|
532 |
parts1 := fromPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
533 |
parts2 := toPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
534 |
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
|
535 |
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
|
536 |
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
|
537 |
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
|
538 |
down isEmpty ifTrue:[^ '.']. |
13419 | 539 |
^ down. |
9852 | 540 |
]. |
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
|
541 |
down isEmpty ifTrue:[ |
13419 | 542 |
^ up. |
9714 | 543 |
]. |
13419 | 544 |
^ up, '\', down |
9901 | 545 |
|
9559 | 546 |
" |
547 |
self msdosPathToPackage:'bosch:dapasx/kernel' from:'bosch:dapasx/application' |
|
13419 | 548 |
self msdosPathToPackage:'stx:libbasic' from:'bosch:dapasx/application' |
549 |
self msdosPathToPackage:'bosch:dapasx/application' from:'stx:libbasic' |
|
550 |
self msdosPathToPackage:'exept:expecco' from:'exept:expecco/application' |
|
551 |
self msdosPathToPackage:'exept:expecco/application' from:'exept:expecco' |
|
9559 | 552 |
" |
9536 | 553 |
|
9559 | 554 |
"Created: / 17-08-2006 / 14:26:39 / cg" |
9901 | 555 |
"Modified: / 14-09-2006 / 22:04:56 / cg" |
9536 | 556 |
! |
557 |
||
9714 | 558 |
msdosPathToTopFor:aProjectID |
9559 | 559 |
"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" |
9536 | 560 |
|
9852 | 561 |
|parts| |
562 |
||
563 |
parts := aProjectID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
564 |
||
565 |
aProjectID asPackageId module = 'stx' ifTrue:[ |
|
13419 | 566 |
parts size == 1 ifTrue:[^ '.']. |
567 |
^ (((2 to:parts size-1) collect:[:p | '..\']) asStringWith:'') , '..' |
|
9852 | 568 |
]. |
569 |
||
13419 | 570 |
^ ((parts collect:[:p | '..\']) asStringWith:'') , 'stx' |
571 |
||
572 |
" |
|
573 |
self msdosPathToTopFor: #'bosch' |
|
574 |
self msdosPathToTopFor: #'bosch:dapasx' |
|
575 |
self msdosPathToTopFor: #'bosch:dapasx/datenbasis' |
|
576 |
self msdosPathToTopFor: #'stx' |
|
577 |
self msdosPathToTopFor: #'stx:libview' |
|
578 |
self msdosPathToTopFor: #'stx:goodies/foo' |
|
9559 | 579 |
" |
9536 | 580 |
|
581 |
"Created: / 09-08-2006 / 15:45:54 / fm" |
|
9852 | 582 |
"Modified: / 14-09-2006 / 14:49:17 / cg" |
9559 | 583 |
! |
584 |
||
12028 | 585 |
packageDirectory |
586 |
||
12315
71599fb91dcf
comment/format in: #packageDirectory
Claus Gittinger <cg@exept.de>
parents:
12314
diff
changeset
|
587 |
^ Smalltalk packageDirectoryForPackageId: self package |
12028 | 588 |
|
589 |
"Created: / 15-06-2009 / 12:01:18 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
590 |
! |
|
591 |
||
9536 | 592 |
packageName |
9688 | 593 |
"the last component" |
9536 | 594 |
|
9688 | 595 |
^ self packageNameFor: self package |
9536 | 596 |
|
9688 | 597 |
" |
10810 | 598 |
stx_libwidg2 packageName |
9688 | 599 |
bosch_dapasx_hw_schnittstellen packageName |
600 |
bosch_dapasx_datenbasis packageName |
|
13419 | 601 |
bosch_dapasx_parameter_system packageName |
9688 | 602 |
" |
9536 | 603 |
|
604 |
"Created: / 08-08-2006 / 20:24:53 / fm" |
|
605 |
"Modified: / 09-08-2006 / 16:16:37 / fm" |
|
606 |
! |
|
607 |
||
608 |
packageNameFor: aProjectID |
|
9688 | 609 |
^ (aProjectID asCollectionOfSubstringsSeparatedByAny:':/') last. |
9536 | 610 |
|
9688 | 611 |
" |
612 |
bosch_dapasx_hw_schnittstellen packageName |
|
613 |
bosch_dapasx_datenbasis packageName |
|
13419 | 614 |
bosch_dapasx_parameter_system packageName |
615 |
cg_croquet packageName |
|
616 |
stx_goodies_xml_vw packageName |
|
617 |
stx_goodies_xml_vw packageDirectory |
|
9688 | 618 |
" |
9536 | 619 |
|
620 |
"Created: / 08-08-2006 / 20:24:53 / fm" |
|
621 |
"Modified: / 09-08-2006 / 16:16:37 / fm" |
|
622 |
"Modified: / 11-08-2006 / 14:02:32 / cg" |
|
623 |
! |
|
624 |
||
625 |
parentProject |
|
10306 | 626 |
^ (self parentProjectFor: self package) |
9536 | 627 |
|
628 |
" |
|
629 |
bosch_dapasx_hw_schnittstellen_Definition parentProject |
|
630 |
DapasX_Datenbasis parentProject |
|
631 |
" |
|
632 |
||
633 |
"Created: / 07-08-2006 / 20:18:27 / fm" |
|
634 |
"Modified: / 08-08-2006 / 10:47:37 / fm" |
|
635 |
! |
|
636 |
||
637 |
parentProjectFor: aProjectID |
|
10306 | 638 |
^ (aProjectID subStrings: $/) first |
9536 | 639 |
|
640 |
" |
|
9664 | 641 |
bosch_dapasx_hw_schnittstellen parentProject |
9536 | 642 |
" |
643 |
||
644 |
"Created: / 07-08-2006 / 20:18:27 / fm" |
|
645 |
"Modified: / 08-08-2006 / 10:47:37 / fm" |
|
9664 | 646 |
"Modified: / 23-08-2006 / 15:07:36 / cg" |
9536 | 647 |
! |
648 |
||
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
649 |
pathSeparator:platformName |
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
650 |
platformName == #unix ifTrue:[ |
13419 | 651 |
^ self pathSeparator_unix |
9850 | 652 |
]. |
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
653 |
platformName == #win32 ifTrue:[ |
13419 | 654 |
^ self pathSeparator_win32 |
9850 | 655 |
]. |
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
656 |
self error:'unknown operating system platform'. |
9850 | 657 |
|
658 |
"Created: / 14-09-2006 / 13:38:00 / cg" |
|
659 |
! |
|
660 |
||
661 |
pathSeparator_unix |
|
662 |
^ $/ |
|
663 |
||
664 |
"Created: / 14-09-2006 / 13:37:18 / cg" |
|
665 |
! |
|
666 |
||
667 |
pathSeparator_win32 |
|
668 |
^ $\ |
|
669 |
||
670 |
"Created: / 14-09-2006 / 13:37:23 / cg" |
|
671 |
! |
|
672 |
||
673 |
pathTo:aBaseFilename inPackage:aPackageID architecture:arch |
|
674 |
"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" |
|
675 |
||
676 |
|p| |
|
677 |
||
678 |
arch == #unix ifTrue:[ |
|
13419 | 679 |
p := (self pathToPackage_unix:aPackageID). |
680 |
aBaseFilename isNil ifTrue:[^ p]. |
|
681 |
^ p , '/' , aBaseFilename |
|
9850 | 682 |
]. |
683 |
arch == #win32 ifTrue:[ |
|
13419 | 684 |
p := self pathToPackage_win32:aPackageID. |
685 |
aBaseFilename isNil ifTrue:[^ p]. |
|
686 |
^ p , '\' , aBaseFilename |
|
9850 | 687 |
]. |
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
688 |
self error:'unknown operating system platform'. |
9850 | 689 |
|
690 |
"Created: / 14-09-2006 / 13:29:20 / cg" |
|
691 |
! |
|
692 |
||
693 |
pathToPackage_unix:aPackageID |
|
694 |
"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" |
|
695 |
||
10875
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
696 |
|rel| |
9850 | 697 |
|
9880 | 698 |
aPackageID asPackageId module = self package asPackageId module ifTrue:[ |
13419 | 699 |
^ self unixPathToPackage:aPackageID from:self package |
9880 | 700 |
]. |
10875
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
701 |
rel := self topRelativePathToPackage_unix:aPackageID. |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
702 |
(rel startsWith:'stx/') ifTrue:[ |
13419 | 703 |
^ '$(TOP)/', (rel copyFrom:'stx/' size + 1). |
9850 | 704 |
] ifFalse:[ |
13419 | 705 |
^ '$(TOP)/../', rel |
9850 | 706 |
] |
707 |
||
708 |
" |
|
13419 | 709 |
bosch_dapasx_kernel pathToPackage_unix:'bosch:dapasx/kernel' |
710 |
bosch_dapasx_kernel pathToPackage_unix:'bosch:dapasx/support' |
|
711 |
stx_libbasic pathToPackage_unix:'bosch:dapasx/kernel' |
|
9850 | 712 |
" |
713 |
||
714 |
"Modified: / 16-08-2006 / 18:55:41 / User" |
|
715 |
"Created: / 14-09-2006 / 13:21:23 / cg" |
|
9880 | 716 |
"Modified: / 14-09-2006 / 15:23:59 / cg" |
9850 | 717 |
! |
718 |
||
13419 | 719 |
pathToPackage_win32:aPackageID |
9850 | 720 |
"Returns the path to the package defined by aPackageID relative to my path" |
13419 | 721 |
|
10875
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
722 |
|rel| |
9850 | 723 |
|
9880 | 724 |
aPackageID asPackageId module = self package asPackageId module ifTrue:[ |
13419 | 725 |
^ self msdosPathToPackage:aPackageID from:self package |
9880 | 726 |
]. |
727 |
||
10875
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
728 |
rel := self topRelativePathToPackage_win32:aPackageID. |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
729 |
(rel startsWith:'stx\') ifTrue:[ |
13419 | 730 |
^ '$(TOP)\', (rel copyFrom:'stx\' size + 1). |
9850 | 731 |
] ifFalse:[ |
13419 | 732 |
^ '$(TOP)\..\', rel |
10875
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
733 |
] |
9850 | 734 |
|
735 |
" |
|
13419 | 736 |
self pathToPackage_win32:'bosch:dapasx/kernel' |
737 |
bosch_dapasx_kernel pathToPackage_win32:'bosch:dapasx/kernel' |
|
738 |
bosch_dapasx_kernel pathToPackage_win32:'bosch:dapasx/support' |
|
739 |
stx_libbasic pathToPackage_win32:'bosch:dapasx/kernel' |
|
9850 | 740 |
" |
741 |
||
742 |
"Created: / 14-09-2006 / 13:22:52 / cg" |
|
9880 | 743 |
"Modified: / 14-09-2006 / 15:28:45 / cg" |
9850 | 744 |
! |
745 |
||
9714 | 746 |
pathToTop_unix |
747 |
"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" |
|
748 |
||
9852 | 749 |
^ self unixPathToTopFor:self package. |
9714 | 750 |
|
751 |
" |
|
13419 | 752 |
bosch_dapasx_kernel pathToTop_unix |
753 |
stx_goodies_xml pathToTop_unix |
|
754 |
stx_libhtml pathToTop_unix |
|
755 |
stx_goodies_refactoryBrowser_changes pathToTop_unix |
|
9714 | 756 |
" |
757 |
||
758 |
"Created: / 09-08-2006 / 15:45:54 / fm" |
|
9852 | 759 |
"Modified: / 14-09-2006 / 15:01:47 / cg" |
9714 | 760 |
! |
761 |
||
762 |
pathToTop_win32 |
|
763 |
"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" |
|
764 |
||
13419 | 765 |
^self msdosPathToTopFor: self package |
766 |
||
767 |
" |
|
768 |
bosch_dapasx_datenbasis pathToTop_win32 |
|
769 |
stx_libbasic pathToTop_win32 |
|
9714 | 770 |
" |
771 |
||
772 |
"Created: / 09-08-2006 / 15:45:54 / fm" |
|
9831 | 773 |
"Modified: / 07-09-2006 / 15:51:00 / cg" |
9714 | 774 |
! |
775 |
||
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
776 |
projectIsLoaded |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
777 |
"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
|
778 |
|
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
779 |
projectIsLoaded isNil ifTrue:[ |
13419 | 780 |
projectIsLoaded := false. |
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
781 |
]. |
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
782 |
^ projectIsLoaded |
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
783 |
|
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
784 |
" |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
785 |
stx_libbasic projectIsLoaded |
13251 | 786 |
(ProjectDefinition definitionClassForPackage:#'stx:libbasic') projectIsLoaded |
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
787 |
" |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
788 |
! |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
789 |
|
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
790 |
projectIsLoaded:something |
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
791 |
projectIsLoaded := something. |
13251 | 792 |
something ifTrue:[ |
13419 | 793 |
"register myself as dependent - I want to get notified on method changes" |
794 |
self class addDependent:self. |
|
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
795 |
]. |
10433
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
796 |
! |
4768502f5cbf
Do not try to load already loaded projects
Stefan Vogel <sv@exept.de>
parents:
10430
diff
changeset
|
797 |
|
9536 | 798 |
requiredProjects |
11479 | 799 |
^ self effectivePreRequisites , self subProjects |
9536 | 800 |
! |
801 |
||
9850 | 802 |
topRelativePathTo:aBaseFilename inPackage:aPackageID architecture:arch |
13419 | 803 |
"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
|
804 |
and adding for each one '../' to get the ST/X top directory" |
9850 | 805 |
|
806 |
|p| |
|
807 |
||
808 |
arch == #unix ifTrue:[ |
|
13419 | 809 |
p := (self topRelativePathToPackage_unix:aPackageID). |
810 |
aBaseFilename isNil ifTrue:[^ p]. |
|
811 |
^ p , '/' , aBaseFilename |
|
9850 | 812 |
]. |
813 |
arch == #win32 ifTrue:[ |
|
13419 | 814 |
p := self topRelativePathToPackage_win32:aPackageID. |
815 |
aBaseFilename isNil ifTrue:[^ p]. |
|
816 |
^ p , '\' , aBaseFilename |
|
9850 | 817 |
]. |
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
818 |
self error:'unknown operating system platform'. |
9850 | 819 |
|
820 |
"Created: / 14-09-2006 / 13:34:05 / cg" |
|
821 |
! |
|
822 |
||
13419 | 823 |
topRelativePathToPackage_unix:aPackageID |
9850 | 824 |
"Returns the path to the package as specified by aPackageID relative to the top directory" |
13419 | 825 |
|
9850 | 826 |
^ aPackageID asString copy replaceAny:':/' with:$/ |
827 |
||
828 |
" |
|
829 |
self topRelativePathToPackage_unix:'stx:goodies/xml' |
|
830 |
self topRelativePathToPackage_unix:'bosch:dapasx/kernel' |
|
831 |
" |
|
832 |
||
833 |
"Created: / 14-09-2006 / 13:20:40 / cg" |
|
834 |
! |
|
835 |
||
13419 | 836 |
topRelativePathToPackage_win32:aPackageID |
9559 | 837 |
"Returns the path to the package as specified by aPackageID relative to the top directory" |
13419 | 838 |
|
9559 | 839 |
^ aPackageID asString copy replaceAny:':/' with:$\ |
840 |
||
841 |
" |
|
9850 | 842 |
self topRelativePathToPackage_win32:'stx:goodies/xml' |
843 |
self topRelativePathToPackage_win32:'bosch:dapasx/kernel' |
|
9559 | 844 |
" |
9536 | 845 |
|
9850 | 846 |
"Created: / 14-09-2006 / 13:20:12 / cg" |
9852 | 847 |
! |
848 |
||
9880 | 849 |
unixPathToPackage:toPackageID from:fromPackageID |
850 |
"Returns the path to the package defined by aPackageID relative to my path" |
|
13419 | 851 |
|
10875
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
852 |
|parts1 parts2 common up down rel| |
9880 | 853 |
|
854 |
parts1 := fromPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
855 |
parts2 := toPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
856 |
common := parts1 commonPrefixWith:parts2. |
|
857 |
common notEmpty ifTrue:[ |
|
13419 | 858 |
up := ((1 to:parts1 size - common size) collect:[:p | '../']) asStringWith:''. |
859 |
down := (parts2 copyFrom:common size+1) asStringWith:'/'. |
|
860 |
(up isEmpty and:[down isEmpty]) ifTrue:[^ '.']. |
|
861 |
^ up , down |
|
9880 | 862 |
]. |
863 |
||
10875
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
864 |
rel := (self topRelativePathToPackage_unix:toPackageID). |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
865 |
(rel startsWith:'stx/') ifTrue:[ |
13419 | 866 |
^ '$(TOP)', (rel copyFrom:'stx/' size) |
9880 | 867 |
]. |
10875
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
868 |
|
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
869 |
^ '$(TOP)/../', rel. |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
870 |
|
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
871 |
"/ pTop := self unixPathToTopFor:fromPackageID. |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
872 |
"/ (pTop endsWith:'/stx') ifTrue:[ |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
873 |
"/ pTop := pTop copyButLast:'stx' size. |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
874 |
"/ ] ifFalse:[ |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
875 |
"/ pTop isEmpty ifTrue:[ |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
876 |
"/ pTop := '../'. |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
877 |
"/ ] ifFalse:[ |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
878 |
"/ pTop := pTop, '/../'. |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
879 |
"/ ]. |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
880 |
"/ ]. |
ed4bd37a995e
Fix unix Make.proto generation: resource file copy
Stefan Vogel <sv@exept.de>
parents:
10872
diff
changeset
|
881 |
"/ ^ pTop, (self topRelativePathToPackage_unix:toPackageID) |
9880 | 882 |
|
883 |
" |
|
10713 | 884 |
self unixPathToPackage:'bosch:dapasx/kernel' from:'bosch:dapasx/application' |
13419 | 885 |
self unixPathToPackage:'stx:libbasic' from:'bosch:dapasx/application' |
886 |
self unixPathToPackage:'bosch:dapasx/application' from:'stx:libbasic' |
|
9880 | 887 |
" |
888 |
||
889 |
"Created: / 14-09-2006 / 15:21:10 / cg" |
|
890 |
! |
|
891 |
||
9852 | 892 |
unixPathToTopFor:aProjectID |
893 |
"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" |
|
894 |
||
895 |
|parts| |
|
896 |
||
897 |
parts := aProjectID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
898 |
||
899 |
aProjectID asPackageId module = 'stx' ifTrue:[ |
|
13419 | 900 |
parts size == 1 ifTrue:[^ '']. |
901 |
^ (((2 to:parts size-1) collect:[:p | '../']) asStringWith:'') , '..' |
|
9852 | 902 |
]. |
903 |
||
13419 | 904 |
^ ((parts collect:[:p | '../']) asStringWith:'') , 'stx' |
905 |
||
906 |
" |
|
907 |
self unixPathToTopFor: #'bosch' |
|
908 |
self unixPathToTopFor: #'bosch:dapasx' |
|
909 |
self unixPathToTopFor: #'bosch:dapasx/datenbasis' |
|
910 |
self unixPathToTopFor: #'stx' |
|
911 |
self unixPathToTopFor: #'stx:libview' |
|
912 |
self unixPathToTopFor: #'stx:goodies/foo' |
|
9852 | 913 |
" |
914 |
||
915 |
"Created: / 14-09-2006 / 14:59:53 / cg" |
|
9536 | 916 |
! ! |
917 |
||
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
918 |
!ProjectDefinition class methodsFor:'accessing - packaging'! |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
919 |
|
12371 | 920 |
classNames:aCollectionOfClassNames |
921 |
"set the set of classes" |
|
922 |
||
923 |
self classNamesAndAttributes:aCollectionOfClassNames usingCompiler:nil |
|
924 |
! |
|
925 |
||
926 |
classNamesAndAttributes:newSpec usingCompiler:compilerOrNil |
|
13419 | 927 |
"set the set of classes. and attributes |
928 |
Because this requires compilation of my classList-method, a compiler can be passed in, |
|
12371 | 929 |
which has to do the job. |
930 |
(this is used by the systembrowser to pass in a CodeGeneratorTool with undo support)" |
|
931 |
||
932 |
|oldSpec newCode| |
|
933 |
||
934 |
oldSpec := self classNamesAndAttributes. |
|
935 |
newSpec = oldSpec ifTrue: [^ self]. |
|
936 |
||
937 |
newCode := self classNamesAndAttributes_codeFor:newSpec. |
|
938 |
||
939 |
(compilerOrNil ? self compilerClass) |
|
13419 | 940 |
compile:newCode |
941 |
forClass:self theMetaclass |
|
942 |
inCategory:'description - contents'. |
|
12371 | 943 |
! |
944 |
||
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
945 |
excludeClasses:toExclude usingCompiler:compilerOrNil |
13419 | 946 |
"exclude (remove from classList) a number of classes. |
947 |
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
|
948 |
which has to do the job. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
949 |
(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
|
950 |
|
12371 | 951 |
|newSpec| |
952 |
||
953 |
newSpec := self classNamesAndAttributes copy. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
954 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
955 |
toExclude do:[:eachClassToExclude | |
13419 | 956 |
|className| |
957 |
className := eachClassToExclude theNonMetaclass name. |
|
958 |
(self allClassNames includes:className) ifTrue:[ |
|
959 |
|idx| |
|
960 |
||
961 |
idx := newSpec findFirst:[:entry | entry = className or:[entry first = className]]. |
|
962 |
idx ~~ 0 ifTrue:[ |
|
963 |
newSpec := newSpec copyWithoutIndex:idx. |
|
964 |
]. |
|
965 |
]. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
966 |
]. |
12371 | 967 |
self classNamesAndAttributes:newSpec usingCompiler:compilerOrNil |
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
968 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
969 |
"Created: / 30-08-2007 / 18:28:28 / cg" |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
970 |
! |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
971 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
972 |
includeClasses:toInclude usingCompiler:compilerOrNil |
13419 | 973 |
"include (add to classList) a number of classes. |
974 |
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
|
975 |
which has to do the job. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
976 |
(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
|
977 |
|
12371 | 978 |
|oldSpec newSpec| |
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
979 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
980 |
oldSpec := self classNamesAndAttributes. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
981 |
newSpec := oldSpec copy. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
982 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
983 |
toInclude do:[:eachClassToInclude | |
13419 | 984 |
|className| |
985 |
||
986 |
className := eachClassToInclude theNonMetaclass name. |
|
987 |
(self compiled_classNames includes:className) ifFalse:[ |
|
988 |
| idx entry| |
|
989 |
||
990 |
idx := oldSpec findFirst:[:entry | entry = className or:[entry first = className]]. |
|
991 |
idx == 0 ifTrue:[ |
|
992 |
newSpec := newSpec copyWith:(Array with:className) |
|
993 |
] ifFalse:[ |
|
994 |
entry := newSpec at:idx. |
|
995 |
entry isArray ifTrue:[ |
|
996 |
entry := entry copyWithout:#autoload |
|
997 |
]. |
|
998 |
newSpec at:idx put:entry |
|
999 |
]. |
|
1000 |
]. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1001 |
]. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1002 |
|
12371 | 1003 |
self classNamesAndAttributes:newSpec usingCompiler:compilerOrNil |
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1004 |
! |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1005 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1006 |
makeClassesAutoloaded:toMakeAutoloaded usingCompiler:compilerOrNil |
13419 | 1007 |
"include as autoloaded (add to classList) a number of classes. |
1008 |
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
|
1009 |
which has to do the job. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1010 |
(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
|
1011 |
|
12371 | 1012 |
|newSpec| |
1013 |
||
1014 |
newSpec := self classNamesAndAttributes copy. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1015 |
|
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1016 |
toMakeAutoloaded do:[:eachClassToMakeAutoloaded | |
13419 | 1017 |
|className| |
1018 |
||
1019 |
className := eachClassToMakeAutoloaded theNonMetaclass name. |
|
1020 |
(self autoloaded_classNames includes:className) ifFalse:[ |
|
1021 |
|idx entry| |
|
1022 |
||
1023 |
idx := newSpec findFirst:[:entry | entry = className or:[entry first = className]]. |
|
1024 |
idx == 0 ifTrue:[ |
|
1025 |
newSpec := newSpec copyWith:(Array with:className with:#autoload) |
|
1026 |
] ifFalse:[ |
|
1027 |
entry := newSpec at:idx. |
|
1028 |
entry isArray ifTrue:[ |
|
1029 |
entry := (entry copyWithout:#autoload) copyWith:#autoload. |
|
1030 |
] ifFalse:[ |
|
1031 |
entry := Array with:entry with:#autoload |
|
1032 |
]. |
|
1033 |
newSpec at:idx put:entry. |
|
1034 |
]. |
|
1035 |
]. |
|
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1036 |
]. |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1037 |
|
12371 | 1038 |
self classNamesAndAttributes:newSpec usingCompiler:compilerOrNil |
12339
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1039 |
! ! |
918b3eddd723
#excludeClasses:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
12338
diff
changeset
|
1040 |
|
12028 | 1041 |
!ProjectDefinition class methodsFor:'accessing - svn'! |
1042 |
||
1043 |
svnRevision |
|
1044 |
||
1045 |
" |
|
13419 | 1046 |
Answers SVN revision of given package. The revision is computed |
1047 |
as follows: |
|
1048 |
1) Look at package directory if there is .svn administration |
|
1049 |
directory. If so, uses SVN to obtain SVN revision & return |
|
1050 |
2) If svnRevisionNr return non-nil, use that as SVN revision & return |
|
1051 |
3) If everything fails, compute maximum from all revision of all |
|
1052 |
classes & extensions |
|
12028 | 1053 |
" |
1054 |
| pkgDir revNr | |
|
1055 |
||
1056 |
"1)" |
|
1057 |
pkgDir := self packageDirectory. |
|
1058 |
(pkgDir notNil and: [pkgDir exists and: [(pkgDir / '.svn') exists]]) ifTrue: |
|
13419 | 1059 |
[[revNr := (SVN::InfoCommand new |
1060 |
workingCopy: (SVN::WorkingCopy branch: (SVN::Branch new) path: pkgDir); |
|
1061 |
execute) anyOne revision] |
|
1062 |
value |
|
1063 |
"/on: Error do: [revNr := nil] |
|
1064 |
]. |
|
12028 | 1065 |
revNr ifNotNil:[^SVN::Revision number:revNr]. |
1066 |
"2)" |
|
1067 |
"We have to explicitly check for existence of svnRevisionNr, |
|
1068 |
because we don't want to invoke inherited method" |
|
1069 |
(self class methodDictionary includesKey: #svnRevisionNr) |
|
13419 | 1070 |
ifTrue:[revNr := self perform:#svnRevisionNr]. |
12028 | 1071 |
revNr ifNotNil:[^SVN::Revision number:(revNr asString select:[:e|e isDigit])]. |
1072 |
||
1073 |
"3)" |
|
1074 |
revNr := (self searchForClassesWithProject: self package) |
|
13419 | 1075 |
inject: 0 |
1076 |
into: |
|
1077 |
[:rev :cls| |
|
1078 |
((cls revision ? '.') includes: $.)"/ CVS revision number? |
|
1079 |
ifTrue:[rev] |
|
1080 |
ifFalse:[rev max: (cls revision ? '0') asNumber]]. |
|
12028 | 1081 |
^revNr ~= 0 |
13419 | 1082 |
ifTrue: [SVN::Revision number:revNr] |
1083 |
ifFalse:[SVN::Revision head] |
|
1084 |
||
1085 |
" |
|
1086 |
stx_libbasic svnRevision |
|
1087 |
stx_goodies_libsvn svnRevision |
|
1088 |
stx_goodies_libsvn revision |
|
12028 | 1089 |
|
1090 |
" |
|
1091 |
||
1092 |
"Created: / 15-06-2009 / 11:54:33 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1093 |
"Modified: / 22-08-2009 / 09:06:29 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
13411 | 1094 |
"Modified: / 13-02-2010 / 19:27:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1095 |
! ! |
|
1096 |
||
1097 |
!ProjectDefinition class methodsFor:'accessing - tests'! |
|
1098 |
||
13419 | 1099 |
excludedFromTestSuite |
13411 | 1100 |
"List of testcases and/or tests excluded from testsuite. |
1101 |
Entries maybe ClassName or #(ClassName testName) |
|
1102 |
" |
|
1103 |
^ #() |
|
1104 |
||
1105 |
"Created: / 03-06-2011 / 16:56:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1106 |
! |
|
1107 |
||
1108 |
testSuite |
|
13544 | 1109 |
"generate and return a testSuite containing all of my test-classes" |
13411 | 1110 |
|
1111 |
|suite classes| |
|
1112 |
||
1113 |
suite := TestSuite named:self package. |
|
13544 | 1114 |
classes := self classes |
1115 |
select:[:each | |
|
1116 |
each isLoaded ifFalse:[each autoload]. |
|
1117 |
(each isTestCaseLike) and:[ each isAbstract not ] |
|
13568 | 1118 |
]. |
13544 | 1119 |
|
13411 | 1120 |
classes := classes asSortedCollection:[:a :b | a name <= b name ]. |
13568 | 1121 |
classes do: [:eachClass | |
13544 | 1122 |
| tests | |
1123 |
||
13568 | 1124 |
tests := eachClass suite tests. |
13544 | 1125 |
tests := tests reject:[:test|self shouldExcludeTest: test]. |
1126 |
suite addTests: tests |
|
1127 |
]. |
|
1128 |
^ suite |
|
13411 | 1129 |
|
1130 |
"Created: / 01-04-2011 / 15:20:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1131 |
"Modified: / 03-06-2011 / 17:07:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13568 | 1132 |
"Modified: / 08-08-2011 / 14:59:45 / cg" |
12028 | 1133 |
! ! |
1134 |
||
9714 | 1135 |
!ProjectDefinition class methodsFor:'class initialization'! |
1136 |
||
1137 |
initialize |
|
1138 |
LibraryType := #'Library'. |
|
1139 |
GUIApplicationType := #'GUI-Application'. |
|
1140 |
NonGUIApplicationType := #'NonGUI-Application'. |
|
13592 | 1141 |
AccessLock := Semaphore forMutualExclusion. |
9714 | 1142 |
|
10121 | 1143 |
" |
1144 |
self initialize |
|
1145 |
" |
|
1146 |
||
13592 | 1147 |
"Modified: / 18-08-2011 / 13:48:31 / cg" |
10121 | 1148 |
! |
1149 |
||
1150 |
initializeAllProjectDefinitions |
|
1151 |
"needs everything else (especially the compiler etc.) to be initialized. |
|
1152 |
Therefore, its not invoked by #initialize, but instead explicitely, |
|
1153 |
by Smalltalk" |
|
13609 | 1154 |
|
1155 |
|isStandAloneApp| |
|
1156 |
||
1157 |
isStandAloneApp := Smalltalk isStandAloneApp. |
|
1158 |
||
1159 |
self allSubclassesDo:[:eachProjectDefinitionClass | |
|
1160 |
eachProjectDefinitionClass isAbstract ifFalse:[ |
|
1161 |
isStandAloneApp ifFalse:[ |
|
1162 |
eachProjectDefinitionClass installAutoloadedClasses. |
|
1163 |
]. |
|
1164 |
eachProjectDefinitionClass projectIsLoaded:true. |
|
1165 |
] |
|
1166 |
]. |
|
10115 | 1167 |
|
9714 | 1168 |
" |
1169 |
self initialize |
|
1170 |
" |
|
10113
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1171 |
|
10121 | 1172 |
"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
|
1173 |
! |
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1174 |
|
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1175 |
installAutoloadedClasses |
12372 | 1176 |
"install all of my autoloaded classes (if any)" |
1177 |
||
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1178 |
|classesToFixClassFileName| |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1179 |
|
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1180 |
classesToFixClassFileName := OrderedCollection new. |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1181 |
|
13592 | 1182 |
self autoloaded_classNames do:[:className | |
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1183 |
|cls| |
13592 | 1184 |
|
1185 |
"/ 'install as autoloaded: ' errorPrint. className errorPrintCR. |
|
1186 |
(cls := Smalltalk classNamed:className) isNil ifTrue:[ |
|
1187 |
Error handle:[:ex | |
|
1188 |
(self name,' [warning]: failed to install autoloaded: ',className) errorPrintCR. |
|
1189 |
(self name,' [info]: reason: ',ex description) errorPrintCR. |
|
1190 |
"/ thisContext fullPrintAll. |
|
1191 |
] do:[ |
|
1192 |
cls := Smalltalk |
|
1193 |
installAutoloadedClassNamed:className |
|
1194 |
category:'* as yet unknown category *' |
|
1195 |
package:self package |
|
1196 |
revision:nil |
|
1197 |
]. |
|
1198 |
cls notNil ifTrue:[ |
|
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1199 |
classesToFixClassFileName add:cls. |
13592 | 1200 |
]. |
1201 |
]. |
|
1202 |
]. |
|
10113
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1203 |
|
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1204 |
Smalltalk addStartBlock:[ |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1205 |
|abbrevs| |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1206 |
|
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1207 |
abbrevs := self abbrevs. |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1208 |
"/ patch the classFileNames |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1209 |
classesToFixClassFileName do:[:cls | |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1210 |
|entry classFilenameFromAbbreviations| |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1211 |
|
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1212 |
entry := abbrevs at:cls name ifAbsent:nil. |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1213 |
entry notNil ifTrue:[ |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1214 |
classFilenameFromAbbreviations := entry fileName. |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1215 |
classFilenameFromAbbreviations notNil ifTrue:[ |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1216 |
classFilenameFromAbbreviations := classFilenameFromAbbreviations,'.st'. |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1217 |
(classFilenameFromAbbreviations ~= cls getClassFilename) ifTrue:[ |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1218 |
cls setClassFilename:classFilenameFromAbbreviations |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1219 |
]. |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1220 |
]. |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1221 |
] |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1222 |
]. |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1223 |
|
13592 | 1224 |
"/ patch the categories |
1225 |
Class withoutUpdatingChangesDo:[ |
|
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1226 |
|entry| |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1227 |
|
13592 | 1228 |
self classNames do:[:nm | |
1229 |
|cls| |
|
1230 |
||
1231 |
((cls := Smalltalk at: nm) notNil |
|
1232 |
and:[ cls isLoaded not |
|
1233 |
and:[ (entry := abbrevs at:cls name ifAbsent:[nil]) notNil |
|
1234 |
]]) ifTrue:[ |
|
1235 |
cls category: (entry category) |
|
1236 |
] |
|
1237 |
] |
|
1238 |
] |
|
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1239 |
]. |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
1240 |
|
13411 | 1241 |
|
10113
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1242 |
" |
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1243 |
stx_libbasic installAutoloadedClasses |
12268
b3cd2af642f2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
12264
diff
changeset
|
1244 |
stx_libhtml installAutoloadedClasses |
13592 | 1245 |
stx_libtool2 installAutoloadedClasses |
10113
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1246 |
" |
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1247 |
|
78086bf25905
install autoloaded classes (if not already present)
Claus Gittinger <cg@exept.de>
parents:
10106
diff
changeset
|
1248 |
"Created: / 23-10-2006 / 16:02:12 / cg" |
13411 | 1249 |
"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
|
1250 |
"Modified: / 20-08-2011 / 23:32:32 / cg" |
9714 | 1251 |
! ! |
1252 |
||
9998 | 1253 |
!ProjectDefinition class methodsFor:'code generation'! |
1254 |
||
11072 | 1255 |
applicationIconFileName_code |
1256 |
^ String streamContents:[:s | |
|
13419 | 1257 |
s nextPutLine:'applicationIconFileName'. |
1258 |
s nextPutLine:' "Return the name (without suffix) of an icon-file (the app''s icon); will be included in the rc-resource file"'. |
|
1259 |
s cr; |
|
1260 |
nextPutLine:' ^ nil'; |
|
1261 |
nextPutLine:' "/ ^ self applicationName'. |
|
11072 | 1262 |
]. |
1263 |
||
1264 |
" |
|
13419 | 1265 |
self legalCopyright_code |
1266 |
stx_libbasic3 legalCopyright_code |
|
11072 | 1267 |
" |
1268 |
||
1269 |
"Created: / 18-08-2006 / 16:21:01 / cg" |
|
1270 |
! |
|
1271 |
||
10393 | 1272 |
classNamesAndAttributes_codeFor:aSpecArray |
1273 |
"generate method code returning all classes of the project from the given spec." |
|
1274 |
||
1275 |
^ String streamContents:[:s | |
|
13419 | 1276 |
s nextPutLine:'classNamesAndAttributes'. |
1277 |
s nextPutLine:' "lists the classes which are to be included in the project.'. |
|
1278 |
s nextPutLine:' Each entry in the list may be: a single class-name (symbol),'. |
|
1279 |
s nextPutLine:' or an array-literal consisting of class name and attributes.'. |
|
1280 |
s nextPutLine:' Attributes are: #autoload or #<os> where os is one of win32, unix,..."'. |
|
1281 |
s nextPutLine:''. |
|
1282 |
s nextPutLine:' ^ #('. |
|
1283 |
s nextPutLine:' "<className> or (<className> attributes...) in load order"'. |
|
1284 |
||
1285 |
(self classNamesAndAttributesFromSpecArray:aSpecArray) do:[:entry | |
|
1286 |
s spaces:8. |
|
1287 |
entry storeArrayElementOn:s. |
|
1288 |
s cr. |
|
1289 |
]. |
|
1290 |
s nextPutLine:' )' |
|
10393 | 1291 |
]. |
1292 |
||
1293 |
" |
|
1294 |
stx_libbasic3 classNamesAndAttributes_codeFor:(stx_libbasic3 classNamesAndAttributes) |
|
1295 |
exept_expecco classNamesAndAttributes_codeFor:(exept_expecco classNamesAndAttributes) |
|
1296 |
" |
|
1297 |
||
1298 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
1299 |
"Created: / 19-02-2007 / 15:43:27 / cg" |
|
1300 |
! |
|
1301 |
||
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1302 |
classNamesAndAttributes_code_ignoreOldEntries:ignoreOldEntries ignoreOldDefinition:ignoreOldDefinition |
10010 | 1303 |
"generate method code returning all classes of the project. |
1304 |
Platform attributes are kept from the old definition. |
|
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1305 |
If ignoreOldEntries is true, the list is completely recreated; |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1306 |
if false, existing entries are preserved. |
10010 | 1307 |
If ignoreOldDefinition is true, the autoload attribute is set/reset if |
13419 | 1308 |
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
|
1309 |
If false, it is taken from an existing definition in #classNamesAndAttributes" |
10010 | 1310 |
|
10393 | 1311 |
|newSpec oldSpec ignored| |
1312 |
||
1313 |
oldSpec := self classNamesAndAttributesAsSpecArray. |
|
1314 |
ignored := self ignoredClassNames asSet. |
|
1315 |
newSpec := OrderedCollection new. |
|
1316 |
||
1317 |
ignoreOldEntries ifFalse:[ |
|
13419 | 1318 |
oldSpec do:[:oldEntry | |
1319 |
|newEntry className cls | |
|
1320 |
||
1321 |
newEntry := oldEntry copy. |
|
1322 |
className := newEntry first. |
|
1323 |
||
1324 |
(ignored includes:className) ifFalse:[ |
|
1325 |
cls := Smalltalk classNamed:className. |
|
1326 |
ignoreOldDefinition ifTrue:[ |
|
1327 |
(cls notNil and:[cls isLoaded not]) ifTrue:[ |
|
1328 |
(newEntry includes:#autoload) ifFalse:[ |
|
1329 |
newEntry := newEntry copyWith:#autoload. |
|
1330 |
]. |
|
1331 |
]. |
|
1332 |
]. |
|
1333 |
"JV @ 2010-06-19 |
|
1334 |
Force merge default class attributes with existing ones" |
|
1335 |
newEntry := self mergeDefaultClassAttributesFor: cls with: newEntry. |
|
1336 |
newSpec add:newEntry. |
|
1337 |
]. |
|
1338 |
]. |
|
10393 | 1339 |
]. |
1340 |
||
1341 |
self searchForClasses do:[:eachClass | |
|
13419 | 1342 |
|className attributes oldSpecEntry oldAttributes newEntry| |
1343 |
||
1344 |
className := eachClass name. |
|
1345 |
(ignored includes:className) ifFalse:[ |
|
1346 |
oldSpecEntry := oldSpec detect:[:entry | entry first = className] ifNone:nil. |
|
1347 |
||
1348 |
(ignoreOldEntries or:[ oldSpecEntry isNil]) ifTrue:[ |
|
1349 |
(eachClass isLoaded not or:[eachClass isPrivate not]) ifTrue:[ |
|
1350 |
(self additionalClassNamesAndAttributes includes:className) ifFalse:[ |
|
1351 |
(oldSpecEntry size > 1) ifTrue:[ |
|
1352 |
oldAttributes := oldSpecEntry copyFrom:2. |
|
1353 |
]. |
|
1354 |
||
1355 |
ignoreOldDefinition ifTrue:[ |
|
1356 |
"take autoload attribute from classes state in the image" |
|
1357 |
oldAttributes notNil ifTrue:[ |
|
1358 |
attributes := oldAttributes copyWithout:#autoload. |
|
1359 |
] ifFalse:[ |
|
1360 |
attributes := #() |
|
1361 |
]. |
|
1362 |
eachClass isLoaded ifFalse:[ |
|
1363 |
attributes := attributes copyWith:#autoload. |
|
1364 |
]. |
|
1365 |
] ifFalse:[ |
|
1366 |
"keep any existing attribute" |
|
1367 |
oldAttributes notNil ifTrue:[ |
|
1368 |
attributes := oldAttributes. |
|
1369 |
] ifFalse:[ |
|
1370 |
attributes := eachClass isLoaded ifTrue:[ #() ] ifFalse:[ #(autoload) ]. |
|
1371 |
]. |
|
1372 |
]. |
|
1373 |
"JV @ 2010-06-19 |
|
1374 |
Support fo additional class attributes and programming language attribute" |
|
1375 |
attributes := self mergeDefaultClassAttributesFor: eachClass with: attributes. |
|
1376 |
||
1377 |
newEntry := Array with:className. |
|
1378 |
attributes notEmptyOrNil ifTrue:[ |
|
1379 |
newEntry := newEntry , attributes. |
|
1380 |
]. |
|
1381 |
newSpec add:newEntry |
|
1382 |
] |
|
1383 |
] |
|
1384 |
] |
|
1385 |
] |
|
9998 | 1386 |
]. |
10393 | 1387 |
^ self classNamesAndAttributes_codeFor:newSpec |
1388 |
||
13419 | 1389 |
" |
10393 | 1390 |
stx_libbasic3 classNamesAndAttributes_code_ignoreOldEntries:false ignoreOldDefinition:true |
1391 |
exept_expecco classNamesAndAttributes_code_ignoreOldEntries:false ignoreOldDefinition:true |
|
1392 |
" |
|
9998 | 1393 |
|
1394 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1395 |
"Created: / 10-10-2006 / 22:00:50 / cg" |
10405
1e4e2f0908e5
update vs. regenerate project definition
Claus Gittinger <cg@exept.de>
parents:
10404
diff
changeset
|
1396 |
"Modified: / 22-02-2007 / 15:06:37 / cg" |
13411 | 1397 |
"Modified: / 19-06-2010 / 10:56:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9998 | 1398 |
! |
1399 |
||
1400 |
companyName_code |
|
12541 | 1401 |
^ self companyName_codeFor:self companyName |
1402 |
||
1403 |
" |
|
1404 |
self companyName_code |
|
1405 |
stx_libbasic3 companyName_code |
|
1406 |
" |
|
1407 |
||
1408 |
"Created: / 18-08-2006 / 16:20:42 / cg" |
|
1409 |
! |
|
1410 |
||
1411 |
companyName_codeFor:aString |
|
9998 | 1412 |
^ String streamContents:[:s | |
13419 | 1413 |
s nextPutLine:'companyName'. |
1414 |
s nextPutLine:' "Return a companyname which will appear in <lib>.rc"'. |
|
1415 |
s cr; nextPutLine:' ^ ',aString storeString. |
|
9998 | 1416 |
]. |
1417 |
||
1418 |
" |
|
1419 |
self companyName_code |
|
1420 |
stx_libbasic3 companyName_code |
|
1421 |
" |
|
1422 |
||
1423 |
"Created: / 18-08-2006 / 16:20:42 / cg" |
|
1424 |
! |
|
1425 |
||
1426 |
compileDescriptionMethods |
|
1427 |
(self isLibraryDefinition |
|
1428 |
or:[ self isApplicationDefinition ] ) ifFalse:[ |
|
13419 | 1429 |
self error:'I am abstract - must be a subclass of Libray- or ApplicationDefinition.' |
9998 | 1430 |
]. |
1431 |
||
13419 | 1432 |
self |
1433 |
forEachMethodsCodeToCompileDo:[:code :category | |
|
1434 |
self compile:code categorized:category |
|
1435 |
]. |
|
9998 | 1436 |
|
1437 |
"/ self instAndClassMethodsDo:[:m | m package:self package]. |
|
1438 |
||
1439 |
" |
|
1440 |
DapasXProject compileDescriptionMethods |
|
1441 |
DapasX_Datenbasis compileDescriptionMethods |
|
1442 |
bosch_dapasx_interactiver_editor compileDescriptionMethods |
|
1443 |
stx_libbasic compileDescriptionMethods |
|
1444 |
" |
|
1445 |
||
1446 |
"Created: / 09-08-2006 / 18:00:31 / fm" |
|
1447 |
"Modified: / 05-09-2006 / 13:46:29 / cg" |
|
1448 |
! |
|
1449 |
||
1450 |
description_code |
|
1451 |
^ String streamContents:[:s | |
|
13419 | 1452 |
s nextPutLine:'description'. |
1453 |
s nextPutLine:' "Return a description string which will appear in vc.def / bc.def"'. |
|
1454 |
s cr; nextPutLine:' ^ ',self description asString storeString. |
|
9998 | 1455 |
]. |
1456 |
||
1457 |
" |
|
13419 | 1458 |
self description_code |
1459 |
stx_libbasic3 description_code |
|
9998 | 1460 |
" |
1461 |
||
1462 |
"Created: / 17-08-2006 / 21:24:01 / cg" |
|
1463 |
"Modified: / 18-08-2006 / 16:16:24 / cg" |
|
1464 |
! |
|
1465 |
||
10923 | 1466 |
effectivePreRequisites |
1467 |
"get the preRequisites, that are not excluded" |
|
1468 |
||
1469 |
|preRequisites| |
|
1470 |
||
1471 |
preRequisites := self preRequisites asSet. |
|
1472 |
preRequisites removeAllFoundIn:self excludedFromPreRequisites. |
|
1473 |
preRequisites remove:self package ifAbsent:[]. |
|
1474 |
||
1475 |
^ preRequisites |
|
1476 |
! |
|
1477 |
||
11386
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1478 |
effectiveSubProjects |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1479 |
"get the subProjects, that are not excluded" |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1480 |
|
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1481 |
|subProjects| |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1482 |
|
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1483 |
subProjects := self subProjects asSet. |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1484 |
subProjects removeAllFoundIn:self excludedFromSubProjects. |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1485 |
subProjects remove:self package ifAbsent:[]. |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1486 |
|
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1487 |
^ subProjects |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1488 |
! |
5e4e1acf7242
Fix #allPrerequisites to return prerequisites that are
Stefan Vogel <sv@exept.de>
parents:
11383
diff
changeset
|
1489 |
|
12425 | 1490 |
excludedFromPreRequisites_code |
1491 |
"generate the code of the #excludedFromPreRequisites method" |
|
1492 |
||
1493 |
^ String streamContents:[:s | |
|
13419 | 1494 |
s nextPutLine:'excludedFromPreRequisites'. |
1495 |
s nextPutLine:' "list all packages which should be ignored in the automatic'. |
|
1496 |
s nextPutLine:' preRequisites scan. See #preRequisites for more."'. |
|
1497 |
s nextPutLine:''. |
|
1498 |
s nextPutLine:' ^ #('. |
|
1499 |
s nextPutLine:' )' |
|
12425 | 1500 |
]. |
1501 |
! |
|
1502 |
||
9998 | 1503 |
extensionMethodNames_code |
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1504 |
^ self extensionMethodNames_code_ignoreOldEntries:true |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1505 |
|
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1506 |
" |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1507 |
self extensionMethodNames_code |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1508 |
" |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1509 |
|
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1510 |
"Created: / 17-08-2006 / 21:21:48 / cg" |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1511 |
"Modified: / 10-10-2006 / 22:02:42 / cg" |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1512 |
! |
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1513 |
|
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1514 |
extensionMethodNames_code_ignoreOldEntries:ignoreOldEntries |
9998 | 1515 |
^ String streamContents:[:s | |
13419 | 1516 |
|oldSpec| |
1517 |
||
1518 |
s nextPutLine:'extensionMethodNames'. |
|
1519 |
s nextPutLine:' "lists the extension methods which are to be included in the project.'. |
|
1520 |
s nextPutLine:' Entries are 2-element array literals, consisting of class-name and selector."'. |
|
1521 |
s nextPutLine:''. |
|
1522 |
s nextPutLine:' ^ #('. |
|
1523 |
||
1524 |
oldSpec := self extensionMethodNames pairWiseCollect:[:className :selector | className -> selector ]. |
|
1525 |
||
1526 |
ignoreOldEntries ifFalse:[ |
|
1527 |
oldSpec do:[:entry | |
|
1528 |
|mclassName mselector| |
|
1529 |
||
1530 |
mclassName := entry key asSymbol. |
|
1531 |
(mclassName endsWith:' class') ifTrue:[ |
|
1532 |
mclassName := mclassName asString. |
|
1533 |
]. |
|
1534 |
mselector := entry value asSymbol. |
|
1535 |
||
1536 |
s spaces:8. |
|
1537 |
mclassName storeArrayElementOn:s. |
|
1538 |
s space. |
|
1539 |
mselector storeArrayElementOn:s. |
|
1540 |
s cr. |
|
1541 |
]. |
|
1542 |
]. |
|
1543 |
||
1544 |
self searchForExtensions do:[:eachMethod | |
|
1545 |
|attributes oldSpecEntry mclassName mselector| |
|
1546 |
||
1547 |
mclassName := eachMethod mclass name. |
|
1548 |
mselector := eachMethod selector. |
|
1549 |
oldSpecEntry := oldSpec detect:[:entry | entry key = mclassName and:[ entry value = mselector]] ifNone:nil. |
|
1550 |
(ignoreOldEntries or:[ oldSpecEntry isNil]) ifTrue:[ |
|
1551 |
s spaces:8. |
|
1552 |
mclassName storeArrayElementOn:s. |
|
1553 |
s space. |
|
1554 |
mselector storeArrayElementOn:s. |
|
1555 |
s cr. |
|
1556 |
] |
|
1557 |
]. |
|
1558 |
||
1559 |
s nextPutLine:' )' |
|
9998 | 1560 |
]. |
1561 |
||
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1562 |
" |
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1563 |
self extensionMethodNames_code_ignoreOldEntries:false |
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1564 |
stx_libtool extensionMethodNames_code_ignoreOldEntries:false |
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1565 |
stx_libtool extensionMethodNames_code_ignoreOldEntries:true |
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1566 |
" |
9998 | 1567 |
|
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1568 |
"Created: / 10-10-2006 / 22:02:36 / cg" |
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
1569 |
"Modified: / 23-10-2006 / 11:07:29 / cg" |
9998 | 1570 |
! |
1571 |
||
1572 |
forEachContentsMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition |
|
13419 | 1573 |
aTwoArgBlock |
1574 |
value:(self classNamesAndAttributes_code_ignoreOldEntries:ignoreOldDefinition ignoreOldDefinition:ignoreOldDefinition) |
|
1575 |
value:'description - contents'. |
|
1576 |
||
1577 |
aTwoArgBlock |
|
1578 |
value: (self extensionMethodNames_code_ignoreOldEntries:ignoreOldDefinition) |
|
1579 |
value: 'description - contents'. |
|
1580 |
||
1581 |
aTwoArgBlock |
|
1582 |
value: self preRequisites_code |
|
1583 |
value: 'description'. |
|
1584 |
||
1585 |
aTwoArgBlock |
|
1586 |
value: self excludedFromPreRequisites_code |
|
1587 |
value: 'description'. |
|
13411 | 1588 |
|
1589 |
(self monticelloPackageName notNil and:[self respondsTo:#monticelloTimestamps_code]) ifTrue:[ |
|
13419 | 1590 |
aTwoArgBlock |
1591 |
value: self monticelloTimestamps_code |
|
1592 |
value: 'description - monticello'. |
|
13411 | 1593 |
]. |
1594 |
||
1595 |
"Modified: / 09-11-2010 / 18:41:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1596 |
! |
|
1597 |
||
9998 | 1598 |
forEachMethodsCodeToCompileDo:aTwoArgBlock |
1599 |
self forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:false |
|
1600 |
! |
|
1601 |
||
1602 |
forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition |
|
13419 | 1603 |
self |
1604 |
forEachContentsMethodsCodeToCompileDo:aTwoArgBlock |
|
1605 |
ignoreOldDefinition:ignoreOldDefinition. |
|
10013
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
1606 |
|
12305 | 1607 |
(self class includesSelector:#description) ifFalse:[ |
13419 | 1608 |
aTwoArgBlock |
1609 |
value: self description_code |
|
1610 |
value: 'description - project information'. |
|
9998 | 1611 |
]. |
12305 | 1612 |
(self class includesSelector:#productName) ifFalse:[ |
13419 | 1613 |
aTwoArgBlock |
1614 |
value: self productName_code |
|
1615 |
value: 'description - project information'. |
|
9998 | 1616 |
]. |
12305 | 1617 |
(self class includesSelector:#companyName) ifFalse:[ |
13419 | 1618 |
aTwoArgBlock |
1619 |
value: self companyName_code |
|
1620 |
value: 'description - project information'. |
|
9998 | 1621 |
]. |
12305 | 1622 |
(self class includesSelector:#legalCopyright) ifFalse:[ |
13419 | 1623 |
aTwoArgBlock |
1624 |
value: self legalCopyright_code |
|
1625 |
value: 'description - project information'. |
|
9998 | 1626 |
]. |
12305 | 1627 |
(self class includesSelector:#applicationIconFileName) ifFalse:[ |
13419 | 1628 |
aTwoArgBlock |
1629 |
value: self applicationIconFileName_code |
|
1630 |
value: 'description - project information'. |
|
11072 | 1631 |
]. |
9998 | 1632 |
|
13411 | 1633 |
(self monticelloPackageName notNil and:[self respondsTo:#monticelloTimestamps_code]) ifTrue:[ |
13419 | 1634 |
aTwoArgBlock |
1635 |
value: self monticelloTimestamps_code |
|
1636 |
value: 'description - monticello'. |
|
13411 | 1637 |
]. |
1638 |
||
9998 | 1639 |
"Created: / 18-08-2006 / 16:22:37 / cg" |
10064
fb1ad676019d
update spec vs. regenerate spec.
Claus Gittinger <cg@exept.de>
parents:
10063
diff
changeset
|
1640 |
"Modified: / 10-10-2006 / 22:02:24 / cg" |
13411 | 1641 |
"Modified: / 09-11-2010 / 18:41:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9998 | 1642 |
! |
1643 |
||
1644 |
legalCopyright_code |
|
1645 |
^ String streamContents:[:s | |
|
13419 | 1646 |
s nextPutLine:'legalCopyright'. |
1647 |
s nextPutLine:' "Return a copyright string which will appear in <lib>.rc"'. |
|
1648 |
s cr; nextPutLine:' ^ ', self legalCopyright storeString. |
|
9998 | 1649 |
]. |
1650 |
||
1651 |
" |
|
13419 | 1652 |
self legalCopyright_code |
1653 |
stx_libbasic3 legalCopyright_code |
|
9998 | 1654 |
" |
1655 |
||
1656 |
"Created: / 18-08-2006 / 16:21:01 / cg" |
|
1657 |
! |
|
1658 |
||
1659 |
preRequisites_code |
|
10574
b77b673bc36c
Better reason comments in #preRequisites packages
Stefan Vogel <sv@exept.de>
parents:
10570
diff
changeset
|
1660 |
"generate the code of the #preRequisites method" |
b77b673bc36c
Better reason comments in #preRequisites packages
Stefan Vogel <sv@exept.de>
parents:
10570
diff
changeset
|
1661 |
|
b77b673bc36c
Better reason comments in #preRequisites packages
Stefan Vogel <sv@exept.de>
parents:
10570
diff
changeset
|
1662 |
|preRequisites searchedPreRequisites importantReason| |
b77b673bc36c
Better reason comments in #preRequisites packages
Stefan Vogel <sv@exept.de>
parents:
10570
diff
changeset
|
1663 |
|
b77b673bc36c
Better reason comments in #preRequisites packages
Stefan Vogel <sv@exept.de>
parents:
10570
diff
changeset
|
1664 |
"maybe, some prerequisites have been added manually - keep them |
b77b673bc36c
Better reason comments in #preRequisites packages
Stefan Vogel <sv@exept.de>
parents:
10570
diff
changeset
|
1665 |
The drawback of this - a preRequisite will never go away, even if it is no longer used" |
9998 | 1666 |
|
1667 |
preRequisites := self preRequisites asSet. |
|
10574
b77b673bc36c
Better reason comments in #preRequisites packages
Stefan Vogel <sv@exept.de>
parents:
10570
diff
changeset
|
1668 |
|
10179 | 1669 |
searchedPreRequisites := self searchForPreRequisites. |
1670 |
preRequisites addAll: (searchedPreRequisites keys). |
|
9998 | 1671 |
|
1672 |
self isApplicationDefinition ifTrue:[ |
|
13419 | 1673 |
preRequisites add:#'stx:libcomp'. |
1674 |
self isGUIApplication ifTrue:[ |
|
1675 |
preRequisites add:#'stx:libbasic2'. |
|
1676 |
preRequisites add:#'stx:libview'. |
|
1677 |
preRequisites add:#'stx:libview2'. |
|
1678 |
preRequisites add:#'stx:libwidg'. |
|
1679 |
preRequisites add:#'stx:libwidg2'. |
|
1680 |
preRequisites add:#'stx:libui'. |
|
1681 |
]. |
|
9998 | 1682 |
]. |
1683 |
||
10897
6a20c3e54653
#removeAllFoundIn: excludedFromPrerequisites
Stefan Vogel <sv@exept.de>
parents:
10875
diff
changeset
|
1684 |
preRequisites removeAllFoundIn:self excludedFromPreRequisites. |
10034 | 1685 |
preRequisites remove:self package ifAbsent:[]. |
9998 | 1686 |
|
1687 |
^ String streamContents:[:s | |
|
13419 | 1688 |
s nextPutLine:'preRequisites'. |
1689 |
s nextPutLine:' "list all required packages.'. |
|
1690 |
s nextPutLine:' This list can be maintained manually or (better) generated and'. |
|
1691 |
s nextPutLine:' updated by scanning the superclass hierarchies and looking for'. |
|
1692 |
s nextPutLine:' global variable accesses. (the browser has a menu function for that)'. |
|
1693 |
s nextPutLine:' Howevery, often too much is found, and you may want to explicitely'. |
|
1694 |
s nextPutLine:' exclude individual packages in the #excludedFromPrerequisites method."'. |
|
1695 |
s nextPutLine:''. |
|
1696 |
s nextPutLine:' ^ #('. |
|
1697 |
preRequisites asSortedCollection do:[:eachPackageID | |
|
1698 |
|reason| |
|
1699 |
||
1700 |
s spaces:8. |
|
1701 |
eachPackageID asSymbol storeOn:s. |
|
1702 |
reason := searchedPreRequisites at:eachPackageID ifAbsent:nil. |
|
1703 |
reason notEmptyOrNil ifTrue:[ |
|
1704 |
"superclasses are really important" |
|
1705 |
importantReason := reason detect:[:eachReasonString| |
|
1706 |
eachReasonString includesString:' superclass ' |
|
1707 |
] ifNone:[reason anElement]. |
|
1708 |
s nextPutAll:' "'; nextPutAll:importantReason; nextPutAll:' "'. |
|
1709 |
]. |
|
1710 |
s cr. |
|
1711 |
]. |
|
1712 |
s nextPutLine:' )' |
|
9998 | 1713 |
]. |
1714 |
||
1715 |
" |
|
1716 |
bosch_dapasx_application preRequisites_code |
|
1717 |
demo_demoApp1 preRequisites_code |
|
10574
b77b673bc36c
Better reason comments in #preRequisites packages
Stefan Vogel <sv@exept.de>
parents:
10570
diff
changeset
|
1718 |
stx_libbasic3 preRequisites_code |
10013
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
1719 |
stx_libtool2 preRequisites_code |
9998 | 1720 |
" |
1721 |
||
1722 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
1723 |
"Created: / 17-08-2006 / 21:28:09 / cg" |
|
10063 | 1724 |
"Modified: / 09-10-2006 / 14:27:20 / cg" |
9998 | 1725 |
! |
1726 |
||
1727 |
productName_code |
|
12541 | 1728 |
^ self productName_codeFor:(self productName) |
1729 |
||
1730 |
" |
|
1731 |
self productName_code |
|
1732 |
stx_libbasic3 productName_code |
|
1733 |
" |
|
1734 |
||
1735 |
"Created: / 18-08-2006 / 16:14:19 / cg" |
|
1736 |
! |
|
1737 |
||
1738 |
productName_codeFor:aString |
|
9998 | 1739 |
^ String streamContents:[:s | |
13419 | 1740 |
s nextPutLine:'productName'. |
1741 |
s nextPutLine:' "Return a product name which will appear in <lib>.rc"'. |
|
1742 |
s cr; nextPutLine:' ^ ',aString storeString. |
|
9998 | 1743 |
]. |
1744 |
||
1745 |
" |
|
1746 |
self productName_code |
|
1747 |
stx_libbasic3 productName_code |
|
1748 |
" |
|
1749 |
||
1750 |
"Created: / 18-08-2006 / 16:14:19 / cg" |
|
12028 | 1751 |
! |
1752 |
||
1753 |
svnRevisionNr_code: revisionNrOrNil |
|
1754 |
^ String streamContents:[:s | |
|
13419 | 1755 |
s nextPutLine:'svnRevisionNr'. |
1756 |
s nextPutLine:' "Return a SVN revision number of myself.'. |
|
1757 |
s nextPutLine:' This number is updated after a commit"'. |
|
1758 |
s cr; |
|
1759 |
nextPutLine:' ^ "$SVN-Revision:"''', revisionNrOrNil printString , '''"$"'. |
|
12028 | 1760 |
]. |
1761 |
||
1762 |
" |
|
1763 |
self svnRevisionNr_code |
|
1764 |
stx_libbasic3 svnRevisionNr_code |
|
1765 |
" |
|
1766 |
||
1767 |
"Created: / 16-06-2009 / 12:12:37 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1768 |
"Modified: / 22-08-2009 / 09:05:05 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
9998 | 1769 |
! ! |
1770 |
||
9569 | 1771 |
!ProjectDefinition class methodsFor:'defaults'! |
9536 | 1772 |
|
9664 | 1773 |
applicationTypes |
9714 | 1774 |
GUIApplicationType isNil ifTrue:[self initialize]. |
1775 |
^ Array with:GUIApplicationType with:NonGUIApplicationType |
|
9664 | 1776 |
|
9714 | 1777 |
" |
13419 | 1778 |
self applicationTypes |
9714 | 1779 |
" |
9664 | 1780 |
! |
1781 |
||
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
1782 |
defaultCategory |
10466 | 1783 |
^'* Projects & Packages *' |
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
1784 |
|
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
1785 |
"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
|
1786 |
! |
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
1787 |
|
9714 | 1788 |
defaultProjectType |
9745 | 1789 |
^ self libraryTypes first |
1790 |
"/ ^ self applicationTypes first |
|
9714 | 1791 |
|
1792 |
"Created: / 23-08-2006 / 14:27:32 / cg" |
|
1793 |
! |
|
1794 |
||
1795 |
defaultProjectTypeForGUIApplication |
|
1796 |
^ GUIApplicationType |
|
1797 |
! |
|
1798 |
||
1799 |
defaultProjectTypeForNonGUIApplication |
|
1800 |
^ NonGUIApplicationType |
|
1801 |
! |
|
9664 | 1802 |
|
9714 | 1803 |
guiApplicationType |
1804 |
^ GUIApplicationType |
|
1805 |
! |
|
1806 |
||
1807 |
libraryType |
|
1808 |
^ LibraryType |
|
1809 |
! |
|
1810 |
||
13419 | 1811 |
libraryTypes |
9714 | 1812 |
LibraryType isNil ifTrue:[self initialize]. |
1813 |
^ Array with:LibraryType |
|
1814 |
||
1815 |
" |
|
13419 | 1816 |
self libraryTypes |
9714 | 1817 |
" |
1818 |
! |
|
1819 |
||
1820 |
nonGuiApplicationType |
|
1821 |
^ NonGUIApplicationType |
|
9664 | 1822 |
! |
1823 |
||
12331 | 1824 |
projectTypeSelectors |
1825 |
"a list of possible project type selectors" |
|
1826 |
||
1827 |
^ #( libraryType guiApplicationType nonGuiApplicationType ) |
|
1828 |
||
1829 |
" |
|
1830 |
self libraryType |
|
1831 |
self guiApplicationType |
|
1832 |
self nonGuiApplicationType |
|
1833 |
" |
|
1834 |
||
1835 |
"Created: / 23-08-2006 / 14:27:32 / cg" |
|
1836 |
! |
|
1837 |
||
9664 | 1838 |
projectTypes |
12331 | 1839 |
"a list of possible project types" |
1840 |
||
9664 | 1841 |
^ self libraryTypes , self applicationTypes |
1842 |
||
12331 | 1843 |
" |
1844 |
self projectTypes |
|
1845 |
" |
|
1846 |
||
9664 | 1847 |
"Created: / 23-08-2006 / 14:27:32 / cg" |
9536 | 1848 |
! ! |
1849 |
||
9569 | 1850 |
!ProjectDefinition class methodsFor:'description'! |
9536 | 1851 |
|
13419 | 1852 |
excludedFromPreRequisites |
9983 | 1853 |
"list packages which are to be explicitely excluded from the automatic constructed |
1854 |
prerequisites list. If empty, everything that is found along the inheritance of any of |
|
1855 |
my classes is considered to be a prerequisite package." |
|
1856 |
||
1857 |
^ #() |
|
1858 |
||
1859 |
"Modified: / 17-08-2006 / 19:48:59 / cg" |
|
1860 |
! |
|
1861 |
||
10380
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
1862 |
excludedFromSubProjects |
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
1863 |
"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
|
1864 |
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
|
1865 |
|
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
1866 |
^ #() |
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
1867 |
|
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
1868 |
"Modified: / 17-08-2006 / 19:49:40 / cg" |
10039 | 1869 |
! |
1870 |
||
9575 | 1871 |
preRequisites |
1872 |
"list packages which are required as a prerequisite. This method is generated automatically, |
|
1873 |
by searching along the inheritance chain of all of my classes. |
|
1874 |
However, when generating automatically, packages are only added - never removed, unless listed |
|
1875 |
in excludedFromPreRequisites." |
|
1876 |
||
1877 |
^ #() |
|
1878 |
||
1879 |
"Modified: / 17-08-2006 / 19:54:21 / cg" |
|
1880 |
! |
|
1881 |
||
13411 | 1882 |
preRequisitesFor: packageId |
1883 |
||
1884 |
| def | |
|
1885 |
||
1886 |
def := self definitionClassForPackage:packageId. |
|
1887 |
def ifNil: |
|
13419 | 1888 |
["Maybe the package is not loaded? Try to load it..." |
1889 |
(Smalltalk loadPackage: packageId) ifTrue: |
|
1890 |
[def := self definitionClassForPackage:packageId]]. |
|
1891 |
^def |
|
1892 |
ifNil: |
|
1893 |
["Still no project definition - maybe does not exists?" |
|
1894 |
(ProjectDefinition searchForPreRequisites: packageId) keys] |
|
1895 |
ifNotNil: |
|
1896 |
[def effectivePreRequisites] |
|
13411 | 1897 |
|
1898 |
"Created: / 24-02-2011 / 22:47:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1899 |
! |
|
1900 |
||
12186 | 1901 |
preRequisitesForBuilding |
1902 |
"for now, there is only one list of prerequisites present; |
|
1903 |
will be changed in the (near?) future" |
|
1904 |
||
1905 |
^ self preRequisites |
|
1906 |
! |
|
1907 |
||
1908 |
preRequisitesForLoading |
|
1909 |
"for now, there is only one list of prerequisites present; |
|
1910 |
will be changed in the (near?) future" |
|
1911 |
||
1912 |
^ self preRequisites |
|
1913 |
! |
|
1914 |
||
9685 | 1915 |
siblingsAreSubProjects |
1916 |
^ false |
|
1917 |
! |
|
1918 |
||
11377 | 1919 |
splashFileName |
1920 |
"answer the base-name of the splash bitmap. |
|
1921 |
||
1922 |
Default is nil, for no splash. If non-nil, it must be a bmp file's name" |
|
1923 |
||
1924 |
^ nil. |
|
1925 |
! |
|
1926 |
||
9575 | 1927 |
subProjects |
12748 | 1928 |
<resource: #obsolete> |
1929 |
||
1930 |
"OBSOLETE. |
|
1931 |
list packages which are known as subprojects. This method is generated automatically. |
|
9575 | 1932 |
However, when generating automatically, packages are only added - never removed, unless listed |
1933 |
in excludedFromSubProjects." |
|
1934 |
||
1935 |
^ #() |
|
1936 |
||
1937 |
"Modified: / 17-08-2006 / 19:57:46 / cg" |
|
1938 |
! ! |
|
1939 |
||
12372 | 1940 |
!ProjectDefinition class methodsFor:'description - actions'! |
1941 |
||
1942 |
postLoadAction |
|
1943 |
"invoked after loading a project" |
|
1944 |
||
1945 |
"/ intentionally left blank, to be redefined by subclasses (i.e. real projects) |
|
1946 |
||
1947 |
"Modified: / 17-08-2006 / 19:59:17 / cg" |
|
1948 |
! |
|
1949 |
||
1950 |
preLoadAction |
|
1951 |
"invoked before loading a project" |
|
1952 |
||
1953 |
"/ intentionally left blank, to be redefined by subclasses (i.e. real projects) |
|
1954 |
! |
|
1955 |
||
1956 |
preUnloadAction |
|
1957 |
"invoked before unloading a project" |
|
1958 |
||
1959 |
"/ intentionally left blank, to be redefined by subclasses (i.e. real projects) |
|
1960 |
||
1961 |
"Modified: / 17-08-2006 / 19:59:26 / cg" |
|
1962 |
! ! |
|
1963 |
||
9575 | 1964 |
!ProjectDefinition class methodsFor:'description - classes'! |
1965 |
||
9621 | 1966 |
additionalClassNamesAndAttributes |
1967 |
^ #() |
|
1968 |
||
1969 |
"Created: / 21-08-2006 / 19:53:04 / cg" |
|
1970 |
! |
|
1971 |
||
9607 | 1972 |
classNamesAndAttributes |
12368 | 1973 |
"a correponding method with real names must be present in my concrete subclasses" |
9575 | 1974 |
|
12202 | 1975 |
"/ should this be a subclassResponsibility here ? |
9595 | 1976 |
^ #() |
9536 | 1977 |
|
9575 | 1978 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
1979 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
1980 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
|
1981 |
! |
|
1982 |
||
1983 |
extensionMethodNames |
|
1984 |
"list class/selector pairs of extensions. |
|
12368 | 1985 |
A correponding method with real names must be present in my concrete subclasses" |
1986 |
||
1987 |
"/ should this be a subclassResponsibility here ? |
|
9595 | 1988 |
^ #() |
9575 | 1989 |
|
1990 |
"Modified: / 17-08-2006 / 20:49:51 / cg" |
|
10350
f70405894961
added optional ignoredClassNames method.
Claus Gittinger <cg@exept.de>
parents:
10331
diff
changeset
|
1991 |
! |
f70405894961
added optional ignoredClassNames method.
Claus Gittinger <cg@exept.de>
parents:
10331
diff
changeset
|
1992 |
|
f70405894961
added optional ignoredClassNames method.
Claus Gittinger <cg@exept.de>
parents:
10331
diff
changeset
|
1993 |
ignoredClassNames |
f70405894961
added optional ignoredClassNames method.
Claus Gittinger <cg@exept.de>
parents:
10331
diff
changeset
|
1994 |
"can be redefined to suppress some classes from being included in a |
f70405894961
added optional ignoredClassNames method.
Claus Gittinger <cg@exept.de>
parents:
10331
diff
changeset
|
1995 |
generated classNamesAndAttributes spec" |
f70405894961
added optional ignoredClassNames method.
Claus Gittinger <cg@exept.de>
parents:
10331
diff
changeset
|
1996 |
|
f70405894961
added optional ignoredClassNames method.
Claus Gittinger <cg@exept.de>
parents:
10331
diff
changeset
|
1997 |
^ #() |
f70405894961
added optional ignoredClassNames method.
Claus Gittinger <cg@exept.de>
parents:
10331
diff
changeset
|
1998 |
|
f70405894961
added optional ignoredClassNames method.
Claus Gittinger <cg@exept.de>
parents:
10331
diff
changeset
|
1999 |
"Created: / 23-01-2007 / 19:08:27 / cg" |
9575 | 2000 |
! ! |
2001 |
||
2002 |
!ProjectDefinition class methodsFor:'description - compilation'! |
|
9536 | 2003 |
|
11940
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2004 |
additionalBaseAddressDefinition_bc_dot_mak |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2005 |
"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
|
2006 |
Subclasses may redefine this to something like |
13419 | 2007 |
LIB_BASE=$(LIBWIDG_BASE) |
11940
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2008 |
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
|
2009 |
" |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2010 |
|
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2011 |
^ nil |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2012 |
! |
cb9e5867b474
base address definition moved into a separate spec
Claus Gittinger <cg@exept.de>
parents:
11937
diff
changeset
|
2013 |
|
11829
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2014 |
additionalDefinitions |
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2015 |
"allows for additional definitions/rules to be added to the make.proto and bc.mak file." |
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2016 |
|
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2017 |
^ '' |
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2018 |
! |
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2019 |
|
10306 | 2020 |
additionalDefinitions_bc_dot_mak |
2021 |
"allows for additional definitions/rules to be added to the bc.mak file. |
|
10974 | 2022 |
Subclasses may redefine this." |
10306 | 2023 |
|
2024 |
^ self additionalDefinitions_nt_dot_mak |
|
2025 |
||
2026 |
"Created: / 22-08-2006 / 23:59:32 / cg" |
|
2027 |
! |
|
2028 |
||
9625 | 2029 |
additionalDefinitions_make_dot_proto |
2030 |
"allows for additional definitions/rules to be added to the make.proto file." |
|
2031 |
||
11829
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2032 |
^ self additionalDefinitions |
9625 | 2033 |
|
2034 |
"Created: / 22-08-2006 / 23:53:08 / cg" |
|
2035 |
! |
|
2036 |
||
2037 |
additionalDefinitions_nt_dot_mak |
|
10306 | 2038 |
"obsolete - kept for compatibility with old project files" |
9625 | 2039 |
|
11829
2d880f341cfc
#additionalDefinitions for both bc_dot_mak and make_dot_proto
Stefan Vogel <sv@exept.de>
parents:
11789
diff
changeset
|
2040 |
^ self additionalDefinitions |
9625 | 2041 |
|
2042 |
"Created: / 22-08-2006 / 23:59:32 / cg" |
|
2043 |
! |
|
2044 |
||
10306 | 2045 |
additionalLinkLibraries_bc_dot_mak |
2046 |
"allows for additional static libraries to be added to the bc.mak file. |
|
2047 |
Subclasses may redefine this" |
|
2048 |
||
2049 |
"backward compatibilty with old projects" |
|
2050 |
||
2051 |
^ self additionalLinkLibraries_nt_dot_mak |
|
2052 |
||
2053 |
||
2054 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
|
2055 |
! |
|
2056 |
||
9733 | 2057 |
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
|
2058 |
"allows for additional static libraries to be added to the make.proto file." |
9733 | 2059 |
|
2060 |
^ '' |
|
2061 |
||
2062 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
|
2063 |
! |
|
2064 |
||
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2065 |
additionalLinkLibraries_nt_dot_mak |
10306 | 2066 |
"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
|
2067 |
|
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2068 |
^ '' |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2069 |
|
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2070 |
"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
|
2071 |
! |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
2072 |
|
12028 | 2073 |
additionalRulesSvn_make_dot_proto |
2074 |
||
2075 |
(self class includesSelector: #svnRevisionNr) ifFalse:[^'']. |
|
2076 |
||
2077 |
^ String streamContents: |
|
13419 | 2078 |
[:s|s |
2079 |
nextPutLine:'update-svn-revision:'; |
|
2080 |
tab; nextPutLine: 'if [ !! -r .svnversion -o "$(shell svnversion -n)" !!= "$(shell cat .svnversion)" ]; then \'; |
|
2081 |
tab; tab; nextPutLine: 'svnversion -n > .svnversion; \'; |
|
2082 |
tab; tab; nextPutLine: 'sed -i -e "s/\"\$$SVN\-Revision:\".*\"\$$\"/\"\$$SVN-Revision:\"''$(shell svnversion -n)''\"\$$\"/g" \'; |
|
2083 |
tab; tab; tab; nextPutLine: (self name , '.st; \'); |
|
2084 |
tab; nextPutLine: 'fi'; |
|
2085 |
nextPutLine: '.PHONY: update-svn-revision'] |
|
12028 | 2086 |
|
2087 |
"Created: / 24-06-2009 / 21:33:32 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
13411 | 2088 |
"Modified: / 07-05-2011 / 13:49:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12028 | 2089 |
! |
2090 |
||
10306 | 2091 |
additionalRules_bc_dot_mak |
10312
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2092 |
"obsolete - kept for compatibility with old project files" |
13419 | 2093 |
|
10312
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2094 |
^ '' |
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2095 |
|
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2096 |
"Created: / 22-08-2006 / 23:59:24 / cg" |
10306 | 2097 |
! |
2098 |
||
9625 | 2099 |
additionalRules_make_dot_proto |
2100 |
"allows for additional rules to be added to the make.proto file." |
|
2101 |
||
2102 |
^ '' |
|
2103 |
||
2104 |
"Created: / 22-08-2006 / 23:59:16 / cg" |
|
2105 |
! |
|
2106 |
||
9972
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2107 |
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
|
2108 |
"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
|
2109 |
|
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2110 |
^ '' |
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2111 |
! |
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
2112 |
|
12028 | 2113 |
additionalTargetsSvn_make_dot_proto |
2114 |
||
2115 |
(self class includesSelector: #svnRevisionNr) ifFalse:[^'']. |
|
2116 |
||
2117 |
^ 'update-svn-revision' |
|
2118 |
||
2119 |
"Created: / 24-06-2009 / 21:35:15 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
2120 |
! |
|
2121 |
||
10306 | 2122 |
additionalTargets_bc_dot_mak |
10312
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2123 |
"obsolete - kept for compatibility with old project files" |
13419 | 2124 |
|
10312
7f71d47b09bd
#additionalTargets_bc_dot_mak for applications
Stefan Vogel <sv@exept.de>
parents:
10306
diff
changeset
|
2125 |
^ '' |
10306 | 2126 |
|
2127 |
"Created: / 23-08-2006 / 00:00:35 / cg" |
|
2128 |
! |
|
2129 |
||
9625 | 2130 |
additionalTargets_make_dot_proto |
2131 |
"allows for additional targets to be added to the make.proto file." |
|
2132 |
||
2133 |
^ '' |
|
2134 |
||
2135 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
|
2136 |
! |
|
2137 |
||
10979 | 2138 |
globalDefines |
2139 |
"allow for the specification of additional defines for stc compilation of prerequisite packages |
|
2140 |
an subprojects" |
|
2141 |
||
2142 |
^ '' |
|
2143 |
! |
|
2144 |
||
2145 |
globalDefines_unix |
|
2146 |
"allow for the specification of additional defines for stc compilation of prerequisite packages |
|
2147 |
an subprojects" |
|
2148 |
||
2149 |
^ self globalDefines |
|
2150 |
! |
|
2151 |
||
2152 |
globalDefines_win32 |
|
2153 |
"allow for the specification of additional defines for stc compilation of prerequisite packages |
|
2154 |
an subprojects" |
|
2155 |
||
2156 |
^ self globalDefines |
|
2157 |
! |
|
2158 |
||
10331 | 2159 |
localDefines |
10979 | 2160 |
"allow for the specification of additional defines for stc compilation" |
10331 | 2161 |
|
2162 |
^ '' |
|
2163 |
! |
|
2164 |
||
2165 |
localDefines_unix |
|
10979 | 2166 |
"allow for the specification of additional defines for stc compilation" |
10331 | 2167 |
|
2168 |
^ self localDefines |
|
2169 |
! |
|
2170 |
||
2171 |
localDefines_win32 |
|
10979 | 2172 |
"allow for the specification of additional defines for stc compilation" |
10331 | 2173 |
|
2174 |
^ self localDefines |
|
2175 |
! |
|
2176 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2177 |
localIncludes |
10979 | 2178 |
"allow for the specification of additional include directories" |
9714 | 2179 |
|
2180 |
^ '' |
|
2181 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2182 |
"Created: / 06-09-2006 / 18:14:31 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2183 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2184 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2185 |
localIncludes_unix |
10979 | 2186 |
"allow for the specification of additional include directories" |
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2187 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2188 |
^ self makeUnixIncludes:(self localIncludes) |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2189 |
|
9714 | 2190 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2191 |
"Modified: / 06-09-2006 / 18:15:26 / cg" |
9714 | 2192 |
! |
2193 |
||
2194 |
localIncludes_win32 |
|
10979 | 2195 |
"allow for the specification of additional include directories" |
9714 | 2196 |
|
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2197 |
^ self makeWin32Includes:(self localIncludes) |
9714 | 2198 |
|
2199 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
|
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2200 |
"Modified: / 06-09-2006 / 18:15:37 / cg" |
9714 | 2201 |
! |
2202 |
||
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
|
2203 |
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
|
2204 |
"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
|
2205 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2206 |
^ '' |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2207 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2208 |
"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
|
2209 |
! |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2210 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2211 |
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
|
2212 |
"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
|
2213 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2214 |
^ 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
|
2215 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2216 |
"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
|
2217 |
! |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2218 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2219 |
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
|
2220 |
"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
|
2221 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2222 |
^ 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
|
2223 |
|
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2224 |
"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
|
2225 |
! |
8b244e994b96
Allow to define primary make target (needed, if sub.makes have to be performed -
Stefan Vogel <sv@exept.de>
parents:
11562
diff
changeset
|
2226 |
|
9575 | 2227 |
stcOptimizationOptions |
2228 |
"see the stc reference / stc usage for options. |
|
2229 |
For now, the following variants are useful: |
|
13419 | 2230 |
+optspace3 most compact code |
2231 |
- use for all gui, application code. |
|
2232 |
||
2233 |
+optinline +optinline2 +inlineNew |
|
2234 |
fastest code |
|
2235 |
- use only for computation-intensive classes" |
|
9575 | 2236 |
|
2237 |
^ '+optspace3' |
|
2238 |
||
2239 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
|
9536 | 2240 |
! |
2241 |
||
9575 | 2242 |
stcWarningOptions |
2243 |
"see the stc reference / stc usage for options. |
|
2244 |
For now, the following variants are useful: |
|
13419 | 2245 |
-warn no warnings |
2246 |
-warnNonStandard no warnings about non-standard smalltalk features" |
|
9575 | 2247 |
|
9714 | 2248 |
^ '-warnNonStandard' |
9575 | 2249 |
|
2250 |
"Created: / 18-08-2006 / 12:51:38 / cg" |
|
2251 |
! ! |
|
9536 | 2252 |
|
9575 | 2253 |
!ProjectDefinition class methodsFor:'description - project information'! |
2254 |
||
11611
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2255 |
applicationAdditionalIconFileNames |
13419 | 2256 |
"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
|
2257 |
(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
|
2258 |
|
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2259 |
^ #() |
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2260 |
! |
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
2261 |
|
11039
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
2262 |
applicationIconFileName |
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
2263 |
"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
|
2264 |
|
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
2265 |
^ nil |
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
2266 |
! |
1f977c01e7df
Fix usage of #iconFilename vs. #applicationIconFilename
Stefan Vogel <sv@exept.de>
parents:
11035
diff
changeset
|
2267 |
|
9575 | 2268 |
companyName |
9584 | 2269 |
"Returns a company string which will appear in <lib>.rc. |
2270 |
Under win32, this is placed into the dlls file-info" |
|
9575 | 2271 |
|
13419 | 2272 |
( |
11172 | 2273 |
#( |
13419 | 2274 |
'stx' |
2275 |
'exept' |
|
11172 | 2276 |
) includes:self module) ifTrue:[ |
13419 | 2277 |
^ 'eXept Software AG' |
9575 | 2278 |
]. |
2279 |
||
2280 |
^ 'My Company' |
|
2281 |
||
9584 | 2282 |
"Modified: / 18-08-2006 / 16:08:20 / cg" |
9536 | 2283 |
! |
2284 |
||
2285 |
description |
|
10306 | 2286 |
"Returns a description string which will appear in vc.def / bc.def" |
9536 | 2287 |
|
9803 | 2288 |
^self productName,' ',self packageName |
2289 |
"/ ^ self name |
|
9536 | 2290 |
|
2291 |
"Created: / 08-08-2006 / 11:15:01 / fm" |
|
9575 | 2292 |
"Modified: / 17-08-2006 / 20:53:34 / cg" |
2293 |
! |
|
2294 |
||
2295 |
fileDescription |
|
10416 | 2296 |
"Returns a description string which will appear in libName.rc and the rc-file" |
9575 | 2297 |
|
9803 | 2298 |
^self description |
9575 | 2299 |
|
2300 |
"Modified: / 17-08-2006 / 20:27:07 / cg" |
|
2301 |
! |
|
2302 |
||
2303 |
fileMajorVersionNr |
|
2304 |
"Returns a versionNumber which will appear in libName.rc" |
|
2305 |
||
11100
c9ec12ef4b3b
Set default for fileMajorVersionNumber and fileMajorVersionNumber
Stefan Vogel <sv@exept.de>
parents:
11074
diff
changeset
|
2306 |
^ self majorVersionNr |
9575 | 2307 |
|
2308 |
"Created: / 18-08-2006 / 12:03:32 / cg" |
|
9817 | 2309 |
"Modified: / 30-08-2006 / 18:50:51 / cg" |
9575 | 2310 |
! |
2311 |
||
2312 |
fileMinorVersionNr |
|
2313 |
"Returns a versionNumber which will appear in libName.rc" |
|
2314 |
||
11100
c9ec12ef4b3b
Set default for fileMajorVersionNumber and fileMajorVersionNumber
Stefan Vogel <sv@exept.de>
parents:
11074
diff
changeset
|
2315 |
^ self minorVersionNr |
9575 | 2316 |
|
2317 |
"Created: / 18-08-2006 / 12:03:13 / cg" |
|
9817 | 2318 |
"Modified: / 30-08-2006 / 18:50:46 / cg" |
9575 | 2319 |
! |
2320 |
||
2321 |
fileReleaseNr |
|
2322 |
"Returns a releaseNumber which will appear in libName.rc" |
|
2323 |
||
11035
ff88ec6339a3
Generate valid project.rc files even if the CVS revision string ends with
Stefan Vogel <sv@exept.de>
parents:
10979
diff
changeset
|
2324 |
"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
|
2325 |
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
|
2326 |
|
ff88ec6339a3
Generate valid project.rc files even if the CVS revision string ends with
Stefan Vogel <sv@exept.de>
parents:
10979
diff
changeset
|
2327 |
^ self cvsRevision last upTo:$m |
9575 | 2328 |
|
2329 |
"Created: / 18-08-2006 / 12:02:58 / cg" |
|
9817 | 2330 |
"Modified: / 30-08-2006 / 18:54:48 / cg" |
9536 | 2331 |
! |
2332 |
||
9575 | 2333 |
fileRevisionNr |
2334 |
"Returns a revisionNumber which will appear in libName.rc" |
|
9536 | 2335 |
|
9817 | 2336 |
"take the default revision from the cvs-version" |
9618 | 2337 |
^ self cvsRevision first |
9575 | 2338 |
|
2339 |
"Created: / 18-08-2006 / 12:02:39 / cg" |
|
9817 | 2340 |
"Modified: / 30-08-2006 / 18:54:39 / cg" |
9536 | 2341 |
! |
2342 |
||
9575 | 2343 |
fileVersion |
2344 |
"Returns a fileVersion string which will appear in libName.rc" |
|
2345 |
||
2346 |
"<major>.<minor>.<rev>.<rel> (such as '1.2.17.1') " |
|
2347 |
||
13419 | 2348 |
^ '%1.%2.%3.%4' |
2349 |
bindWith:self fileMajorVersionNr |
|
2350 |
with:self fileMinorVersionNr |
|
2351 |
with:self fileRevisionNr |
|
2352 |
with:self fileReleaseNr. |
|
9575 | 2353 |
|
2354 |
" |
|
2355 |
self fileVersion |
|
2356 |
" |
|
2357 |
||
9817 | 2358 |
"Modified: / 30-08-2006 / 18:51:49 / cg" |
9575 | 2359 |
! |
9536 | 2360 |
|
9575 | 2361 |
fileVersionCommaSeparated |
2362 |
"Returns a fileVersion string which will appear in libName.rc" |
|
2363 |
||
9817 | 2364 |
"<major>,<minor>,<revision>,<release> (such as '2,17,1,2') " |
2365 |
||
13419 | 2366 |
^ '%1,%2,%3,%4' |
2367 |
bindWith:self fileMajorVersionNr |
|
2368 |
with:self fileMinorVersionNr |
|
2369 |
with:self fileRevisionNr |
|
2370 |
with:self fileReleaseNr. |
|
9575 | 2371 |
|
2372 |
"Created: / 17-08-2006 / 20:16:17 / cg" |
|
9817 | 2373 |
"Modified: / 30-08-2006 / 18:54:20 / cg" |
2374 |
! |
|
2375 |
||
9575 | 2376 |
internalName |
2377 |
"Returns a name string which will appear in libName.rc" |
|
2378 |
||
11041
3bb26d86e616
Fix #description and #internalName
Stefan Vogel <sv@exept.de>
parents:
11039
diff
changeset
|
2379 |
^ self package |
9575 | 2380 |
|
2381 |
"Modified: / 17-08-2006 / 20:27:37 / cg" |
|
9536 | 2382 |
! |
2383 |
||
9575 | 2384 |
legalCopyright |
9584 | 2385 |
"Returns a copyright string which will appear in <lib>.rc. |
2386 |
Under win32, this is placed into the dlls file-info" |
|
9575 | 2387 |
|
2388 |
self module = 'stx' ifTrue:[ |
|
13419 | 2389 |
"hardwired-default" |
2390 |
^ 'Copyright Claus Gittinger 1988-%1\nCopyright eXept Software AG 1998-%1' |
|
2391 |
bindWith:(Date today year printString) |
|
9575 | 2392 |
]. |
9817 | 2393 |
self module = 'exept' ifTrue:[ |
13419 | 2394 |
"hardwired-default" |
2395 |
^ 'Copyright eXept Software AG 1998-%1' |
|
2396 |
bindWith:(Date today year printString) |
|
9817 | 2397 |
]. |
9575 | 2398 |
|
2399 |
^ 'My CopyRight or CopyLeft' |
|
2400 |
||
9817 | 2401 |
"Modified: / 30-08-2006 / 18:53:36 / cg" |
9575 | 2402 |
! |
2403 |
||
2404 |
majorVersionNr |
|
2405 |
"Returns a versionNumber which will appear in libName.rc" |
|
2406 |
||
2407 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
|
2408 |
the default here takes smalltalks version number. |
|
2409 |
But thats probably not good for an end-user-app." |
|
2410 |
||
11042 | 2411 |
^ Smalltalk majorVersionNr |
9575 | 2412 |
|
2413 |
"Created: / 17-08-2006 / 20:20:18 / cg" |
|
9817 | 2414 |
"Modified: / 30-08-2006 / 18:52:13 / cg" |
9575 | 2415 |
! |
2416 |
||
2417 |
minorVersionNr |
|
2418 |
"Returns a versionNumber which will appear in libName.rc" |
|
9536 | 2419 |
|
9575 | 2420 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
2421 |
the default here takes smalltalks version number. |
|
2422 |
But thats probably not good for an end-user-app." |
|
2423 |
||
11042 | 2424 |
^ Smalltalk minorVersionNr |
9575 | 2425 |
|
2426 |
"Created: / 17-08-2006 / 20:20:32 / cg" |
|
9817 | 2427 |
"Modified: / 30-08-2006 / 18:52:16 / cg" |
9575 | 2428 |
! |
2429 |
||
2430 |
productDate |
|
11043 | 2431 |
"Returns a product-date string which will appear in libName.rc and the installer file" |
9575 | 2432 |
|
2433 |
"take the current date - by default" |
|
9536 | 2434 |
|
9575 | 2435 |
^ Timestamp now printStringRFC1123Format |
2436 |
||
2437 |
"Created: / 17-08-2006 / 20:17:28 / cg" |
|
2438 |
! |
|
2439 |
||
13177 | 2440 |
productDescription |
2441 |
"Returns a description (for autopackage)" |
|
2442 |
||
2443 |
^ self description |
|
2444 |
||
2445 |
"Created: / 21-12-2010 / 09:32:16 / cg" |
|
2446 |
! |
|
2447 |
||
10426 | 2448 |
productFilename |
2449 |
"Returns a filename which be used as linkname, product file name etc." |
|
2450 |
||
2451 |
^ self productNameAsValidFilename |
|
2452 |
||
2453 |
" |
|
13419 | 2454 |
stx_projects_smalltalk productName |
10426 | 2455 |
stx_projects_smalltalk productFilename |
2456 |
" |
|
2457 |
||
2458 |
"Created: / 01-03-2007 / 19:33:06 / cg" |
|
2459 |
! |
|
2460 |
||
9898 | 2461 |
productInstallDir |
2462 |
"Returns a product default installDir which will appear in <app>.nsi." |
|
2463 |
||
2464 |
^ '$PROGRAMFILES\',self module |
|
2465 |
||
2466 |
"Created: / 14-09-2006 / 21:23:01 / cg" |
|
2467 |
! |
|
2468 |
||
13177 | 2469 |
productLicense |
2470 |
"Returns the license (for autopackage)" |
|
2471 |
||
2472 |
^ 'Commercial' |
|
2473 |
||
2474 |
"Created: / 21-12-2010 / 09:31:25 / cg" |
|
2475 |
! |
|
2476 |
||
2477 |
productMaintainer |
|
2478 |
"Returns the maintainer (for autopackage)" |
|
2479 |
||
2480 |
^ self companyName |
|
2481 |
||
2482 |
"Created: / 21-12-2010 / 09:26:16 / cg" |
|
2483 |
! |
|
2484 |
||
9575 | 2485 |
productName |
9584 | 2486 |
"Returns a product name which will appear in <lib>.rc. |
2487 |
Under win32, this is placed into the dlls file-info" |
|
9575 | 2488 |
|
10785
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
2489 |
|m| |
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
2490 |
|
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
2491 |
m := self module. |
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
2492 |
m = 'stx' ifTrue:[ |
13419 | 2493 |
^ 'Smalltalk/X' |
9575 | 2494 |
]. |
10785
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
2495 |
m = 'exept' ifTrue:[ |
13419 | 2496 |
^ 'eXept addOns' |
10785
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
2497 |
]. |
10296 | 2498 |
Error handle:[:ex | |
13419 | 2499 |
^ 'ProductName' |
10296 | 2500 |
] do:[ |
13419 | 2501 |
^ self startupClassName |
10296 | 2502 |
]. |
2503 |
||
10785
da5023cdf55b
no need for productName string (already inherited)
Claus Gittinger <cg@exept.de>
parents:
10774
diff
changeset
|
2504 |
"Modified: / 08-11-2007 / 16:45:14 / cg" |
9536 | 2505 |
! |
2506 |
||
10426 | 2507 |
productNameAsValidFilename |
2508 |
"Returns a product name which will appear in <lib>.rc. |
|
2509 |
Under win32, this is placed into the dlls file-info" |
|
2510 |
||
2511 |
|nm| |
|
2512 |
||
2513 |
nm := self productName. |
|
2514 |
^ nm copy replaceAny:'/\:;.,' with:$_ |
|
2515 |
||
2516 |
" |
|
2517 |
'Smalltalk/X' replaceAny:'/\:;.,' with:nil |
|
2518 |
" |
|
2519 |
||
2520 |
"Created: / 01-03-2007 / 19:19:21 / cg" |
|
2521 |
! |
|
2522 |
||
9898 | 2523 |
productPublisher |
2524 |
"Returns a product publisher which will appear in <app>.nsi." |
|
2525 |
||
2526 |
( #('exept' 'stx') includes:self module) ifTrue:[ |
|
13419 | 2527 |
^ 'eXept Software AG' |
9898 | 2528 |
]. |
2529 |
||
11789
8d56dc5fa8a8
Default productPublisher is companyName
Stefan Vogel <sv@exept.de>
parents:
11777
diff
changeset
|
2530 |
^ self companyName |
9898 | 2531 |
|
2532 |
"Created: / 14-09-2006 / 21:12:54 / cg" |
|
2533 |
! |
|
2534 |
||
13177 | 2535 |
productType |
2536 |
"Returns the product type for autopackage" |
|
2537 |
||
2538 |
^ 'Application' |
|
2539 |
||
2540 |
"Created: / 21-12-2010 / 09:28:48 / cg" |
|
2541 |
! |
|
2542 |
||
9575 | 2543 |
productVersion |
11043 | 2544 |
"Returns a product version which will appear in libName.rc and the installer file" |
9575 | 2545 |
|
2546 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1')" |
|
9536 | 2547 |
|
13419 | 2548 |
^ '%1.%2.%3.%4' |
2549 |
bindWith:self majorVersionNr |
|
2550 |
with:self minorVersionNr |
|
2551 |
with:self revisionNr |
|
2552 |
with:self releaseNr. |
|
9536 | 2553 |
|
9575 | 2554 |
" |
2555 |
self productVersion |
|
2556 |
" |
|
2557 |
||
9817 | 2558 |
"Modified: / 30-08-2006 / 18:52:47 / cg" |
9536 | 2559 |
! |
2560 |
||
9575 | 2561 |
productVersionCommaSeparated |
2562 |
"Returns a product version which will appear in libName.rc" |
|
2563 |
||
2564 |
"<major>.<minor>.<revision>.<release> (such as '0,1,1,1') " |
|
9536 | 2565 |
|
13419 | 2566 |
^ '%1,%2,%3,%4' |
2567 |
bindWith:self majorVersionNr |
|
2568 |
with:self minorVersionNr |
|
2569 |
with:self revisionNr |
|
2570 |
with:self releaseNr. |
|
11042 | 2571 |
|
2572 |
" |
|
2573 |
self productVersionCommaSeparated |
|
2574 |
" |
|
9536 | 2575 |
|
9575 | 2576 |
"Created: / 17-08-2006 / 20:13:32 / cg" |
9817 | 2577 |
"Modified: / 30-08-2006 / 18:52:42 / cg" |
9536 | 2578 |
! |
2579 |
||
9898 | 2580 |
productWebSite |
2581 |
"Returns a product webSite which will appear in <app>.nsi." |
|
2582 |
||
2583 |
( #('exept' 'stx') includes:self module) ifTrue:[ |
|
13419 | 2584 |
^ 'http://www.exept.de' |
9898 | 2585 |
]. |
2586 |
||
10426 | 2587 |
"/ should be redefined by concrete ApplicationDefinition |
9898 | 2588 |
^ 'http://www.yoursite.com' |
2589 |
||
2590 |
"Created: / 14-09-2006 / 21:15:05 / cg" |
|
10426 | 2591 |
"Modified: / 01-03-2007 / 18:11:27 / cg" |
9898 | 2592 |
! |
2593 |
||
9575 | 2594 |
releaseNr |
2595 |
"Returns a releaseNr which will appear in libName.rc" |
|
2596 |
||
2597 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
|
2598 |
the default here takes smalltalks version number. |
|
2599 |
But thats probably not good for an end-user-app." |
|
2600 |
||
11042 | 2601 |
^ Smalltalk releaseNr |
9536 | 2602 |
|
9575 | 2603 |
"Created: / 17-08-2006 / 20:20:51 / cg" |
9817 | 2604 |
"Modified: / 30-08-2006 / 18:52:22 / cg" |
9575 | 2605 |
! |
2606 |
||
2607 |
revisionNr |
|
2608 |
"Returns a revisionNr which will appear in libName.rc" |
|
9536 | 2609 |
|
9575 | 2610 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
2611 |
the default here takes smalltalks version number. |
|
2612 |
But thats probably not good for an end-user-app." |
|
2613 |
||
11042 | 2614 |
^ Smalltalk revisionNr |
9575 | 2615 |
|
2616 |
"Created: / 17-08-2006 / 20:20:40 / cg" |
|
9817 | 2617 |
"Modified: / 30-08-2006 / 18:52:32 / cg" |
9536 | 2618 |
! |
2619 |
||
2620 |
versionNumber |
|
10306 | 2621 |
"Returns a version string which will appear in bc.def / vc.def " |
9536 | 2622 |
|
9575 | 2623 |
^'' |
9536 | 2624 |
|
2625 |
"Created: / 08-08-2006 / 11:35:52 / fm" |
|
9575 | 2626 |
"Modified: / 17-08-2006 / 19:46:29 / cg" |
9536 | 2627 |
! ! |
2628 |
||
9569 | 2629 |
!ProjectDefinition class methodsFor:'file generation'! |
9536 | 2630 |
|
13177 | 2631 |
apspecFilename |
2632 |
^ 'autopackage/default.apspec' |
|
2633 |
||
2634 |
"Created: / 21-12-2010 / 09:43:13 / cg" |
|
2635 |
! |
|
2636 |
||
9852 | 2637 |
basicFileNamesToGenerate |
13419 | 2638 |
"answer a dictionary (filename -> generator method) with all the files, |
11937 | 2639 |
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
|
2640 |
|
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2641 |
|dict| |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2642 |
|
13419 | 2643 |
dict := OrderedDictionary withKeysAndValues:#( |
2644 |
'Make.spec' #'generate_make_dot_spec' |
|
2645 |
'Make.proto' #'generate_make_dot_proto' |
|
2646 |
'Makefile' #'generate_makefile' |
|
2647 |
'bc.mak' #'generate_bc_dot_mak' |
|
2648 |
'abbrev.stc' #'generate_abbrev_dot_stc' |
|
2649 |
'bmake.bat' #'generate_bmake_dot_mak' |
|
2650 |
'vcmake.bat' #'generate_vcmake_dot_mak' |
|
2651 |
'lcmake.bat' #'generate_lcmake_dot_mak' |
|
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2652 |
). |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2653 |
|
13419 | 2654 |
dict |
2655 |
at:self rcFilename put:#'generate_packageName_dot_rc'; |
|
2656 |
at:self apspecFilename put:#'generate_autopackage_default_dot_apspec'. |
|
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2657 |
|
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2658 |
^ dict. |
13154
bac0fcd8a888
make sure that the makefiles are generated before the libInit file
Claus Gittinger <cg@exept.de>
parents:
13148
diff
changeset
|
2659 |
|
13177 | 2660 |
"Modified: / 21-12-2010 / 11:02:02 / cg" |
9852 | 2661 |
! |
2662 |
||
9536 | 2663 |
fileNamesToGenerate |
12200
7e452033e984
rememberOverwrittenExtensionMethods
Claus Gittinger <cg@exept.de>
parents:
12198
diff
changeset
|
2664 |
"answer the 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
|
2665 |
|
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2666 |
^ self basicFileNamesToGenerate removeAllKeys:self protectedFileNames ifAbsent:[] |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2667 |
|
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2668 |
" |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2669 |
stx_libbasic fileNamesToGenerate |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2670 |
" |
9536 | 2671 |
! |
2672 |
||
13419 | 2673 |
forEachFileNameAndGeneratedContentsDo:aTwoArgBlock |
9544 | 2674 |
|pairs| |
2675 |
||
2676 |
pairs := OrderedCollection new. |
|
13419 | 2677 |
self forEachFileNameAndGeneratorMethodDo:[:fileName :generator | |
2678 |
|file| |
|
2679 |
||
2680 |
file := self perform:generator. |
|
2681 |
pairs add:(Array with:fileName with:file) |
|
9544 | 2682 |
]. |
2683 |
||
2684 |
pairs pairsDo:aTwoArgBlock |
|
2685 |
||
2686 |
"Created: / 16-08-2006 / 18:37:52 / User" |
|
2687 |
! |
|
2688 |
||
13419 | 2689 |
forEachFileNameAndGeneratorMethodDo:aTwoArgBlock |
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2690 |
self fileNamesToGenerate keysAndValuesDo:aTwoArgBlock |
9831 | 2691 |
|
9898 | 2692 |
"Modified: / 14-09-2006 / 21:02:37 / cg" |
9536 | 2693 |
! |
2694 |
||
2695 |
generateFile:filename |
|
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2696 |
|action| |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2697 |
|
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2698 |
action := self basicFileNamesToGenerate at:filename ifAbsent:[]. |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2699 |
action notNil ifTrue:[ |
13419 | 2700 |
^ self perform:action |
10864
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2701 |
]. |
512cd79cee0e
Use dictionary to hold filename->generatorMethpd mapping
Stefan Vogel <sv@exept.de>
parents:
10849
diff
changeset
|
2702 |
(filename = 'app.rc' or:[filename = 'lib.rc']) ifTrue:[ |
13419 | 2703 |
^ self generate_packageName_dot_rc |
9607 | 2704 |
]. |
9850 | 2705 |
(filename = 'loadAll') ifTrue:[ |
13419 | 2706 |
^ self generate_loadAll |
9850 | 2707 |
]. |
13177 | 2708 |
(filename = 'autopackage/default.apspec' or:[filename = self apspecFilename]) ifTrue:[ |
13419 | 2709 |
^ self generate_autopackage_default_dot_apspec |
13177 | 2710 |
]. |
2711 |
self error:('File "%1" not appropriate (not generated) for this type of project.' bindWith:filename) |
|
2712 |
||
2713 |
"Modified: / 21-12-2010 / 11:01:10 / cg" |
|
9536 | 2714 |
! |
2715 |
||
13411 | 2716 |
generateFile:filename in: directory |
2717 |
||
2718 |
| dir s | |
|
2719 |
dir := directory asFilename. |
|
2720 |
dir exists ifFalse:[self error:'Directory does not exist']. |
|
2721 |
[ |
|
13419 | 2722 |
s := ( dir / (filename asFilename baseName) ) writeStream. |
2723 |
s nextPutAll: (self generateFile: filename). |
|
13411 | 2724 |
] ensure:[ |
13419 | 2725 |
s ifNotNil:[s close] |
13411 | 2726 |
] |
2727 |
||
2728 |
" |
|
13419 | 2729 |
stx_projects_smalltalk generateFile:'package.deps.rake' in: '/tmp' |
13411 | 2730 |
" |
2731 |
||
2732 |
"Created: / 26-02-2011 / 10:42:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2733 |
"Modified: / 09-06-2011 / 14:53:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2734 |
! |
|
2735 |
||
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2736 |
generateRemoveShellScriptOn:aStream |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2737 |
"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
|
2738 |
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
|
2739 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2740 |
|firstLine| |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2741 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2742 |
firstLine := true. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2743 |
self searchForClasses do:[:eachClass| |
13419 | 2744 |
firstLine ifTrue:[ |
2745 |
aStream nextPutAll:'cvs rm -f '. |
|
2746 |
firstLine := false. |
|
2747 |
]. |
|
2748 |
eachClass classFilename ~= (eachClass generateClassFilename, '.st') ifTrue:[ |
|
2749 |
aStream nextPutAll:eachClass classBaseFilename; space. |
|
2750 |
] |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2751 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2752 |
firstLine ifFalse:[ |
13419 | 2753 |
aStream cr. |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2754 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2755 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2756 |
" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2757 |
stx_goodies_webServer_htmlTree generateRemoveShellScriptOn:Transcript |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2758 |
" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2759 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2760 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2761 |
generateRenameShellScriptOn:aStream |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2762 |
"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
|
2763 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2764 |
self searchForClasses do:[:eachClass| |
13419 | 2765 |
eachClass classFilename ~= (eachClass generateClassFilename, '.st') ifTrue:[ |
2766 |
aStream nextPutAll:'cp '; |
|
2767 |
nextPutAll:eachClass classBaseFilename; nextPutAll:',v '; |
|
2768 |
nextPutAll:eachClass generateClassFilename; nextPutAll:'.st,v'; cr. |
|
2769 |
] |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2770 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2771 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2772 |
" |
11981
e479249ba36e
Fix #generateRenameShellScriptOn:
Stefan Vogel <sv@exept.de>
parents:
11980
diff
changeset
|
2773 |
stx_libdb generateRemoveShellScriptOn:Transcript |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2774 |
" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2775 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2776 |
|
9536 | 2777 |
generate_abbrev_dot_stc |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
2778 |
self checkIfClassesArePresent. |
10104
96bce48c03b5
some care for incomplete information bein present when
Claus Gittinger <cg@exept.de>
parents:
10103
diff
changeset
|
2779 |
|
13419 | 2780 |
^ String |
2781 |
streamContents:[:s | |
|
2782 |
|addEntry| |
|
2783 |
||
2784 |
addEntry := |
|
2785 |
[:eachClassName | |
|
2786 |
|cls fn wasLoaded failedToLoad numClassInstvars| |
|
2787 |
||
2788 |
s nextPutAll:eachClassName. |
|
2789 |
s nextPutAll:' '. |
|
2790 |
||
2791 |
cls := Smalltalk classNamed:eachClassName. |
|
2792 |
cls isNil ifTrue:[ |
|
2793 |
fn := self filenameForClass:eachClassName. |
|
2794 |
s nextPutAll:fn. |
|
2795 |
s nextPutAll:' '; nextPutAll:(self package); nextPutAll:' '. |
|
2796 |
s nextPutAll:' '; nextPutAll:'unknownCategory' storeString; nextPutAll:' '. |
|
2797 |
s nextPutAll:' '; nextPutAll:'0'. |
|
2798 |
] ifFalse:[ |
|
2799 |
wasLoaded := cls isLoaded. |
|
2800 |
wasLoaded ifFalse:[ |
|
2801 |
failedToLoad := false. |
|
2802 |
||
2803 |
Error handle:[:ex | |
|
2804 |
failedToLoad := true. |
|
2805 |
] do:[ |
|
2806 |
ParserFlags |
|
2807 |
withSTCCompilation:#never |
|
2808 |
do:[ |
|
2809 |
cls autoload. |
|
2810 |
] |
|
2811 |
]. |
|
2812 |
]. |
|
2813 |
||
2814 |
fn := self filenameForClass:cls. |
|
2815 |
(fn includes:Character space) ifTrue:[ |
|
2816 |
s nextPutAll:fn storeString. |
|
2817 |
] ifFalse:[ |
|
2818 |
s nextPutAll:fn. |
|
2819 |
]. |
|
2820 |
s nextPutAll:' '; nextPutAll:(self package); nextPutAll:' '. |
|
2821 |
s nextPutAll: (cls category asString storeString). |
|
2822 |
failedToLoad ifTrue:[ |
|
2823 |
s nextPutAll:' 0'. |
|
2824 |
] ifFalse:[ |
|
2825 |
numClassInstvars := cls theMetaclass instSize - Class instSize. |
|
2826 |
s nextPutAll:' '; nextPutAll:numClassInstvars printString. |
|
2827 |
]. |
|
2828 |
||
2829 |
wasLoaded ifFalse:[ |
|
2830 |
cls unload |
|
2831 |
] |
|
2832 |
]. |
|
2833 |
s cr. |
|
2834 |
]. |
|
2835 |
||
2836 |
self allClassNames do:addEntry. |
|
2837 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do: [:nm :attr | |
|
2838 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
|
2839 |
addEntry value:nm |
|
2840 |
]. |
|
2841 |
]. |
|
2842 |
] |
|
2843 |
||
2844 |
" |
|
2845 |
DapasXProject generate_abbrev_dot_stc |
|
2846 |
DapasX_Datenbasis generate_abbrev_dot_stc |
|
2847 |
bosch_dapasx_interactiver_editor generate_abbrev_dot_stc |
|
9536 | 2848 |
" |
2849 |
||
2850 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
10104
96bce48c03b5
some care for incomplete information bein present when
Claus Gittinger <cg@exept.de>
parents:
10103
diff
changeset
|
2851 |
"Modified: / 20-10-2006 / 16:31:08 / cg" |
9536 | 2852 |
! |
2853 |
||
13177 | 2854 |
generate_autopackage_default_dot_apspec |
2855 |
||
13419 | 2856 |
^self |
2857 |
replaceMappings: self autopackage_default_dot_apspec_mappings |
|
2858 |
in: self autopackage_default_dot_apspec |
|
13177 | 2859 |
|
2860 |
" |
|
2861 |
stx_projects_smalltalk generate_autopackage_default_dot_apspec |
|
2862 |
" |
|
2863 |
||
2864 |
"Created: / 21-12-2010 / 09:40:04 / cg" |
|
2865 |
! |
|
2866 |
||
13419 | 2867 |
generate_bc_dot_mak |
2868 |
^ (self |
|
2869 |
replaceMappings: self bc_dot_mak_mappings |
|
2870 |
in: self bc_dot_mak) asStringCollection withTabs asString |
|
10306 | 2871 |
|
2872 |
" |
|
2873 |
DapasXProject generate_bc_dot_mak |
|
2874 |
DapasX_Datenbasis generate_bc_dot_mak |
|
2875 |
" |
|
2876 |
||
2877 |
"Modified: / 09-08-2006 / 11:46:14 / fm" |
|
2878 |
! |
|
2879 |
||
13419 | 2880 |
generate_bmake_dot_mak |
2881 |
||
2882 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
2883 |
in: self bmake_dot_mak |
|
9575 | 2884 |
|
2885 |
"Created: / 17-08-2006 / 20:03:43 / cg" |
|
2886 |
! |
|
2887 |
||
13411 | 2888 |
generate_builder_baseline_dot_rbspec |
2889 |
^ self replaceMappings:self builder_baseline_dot_rbspec_mappings |
|
13419 | 2890 |
in:self builder_baseline_dot_rbspec |
13411 | 2891 |
|
2892 |
" |
|
2893 |
stx_projects_smalltalk generate_builder_baseline_dot_rbspec |
|
2894 |
||
2895 |
" |
|
2896 |
||
2897 |
"Created: / 24-02-2011 / 11:38:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2898 |
! |
|
2899 |
||
13419 | 2900 |
generate_lcmake_dot_mak |
2901 |
||
2902 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
2903 |
in: self lcmake_dot_mak |
|
11979 | 2904 |
! |
2905 |
||
9850 | 2906 |
generate_loadAll |
13419 | 2907 |
^ String |
2908 |
streamContents:[:s | |
|
2909 |
|classNames classesLoaded classNamesUnloaded classesSorted classNamesSorted| |
|
2910 |
||
2911 |
classNames := self compiled_classNames_common. |
|
2912 |
classesLoaded := classNames |
|
2913 |
collect:[:nm | Smalltalk classNamed:nm] |
|
2914 |
thenSelect:[:cls | cls notNil and:[cls isLoaded] ]. |
|
2915 |
classNamesUnloaded := classNames |
|
2916 |
select:[:nm | |
|
2917 |
|cls| |
|
2918 |
cls := Smalltalk classNamed:nm. |
|
2919 |
cls isNil or:[cls isLoaded not] |
|
2920 |
]. |
|
2921 |
||
2922 |
classesSorted := Class classesSortedByLoadOrder:classesLoaded. |
|
2923 |
classNamesSorted := classesSorted collect:[:cls | cls name]. |
|
2924 |
||
2925 |
s nextPutAll:'"/ |
|
9850 | 2926 |
"/ $' , 'Header' , '$ |
2927 |
"/ |
|
2928 |
"/ loadAll-file to fileIn code for: ' , self package , ' |
|
2929 |
"/ |
|
2930 |
"/ Automatically generated from the ProjectDefinition. |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2931 |
"/ DO NOT MODIFY THIS FILE; |
9850 | 2932 |
"/ |
2933 |
"/ |
|
2934 |
"/ Prerequisites: |
|
2935 |
"/ |
|
2936 |
"/ Smalltalk loadPackage:''module:directory''. |
|
2937 |
"/ Smalltalk loadPackage:''....''. |
|
2938 |
!! |
|
2939 |
||
2940 |
"{ package:''' , self package, ''' }" |
|
2941 |
!! |
|
2942 |
||
2943 |
|files| |
|
2944 |
||
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2945 |
''loading package ' , self package ,'...'' infoPrint. |
9850 | 2946 |
|
2947 |
files := #( |
|
2948 |
'. |
|
2949 |
||
13419 | 2950 |
classesSorted do:[:eachClass | |
2951 |
s nextPutLine:' ''' , (self filenameForClass:eachClass), ''''. |
|
2952 |
]. |
|
2953 |
classNamesUnloaded do:[:nm | |
|
2954 |
s nextPutLine:' ''' , (self filenameForClass:nm), ''''. |
|
2955 |
]. |
|
2956 |
||
2957 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do:[:nm :attr | |
|
2958 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
|
2959 |
s nextPutLine:' ''' , (self filenameForClass:nm), ''''. |
|
2960 |
]. |
|
2961 |
]. |
|
2962 |
||
2963 |
self hasExtensionMethods ifTrue:[ |
|
2964 |
s nextPutLine:' ''extensions.st'''. |
|
2965 |
]. |
|
2966 |
||
2967 |
s nextPutAll:' |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2968 |
). |
9850 | 2969 |
|
2970 |
"/ see if there is a classLibrary |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2971 |
(Smalltalk fileInClassLibrary:''' , (self libraryName) , ''') ifTrue:[ |
9850 | 2972 |
|handle loaded| |
2973 |
||
13419 | 2974 |
handle := ObjectFileLoader loadedObjectHandles |
2975 |
detect:[:h | h package = ''' , self package , '''] ifNone:nil. |
|
9850 | 2976 |
handle ifNotNil:[ |
13419 | 2977 |
loaded := Set new:(handle classes size). |
2978 |
handle classes do:[:c| c isMeta ifFalse:[loaded add:c classBaseFilename]]. |
|
2979 |
files := files \ loaded. |
|
9850 | 2980 |
]. |
2981 |
]. |
|
2982 |
||
2983 |
"/ 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
|
2984 |
files notEmpty ifTrue:[ |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2985 |
'''' infoPrintCR. |
9850 | 2986 |
files do:[:f | |
2987 |
''.'' infoPrint. |
|
2988 |
f asFilename exists ifTrue:[ |
|
13419 | 2989 |
Smalltalk fileIn:f. |
9850 | 2990 |
] ifFalse:[ |
13419 | 2991 |
Smalltalk fileIn:(''source/'' , f) |
9850 | 2992 |
] |
2993 |
]. |
|
2994 |
'' '' infoPrintCR. |
|
2995 |
]. |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2996 |
''done (' , self package ,').'' infoPrintCR. |
9850 | 2997 |
'. |
13419 | 2998 |
]. |
9850 | 2999 |
|
3000 |
"Created: / 14-09-2006 / 14:21:31 / cg" |
|
10080 | 3001 |
"Modified: / 12-10-2006 / 15:55:00 / cg" |
9850 | 3002 |
! |
3003 |
||
13419 | 3004 |
generate_make_dot_proto |
3005 |
||
3006 |
^ (self |
|
3007 |
replaceMappings: self make_dot_proto_mappings |
|
3008 |
in: self make_dot_proto) asStringCollection withTabs asString |
|
9536 | 3009 |
|
9733 | 3010 |
" |
12428 | 3011 |
stx_libbasic2 generate_make_dot_proto |
9733 | 3012 |
" |
9536 | 3013 |
|
3014 |
"Modified: / 09-08-2006 / 11:31:01 / fm" |
|
3015 |
! |
|
3016 |
||
3017 |
generate_make_dot_spec |
|
13419 | 3018 |
^ (self |
3019 |
replaceMappings: self make_dot_spec_mappings |
|
3020 |
in: self make_dot_spec) asStringCollection withTabs asString |
|
9536 | 3021 |
|
9733 | 3022 |
" |
3023 |
DapasXProject generate_make_dot_spec |
|
3024 |
DapasX_Datenbasis generate_make_dot_spec |
|
3025 |
bosch_dapasx_kernel_Definition generate_make_dot_spec |
|
3026 |
" |
|
9536 | 3027 |
|
3028 |
"Modified: / 09-08-2006 / 11:31:09 / fm" |
|
3029 |
! |
|
3030 |
||
13419 | 3031 |
generate_makefile |
3032 |
||
3033 |
^ (self |
|
3034 |
replaceMappings: self makefile_mappings |
|
3035 |
in: self makefile) asStringCollection withTabs asString |
|
12428 | 3036 |
|
3037 |
" |
|
3038 |
stx_libbasic2 generate_makefile |
|
3039 |
" |
|
3040 |
! |
|
3041 |
||
9536 | 3042 |
generate_packageName_dot_rc |
3043 |
||
13419 | 3044 |
^self replaceMappings: self packageName_dot_rc_mappings |
3045 |
in: self packageName_dot_rc |
|
9536 | 3046 |
|
3047 |
" |
|
3048 |
bosch_dapasx_datenbasis generate_packageName_dot_rc |
|
3049 |
bosch_dapasx_hw_schnittstellen generate_packageName_dot_rc |
|
9575 | 3050 |
stx_libbasic3 generate_packageName_dot_rc |
9618 | 3051 |
stx_libwidg3 generate_packageName_dot_rc |
13419 | 3052 |
stx_libwidg3 productVersion |
9536 | 3053 |
|
3054 |
" |
|
3055 |
||
3056 |
"Modified: / 09-08-2006 / 11:31:09 / fm" |
|
9618 | 3057 |
"Modified: / 21-08-2006 / 19:33:21 / cg" |
9831 | 3058 |
! |
3059 |
||
13411 | 3060 |
generate_package_dot_deps_dot_rake |
3061 |
^ (self replaceMappings:self package_dot_deps_dot_rake_mappings |
|
13419 | 3062 |
in:self package_dot_deps_dot_rake) asStringCollection |
3063 |
withTabs asString |
|
13411 | 3064 |
|
3065 |
" |
|
3066 |
stx_libjava generate_dependencies_dot_rake" |
|
3067 |
||
3068 |
"Created: / 24-02-2011 / 22:32:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3069 |
! |
|
3070 |
||
13419 | 3071 |
generate_vc_dot_def |
3072 |
||
3073 |
^self replaceMappings: self vc_dot_def_mappings |
|
3074 |
in: self vc_dot_def |
|
10306 | 3075 |
|
3076 |
" |
|
3077 |
DapasXProject generate_vc_dot_def |
|
3078 |
DapasX_Datenbasis generate_vc_dot_def |
|
3079 |
||
3080 |
" |
|
3081 |
||
3082 |
"Modified: / 09-08-2006 / 11:31:21 / fm" |
|
3083 |
! |
|
3084 |
||
13419 | 3085 |
generate_vcmake_dot_mak |
3086 |
||
3087 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
3088 |
in: self vcmake_dot_mak |
|
11937 | 3089 |
! |
3090 |
||
9852 | 3091 |
protectedFileNames |
13178
07e3a9bb37c8
changed: #protectedFileNames
Claus Gittinger <cg@exept.de>
parents:
13177
diff
changeset
|
3092 |
"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
|
3093 |
- redefine this to protect a hand-written Make.proto or other handwritten support files" |
9852 | 3094 |
|
3095 |
^ #() |
|
3096 |
||
3097 |
"Created: / 14-09-2006 / 14:38:40 / cg" |
|
13178
07e3a9bb37c8
changed: #protectedFileNames
Claus Gittinger <cg@exept.de>
parents:
13177
diff
changeset
|
3098 |
"Modified: / 21-12-2010 / 11:36:46 / cg" |
9852 | 3099 |
! |
3100 |
||
9831 | 3101 |
rcFilename |
3102 |
^ self packageName,'.rc'. |
|
3103 |
||
3104 |
"Created: / 07-09-2006 / 17:07:00 / cg" |
|
9536 | 3105 |
! ! |
3106 |
||
12364 | 3107 |
!ProjectDefinition class methodsFor:'file mappings'! |
9536 | 3108 |
|
13177 | 3109 |
autopackage_default_dot_apspec_mappings |
3110 |
|mappings| |
|
3111 |
||
3112 |
mappings := Dictionary new. |
|
3113 |
||
3114 |
mappings |
|
3115 |
"/ at: 'TOP' put: ( self pathToTop_unix ); |
|
3116 |
"/ at: 'NSI_FILENAME' put: self nsiFilename ; |
|
13419 | 3117 |
at: 'DESCRIPTION' put: (self description); |
3118 |
at: 'PRODUCT_VERSION' put: (self productVersion); |
|
3119 |
at: 'PRODUCT_DATE' put: (self productDate); |
|
3120 |
at: 'PRODUCT_PUBLISHER' put: (self productPublisher); |
|
3121 |
at: 'PRODUCT_WEBSITE' put: (self productWebSite); |
|
3122 |
at: 'PRODUCT_INSTALLDIR' put: (self productInstallDir); |
|
3123 |
at: 'PRODUCT_TYPE' put: (self productType); |
|
3124 |
at: 'PRODUCT_LICENSE' put: (self productLicense); |
|
3125 |
at: 'PRODUCT_DESCRIPTION' put: (self productDescription); |
|
3126 |
at: 'MAINTAINER' put: (self productMaintainer); |
|
3127 |
at: 'PACKAGER' put: (self productPublisher); |
|
13177 | 3128 |
"/ at: 'STARTUP_CLASS' put: (self startupClassName); |
3129 |
"/ at: 'STARTUP_SELECTOR' put: (self startupSelector); |
|
3130 |
"/ at: 'MAIN_DEFINES' put: (self mainDefines); |
|
13419 | 3131 |
"/ at: 'REQUIRED_LIBS' put: (self generateRequiredLibs_make_dot_proto); |
3132 |
"/ at: 'PREREQUISITES_LIBS' put: (self generatePreRequisiteLines_make_dot_proto); |
|
3133 |
"/ at: 'SUBPROJECTS_LIBS' put: (self generateSubProjectLines_make_dot_proto); |
|
13177 | 3134 |
"/ at: 'REQUIRED_LIBOBJS' put: (self generateRequiredLibobjs_make_dot_proto); |
3135 |
"/ at: 'REQUIRED_LINK_LIBOBJS' put: (self generateRequiredLinkLibobjs_make_dot_proto); |
|
3136 |
"/ at: 'DEPENDENCIES' put: (self generateDependencies_unix); |
|
13419 | 3137 |
"/ at: 'SUBPROJECTS_LIBS' put: (self generateSubProjectLines_make_dot_proto ); |
13177 | 3138 |
"/ at: 'BUILD_TARGET' put: (self buildTarget ); |
13419 | 3139 |
yourself. |
3140 |
||
3141 |
"/ self offerSmalltalkSourceCode ifTrue:[ |
|
13177 | 3142 |
"/ mappings |
13419 | 3143 |
"/ at: 'STX_SOURCE_RULES' put: ( self replaceMappings: mappings |
13177 | 3144 |
"/ in: self make_dot_proto_stx_source_rules). |
3145 |
"/ ]. |
|
3146 |
||
13419 | 3147 |
"/ self offerApplicationSourceCode ifTrue:[ |
13177 | 3148 |
"/ mappings |
13419 | 3149 |
"/ at: 'SOURCE_RULES' put:( self replaceMappings: mappings |
13177 | 3150 |
"/ in: self make_dot_proto_app_source_rules ). |
3151 |
"/ ]. |
|
3152 |
||
3153 |
"/ self needResources ifTrue:[ |
|
3154 |
"/ mappings |
|
3155 |
"/ at: 'REQUIRED_SUPPORT_DIRS' put: 'RESOURCEFILES'; |
|
13419 | 3156 |
"/ at: 'RESOURCE_RULES' put:( self replaceMappings: mappings |
13177 | 3157 |
"/ in: self make_dot_proto_resource_rules ); |
13419 | 3158 |
"/ at: 'STX_RESOURCE_RULES' put: ( self replaceMappings: mappings |
13177 | 3159 |
"/ in: self make_dot_proto_stx_resource_rules); |
3160 |
"/ at: 'ADDITIONAL_RESOURCE_TARGETS' put:( self additionalResourceTargets asStringWith:' '); |
|
3161 |
"/ yourself. |
|
3162 |
"/ ]. |
|
3163 |
||
3164 |
^ mappings |
|
3165 |
||
3166 |
"Created: / 21-12-2010 / 09:00:49 / cg" |
|
3167 |
"Modified: / 21-12-2010 / 11:14:41 / cg" |
|
3168 |
! |
|
3169 |
||
10306 | 3170 |
bc_dot_mak_mappings |
3171 |
|d| |
|
3172 |
||
3173 |
d := Dictionary new. |
|
13419 | 3174 |
d |
3175 |
at: 'TAB' put: ( Character tab asString ); |
|
3176 |
at: 'TOP' put: ( self pathToTop_win32 ); |
|
3177 |
at: 'MODULE' put: ( self module ); |
|
3178 |
at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); |
|
3179 |
at: 'MODULE_PATH' put: ( self moduleDirectory_win32 ); |
|
3180 |
at: 'PRIMARY_TARGET' put: (self primaryTarget_bc_dot_mak); |
|
3181 |
at: 'ADDITIONAL_BASE_ADDRESS_DEFINITION' put: (self additionalBaseAddressDefinition_bc_dot_mak ? ''); |
|
3182 |
at: 'ADDITIONAL_DEFINITIONS' put: (self additionalDefinitions_bc_dot_mak ? ''); |
|
3183 |
at: 'ADDITIONAL_RULES' put: (self additionalRules_bc_dot_mak ? ''); |
|
3184 |
at: 'ADDITIONAL_TARGETS' put: (self additionalTargets_bc_dot_mak ? ''); |
|
3185 |
at: 'ADDITIONAL_LINK_LIBRARIES' put: (self additionalLinkLibraries_bc_dot_mak ? ''); |
|
3186 |
at: 'LOCAL_INCLUDES' put: (self generateLocalIncludes_win32 ? ''); |
|
3187 |
at: 'LOCAL_DEFINES' put: self localDefines_win32 ? ''; |
|
3188 |
at: 'GLOBAL_DEFINES' put: self globalDefines_win32 ? ''; |
|
3189 |
at: 'MAKE_PREREQUISITES' put: (self generateRequiredMakePrerequisites_bc_dot_mak ? ''). |
|
10306 | 3190 |
^ d |
3191 |
||
3192 |
"Created: / 18-08-2006 / 11:43:39 / cg" |
|
13148
5057819fd8aa
changed: #bc_dot_mak_mappings
Claus Gittinger <cg@exept.de>
parents:
13118
diff
changeset
|
3193 |
"Modified: / 24-11-2010 / 20:15:05 / cg" |
10306 | 3194 |
! |
3195 |
||
9627 | 3196 |
bmake_dot_mak_mappings |
3197 |
^ (Dictionary new) |
|
13419 | 3198 |
at:'SUBPROJECT_BMAKE_CALLS' put:(self subProjectBmakeCalls); |
3199 |
at:'SUBPROJECT_VCMAKE_CALLS' put:(self subProjectVCmakeCalls); |
|
3200 |
at:'SUBPROJECT_LCMAKE_CALLS' put:(self subProjectLCmakeCalls); |
|
3201 |
yourself |
|
9627 | 3202 |
|
3203 |
"Created: / 17-08-2006 / 21:41:56 / cg" |
|
9887 | 3204 |
"Modified: / 14-09-2006 / 18:55:33 / cg" |
9575 | 3205 |
! |
3206 |
||
13411 | 3207 |
builder_baseline_dot_rbspec_mappings |
3208 |
|mappings| |
|
3209 |
||
3210 |
mappings := Dictionary new. |
|
3211 |
mappings |
|
13419 | 3212 |
at:'APPLICATION' put:(self perform:#applicationName ifNotUnderstood:[self packageName]); |
3213 |
at:'APPLICATION_PACKAGE' put:self package printString; |
|
3214 |
at:'PREAMBLE' put:self builder_baseline_dot_rbspec_preamble; |
|
3215 |
at:'POSTAMBLE' put:self builder_baseline_dot_rbspec_postamble; |
|
3216 |
at:'PACKAGES' put:self builder_baseline_dot_rbspec_packages; |
|
3217 |
yourself. |
|
13411 | 3218 |
^ mappings |
3219 |
||
3220 |
"Modified: / 21-12-2010 / 11:00:22 / cg" |
|
3221 |
"Created: / 24-02-2011 / 11:58:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3222 |
"Modified: / 09-06-2011 / 14:55:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3223 |
! |
|
3224 |
||
3225 |
builder_baseline_dot_rbspec_packages |
|
3226 |
^ String streamContents: |
|
13419 | 3227 |
[:s | |
3228 |
self allPreRequisitesSorted do: |
|
3229 |
[:packageId | |
|
3230 |
s |
|
3231 |
nextPutAll:(' package "%1"' bindWith:packageId); |
|
3232 |
cr ] ]. |
|
13411 | 3233 |
|
3234 |
"Created: / 24-02-2011 / 11:59:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3235 |
! |
|
3236 |
||
13419 | 3237 |
classLine_mappings:aClassName |
12545 | 3238 |
^ Dictionary new |
13419 | 3239 |
at:'CLASS' put:(self st2c:aClassName); |
3240 |
yourself |
|
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3241 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3242 |
"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
|
3243 |
"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
|
3244 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3245 |
|
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
3246 |
make_dot_proto_mappings |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
3247 |
^ Dictionary new |
13419 | 3248 |
at: 'TAB' put: ( Character tab asString ); |
3249 |
at: 'TOP' put: ( self pathToTop_unix ); |
|
3250 |
at: 'LIBRARY_NAME' put: ( self libraryName ); |
|
3251 |
at: 'SUBDIRECTORIES' put: (self generateSubDirectories); |
|
3252 |
at: 'LOCAL_INCLUDES' put: (self generateLocalIncludes_unix); |
|
3253 |
at: 'LOCAL_DEFINES' put: self localDefines_unix; |
|
3254 |
at: 'GLOBAL_DEFINES' put: self globalDefines_unix; |
|
3255 |
at: 'COMMONSYMFLAG' put: (self commonSymbolsFlag); |
|
3256 |
at: 'HEADEROUTPUTARG' put: (self headerFileOutputArg); |
|
3257 |
at: 'PRIMARY_TARGET' put: (self primaryTarget_make_dot_proto); |
|
3258 |
at: 'ADDITIONAL_DEFINITIONS' put: (self additionalDefinitions_make_dot_proto); |
|
3259 |
at: 'ADDITIONAL_RULES' put: (self additionalRules_make_dot_proto); |
|
3260 |
at: 'ADDITIONAL_RULES_SVN' put: (self additionalRulesSvn_make_dot_proto); |
|
3261 |
at: 'ADDITIONAL_TARGETS' put: (self additionalTargets_make_dot_proto); |
|
3262 |
at: 'ADDITIONAL_TARGETS_SVN' put: (self additionalTargetsSvn_make_dot_proto); |
|
3263 |
at: 'ADDITIONAL_LINK_LIBRARIES' put: (self additionalLinkLibraries_make_dot_proto); |
|
3264 |
at: 'ADDITIONAL_SHARED_LINK_LIBRARIES' put: (self additionalSharedLinkLibraries_make_dot_proto); |
|
3265 |
at: 'DEPENDENCIES' put: (self generateDependencies_unix); |
|
3266 |
at: 'MODULE' put: ( self module ); |
|
3267 |
at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); |
|
3268 |
at: 'MODULE_PATH' put: ( self moduleDirectory ); |
|
3269 |
at: 'MAKE_PREREQUISITES' put: (self generateRequiredMakePrerequisites_make_dot_proto); |
|
3270 |
yourself |
|
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
3271 |
|
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
3272 |
"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
|
3273 |
"Modified: / 09-08-2006 / 16:44:48 / fm" |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
3274 |
"Modified: / 14-09-2006 / 18:57:52 / cg" |
12028 | 3275 |
"Modified: / 24-06-2009 / 21:50:13 / Jan Vrany <vranyj1@fel.cvut.cz>" |
3276 |
"Modified: / 22-08-2009 / 12:03:25 / 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
|
3277 |
! |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
3278 |
|
9627 | 3279 |
make_dot_spec_mappings |
3280 |
^ Dictionary new |
|
13419 | 3281 |
at: 'TAB' put: ( Character tab asString ); |
3282 |
at: 'MODULE' put: ( self module ); |
|
3283 |
at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); |
|
3284 |
at: 'STCWARNINGOPTIONS' put: (self stcWarningOptions); |
|
3285 |
at: 'STCOPTIMIZATIONOPTIONS' put: (self stcOptimizationOptions); |
|
3286 |
at: 'CLASSES' put: [self generateClasses_make_dot_spec]; |
|
3287 |
at: 'OBJECTS' put: [self generateObjects_make_dot_spec]; |
|
3288 |
yourself |
|
9627 | 3289 |
|
3290 |
"Created: / 18-08-2006 / 11:44:23 / cg" |
|
9887 | 3291 |
"Modified: / 14-09-2006 / 18:51:24 / cg" |
9575 | 3292 |
! |
3293 |
||
12428 | 3294 |
makefile_mappings |
3295 |
^ Dictionary new |
|
13419 | 3296 |
yourself |
12428 | 3297 |
! |
3298 |
||
9627 | 3299 |
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
|
3300 |
|d s resourceCount| |
9627 | 3301 |
|
9630 | 3302 |
d := Dictionary new. |
3303 |
d |
|
13419 | 3304 |
at: 'PRODUCT_NAME' put: (self productName); |
3305 |
at: 'PRODUCT_VERSION' put: (self productVersion); |
|
3306 |
at: 'PRODUCT_DATE' put: (self productDate); |
|
3307 |
at: 'FILETYPE' put: ( 'VFT_DLL' ); |
|
3308 |
at: 'FILE_VERSION_COMMASEPARATED' put: (self fileVersionCommaSeparated); |
|
3309 |
at: 'PRODUCT_VERSION_COMMASEPARATED' put: (self productVersionCommaSeparated); |
|
3310 |
||
3311 |
at: 'COMPANY_NAME' put: (self companyName); |
|
3312 |
at: 'FILE_DESCRIPTION' put: (self fileDescription); |
|
3313 |
at: 'FILE_VERSION' put: (self fileVersion); |
|
3314 |
at: 'INTERNAL_NAME' put: (self internalName). |
|
11377 | 3315 |
|
9630 | 3316 |
s := self legalCopyright. |
3317 |
s notNil ifTrue:[ |
|
13419 | 3318 |
d at: 'LEGAL_COPYRIGHT_LINE' put: ' VALUE "LegalCopyright", "',s,'\0"' |
9630 | 3319 |
]. |
11611
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
3320 |
s := String streamContents:[:stream| |
13419 | 3321 |
|suff| |
3322 |
||
3323 |
s := self applicationIconFileName. |
|
3324 |
s notNil ifTrue:[ |
|
3325 |
s asFilename suffix isEmptyOrNil ifTrue:[ |
|
3326 |
suff := '.ico' |
|
3327 |
] ifFalse:[ |
|
3328 |
suff := '' |
|
3329 |
]. |
|
3330 |
'IDR_MAINFRAME ICON DISCARDABLE "%1%2"' |
|
3331 |
expandPlaceholdersWith:(Array with:s with:suff) on:stream. |
|
3332 |
stream cr. |
|
3333 |
]. |
|
3334 |
||
3335 |
s := self splashFileName. |
|
3336 |
s notNil ifTrue:[ |
|
3337 |
s asFilename suffix isEmptyOrNil ifTrue:[ |
|
3338 |
suff := '.bmp' |
|
3339 |
] ifFalse:[ |
|
3340 |
suff := '' |
|
3341 |
]. |
|
3342 |
'IDR_SPLASH BITMAP DISCARDABLE "%1%2"' |
|
3343 |
expandPlaceholdersWith:(Array with:s with:suff) on:stream. |
|
3344 |
stream cr. |
|
3345 |
]. |
|
3346 |
resourceCount := 2. |
|
3347 |
self applicationAdditionalIconFileNames do:[:eachFilename| |
|
3348 |
'IDR_MAINFRAME+%1 ICON DISCARDABLE "%2"' |
|
3349 |
expandPlaceholdersWith:(Array with:resourceCount with:eachFilename) on:stream. |
|
3350 |
stream cr. |
|
3351 |
resourceCount := resourceCount+1. |
|
3352 |
]. |
|
3353 |
]. |
|
11611
fa06cde6bd11
Allow for additional icon files to be placed in resources
Stefan Vogel <sv@exept.de>
parents:
11580
diff
changeset
|
3354 |
d at: #'ICONDEFINITION_LINE' put:s. |
9817 | 3355 |
|
9630 | 3356 |
^ d |
9627 | 3357 |
|
3358 |
"Created: / 09-08-2006 / 11:21:21 / fm" |
|
13309
27f463f6c0cb
changed: #packageName_dot_rc_mappings
Claus Gittinger <cg@exept.de>
parents:
13285
diff
changeset
|
3359 |
"Modified: / 22-02-2011 / 11:30:36 / cg" |
9536 | 3360 |
! |
3361 |
||
13411 | 3362 |
package_dot_deps_dot_rake_mappings |
3363 |
| dependencies | |
|
3364 |
||
3365 |
dependencies := String streamContents: |
|
13419 | 3366 |
[:s| |
3367 |
self allPreRequisites do: |
|
3368 |
[:package| |
|
3369 |
(self preRequisitesFor: package) do: |
|
3370 |
[:prereq| |
|
3371 |
s nextPutAll: ('task "%1" => "%2"' bindWith: package with: prereq); cr]. |
|
3372 |
s cr]. |
|
3373 |
self effectivePreRequisites do: |
|
3374 |
[:prereq| |
|
3375 |
s nextPutAll: ('task "%1" => "%2"' bindWith: self package with: prereq); cr]. |
|
3376 |
]. |
|
13411 | 3377 |
|
3378 |
^ (Dictionary new) |
|
13419 | 3379 |
at:'DEPENDENCIES' put:dependencies; |
3380 |
yourself |
|
3381 |
||
3382 |
" |
|
3383 |
stx_libjava generate_package_dot_deps_dot_rake |
|
13411 | 3384 |
" |
3385 |
||
3386 |
"Created: / 24-02-2011 / 22:32:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3387 |
! |
|
3388 |
||
9627 | 3389 |
replaceMappings: mappings in: fileTemplate |
9733 | 3390 |
"Replaces the defined variable mappings found in a file template with the corresponding information" |
9627 | 3391 |
|
9733 | 3392 |
^ fileTemplate bindWithArguments:mappings. |
9627 | 3393 |
|
9733 | 3394 |
" |
13419 | 3395 |
self replaceMappings: (self nt_dot_def_mappingsFor: self) in: self nt_dot_def |
9733 | 3396 |
" |
9627 | 3397 |
|
3398 |
"Created: / 08-08-2006 / 11:44:27 / fm" |
|
3399 |
"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
|
3400 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3401 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3402 |
st2c:aString |
13419 | 3403 |
^ (aString asString |
3404 |
copyReplaceString:'_' withString:('_',($_ codePoint printStringRadix:8))) |
|
3405 |
replaceAny:':' with:$_ |
|
9536 | 3406 |
! ! |
3407 |
||
12364 | 3408 |
!ProjectDefinition class methodsFor:'file mappings support'! |
9817 | 3409 |
|
12545 | 3410 |
classNamesByCategory |
3411 |
"answer a dictionary |
|
13485
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3412 |
category -> classNames topological sorted" |
12545 | 3413 |
|
3414 |
|pivateClassesOf sorter classes classNames mapping| |
|
3415 |
||
3416 |
mapping := Dictionary new. |
|
3417 |
||
3418 |
classes := self compiled_classes_common. |
|
3419 |
pivateClassesOf := IdentityDictionary new. |
|
3420 |
classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)]. |
|
3421 |
||
3422 |
sorter := [:a :b | |
|
13485
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3423 |
"/ a must come before b iff: |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3424 |
"/ b is a subclass of a |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3425 |
"/ b has a private class which is a subclass of a |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3426 |
"/ a is a sharedPool, used by b |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3427 |
|
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3428 |
|mustComeBefore pivateClassesOfB| |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3429 |
|
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3430 |
mustComeBefore := false. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3431 |
mustComeBefore := (a isSharedPool and:[(b sharedPoolNames includes: a name)]). |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3432 |
mustComeBefore := mustComeBefore or:[b isSubclassOf:a]. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3433 |
mustComeBefore ifFalse:[ |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3434 |
pivateClassesOfB := pivateClassesOf at:b ifAbsent:[ #() ]. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3435 |
pivateClassesOfB do:[:eachClassInB | |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3436 |
mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a] |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3437 |
]. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3438 |
]. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3439 |
mustComeBefore |
12545 | 3440 |
]. |
3441 |
||
3442 |
classes topologicalSort:sorter. |
|
3443 |
||
3444 |
OperatingSystem knownPlatformNames do:[:platformID | |
|
13485
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3445 |
|prefix depClasses depClassNames| |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3446 |
|
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3447 |
prefix := platformID asUppercase. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3448 |
depClasses := self compiled_classesForArchitecture:platformID. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3449 |
depClasses notEmpty ifTrue:[ |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3450 |
(self compiled_classNamesForPlatform:platformID) |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3451 |
select:[:nm | (Smalltalk at:nm ifAbsent:nil) isNil] |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3452 |
thenDo:[:nm | Transcript showCR:nm]. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3453 |
(depClasses includes:nil) ifTrue:[ |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3454 |
(Dialog confirm:'Dependencies are not in correct (some classes are not present).\\Continue anyway ?' withCRs) |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3455 |
ifFalse:[ |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3456 |
AbortOperationRequest raise. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3457 |
]. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3458 |
depClassNames := self compiled_classNamesForPlatform:platformID. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3459 |
] ifFalse:[ |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3460 |
depClasses topologicalSort:sorter. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3461 |
depClassNames := depClasses collect:[:eachClass| eachClass name]. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3462 |
]. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3463 |
mapping at:prefix put:depClassNames. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3464 |
]. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3465 |
|
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3466 |
classNames := classes collect:[:eachClass| eachClass name]. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3467 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do: [:nm :attr | |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3468 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3469 |
classNames add:nm. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3470 |
]. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3471 |
]. |
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3472 |
|
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3473 |
mapping at:'COMMON' put:classNames. |
12545 | 3474 |
]. |
3475 |
^ mapping |
|
3476 |
||
3477 |
" |
|
3478 |
stx_libbasic classNamesByCategory |
|
3479 |
stx_libbasic3 classNamesByCategory |
|
3480 |
stx_libview classNamesByCategory |
|
3481 |
" |
|
3482 |
||
3483 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
13485
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
3484 |
"Modified: / 03-07-2011 / 21:51:36 / cg" |
12545 | 3485 |
! |
3486 |
||
10299
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
3487 |
commonSymbolsFlag |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
3488 |
"only for libraries" |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
3489 |
|
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
3490 |
^ '' |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
3491 |
! |
af27a10749c2
add #additional_link_libraries_nt_dot_mak
Stefan Vogel <sv@exept.de>
parents:
10296
diff
changeset
|
3492 |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3493 |
filenameForClass:classNameOrClass |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3494 |
"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
|
3495 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3496 |
"/ "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
|
3497 |
"/ See also: #generateRemoveShellScriptOn: and #generateRenamShellScriptOn:" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3498 |
"/ classNameOrClass isBehavior ifTrue:[ |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3499 |
"/ ^ classNameOrClass generateClassFilename. |
13419 | 3500 |
"/ ] ifFalse:[ |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3501 |
"/ |cls| |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3502 |
"/ |
13419 | 3503 |
"/ cls := Smalltalk classNamed:classNameOrClass. |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3504 |
"/ cls notNil ifTrue:[ |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3505 |
"/ ^ cls generateClassFilename. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3506 |
"/ ]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3507 |
"/ ]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3508 |
"/ "end special code" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3509 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3510 |
^ Smalltalk fileNameForClass:classNameOrClass. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3511 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3512 |
" |
13419 | 3513 |
self filenameForClass:HTML::Encoder |
3514 |
Smalltalk fileNameForClass:HTML::Encoder |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3515 |
" |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3516 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3517 |
"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
|
3518 |
"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
|
3519 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3520 |
|
13419 | 3521 |
generateClassLines:classLineTemplate |
12771
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
3522 |
"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
|
3523 |
|
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
3524 |
^ 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
|
3525 |
! |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
3526 |
|
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
3527 |
generateClassLines:classLineTemplate forClasses:classNames |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
3528 |
"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
|
3529 |
|
13419 | 3530 |
^ self generateClassLines:classLineTemplate forClasses:classNames includeAdditionalClasses:true |
12804
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
3531 |
! |
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
3532 |
|
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
3533 |
generateClassLines:classLineTemplate forClasses:classNames includeAdditionalClasses:includeAdditionalClasses |
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
3534 |
"for the init-file: generate class-init-lines for a collection of classes" |
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
3535 |
|
13419 | 3536 |
^ String |
3537 |
streamContents:[:s | |
|
3538 |
|classesLoaded classNamesUnloaded classNamesSorted putLineForClassName| |
|
3539 |
||
3540 |
putLineForClassName := [:className | |
|
3541 |
|newClassLine mappings| |
|
3542 |
||
3543 |
mappings := self classLine_mappings:className. |
|
3544 |
newClassLine := self replaceMappings:mappings in:classLineTemplate. |
|
3545 |
s nextPutLine:newClassLine |
|
3546 |
]. |
|
3547 |
classesLoaded := classNames collect:[:eachClassName | Smalltalk classNamed:eachClassName] |
|
3548 |
thenSelect:[:eachClass | eachClass notNil and:[eachClass isLoaded]]. |
|
3549 |
classNamesUnloaded := classNames |
|
3550 |
select:[:nm | |
|
3551 |
|cls| |
|
3552 |
||
3553 |
cls := Smalltalk classNamed:nm. |
|
3554 |
cls isNil or:[ cls isLoaded not ] |
|
3555 |
]. |
|
3556 |
classNamesSorted := (Class classesSortedByLoadOrder:classesLoaded) collect:[:cls | cls name]. |
|
3557 |
classNamesSorted do:putLineForClassName. |
|
3558 |
classNamesUnloaded do:putLineForClassName. |
|
3559 |
||
3560 |
includeAdditionalClasses ifTrue:[ |
|
3561 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) |
|
3562 |
do:[:nm :attr | |
|
3563 |
(attr isEmptyOrNil or:[ (attr includes:#autoload) not ]) ifTrue:[ |
|
3564 |
putLineForClassName value:nm. |
|
3565 |
]. |
|
3566 |
]. |
|
3567 |
#( ('UNIX' unix) |
|
3568 |
('WIN32' win32) |
|
3569 |
('VMS' vms) |
|
3570 |
('BEOS' beos) ) |
|
3571 |
pairsDo:[:ifdef :platformName | |
|
3572 |
|archClassNames archClassesLoaded| |
|
3573 |
||
3574 |
archClassNames := self compiled_classNamesForPlatform:platformName. |
|
3575 |
archClassNames notEmpty ifTrue:[ |
|
3576 |
s nextPutLine:'#ifdef ' , ifdef. |
|
3577 |
archClassNames do:[:clsName | |
|
3578 |
putLineForClassName value:clsName |
|
3579 |
]. |
|
3580 |
s nextPutLine:'#endif /* ' , ifdef , ' */'. |
|
3581 |
]. |
|
3582 |
]. |
|
3583 |
] |
|
3584 |
] |
|
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3585 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3586 |
" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3587 |
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
|
3588 |
bosch_dapasx_kernel generateClassLines_libInit_dot_cc |
10010 | 3589 |
stx_libbasic3 generateClassLines_libInit_dot_cc |
3590 |
" |
|
3591 |
||
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3592 |
"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
|
3593 |
"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
|
3594 |
"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
|
3595 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3596 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3597 |
generateClassLines_libInit_dot_cc |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3598 |
^ 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
|
3599 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3600 |
" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3601 |
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
|
3602 |
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
|
3603 |
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
|
3604 |
" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3605 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3606 |
"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
|
3607 |
"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
|
3608 |
"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
|
3609 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
3610 |
|
13419 | 3611 |
generateClasses_make_dot_spec |
12545 | 3612 |
|classNamesDict| |
3613 |
||
3614 |
classNamesDict := self classNamesByCategory. |
|
3615 |
||
3616 |
^ String streamContents:[:s | |
|
13419 | 3617 |
classNamesDict keysAndValuesDo:[:eachCategory :classNames| |
3618 |
s nextPutLine:eachCategory,'_CLASSES= \'. |
|
3619 |
classNames do:[:eachClassName| |
|
3620 |
s tab; nextPutAll:eachClassName; nextPutLine:' \'. |
|
3621 |
]. |
|
3622 |
s cr. |
|
3623 |
]. |
|
3624 |
s cr. |
|
12545 | 3625 |
]. |
3626 |
||
3627 |
" |
|
3628 |
stx_libbasic generateClasses_make_dot_spec |
|
3629 |
stx_libbasic3 generateClasses_make_dot_spec |
|
3630 |
stx_libview generateClasses_make_dot_spec |
|
3631 |
stx_libboss generateClasses_make_dot_spec |
|
3632 |
" |
|
3633 |
||
3634 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
3635 |
"Modified: / 20-10-2006 / 16:18:54 / cg" |
|
3636 |
! |
|
3637 |
||
13419 | 3638 |
generateDependencies:whichArchitecture |
3639 |
^ String |
|
3640 |
streamContents:[:s | |
|
3641 |
|classNames classesPresent classesLoaded clsBaseName putDependencyForClassBlock |
|
3642 |
putDependencyForClassBaseNameBlock |
|
3643 |
archClassNames archClassesPresent archClassesLoaded |
|
3644 |
putSingleClassDependencyEntryBlock putDependencyForExtensionsBlock| |
|
3645 |
||
3646 |
putSingleClassDependencyEntryBlock := [:cls | |
|
3647 |
|sclsBaseName| |
|
3648 |
||
3649 |
s nextPutAll:' $(INCLUDE_TOP)'. |
|
3650 |
s nextPutAll:(self pathSeparator:whichArchitecture) asString. |
|
3651 |
sclsBaseName := self filenameForClass:cls. |
|
3652 |
s nextPutAll:(self |
|
3653 |
topRelativePathTo:sclsBaseName |
|
3654 |
inPackage:cls package |
|
3655 |
architecture:whichArchitecture). |
|
3656 |
s nextPutAll:'.$(H)'. |
|
3657 |
]. |
|
3658 |
||
3659 |
putDependencyForClassBaseNameBlock := [:clsBaseName | |
|
3660 |
s nextPutAll:'$(OUTDIR)'. |
|
3661 |
s nextPutAll:clsBaseName. |
|
3662 |
s nextPutAll:'.$(O)'. |
|
3663 |
s nextPutAll:' '. |
|
3664 |
s nextPutAll:clsBaseName. |
|
3665 |
s nextPutAll:'.$(H)'. |
|
3666 |
s nextPutAll:': '. |
|
3667 |
s nextPutAll:clsBaseName. |
|
3668 |
s nextPutAll:'.st'. |
|
3669 |
]. |
|
3670 |
||
3671 |
||
3672 |
putDependencyForClassBlock := [:cls | |
|
3673 |
|clsBaseName already| |
|
3674 |
||
3675 |
clsBaseName := self filenameForClass:cls. |
|
3676 |
putDependencyForClassBaseNameBlock value:clsBaseName. |
|
3677 |
cls isLoaded ifTrue:[ |
|
3678 |
already := IdentitySet new. |
|
3679 |
cls |
|
3680 |
allSuperclassesDo:[:scls | |
|
3681 |
putSingleClassDependencyEntryBlock value:scls. |
|
3682 |
already add:scls. |
|
3683 |
]. |
|
3684 |
cls |
|
3685 |
allPrivateClassesDo:[:eachPrivateClass | |
|
3686 |
eachPrivateClass |
|
3687 |
allSuperclassesDo:[:scls | |
|
3688 |
|sclsBaseName| |
|
3689 |
||
3690 |
scls ~~ cls ifTrue:[ |
|
3691 |
scls isPrivate ifFalse:[ |
|
3692 |
(already includes:scls) ifFalse:[ |
|
3693 |
putSingleClassDependencyEntryBlock value:scls. |
|
3694 |
already add:scls. |
|
3695 |
]. |
|
3696 |
]. |
|
3697 |
]. |
|
3698 |
] |
|
3699 |
]. |
|
3700 |
]. |
|
3701 |
s nextPutLine:' $(STCHDR)'. |
|
3702 |
]. |
|
3703 |
||
3704 |
putDependencyForExtensionsBlock := [ |
|
3705 |
|already| |
|
3706 |
||
3707 |
s nextPutAll:'$(OUTDIR)extensions.$(O): extensions.st'. |
|
3708 |
already := Set new. |
|
3709 |
self extensionMethodNames pairWiseDo:[:className :selector | |
|
3710 |
|mthdCls cls| |
|
3711 |
||
3712 |
((mthdCls := Smalltalk classNamed:className) notNil |
|
3713 |
and:[ mthdCls isLoaded ]) |
|
3714 |
ifTrue:[ |
|
3715 |
cls := mthdCls theNonMetaclass. |
|
3716 |
(already includes:cls) ifFalse:[ |
|
3717 |
cls |
|
3718 |
withAllSuperclassesDo:[:scls | |
|
3719 |
(already includes:scls) ifFalse:[ |
|
3720 |
putSingleClassDependencyEntryBlock value:scls. |
|
3721 |
already add:scls. |
|
3722 |
]. |
|
3723 |
]. |
|
3724 |
]. |
|
3725 |
]. |
|
3726 |
]. |
|
3727 |
s nextPutLine:' $(STCHDR)'. |
|
3728 |
]. |
|
3729 |
||
3730 |
classNames := self compiled_classNames_common. |
|
3731 |
classesPresent := classNames |
|
3732 |
collect:[:className | Smalltalk classNamed:className] |
|
3733 |
thenSelect:[:cls | cls notNil]. |
|
3734 |
classesLoaded := classesPresent |
|
3735 |
select:[:cls | cls isLoaded]. |
|
3736 |
||
3737 |
(Class classesSortedByLoadOrder:classesLoaded) |
|
3738 |
do:putDependencyForClassBlock. |
|
3739 |
(classesPresent select:[:cls | cls isLoaded not]) |
|
3740 |
do:putDependencyForClassBlock. |
|
3741 |
||
3742 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) |
|
3743 |
do:[:className :attr | |
|
3744 |
|cls| |
|
3745 |
||
3746 |
(attr isEmptyOrNil or:[ (attr includes:#autoload) not ]) ifTrue:[ |
|
3747 |
((cls := Smalltalk classNamed:className) notNil) ifTrue:[ |
|
3748 |
putDependencyForClassBlock value:cls. |
|
3749 |
] |
|
3750 |
]. |
|
3751 |
]. |
|
3752 |
archClassNames := self compiled_classNamesForPlatform:whichArchitecture. |
|
3753 |
archClassesPresent := archClassNames |
|
3754 |
collect:[:className | Smalltalk classNamed:className] |
|
3755 |
thenSelect:[:cls | cls notNil]. |
|
3756 |
||
3757 |
archClassesLoaded := archClassesPresent |
|
3758 |
select:[:cls | cls isLoaded]. |
|
3759 |
||
3760 |
(Class classesSortedByLoadOrder:archClassesLoaded) |
|
3761 |
do:putDependencyForClassBlock. |
|
3762 |
||
3763 |
"some classes are not loaded - probably this is the wrong architecture. |
|
3764 |
Sorry, but for these classes, we do not know the superclass chain" |
|
3765 |
archClassesPresent |
|
3766 |
select:[:cls | cls isLoaded not] |
|
3767 |
thenDo:putDependencyForClassBlock. |
|
3768 |
||
3769 |
"for the following classes, we do not know the superclass chain |
|
3770 |
and neither the real class file name" |
|
3771 |
archClassNames |
|
3772 |
select:[:eachClassName | (Smalltalk classNamed:eachClassName) isNil] |
|
3773 |
thenDo:[:eachClassName | |
|
3774 |
putDependencyForClassBaseNameBlock value:(self filenameForClass:eachClassName). |
|
3775 |
s nextPutLine:' $(STCHDR)'. |
|
3776 |
]. |
|
3777 |
||
3778 |
self hasExtensionMethods ifTrue:putDependencyForExtensionsBlock. |
|
3779 |
] |
|
9887 | 3780 |
|
3781 |
" |
|
3782 |
stx_libbasic3 generateDependencies:#unix |
|
10010 | 3783 |
stx_libbasic3 generateDependencies:#win32 |
3784 |
" |
|
3785 |
||
9887 | 3786 |
"Created: / 14-09-2006 / 12:38:57 / cg" |
10144 | 3787 |
"Modified: / 25-10-2006 / 16:01:13 / cg" |
9887 | 3788 |
! |
3789 |
||
3790 |
generateDependencies_unix |
|
3791 |
^ self generateDependencies:#unix |
|
3792 |
||
3793 |
" |
|
3794 |
stx_libbasic3 generateDependencies:#unix |
|
3795 |
stx_libbasic3 generateDependencies:#win32 |
|
3796 |
" |
|
3797 |
||
3798 |
"Modified: / 14-09-2006 / 13:32:34 / cg" |
|
3799 |
! |
|
3800 |
||
3801 |
generateDependencies_win32 |
|
3802 |
^ self generateDependencies:#win32 |
|
3803 |
||
3804 |
"Created: / 14-09-2006 / 12:39:18 / cg" |
|
3805 |
! |
|
3806 |
||
9956 | 3807 |
generateLocalIncludes_unix |
3808 |
^ String streamContents:[:s | |
|
13419 | 3809 |
s nextPutAll:(self localIncludes_unix). |
3810 |
self searchForProjectsWhichProvideHeaderFiles |
|
3811 |
do:[:includeProject | |
|
3812 |
s nextPutAll:' -I$(INCLUDE_TOP)/',(self topRelativePathToPackage_unix: includeProject) |
|
3813 |
] |
|
9956 | 3814 |
] |
3815 |
||
3816 |
" |
|
3817 |
bosch_dapasx generateLocalIncludes_unix |
|
13419 | 3818 |
bosch_dapasx_datenbasis generateLocalIncludes_unix |
3819 |
stx_libbasic generateLocalIncludes_unix |
|
3820 |
stx_libview generateLocalIncludes_unix |
|
3821 |
stx_libtool2 generateLocalIncludes_unix |
|
3822 |
stx_libui generateLocalIncludes_unix |
|
9956 | 3823 |
" |
3824 |
||
3825 |
"Created: / 09-08-2006 / 16:46:49 / fm" |
|
10251 | 3826 |
"Modified: / 07-12-2006 / 17:47:06 / cg" |
9956 | 3827 |
! |
3828 |
||
9887 | 3829 |
generateLocalIncludes_win32 |
3830 |
^ String streamContents:[:s | |
|
13419 | 3831 |
s nextPutAll:(self localIncludes_win32). |
3832 |
self searchForProjectsWhichProvideHeaderFiles |
|
3833 |
do:[:includeProject | |
|
3834 |
s nextPutAll:' -I$(INCLUDE_TOP)\',(self topRelativePathToPackage_win32: includeProject) |
|
3835 |
] |
|
9887 | 3836 |
] |
3837 |
||
3838 |
" |
|
3839 |
bosch_dapasx_application generateLocalIncludes_win32 |
|
13419 | 3840 |
bosch_dapasx_datenbasis generateLocalIncludes_win32 |
3841 |
stx_libbasic generateLocalIncludes_win32 |
|
3842 |
stx_libview generateLocalIncludes_win32 |
|
3843 |
stx_libtool2 generateLocalIncludes_win32 |
|
9887 | 3844 |
" |
3845 |
||
3846 |
"Created: / 09-08-2006 / 16:46:49 / fm" |
|
10251 | 3847 |
"Modified: / 07-12-2006 / 17:47:10 / cg" |
9887 | 3848 |
! |
3849 |
||
13419 | 3850 |
generateObjects_make_dot_spec |
12545 | 3851 |
|classNamesDict| |
3852 |
||
3853 |
classNamesDict := self classNamesByCategory. |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
3854 |
|
9817 | 3855 |
^ String streamContents:[:s | |
13419 | 3856 |
|putLineForClassName| |
3857 |
||
3858 |
putLineForClassName := |
|
3859 |
[:eachClassName | |
|
3860 |
|mappings newObjectLine| |
|
3861 |
mappings := self objectLine_make_dot_spec_mappings: eachClassName. |
|
3862 |
newObjectLine := self replaceMappings: mappings in: self objectLine_make_dot_spec. |
|
3863 |
s nextPutLine:newObjectLine. |
|
3864 |
]. |
|
3865 |
||
3866 |
classNamesDict keysAndValuesDo:[:eachCategory :classNames| |
|
3867 |
s nextPutLine:eachCategory,'_OBJS= \'. |
|
3868 |
classNames do:putLineForClassName. |
|
3869 |
(eachCategory = 'COMMON' and:[self hasExtensionMethods]) ifTrue:[ |
|
3870 |
s nextPutLine:' $(OUTDIR)extensions.$(O) \'. |
|
3871 |
]. |
|
3872 |
||
3873 |
s cr. |
|
3874 |
]. |
|
3875 |
s cr. |
|
12545 | 3876 |
]. |
9817 | 3877 |
|
3878 |
" |
|
12545 | 3879 |
stx_libbasic generateObjects_make_dot_spec |
9817 | 3880 |
stx_libbasic3 generateObjects_make_dot_spec |
12545 | 3881 |
stx_libview generateObjects_make_dot_spec |
3882 |
stx_libboss generateObjects_make_dot_spec |
|
9817 | 3883 |
" |
3884 |
||
3885 |
"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
|
3886 |
"Modified: / 20-10-2006 / 16:18:54 / cg" |
9887 | 3887 |
! |
3888 |
||
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3889 |
generateRequiredMakePrerequisites_bc_dot_mak |
11380
ac50ce4321b5
Fix prerequisite makes (pushd)
Stefan Vogel <sv@exept.de>
parents:
11377
diff
changeset
|
3890 |
|myProjectId| |
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3891 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3892 |
^ String streamContents:[:s | |
13419 | 3893 |
myProjectId := self package. |
3894 |
"Note: the trailing blank in 'CFLAGS_LOCAL=$(GLOBALDEFINES) ' |
|
3895 |
is required!! |
|
3896 |
Use 'pushd' instead of 'cd', since cd is executed by borland make directly. |
|
3897 |
'popd' is not needed, since each line is executed in |
|
3898 |
an own cmd.exe process. |
|
3899 |
'popd' is not desireable, since it masks a possible |
|
3900 |
error return from the 'bmake'. |
|
11380
ac50ce4321b5
Fix prerequisite makes (pushd)
Stefan Vogel <sv@exept.de>
parents:
11377
diff
changeset
|
3901 |
" |
13419 | 3902 |
(self allPreRequisitesSorted copyWith:'stx:librun') do:[:eachProjectId | |
3903 |
s tab; nextPutAll:'pushd '; |
|
3904 |
nextPutAll:(self msdosPathToPackage:eachProjectId from:myProjectId); |
|
3905 |
nextPutLine:' & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "'. |
|
3906 |
]. |
|
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3907 |
]. |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3908 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3909 |
" |
13419 | 3910 |
exept_expecco_application generateRequiredMakePrerequisites_bc_dot_mak |
3911 |
alspa_batch_application generateRequiredMakePrerequisites_bc_dot_mak |
|
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3912 |
" |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3913 |
! |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3914 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3915 |
generateRequiredMakePrerequisites_make_dot_proto |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3916 |
|libPath| |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3917 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3918 |
^ String streamContents:[:s | |
13419 | 3919 |
(self allPreRequisitesSorted copyWith:'stx:librun') do:[:projectID | |
3920 |
libPath := self pathToPackage_unix:projectID. |
|
3921 |
s tab; nextPutAll: 'cd ', libPath; nextPutLine:' && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"'. |
|
3922 |
]. |
|
3923 |
||
3924 |
s cr. |
|
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3925 |
]. |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3926 |
|
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3927 |
" |
13419 | 3928 |
exept_expecco_application generateRequiredMakePrerequisites_make_dot_proto |
3929 |
alspa_batch_application generateRequiredMakePrerequisites_make_dot_proto |
|
11157
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3930 |
" |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3931 |
! |
5bef68f784c7
prereq rule also for libraries
Claus Gittinger <cg@exept.de>
parents:
11152
diff
changeset
|
3932 |
|
10022 | 3933 |
generateSubDirectories |
3934 |
^ String streamContents:[:s | |
|
13419 | 3935 |
self subProjects |
3936 |
do:[:eachProjectID | |
|
3937 |
s space; nextPutAll:(self unixPathToPackage:eachProjectID from:self package) |
|
3938 |
] |
|
10022 | 3939 |
] |
3940 |
||
3941 |
" |
|
10380
ff1cfee6130b
Fix subproject incluseion in Make.proto
Stefan Vogel <sv@exept.de>
parents:
10369
diff
changeset
|
3942 |
exept_expecco generateSubDirectories |
10022 | 3943 |
" |
3944 |
||
3945 |
"Created: / 09-08-2006 / 11:26:59 / fm" |
|
3946 |
"Modified: / 14-09-2006 / 18:46:18 / cg" |
|
3947 |
! |
|
3948 |
||
12771
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
3949 |
generate_definitionClassLine_libInit_dot_cc |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
3950 |
"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
|
3951 |
|
13419 | 3952 |
^ self |
3953 |
generateClassLines:(self classLine_libInit_dot_cc) |
|
3954 |
forClasses:(Array with:self name) |
|
3955 |
includeAdditionalClasses:false |
|
12804
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
3956 |
|
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
3957 |
" |
079b692e0776
added: #generateClassLines:forClasses:includeAdditionalClasses:
sr
parents:
12771
diff
changeset
|
3958 |
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
|
3959 |
" |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
3960 |
! |
878fc210c8e7
add an extra entry to the libInit.cc code:
Claus Gittinger <cg@exept.de>
parents:
12749
diff
changeset
|
3961 |
|
10022 | 3962 |
headerFileOutputArg |
3963 |
"/ "all stx stuff goes to the common include directory. |
|
3964 |
"/ Everything else is left locally" |
|
3965 |
"/ |
|
3966 |
"/ ( |
|
3967 |
"/ #( |
|
13419 | 3968 |
"/ 'stx:libbasic' 'stx:libview' 'stx:libtool' |
10022 | 3969 |
"/ 'stx:libbasic2' 'stx:libview2' 'stx:libtool2' |
3970 |
"/ 'stx:libbasic3' 'stx:libwidg' 'stx:libhtml' |
|
3971 |
"/ 'stx:libcomp' 'stx:libwidg2' 'stx:libui' |
|
3972 |
"/ 'stx:libboss' 'stx:libdb' |
|
3973 |
"/ ) |
|
3974 |
"/ includes:self package) ifTrue:[ |
|
3975 |
"/ ^ '-H$(INCLUDE)' |
|
3976 |
"/ ]. |
|
3977 |
^ '-H.' |
|
3978 |
||
3979 |
"Created: / 18-08-2006 / 13:01:52 / cg" |
|
3980 |
"Modified: / 14-09-2006 / 15:38:25 / cg" |
|
3981 |
! |
|
3982 |
||
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3983 |
objectLine_make_dot_spec_mappings: aClassName |
13419 | 3984 |
^ Dictionary new |
3985 |
at: 'CLASSFILE' put:(self filenameForClass:aClassName); |
|
3986 |
yourself |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3987 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3988 |
"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
|
3989 |
"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
|
3990 |
"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
|
3991 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
3992 |
|
9887 | 3993 |
subProjectBmakeCalls |
12439 | 3994 |
"generate submake-calls for borland bcc" |
3995 |
||
13419 | 3996 |
^ self subProjectMakeCallsUsing:'call bmake %1 %2'. |
12438
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3997 |
! |
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3998 |
|
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3999 |
subProjectLCmakeCalls |
12439 | 4000 |
"generate submake-calls for lc" |
4001 |
||
13419 | 4002 |
^ self subProjectMakeCallsUsing:'call lcmake %1 %2'. |
12438
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
4003 |
! |
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
4004 |
|
26bbeae51816
added: #subProjectMakeCallsUsing:
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
4005 |
subProjectMakeCallsUsing:callString |
9887 | 4006 |
^ String streamContents:[:s | |
13419 | 4007 |
self subProjects do:[:packageID | |
4008 |
s nextPutLine:'@echo "***********************************"'. |
|
4009 |
s nextPutLine:'@echo "Buildung ',(packageID copyReplaceAll:$: with:$/). |
|
4010 |
s nextPutLine:'@echo "***********************************"'. |
|
4011 |
s nextPutLine:'cd ', (self msdosPathToPackage:packageID from:(self package)). |
|
4012 |
s nextPutLine:callString. |
|
4013 |
s nextPutLine:'cd ', (self msdosPathToPackage:(self package) from:packageID). |
|
4014 |
s cr. |
|
4015 |
] |
|
9887 | 4016 |
] |
4017 |
||
4018 |
"Created: / 14-09-2006 / 18:40:09 / cg" |
|
9888 | 4019 |
"Modified: / 14-09-2006 / 19:46:57 / cg" |
11937 | 4020 |
! |
4021 |
||
4022 |
subProjectVCmakeCalls |
|
12439 | 4023 |
"generate submake-calls for visual-C" |
4024 |
||
13419 | 4025 |
^ self subProjectMakeCallsUsing:'call vcmake %1 %2'. |
9817 | 4026 |
! ! |
4027 |
||
12364 | 4028 |
!ProjectDefinition class methodsFor:'file templates'! |
4029 |
||
13177 | 4030 |
autopackage_default_dot_apspec |
4031 |
"for linux's autopackage" |
|
4032 |
||
4033 |
^ |
|
4034 |
'# -*- shell-script -*- |
|
4035 |
[Meta] |
|
4036 |
ShortName: %(APPLICATION) |
|
4037 |
SoftwareVersion: %(PRODUCT_VERSION) |
|
4038 |
DisplayName: %(DESCRIPTION) |
|
4039 |
RootName: @exept.de/expecco:$SOFTWAREVERSION |
|
4040 |
Summary: %(DESCRIPTION) |
|
4041 |
Maintainer: %(MAINTAINER) |
|
4042 |
Packager: %(PACKAGER) |
|
4043 |
PackageVersion: 1 |
|
4044 |
CPUArchitectures: x86 |
|
4045 |
AutopackageTarget: 1.0 |
|
4046 |
Type: %(PRODUCT_TYPE) |
|
13419 | 4047 |
License: %(PRODUCT_LICENSE) |
13177 | 4048 |
|
4049 |
[Description] |
|
4050 |
%(PRODUCT_DESCRIPTION) |
|
4051 |
||
4052 |
[BuildPrepare] |
|
4053 |
# If you''re using autotools, the default should be enough. |
|
4054 |
# prepareBuild will set up apbuild and run configure for you. If you |
|
4055 |
# need to pass arguments to configure, just add them to prepareBuild: |
|
4056 |
# prepareBuild --enable-foo --disable-bar |
|
4057 |
#prepareBuild |
|
4058 |
||
4059 |
[BuildUnprepare] |
|
4060 |
# If you''re using prepareBuild above, there is no need to change this!! |
|
4061 |
#unprepareBuild |
|
4062 |
||
4063 |
[Globals] |
|
4064 |
# Variables declared in this section will be available in all other sections |
|
4065 |
export APKG_BUILD_SKIP_CONFIGURE=1 |
|
4066 |
export APKG_BUILD_SKIP_MAKE=1 |
|
4067 |
export MYPREFIX=/opt/%(APPLICATION) |
|
4068 |
||
4069 |
[Prepare] |
|
4070 |
#recommend ''@autopackage.org/autopackage-gtk'' 1 |
|
4071 |
||
4072 |
[Imports] |
|
4073 |
import <<EOF |
|
4074 |
$source_dir/%(APPLICATION) |
|
4075 |
$source_dir/resources |
|
4076 |
$source_dir/keyboard.rc |
|
4077 |
$source_dir/display.rc |
|
4078 |
$source_dir/../doc |
|
4079 |
$source_dir/../testsuites/webedition |
|
4080 |
$source_dir/../projects/libraries |
|
4081 |
$source_dir/../reportGenerator/tools |
|
4082 |
$source_dir/../../pdf/afm |
|
4083 |
$source_dir/../plugin/selenium/libexept_expecco_plugin_selenium.so |
|
4084 |
$source_dir/../externalTools |
|
4085 |
EOF |
|
4086 |
||
4087 |
for i in $source_dir/*.so |
|
4088 |
do |
|
4089 |
echo $source_dir/$(readlink $i) |
|
4090 |
done | import |
|
4091 |
||
4092 |
[Install] |
|
4093 |
if [ "$PREFIX" !!= "/usr" ] |
|
4094 |
then |
|
4095 |
export MYPREFIX=$PREFIX |
|
4096 |
fi |
|
4097 |
||
4098 |
find . -type d \( -name CVS -or -name ''not_*'' \) -print | xargs rm -rf |
|
4099 |
mkdir -p $MYPREFIX |
|
4100 |
copyFiles expecco *.rc resources $MYPREFIX/bin |
|
4101 |
copyFiles *.so $MYPREFIX/lib |
|
4102 |
copyFiles doc externalTools $MYPREFIX/packages/exept/expecco |
|
4103 |
copyFiles webedition/projects libraries $MYPREFIX/testsuites |
|
4104 |
copyFiles tools $MYPREFIX/packages/exept/expecco/reportGenerator |
|
4105 |
copyFiles afm $MYPREFIX/packages/exept/pdf |
|
4106 |
copyFiles libexept_expecco_plugin_selenium.so $MYPREFIX/plugin |
|
4107 |
||
4108 |
#installExe expecco |
|
4109 |
#installLib *.so |
|
4110 |
#installData resources |
|
4111 |
#installData keyboard.rc |
|
4112 |
#installData doc |
|
4113 |
||
4114 |
[Uninstall] |
|
4115 |
# Leaving this at the default is safe unless you use custom commands in |
|
4116 |
# "Install" to create files. All autopackage API functions |
|
4117 |
# that installs files are logged. |
|
4118 |
uninstallFromLog |
|
4119 |
' |
|
4120 |
||
4121 |
"Created: / 21-12-2010 / 09:06:21 / cg" |
|
4122 |
! |
|
4123 |
||
12364 | 4124 |
bc_dot_mak |
4125 |
"answer a template for the bc.mak makefile. |
|
4126 |
Any variable definition %(Variable) will be later replaced by the mapping. |
|
4127 |
$% characters have to be duplicated. |
|
4128 |
Only needed for WIN" |
|
4129 |
||
4130 |
^ self subclassResponsibility |
|
4131 |
! |
|
4132 |
||
4133 |
bmake_dot_mak |
|
4134 |
"the template code for the bmake.bat file" |
|
4135 |
||
13419 | 4136 |
^ |
12364 | 4137 |
'@REM ------- |
4138 |
@REM make using borland bcc |
|
4139 |
@REM type bmake, and wait... |
|
4140 |
@REM do not edit - automatically generated from ProjectDefinition |
|
4141 |
@REM ------- |
|
4142 |
make.exe -N -f bc.mak %%1 %%2 |
|
4143 |
||
4144 |
%(SUBPROJECT_BMAKE_CALLS) |
|
4145 |
' |
|
4146 |
||
4147 |
"Created: / 17-08-2006 / 20:04:14 / cg" |
|
4148 |
"Modified: / 14-09-2006 / 19:46:40 / cg" |
|
4149 |
! |
|
4150 |
||
13411 | 4151 |
builder_baseline_dot_rbspec |
4152 |
"For rake-base automatic builder" |
|
13419 | 4153 |
|
13411 | 4154 |
^ ' |
4155 |
# generated from project definition |
|
4156 |
||
4157 |
# load package dependencies |
|
4158 |
load ''package.deps.rake'' |
|
4159 |
||
4160 |
# kludge: clear some invalid dependencies of libwidg |
|
4161 |
# (should be fixed in baseline) |
|
4162 |
clear "stx:libwidg" => "stx:libui" |
|
4163 |
clear "stx:libwidg2" => "stx:libui" |
|
4164 |
||
4165 |
project :''%(APPLICATION):baseline'' do |
|
4166 |
# preamble |
|
4167 |
%(PREAMBLE) |
|
4168 |
# -------- |
|
4169 |
||
4170 |
%(PACKAGES) |
|
4171 |
||
4172 |
application "%(APPLICATION_PACKAGE)" |
|
4173 |
||
4174 |
# postamble |
|
4175 |
%(POSTABLE) |
|
4176 |
# --------- |
|
4177 |
||
4178 |
end |
|
4179 |
' |
|
4180 |
||
4181 |
"Created: / 24-02-2011 / 11:39:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4182 |
"Modified: / 27-02-2011 / 12:42:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4183 |
! |
|
4184 |
||
4185 |
builder_baseline_dot_rbspec_postamble |
|
4186 |
^ '' |
|
4187 |
||
4188 |
"Created: / 24-02-2011 / 11:58:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4189 |
! |
|
4190 |
||
4191 |
builder_baseline_dot_rbspec_preamble |
|
4192 |
^ '' |
|
4193 |
||
4194 |
"Created: / 24-02-2011 / 11:58:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4195 |
! |
|
4196 |
||
12364 | 4197 |
classLine_libInit_dot_cc |
4198 |
||
4199 |
^'_%(CLASS)_Init(pass,__pRT__,snd);' |
|
4200 |
||
4201 |
"Created: / 08-08-2006 / 12:51:44 / fm" |
|
4202 |
"Modified: / 08-08-2006 / 15:46:05 / fm" |
|
4203 |
! |
|
4204 |
||
4205 |
lcmake_dot_mak |
|
4206 |
"the template code for the lcmake.bat file" |
|
4207 |
||
13419 | 4208 |
^ |
12364 | 4209 |
'@REM ------- |
4210 |
@REM make using lcc compiler |
|
4211 |
@REM type lcmake, and wait... |
|
4212 |
@REM do not edit - automatically generated from ProjectDefinition |
|
4213 |
@REM ------- |
|
4214 |
make.exe -N -f bc.mak USELCC=1 %%1 %%2 |
|
4215 |
||
4216 |
%(SUBPROJECT_LCCMAKE_CALLS) |
|
4217 |
' |
|
4218 |
! |
|
4219 |
||
4220 |
make_dot_proto |
|
4221 |
"the template code for the make.proto file" |
|
4222 |
||
4223 |
^ self subclassResponsibility |
|
4224 |
! |
|
4225 |
||
4226 |
make_dot_spec |
|
4227 |
||
13419 | 4228 |
^ |
12364 | 4229 |
'# $','Header','$ |
4230 |
# |
|
13419 | 4231 |
# DO NOT EDIT |
12364 | 4232 |
# automagically generated from the projectDefinition: ',self name,'. |
4233 |
# |
|
4234 |
# Warning: once you modify this file, do not rerun |
|
4235 |
# stmkmp or projectDefinition-build again - otherwise, your changes are lost. |
|
4236 |
# |
|
4237 |
# This file contains specifications which are common to all platforms. |
|
4238 |
# |
|
4239 |
||
4240 |
# Do NOT CHANGE THESE DEFINITIONS |
|
4241 |
# (otherwise, ST/X will have a hard time to find out the packages location from its packageID, |
|
4242 |
# to find the source code of a class and to find the library for a package) |
|
4243 |
MODULE=%(MODULE) |
|
4244 |
MODULE_DIR=%(MODULE_DIRECTORY) |
|
4245 |
PACKAGE=$(MODULE):$(MODULE_DIR) |
|
4246 |
||
4247 |
||
4248 |
# Argument(s) to the stc compiler (stc --usage). |
|
4249 |
# -H. : create header files locally |
|
4250 |
# (if removed, they will be created as common |
|
4251 |
# -Pxxx : defines the package |
|
4252 |
# -Zxxx : a prefix for variables within the classLib |
|
4253 |
# -Dxxx : defines passed to to CC for inline C-code |
|
4254 |
# -Ixxx : include path passed to CC for inline C-code |
|
4255 |
# +optspace : optimized for space |
|
4256 |
# +optspace2 : optimized more for space |
|
4257 |
# +optspace3 : optimized even more for space |
|
4258 |
# +optinline : generate inline code for some ST constructs |
|
4259 |
# +inlineNew : additionally inline new |
|
4260 |
# +inlineMath : additionally inline some floatPnt math stuff |
|
4261 |
# |
|
4262 |
# ********** OPTIONAL: MODIFY the next line(s) *** |
|
4263 |
# STCLOCALOPTIMIZATIONS=+optinline +inlineNew |
|
4264 |
# STCLOCALOPTIMIZATIONS=+optspace3 |
|
4265 |
STCLOCALOPTIMIZATIONS=%(STCOPTIMIZATIONOPTIONS) |
|
4266 |
||
4267 |
||
4268 |
# Argument(s) to the stc compiler (stc --usage). |
|
4269 |
# -warn : no warnings |
|
4270 |
# -warnNonStandard : no warnings about ST/X extensions |
|
4271 |
# -warnEOLComments : no warnings about EOL comment extension |
|
4272 |
# -warnPrivacy : no warnings about privateClass extension |
|
4273 |
# |
|
4274 |
# ********** OPTIONAL: MODIFY the next line(s) *** |
|
4275 |
# STCWARNINGS=-warn |
|
4276 |
# STCWARNINGS=-warnNonStandard |
|
4277 |
# STCWARNINGS=-warnEOLComments |
|
4278 |
STCWARNINGS=%(STCWARNINGOPTIONS) |
|
4279 |
||
12545 | 4280 |
%(CLASSES) |
4281 |
||
12364 | 4282 |
%(OBJECTS) |
4283 |
' |
|
4284 |
||
4285 |
"Created: / 08-08-2006 / 19:31:29 / fm" |
|
4286 |
"Modified: / 09-08-2006 / 15:10:57 / fm" |
|
4287 |
"Modified: / 30-08-2006 / 19:07:26 / cg" |
|
4288 |
! |
|
4289 |
||
12428 | 4290 |
makefile |
13419 | 4291 |
^ |
12428 | 4292 |
'# |
13419 | 4293 |
# DO NOT EDIT |
12428 | 4294 |
# |
13419 | 4295 |
# make uses this file (Makefile) only, if there is no |
12428 | 4296 |
# file named "makefile" (lower-case m) in the same directory. |
4297 |
# My only task is to generate the real makefile and call make again. |
|
4298 |
# Thereafter, I am no longer used and needed. |
|
4299 |
# |
|
4300 |
||
4301 |
.PHONY: run |
|
4302 |
||
4303 |
run: makefile |
|
13419 | 4304 |
$(MAKE) -f makefile |
12428 | 4305 |
|
4306 |
#only needed for the definition of $(TOP) |
|
4307 |
include Make.proto |
|
4308 |
||
4309 |
makefile: |
|
13419 | 4310 |
$(TOP)/rules/stmkmf |
12428 | 4311 |
' |
4312 |
! |
|
4313 |
||
12364 | 4314 |
objectLine_make_dot_spec |
4315 |
||
4316 |
^' $(OUTDIR)%(CLASSFILE).$(O) \' |
|
4317 |
||
4318 |
"Created: / 08-08-2006 / 20:16:46 / fm" |
|
4319 |
"Modified: / 23-08-2006 / 11:11:38 / cg" |
|
4320 |
! |
|
4321 |
||
4322 |
packageName_dot_rc |
|
4323 |
"the template code for the <libName>.rc file. |
|
4324 |
Only used for WIN" |
|
4325 |
||
13419 | 4326 |
^ |
12364 | 4327 |
'// |
13419 | 4328 |
// DO NOT EDIT |
12364 | 4329 |
// automagically generated from the projectDefinition: ',self name,'. |
4330 |
// |
|
4331 |
VS_VERSION_INFO VERSIONINFO |
|
4332 |
FILEVERSION %(FILE_VERSION_COMMASEPARATED) |
|
4333 |
PRODUCTVERSION %(PRODUCT_VERSION_COMMASEPARATED) |
|
4334 |
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE |
|
4335 |
FILEFLAGS VS_FF_PRERELEASE | VS_FF_SPECIALBUILD |
|
4336 |
FILEOS VOS_NT_WINDOWS32 |
|
4337 |
FILETYPE %(FILETYPE) |
|
4338 |
FILESUBTYPE VS_USER_DEFINED |
|
4339 |
||
4340 |
BEGIN |
|
4341 |
BLOCK "StringFileInfo" |
|
4342 |
BEGIN |
|
4343 |
BLOCK "040904E4" |
|
4344 |
BEGIN |
|
4345 |
VALUE "CompanyName", "%(COMPANY_NAME)\0" |
|
4346 |
VALUE "FileDescription", "%(FILE_DESCRIPTION)\0" |
|
4347 |
VALUE "FileVersion", "%(FILE_VERSION)\0" |
|
4348 |
VALUE "InternalName", "%(INTERNAL_NAME)\0" |
|
4349 |
%(LEGAL_COPYRIGHT_LINE) |
|
4350 |
VALUE "ProductName", "%(PRODUCT_NAME)\0" |
|
4351 |
VALUE "ProductVersion", "%(PRODUCT_VERSION)\0" |
|
4352 |
VALUE "ProductDate", "%(PRODUCT_DATE)\0" |
|
4353 |
END |
|
4354 |
||
4355 |
END |
|
4356 |
||
4357 |
BLOCK "VarFileInfo" |
|
4358 |
BEGIN // Language | Translation |
|
4359 |
VALUE "Translation", 0x409, 0x4E4 // U.S. English, Windows Multilingual |
|
4360 |
END |
|
4361 |
END |
|
4362 |
' |
|
4363 |
" |
|
4364 |
stx_libbasic3 packageName_dot_rc |
|
4365 |
stx_libbasic3 generate_packageName_dot_rc |
|
4366 |
" |
|
4367 |
||
4368 |
"Created: / 08-08-2006 / 19:31:29 / fm" |
|
4369 |
"Modified: / 09-08-2006 / 15:10:57 / fm" |
|
4370 |
"Modified: / 23-08-2006 / 01:32:23 / cg" |
|
4371 |
! |
|
4372 |
||
13411 | 4373 |
package_dot_deps_dot_rake |
4374 |
^ ' |
|
4375 |
# Package dependencies. |
|
4376 |
# Automatically generated by project defintion. |
|
4377 |
||
4378 |
%(DEPENDENCIES) |
|
4379 |
||
4380 |
' |
|
4381 |
||
4382 |
"Created: / 24-02-2011 / 22:32:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4383 |
! |
|
4384 |
||
12364 | 4385 |
vcmake_dot_mak |
4386 |
"the template code for the vcmake.bat file" |
|
4387 |
||
13419 | 4388 |
^ |
12364 | 4389 |
'@REM ------- |
4390 |
@REM make using microsoft visual c |
|
4391 |
@REM type vcmake, and wait... |
|
4392 |
@REM do not edit - automatically generated from ProjectDefinition |
|
4393 |
@REM ------- |
|
12966 | 4394 |
make.exe -N -f bc.mak -DUSEVC %%1 %%2 |
12364 | 4395 |
|
4396 |
%(SUBPROJECT_VCMAKE_CALLS) |
|
4397 |
' |
|
12966 | 4398 |
|
4399 |
"Modified: / 26-07-2010 / 12:25:44 / cg" |
|
12364 | 4400 |
! ! |
4401 |
||
4402 |
!ProjectDefinition class methodsFor:'loading'! |
|
4403 |
||
12397 | 4404 |
ensureFullyLoaded |
4405 |
"ensure that all classes and extensions are loaded properly. |
|
4406 |
This is normally no problem for compiled classLibs - however, if a package |
|
4407 |
has only be installedAsAutoloaded, some classes might want to ensure that |
|
4408 |
when being loaded themself." |
|
4409 |
||
4410 |
self hasAllExtensionsLoaded ifFalse:[ |
|
13419 | 4411 |
self breakPoint:#cg. |
12397 | 4412 |
]. |
4413 |
self hasAllClassesFullyLoaded ifFalse:[ |
|
13419 | 4414 |
self hasAllClassesLoaded ifFalse:[ |
4415 |
self breakPoint:#cg. |
|
4416 |
]. |
|
4417 |
self classes do:[:cls | cls autoload ]. |
|
12397 | 4418 |
]. |
4419 |
||
4420 |
" |
|
4421 |
stx_libbasic ensureFullyLoaded |
|
4422 |
" |
|
12731 | 4423 |
"Verbose := true |
4424 |
stx_libjavascript hasAllExtensionsLoaded |
|
4425 |
" |
|
12735
215f7514f56b
comment/format in: #ensureFullyLoaded
Claus Gittinger <cg@exept.de>
parents:
12731
diff
changeset
|
4426 |
"Verbose := true |
215f7514f56b
comment/format in: #ensureFullyLoaded
Claus Gittinger <cg@exept.de>
parents:
12731
diff
changeset
|
4427 |
stx_goodies_soap_xe hasAllExtensionsLoaded |
215f7514f56b
comment/format in: #ensureFullyLoaded
Claus Gittinger <cg@exept.de>
parents:
12731
diff
changeset
|
4428 |
" |
12397 | 4429 |
! |
4430 |
||
12364 | 4431 |
load |
4432 |
"load the project |
|
13419 | 4433 |
Answer true, if new classes have been installed for this package, |
12364 | 4434 |
false if the package's classes have been already present." |
4435 |
||
4436 |
^ self loadAsAutoloaded:false. |
|
4437 |
! |
|
4438 |
||
4439 |
loadAsAutoloaded:asAutoloaded |
|
4440 |
"load the project. |
|
4441 |
If asAutoloaded == true, install all new classes as autoloaded. |
|
4442 |
Answer true, if new classes have been installed for this package, |
|
4443 |
false if the package's classes have been already present." |
|
4444 |
||
4445 |
|newStuffHasBeenLoaded meOrMySecondIncarnation| |
|
4446 |
||
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4447 |
self projectIsLoaded ifTrue:[ |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4448 |
asAutoloaded ifFalse:[ |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4449 |
"/ to be considered !! |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4450 |
"/ self isFullyLoaded ifFalse:[ |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4451 |
"/ self hasAllExtensionsLoaded ifFalse:[ |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4452 |
"/ self loadExtensions. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4453 |
"/ ]. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4454 |
"/ self loadAllAutoloadedClasses |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4455 |
"/ ]. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4456 |
]. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4457 |
^ false |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4458 |
]. |
12749 | 4459 |
thisContext isRecursive ifTrue:[self breakPoint:#cg. ^ false]. "/ avoid endless loops |
12364 | 4460 |
|
4461 |
newStuffHasBeenLoaded := false. |
|
4462 |
||
4463 |
(self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[ |
|
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4464 |
"/ thisContext fullPrintAll. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4465 |
Transcript showCR:('loading %1%2...' |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4466 |
bindWith:(asAutoloaded ifTrue:['as autoloaded '] ifFalse:['']) |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4467 |
with:self name). |
12364 | 4468 |
]. |
4469 |
||
4470 |
self rememberOverwrittenExtensionMethods. |
|
4471 |
||
4472 |
self activityNotification:'Executing pre-load action'. |
|
4473 |
self preLoadAction. |
|
4474 |
||
4475 |
meOrMySecondIncarnation := self. |
|
4476 |
||
4477 |
Class withoutUpdatingChangesDo:[ |
|
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4478 |
self activityNotification:'Loading prerequisities'. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4479 |
self loadPreRequisitesAsAutoloaded:asAutoloaded. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4480 |
|
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4481 |
self checkPrerequisitesForLoading. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4482 |
|
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4483 |
asAutoloaded ifFalse:[ |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4484 |
self loadClassLibrary. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4485 |
"/ could have overloaded my first incarnation |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4486 |
meOrMySecondIncarnation := (Smalltalk at:(self name)) ? self. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4487 |
meOrMySecondIncarnation ~~ self ifTrue:[ |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4488 |
meOrMySecondIncarnation fetchSlotsFrom:self. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4489 |
]. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4490 |
]. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4491 |
|
13623
46625f58d8ee
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13614
diff
changeset
|
4492 |
self hasAllExtensionsLoaded ifFalse:[ |
46625f58d8ee
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13614
diff
changeset
|
4493 |
self activityNotification:'Loading extensions'. |
46625f58d8ee
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13614
diff
changeset
|
4494 |
newStuffHasBeenLoaded := newStuffHasBeenLoaded | meOrMySecondIncarnation loadExtensions. |
46625f58d8ee
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13614
diff
changeset
|
4495 |
]. |
46625f58d8ee
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13614
diff
changeset
|
4496 |
self hasAllClassesLoaded ifFalse:[ |
46625f58d8ee
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13614
diff
changeset
|
4497 |
self activityNotification:'Loading classes'. |
46625f58d8ee
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13614
diff
changeset
|
4498 |
newStuffHasBeenLoaded := newStuffHasBeenLoaded | (meOrMySecondIncarnation loadAllClassesAsAutoloaded:asAutoloaded). |
46625f58d8ee
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13614
diff
changeset
|
4499 |
]. |
12743 | 4500 |
"/ no, don't load subProjects here - will lead to a recursion, which leads |
4501 |
"/ to some classes being loaded from source (soap) |
|
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4502 |
self activityNotification:'Loading sub projects'. |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4503 |
meOrMySecondIncarnation loadSubProjectsAsAutoloaded:asAutoloaded. |
12364 | 4504 |
]. |
13194
8e451f8ff654
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13178
diff
changeset
|
4505 |
self activityNotification:('Executing post-load action for %1' bindWith:self package). |
12372 | 4506 |
|
4507 |
"/ mhmh - already done for dll-loaded packages |
|
4508 |
"/ meOrMySecondIncarnation initializeAllClasses. |
|
12364 | 4509 |
meOrMySecondIncarnation postLoadAction. |
4510 |
||
4511 |
meOrMySecondIncarnation projectIsLoaded:true. |
|
12736
e18f8f352186
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
12735
diff
changeset
|
4512 |
meOrMySecondIncarnation ~~ self ifTrue:[ |
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
4513 |
self projectIsLoaded:true. |
12736
e18f8f352186
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
12735
diff
changeset
|
4514 |
]. |
12364 | 4515 |
|
13194
8e451f8ff654
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13178
diff
changeset
|
4516 |
self activityNotification:('Done (%1).' bindWith:self package). |
12364 | 4517 |
^ newStuffHasBeenLoaded |
4518 |
||
4519 |
"Created: / 17-08-2006 / 01:01:41 / cg" |
|
4520 |
"Modified: / 30-10-2008 / 08:16:21 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
4521 |
"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
|
4522 |
"Modified: / 04-09-2011 / 10:01:53 / cg" |
12364 | 4523 |
! |
4524 |
||
4525 |
unloadPackage |
|
4526 |
"unload the project. |
|
4527 |
Fails if there are still instances of any of my classes in the system" |
|
4528 |
||
4529 |
self projectIsLoaded ifFalse:[^ false]. |
|
4530 |
thisContext isRecursive ifTrue:[^ false]. |
|
4531 |
||
4532 |
(self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[ |
|
13419 | 4533 |
"/ thisContext fullPrintAll. |
4534 |
Transcript show:'unloading '; showCR:self name. |
|
12364 | 4535 |
]. |
4536 |
||
4537 |
self activityNotification:'Executing pre-unload action'. |
|
4538 |
self preUnloadAction. |
|
4539 |
||
4540 |
self activityNotification:'Restoring original methods'. |
|
4541 |
self restoreOverwrittenExtensionMethods. |
|
4542 |
||
4543 |
Class withoutUpdatingChangesDo:[ |
|
13419 | 4544 |
self activityNotification:'Unloading sunprojects'. |
4545 |
self unloadSubProjects. |
|
4546 |
||
4547 |
self activityNotification:'Unloading classes'. |
|
4548 |
self unloadClassLibrary. |
|
4549 |
self unloadAllClasses. |
|
12364 | 4550 |
]. |
4551 |
self projectIsLoaded:false. |
|
4552 |
^ true |
|
4553 |
! ! |
|
4554 |
||
12086 | 4555 |
!ProjectDefinition class methodsFor:'misc ui support'! |
4556 |
||
4557 |
iconInBrowserSymbol |
|
4558 |
<resource: #programImage> |
|
4559 |
||
4560 |
self theNonMetaclass isApplicationDefinition ifTrue:[ |
|
13419 | 4561 |
self theNonMetaclass isGUIApplication ifTrue:[ |
4562 |
^ #guiApplicationDefinitionClassIcon |
|
4563 |
]. |
|
4564 |
^ #applicationDefinitionClassIcon |
|
12086 | 4565 |
]. |
4566 |
^ super iconInBrowserSymbol |
|
4567 |
! ! |
|
4568 |
||
9575 | 4569 |
!ProjectDefinition class methodsFor:'private'! |
9536 | 4570 |
|
13411 | 4571 |
abbrevs |
13592 | 4572 |
"return a dictionary containing my abbreviations; |
4573 |
this dictionary is read from my project-directory's abbrev.stc file, |
|
4574 |
and cached for future use" |
|
4575 |
||
4576 |
|abbrevs| |
|
4577 |
||
4578 |
AccessLock critical:[ |
|
4579 |
|mustRead file| |
|
4580 |
||
4581 |
AbbrevDictionary isNil ifTrue:[ |
|
4582 |
AbbrevDictionary := WeakIdentityDictionary new. |
|
4583 |
]. |
|
4584 |
||
4585 |
mustRead := false. |
|
4586 |
abbrevs := AbbrevDictionary at:self ifAbsent:[ mustRead := true. Dictionary new ]. |
|
4587 |
||
4588 |
mustRead ifTrue:[ |
|
4589 |
file := self packageDirectory / 'abbrev.stc'. |
|
4590 |
file exists ifTrue: [ |
|
4591 |
file readingFileDo:[:stream | |
|
4592 |
Smalltalk |
|
4593 |
withAbbreviationsFromStream:stream |
|
4594 |
do:[:nm :fn :pkg :cat :sz| |
|
4595 |
abbrevs at: nm put: (AbbrevEntry new className:nm fileName:fn category:cat numClassInstVars:sz) |
|
4596 |
] |
|
4597 |
] |
|
4598 |
]. |
|
4599 |
]. |
|
13419 | 4600 |
]. |
13592 | 4601 |
|
13411 | 4602 |
^abbrevs |
4603 |
||
4604 |
"Created: / 06-03-2011 / 18:25:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13592 | 4605 |
"Modified: / 18-08-2011 / 14:24:15 / cg" |
13411 | 4606 |
! |
4607 |
||
12368 | 4608 |
additionalClassAttributesFor: aClass |
4609 |
"Answers additional set of class attributes for given class |
|
4610 |
Individual project definitions may override this method, but |
|
4611 |
overriding method should always merge its attributes with result |
|
4612 |
of 'super additionalClassAttributesFor: aClass'. |
|
4613 |
||
4614 |
Here, we add #autoload attributes to all test cases and |
|
4615 |
test resources, as they are not neccessary for the package |
|
4616 |
and should not be compiled (because of unwanted dependency |
|
4617 |
on stx:goodies/sunit package) |
|
4618 |
" |
|
4619 |
||
4620 |
(aClass inheritsFrom: TestCase) ifTrue:[^#(autoload)]. |
|
4621 |
(aClass inheritsFrom: TestResource) ifTrue:[^#(autoload)]. |
|
4622 |
||
4623 |
"No additional attributes" |
|
4624 |
^#() |
|
4625 |
||
4626 |
" |
|
13419 | 4627 |
stx_libbasic additionalClassAttributesFor: Object |
4628 |
stx_libtool additionalClassAttributesFor: Tools::NavigationHistoryTests |
|
4629 |
stx_goodies_sunit additionalClassAttributesFor: TestCase |
|
4630 |
||
4631 |
||
4632 |
stx_libtool classNamesAndAttributes_code_ignoreOldEntries:true ignoreOldDefinition: true |
|
12368 | 4633 |
|
4634 |
" |
|
4635 |
||
4636 |
"Created: / 26-10-2009 / 12:54:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4637 |
! |
|
4638 |
||
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4639 |
checkIfClassesArePresent |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4640 |
"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
|
4641 |
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
|
4642 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4643 |
|check nonExistantClasses| |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4644 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4645 |
nonExistantClasses := Set new. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4646 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4647 |
check := |
13419 | 4648 |
[:eachClassName | |
4649 |
|cls fn wasLoaded failedToLoad numClassInstvars| |
|
4650 |
||
4651 |
cls := Smalltalk classNamed:eachClassName. |
|
4652 |
cls isNil ifTrue:[ |
|
4653 |
Transcript showCR:eachClassName. |
|
4654 |
nonExistantClasses add:eachClassName. |
|
4655 |
]. |
|
4656 |
]. |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4657 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4658 |
self allClassNames do:check. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4659 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do:[:nm :attr | |
13419 | 4660 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
4661 |
check value:nm |
|
4662 |
]. |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4663 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4664 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4665 |
nonExistantClasses notEmpty ifTrue:[ |
13419 | 4666 |
(Dialog confirm:(Dialog classResources |
4667 |
stringWithCRs:'"%1" and possibly more classes are missing.\Cannot generate a correct "abbrev.stc" file.\\Continue anyway?' |
|
4668 |
with:nonExistantClasses anElement allBold)) |
|
4669 |
ifFalse:[ |
|
4670 |
AbortOperationRequest raise. |
|
4671 |
]. |
|
4672 |
^ false. |
|
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4673 |
]. |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4674 |
|
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4675 |
^ true |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4676 |
! |
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4677 |
|
12368 | 4678 |
classNamesAndAttributesAsSpecArray |
13419 | 4679 |
"given a classNamesAndAttributes array, make this a spec array (array of arrays). |
12368 | 4680 |
This decompresses class-name entries into a one-element array for easier processing" |
4681 |
||
4682 |
^ self classNamesAndAttributes |
|
13419 | 4683 |
collect:[:entry | |
4684 |
entry isArray ifTrue:[ |
|
4685 |
entry first isSymbol ifTrue:[ |
|
4686 |
entry |
|
4687 |
] ifFalse:[ |
|
4688 |
(Array with:entry first asSymbol) , (entry copyFrom:2) |
|
4689 |
]. |
|
4690 |
] ifFalse:[ |
|
4691 |
Array with:entry asSymbol. |
|
4692 |
]]. |
|
12368 | 4693 |
|
4694 |
"Created: / 19-02-2007 / 16:11:53 / cg" |
|
4695 |
! |
|
4696 |
||
9627 | 4697 |
classNamesAndAttributesDo: aBlock |
4698 |
self namesAndAttributesIn:(self classNamesAndAttributes) do: aBlock |
|
4699 |
||
4700 |
"Modified: / 22-08-2006 / 18:20:21 / cg" |
|
9607 | 4701 |
! |
4702 |
||
12368 | 4703 |
classNamesAndAttributesFromSpecArray:aSpecArray |
4704 |
"given a spec array (array of arrays), make this a classNamesAndAttributes array |
|
4705 |
as stored literally in the method. |
|
4706 |
This compresses single element array-elements into plain names |
|
4707 |
(to save code in the compiled binaries)" |
|
4708 |
||
4709 |
^ aSpecArray |
|
13419 | 4710 |
collect:[:entry | |
4711 |
(entry isArray and:[entry size == 1]) ifTrue:[ |
|
4712 |
entry first |
|
4713 |
] ifFalse:[ |
|
4714 |
entry |
|
4715 |
]]. |
|
12368 | 4716 |
|
4717 |
"Created: / 19-02-2007 / 16:12:32 / cg" |
|
4718 |
! |
|
4719 |
||
9664 | 4720 |
compile:someCode categorized:category |
13419 | 4721 |
Class packageQuerySignal |
4722 |
answer:self package |
|
4723 |
do:[ |
|
4724 |
self theMetaclass compilerClass |
|
4725 |
compile:someCode |
|
4726 |
forClass:self theMetaclass |
|
4727 |
inCategory:category |
|
4728 |
notifying:nil |
|
4729 |
install:true |
|
4730 |
skipIfSame:true |
|
4731 |
silent:true. |
|
4732 |
] |
|
9664 | 4733 |
|
4734 |
"Created: / 23-08-2006 / 14:36:53 / cg" |
|
4735 |
! |
|
4736 |
||
9627 | 4737 |
compiled_classes |
13419 | 4738 |
^ self compiled_classNames |
4739 |
collect: |
|
4740 |
[:eachName| |
|
4741 |
|cls| |
|
4742 |
||
4743 |
cls := (Smalltalk at:eachName asSymbol). |
|
4744 |
(cls isNil or:[cls isBehavior not]) ifTrue:[ |
|
4745 |
Transcript showCR:('ProjectDefinition: missing/invalid class: ', eachName). |
|
4746 |
cls := nil. |
|
4747 |
]. |
|
4748 |
cls. |
|
4749 |
] |
|
4750 |
thenSelect:[:cls | cls notNil] |
|
9627 | 4751 |
|
4752 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
4753 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
10251 | 4754 |
"Modified: / 07-12-2006 / 17:48:11 / cg" |
9536 | 4755 |
! |
4756 |
||
9627 | 4757 |
compiled_classesDo:aBlock |
4758 |
self compiled_classes do:aBlock. |
|
4759 |
||
4760 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
4761 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
4762 |
! |
|
4763 |
||
13419 | 4764 |
compiled_classesForArchitecture:arch |
4765 |
^ (self compiled_classNamesForPlatform:arch) |
|
4766 |
collect:[:eachName | (Smalltalk at:eachName asSymbol) ] |
|
9627 | 4767 |
|
10251 | 4768 |
" |
4769 |
stx_libbasic compiled_classesForArchitecture:#win32 |
|
4770 |
stx_libbasic compiled_classesForArchitecture:#macos |
|
4771 |
stx_libbasic compiled_classesForArchitecture:#unix |
|
4772 |
" |
|
4773 |
||
9627 | 4774 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
4775 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
10251 | 4776 |
"Modified: / 07-12-2006 / 17:43:17 / cg" |
9627 | 4777 |
! |
4778 |
||
4779 |
compiled_classes_common |
|
13419 | 4780 |
^ self |
4781 |
compiled_classNames_common |
|
4782 |
collect:[:eachName | |
|
4783 |
|cls| |
|
4784 |
||
4785 |
cls := (Smalltalk at:eachName asSymbol). |
|
4786 |
cls isBehavior ifFalse:[ |
|
4787 |
self warn:('Missing/invalid class: %1\\%2' |
|
4788 |
bindWith:eachName |
|
4789 |
with:('Warning: The class is skipped in the list of compiled classes.' allBold)) withCRs. |
|
4790 |
cls := nil. |
|
4791 |
]. |
|
4792 |
cls |
|
4793 |
] |
|
4794 |
thenSelect:[:cls| cls notNil "isBehavior"] |
|
9627 | 4795 |
|
4796 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
4797 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
13090
827d5322948f
changed: #compiled_classes_common
Claus Gittinger <cg@exept.de>
parents:
13088
diff
changeset
|
4798 |
"Modified: / 11-10-2010 / 12:11:06 / cg" |
9607 | 4799 |
! |
4800 |
||
9627 | 4801 |
cvsRevision |
4802 |
|rev| |
|
4803 |
||
4804 |
rev := self revision. |
|
4805 |
rev isNil ifTrue:[ |
|
13419 | 4806 |
"not yet pubplished" |
4807 |
^ #( '0' '1' ) |
|
9627 | 4808 |
]. |
4809 |
^ rev asCollectionOfSubstringsSeparatedBy:$. . |
|
4810 |
||
4811 |
" |
|
4812 |
self cvsRevision |
|
13419 | 4813 |
stx_libbasic3 cvsRevision |
9627 | 4814 |
" |
4815 |
||
4816 |
"Created: / 17-08-2006 / 20:19:03 / cg" |
|
9575 | 4817 |
! |
4818 |
||
13411 | 4819 |
defaultClassAttributesFor: aClass |
4820 |
"Answers default set of class attributes for given class. |
|
4821 |
This is internal method only, to per-project customization |
|
4822 |
please override either #additionalClassAttributes or |
|
4823 |
#additional classAttributesFor:" |
|
4824 |
||
4825 |
| attrs | |
|
4826 |
||
4827 |
"JV @ 2010-06-19 |
|
4828 |
Add a programming language attribute for non-smalltalk classes. |
|
4829 |
Used by multi-lang enabled loading mechanism" |
|
13419 | 4830 |
attrs := aClass programmingLanguage isSmalltalk |
4831 |
ifTrue:[#()] |
|
4832 |
ifFalse:[Array with: (Array with: #lang with: aClass programmingLanguage name asSymbol)]. |
|
4833 |
||
13411 | 4834 |
|
4835 |
"JV @ 2009-10-26 |
|
4836 |
Give a project definition to specify additional attributes for given class." |
|
4837 |
attrs := attrs , (self additionalClassAttributesFor: aClass). |
|
4838 |
||
4839 |
^attrs |
|
4840 |
||
4841 |
"Created: / 19-06-2010 / 10:44:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4842 |
! |
|
4843 |
||
9627 | 4844 |
inconsistency:message |
4845 |
Dialog warn:message |
|
9536 | 4846 |
|
9627 | 4847 |
" |
4848 |
self searchForNeverCompiledSuperclasses |
|
13419 | 4849 |
DapasX_Datenbasis searchForNeverCompiledSuperclasses |
9627 | 4850 |
" |
4851 |
||
4852 |
"Created: / 09-08-2006 / 16:32:31 / fm" |
|
9536 | 4853 |
! |
4854 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4855 |
makeOSIncludesWith:fileSeparator from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4856 |
^ aString copy replaceAny:'/\' with:fileSeparator |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4857 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4858 |
" |
13419 | 4859 |
self makeOSIncludesWith:$/ from:'-I$(TOP)/foo/bar' |
4860 |
self makeOSIncludesWith:$\ from:'-I$(TOP)/foo/bar' |
|
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4861 |
" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4862 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4863 |
"Created: / 06-09-2006 / 18:17:03 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4864 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4865 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4866 |
makeUnixIncludes:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4867 |
^ self makeOSIncludesWith:$/ from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4868 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4869 |
"Created: / 06-09-2006 / 18:16:19 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4870 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4871 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4872 |
makeWin32Includes:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4873 |
^ self makeOSIncludesWith:$\ from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4874 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4875 |
"Created: / 06-09-2006 / 18:16:13 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4876 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
4877 |
|
13411 | 4878 |
mergeClassAttributes: attr1 with: attr2 |
4879 |
||
4880 |
^attr1 , (attr2 reject:[:each|attr1 includes: each]) |
|
4881 |
||
4882 |
"Created: / 19-06-2010 / 10:50:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4883 |
! |
|
4884 |
||
4885 |
mergeDefaultClassAttributesFor: aClass with: attributes |
|
4886 |
||
4887 |
^self mergeClassAttributes: attributes with: (self defaultClassAttributesFor: aClass) |
|
4888 |
||
4889 |
"Created: / 19-06-2010 / 10:51:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4890 |
! |
|
4891 |
||
9627 | 4892 |
namesAndAttributesIn:aCollection do: aBlock |
4893 |
aCollection do:[:entry | |
|
13419 | 4894 |
|className attributes| |
4895 |
||
4896 |
entry isArray ifFalse:[ |
|
4897 |
className := entry. |
|
4898 |
attributes := #(). |
|
4899 |
] ifTrue:[ |
|
4900 |
className := entry first. |
|
4901 |
attributes := entry copyFrom:2. |
|
4902 |
]. |
|
4903 |
aBlock value: className value: attributes |
|
9627 | 4904 |
]. |
4905 |
||
4906 |
"Created: / 22-08-2006 / 18:20:09 / cg" |
|
9621 | 4907 |
! |
4908 |
||
9627 | 4909 |
searchForClasses |
10010 | 4910 |
"answer all non-private classes that belong to this project. |
10005 | 4911 |
They are sorted in load order" |
4912 |
||
13419 | 4913 |
^ Class classesSortedByLoadOrder:(self searchForClassesWithProject: self package) |
9627 | 4914 |
|
4915 |
" |
|
10010 | 4916 |
stx_libbasic3 searchForClasses |
11868
59e160ca3419
First support for cleanup of class filenames
Stefan Vogel <sv@exept.de>
parents:
11829
diff
changeset
|
4917 |
stx_goodies_webServer_htmlTree searchForClasses |
9627 | 4918 |
" |
4919 |
||
4920 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
4921 |
"Created: / 17-08-2006 / 21:18:30 / cg" |
|
9536 | 4922 |
! |
4923 |
||
9627 | 4924 |
searchForClassesWithProject: aProjectID |
4925 |
||
13419 | 4926 |
^ Smalltalk allClasses |
4927 |
select:[:cls | (cls package = aProjectID) ]. |
|
9627 | 4928 |
|
4929 |
" |
|
4930 |
self searchForClassesWithProject: #'bosch:dapasx' |
|
4931 |
self searchForClassesWithProject: #'bosch:dapasx/datenbasis' |
|
4932 |
self searchForClassesWithProject: #'bosch:dapasx/kernel' |
|
4933 |
" |
|
4934 |
||
4935 |
"Created: / 07-08-2006 / 20:42:39 / fm" |
|
4936 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
4937 |
"Modified: / 16-08-2006 / 18:50:48 / User" |
|
9536 | 4938 |
! |
4939 |
||
9627 | 4940 |
searchForExtensions |
4941 |
^ self searchForExtensionsWithProject:self package |
|
4942 |
||
4943 |
" |
|
13419 | 4944 |
self searchForExtensions |
9627 | 4945 |
DapasXProject searchForExtensions |
4946 |
DapasX_Datenbasis searchForExtensions |
|
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
4947 |
stx_libtool searchForExtensions |
9627 | 4948 |
" |
4949 |
||
4950 |
"Modified: / 09-08-2006 / 13:01:26 / fm" |
|
4951 |
"Created: / 17-08-2006 / 21:17:46 / cg" |
|
10106
c26879b72dfe
extensionlist generator was buggy
Claus Gittinger <cg@exept.de>
parents:
10104
diff
changeset
|
4952 |
"Modified: / 23-10-2006 / 11:03:07 / cg" |
9575 | 4953 |
! |
4954 |
||
9627 | 4955 |
searchForExtensionsWithProject:aProjectID |
4956 |
"search for any class which has extensions from aProjectID. |
|
10086
024ea420d1a6
extension method stuff refactored
Claus Gittinger <cg@exept.de>
parents:
10080
diff
changeset
|
4957 |
Return the extension-methods sorted by classname-selector" |
9627 | 4958 |
|
4959 |
|methods| |
|
4960 |
||
11152 | 4961 |
methods := Smalltalk allExtensionsForPackage:aProjectID. |
13419 | 4962 |
methods |
4963 |
sort:[:m1 :m2 | |
|
4964 |
|c1 c2| |
|
4965 |
||
4966 |
c1 := m1 mclass. |
|
4967 |
c2 := m2 mclass. |
|
4968 |
c1 == c2 ifTrue:[ |
|
4969 |
m1 selector < m2 selector |
|
4970 |
] ifFalse:[ |
|
4971 |
(c2 isMeta and:[c1 isMeta not]) ifTrue:[ |
|
4972 |
true |
|
4973 |
] ifFalse:[ |
|
4974 |
(c1 isMeta and:[c2 isMeta not]) ifTrue:[ |
|
4975 |
false |
|
4976 |
] ifFalse:[ |
|
4977 |
c1 name < c2 name |
|
9908
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
4978 |
"/ (c2 isSubclassOf:c1) ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
4979 |
"/ true |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
4980 |
"/ ] ifFalse:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
4981 |
"/ (c1 isSubclassOf:c2) ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
4982 |
"/ false |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
4983 |
"/ ] ifFalse:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
4984 |
"/ "/ leave as is |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
4985 |
"/ true |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
4986 |
"/ ]. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
4987 |
"/ ]. |
13419 | 4988 |
]. |
4989 |
]. |
|
4990 |
]. |
|
4991 |
]. |
|
9627 | 4992 |
^ methods |
4993 |
||
4994 |
" |
|
4995 |
self searchForExtensionsWithProject:#'bosch:dapasx' |
|
4996 |
self searchForExtensionsWithProject:#'cg:oyster' |
|
10086
024ea420d1a6
extension method stuff refactored
Claus Gittinger <cg@exept.de>
parents:
10080
diff
changeset
|
4997 |
self searchForExtensionsWithProject:#'stx:libboss' |
9627 | 4998 |
" |
4999 |
||
5000 |
"Created: / 17-08-2006 / 21:19:04 / cg" |
|
10086
024ea420d1a6
extension method stuff refactored
Claus Gittinger <cg@exept.de>
parents:
10080
diff
changeset
|
5001 |
"Modified: / 12-10-2006 / 20:45:39 / cg" |
9536 | 5002 |
! |
5003 |
||
9627 | 5004 |
searchForProjectsWhichProvideHeaderFiles |
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
5005 |
|addPackage myPackageID requiredPackages| |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
5006 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
5007 |
myPackageID := self package. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
5008 |
requiredPackages := Set new. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
5009 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
5010 |
addPackage := |
13419 | 5011 |
[:package | |
5012 |
(package ~= myPackageID) ifTrue:[ |
|
5013 |
true "(package startsWith:'stx:') not" ifTrue:[ |
|
5014 |
package ~= PackageId noProjectID ifTrue:[ |
|
5015 |
requiredPackages add:package. |
|
5016 |
] |
|
5017 |
] |
|
5018 |
] |
|
5019 |
]. |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
5020 |
|
12555
9924562388ed
changed: #searchForProjectsWhichProvideHeaderFiles
Claus Gittinger <cg@exept.de>
parents:
12554
diff
changeset
|
5021 |
"/ need them also... |
9924562388ed
changed: #searchForProjectsWhichProvideHeaderFiles
Claus Gittinger <cg@exept.de>
parents:
12554
diff
changeset
|
5022 |
self preRequisites do:[:eachPreRequisitePackage | |
13419 | 5023 |
addPackage value:eachPreRequisitePackage |
12555
9924562388ed
changed: #searchForProjectsWhichProvideHeaderFiles
Claus Gittinger <cg@exept.de>
parents:
12554
diff
changeset
|
5024 |
]. |
9924562388ed
changed: #searchForProjectsWhichProvideHeaderFiles
Claus Gittinger <cg@exept.de>
parents:
12554
diff
changeset
|
5025 |
|
10788 | 5026 |
self compiled_classesDo:[:cls | |
13419 | 5027 |
cls allSuperclassesDo:[:eachSuperClass | |
5028 |
addPackage value:(eachSuperClass package) |
|
5029 |
]. |
|
5030 |
||
5031 |
cls allPrivateClassesDo:[:eachPrivateClass | |
|
5032 |
eachPrivateClass allSuperclassesDo:[:eachSuperClass | |
|
5033 |
eachSuperClass isPrivate ifFalse:[ |
|
5034 |
addPackage value:(eachSuperClass package) |
|
5035 |
]. |
|
5036 |
] |
|
5037 |
]. |
|
5038 |
||
5039 |
cls sharedPoolNames do:[:eachPoolName | |
|
5040 |
|eachPoolClass| |
|
5041 |
||
5042 |
eachPoolClass := Smalltalk classNamed:eachPoolName. |
|
5043 |
eachPoolClass isNil ifTrue:[ |
|
5044 |
Transcript showCR:('Warning: missing pool: %1 (required by %2)' bindWith:eachPoolName with:cls name) |
|
5045 |
] ifFalse:[ |
|
5046 |
eachPoolClass withAllSuperclassesDo:[:eachPoolSuperClass | |
|
5047 |
addPackage value:(eachPoolSuperClass package) |
|
5048 |
] |
|
5049 |
] |
|
5050 |
]. |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
5051 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
5052 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
5053 |
self extensionMethodNames pairWiseDo:[:className :selector | |
13419 | 5054 |
|cls| |
5055 |
((cls := Smalltalk classNamed:className) notNil and:[cls isLoaded]) ifTrue:[ |
|
5056 |
cls withAllSuperclassesDo:[:eachSuperClass | |
|
5057 |
addPackage value:(eachSuperClass package) |
|
5058 |
] |
|
5059 |
] |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
5060 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
5061 |
^ requiredPackages |
9627 | 5062 |
|
9880 | 5063 |
" |
13419 | 5064 |
stx_libtool searchForProjectsWhichProvideHeaderFiles |
9880 | 5065 |
" |
9627 | 5066 |
|
10251 | 5067 |
"Created: / 07-12-2006 / 17:46:38 / cg" |
13216 | 5068 |
"Modified: / 18-01-2011 / 17:58:33 / cg" |
9664 | 5069 |
! |
5070 |
||
9667 | 5071 |
searchForSiblingProjects |
10132 | 5072 |
"answer all the packages (package names) having the my parent package" |
5073 |
||
9667 | 5074 |
|myPackage myParentPackage| |
5075 |
||
5076 |
myPackage := self package asPackageId. |
|
5077 |
myParentPackage := myPackage parentPackage. |
|
5078 |
myParentPackage isNil ifTrue:[^ #() ]. |
|
5079 |
||
13419 | 5080 |
^ Smalltalk allProjectIDs |
5081 |
select:[:projectID | |
|
5082 |
|thisPackage| |
|
5083 |
thisPackage := projectID asPackageId. |
|
5084 |
(thisPackage parentPackage = myParentPackage) |
|
5085 |
and:[ thisPackage ~= myPackage ]. |
|
5086 |
] |
|
9667 | 5087 |
|
5088 |
" |
|
5089 |
self searchForSiblingProjects |
|
5090 |
bosch_dapasx_Application searchForSiblingProjects |
|
5091 |
stx_goodies_refactoryBrowser_changes searchForSiblingProjects |
|
5092 |
" |
|
5093 |
||
5094 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
5095 |
"Created: / 23-08-2006 / 15:06:12 / cg" |
|
5096 |
! |
|
5097 |
||
9664 | 5098 |
searchForSubProjects |
10132 | 5099 |
"answer all packages (package names), that are my subProjects" |
5100 |
||
9664 | 5101 |
|myPackage| |
5102 |
||
5103 |
myPackage := self package. |
|
13419 | 5104 |
^ Smalltalk allProjectIDs |
5105 |
select:[:projectID | |
|
5106 |
projectID ~= PackageId noProjectID |
|
5107 |
and:[ (projectID asPackageId parentPackage) = myPackage ]]. |
|
5108 |
||
5109 |
" |
|
5110 |
self searchForSubProjects |
|
9664 | 5111 |
bosch_dapasx_Application searchForSubProjects |
5112 |
stx_goodies_refactoryBrowser_changes searchForSubProjects |
|
5113 |
" |
|
5114 |
||
5115 |
"Created: / 07-08-2006 / 20:42:39 / fm" |
|
5116 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
10215 | 5117 |
"Modified: / 05-12-2006 / 18:04:27 / cg" |
9664 | 5118 |
! |
5119 |
||
5120 |
setupForType:typeOrNil |
|
9714 | 5121 |
typeOrNil = GUIApplicationType ifTrue:[ |
13419 | 5122 |
self compile: |
12425 | 5123 |
'isGUIApplication |
5124 |
"return true, if this is a GUI application. |
|
5125 |
(these need more libraries and use a different startup procedure)" |
|
5126 |
||
5127 |
^ true |
|
5128 |
' |
|
13419 | 5129 |
categorized:'description'. |
5130 |
self superclass: ApplicationDefinition. |
|
5131 |
^ self |
|
9664 | 5132 |
]. |
12856
1651184275a2
comment/format in: #setupForType:
Claus Gittinger <cg@exept.de>
parents:
12804
diff
changeset
|
5133 |
|
9714 | 5134 |
typeOrNil = NonGUIApplicationType ifTrue:[ |
13419 | 5135 |
self compile: |
12425 | 5136 |
'isGUIApplication |
5137 |
"return true, if this is a GUI application. |
|
5138 |
(these need more libraries and use a different startup procedure)" |
|
5139 |
||
5140 |
^ false |
|
5141 |
' |
|
13419 | 5142 |
categorized:'description'. |
5143 |
self superclass: ApplicationDefinition. |
|
5144 |
^ self |
|
5145 |
]. |
|
12856
1651184275a2
comment/format in: #setupForType:
Claus Gittinger <cg@exept.de>
parents:
12804
diff
changeset
|
5146 |
|
12349 | 5147 |
self theMetaclass removeSelector: #isGUIApplication. |
12353 | 5148 |
self superclass: LibraryDefinition. |
9664 | 5149 |
^ self. |
5150 |
||
5151 |
"Created: / 23-08-2006 / 14:26:10 / cg" |
|
13411 | 5152 |
! |
5153 |
||
5154 |
shouldExcludeTest: test |
|
5155 |
||
5156 |
self excludedFromTestSuite do: |
|
13419 | 5157 |
[:spec| |
5158 |
(spec isSymbol and:[test class name == spec]) |
|
5159 |
ifTrue:[^true]. |
|
5160 |
(spec isArray and:[test class name == spec first and:[test selector == spec second]]) |
|
5161 |
ifTrue:[^true]. |
|
5162 |
]. |
|
13411 | 5163 |
^false |
5164 |
||
5165 |
"Created: / 03-06-2011 / 17:01:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9536 | 5166 |
! ! |
5167 |
||
12210 | 5168 |
!ProjectDefinition class methodsFor:'private-extension handling'! |
5169 |
||
5170 |
hasSavedOverwrittenMethods |
|
5171 |
"true, if any of my methods was overwritten by another loaded package. |
|
5172 |
These methods are now in my safe" |
|
5173 |
||
12208
0b65ddcb68f2
added: #hasSafedOverwrittenMethods
Michael Beyl <mb@exept.de>
parents:
12202
diff
changeset
|
5174 |
^ safeForOverwrittenMethods notEmptyOrNil |
0b65ddcb68f2
added: #hasSafedOverwrittenMethods
Michael Beyl <mb@exept.de>
parents:
12202
diff
changeset
|
5175 |
! |
0b65ddcb68f2
added: #hasSafedOverwrittenMethods
Michael Beyl <mb@exept.de>
parents:
12202
diff
changeset
|
5176 |
|
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5177 |
methodOverwrittenBy:aMethod |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5178 |
"return the (hidden) original method, which was located in another package |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5179 |
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
|
5180 |
|
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5181 |
|mclass selector oldPackage| |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5182 |
|
12218
a3662ecd1438
changed: #methodOverwrittenBy:
Claus Gittinger <cg@exept.de>
parents:
12213
diff
changeset
|
5183 |
extensionOverwriteInfo isNil ifTrue:[^ nil]. |
a3662ecd1438
changed: #methodOverwrittenBy:
Claus Gittinger <cg@exept.de>
parents:
12213
diff
changeset
|
5184 |
|
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5185 |
mclass := aMethod mclass. |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5186 |
selector := aMethod selector. |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5187 |
oldPackage := extensionOverwriteInfo at:(mclass name,'>>',selector) ifAbsent:nil. |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5188 |
oldPackage isNil ifTrue:[^ nil]. |
13419 | 5189 |
^ oldPackage asPackageId projectDefinitionClass |
5190 |
savedOverwrittenMethodForClass:mclass selector:selector. |
|
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5191 |
! |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5192 |
|
12210 | 5193 |
rememberOverwrittenExtensionMethods |
5194 |
"before loading, tell other packages to keep a safe reference to any method |
|
5195 |
which gets overloaded by me, and also remember here, whome I have overloaded. |
|
5196 |
This allows for two things: |
|
13419 | 5197 |
a) correct fileout of the other base-package (for example, when checking in any of its class) |
5198 |
b) correct unloading of myself" |
|
12210 | 5199 |
|
5200 |
self extensionMethodNames pairWiseDo:[:className :selector | |
|
13419 | 5201 |
|class oldMethod oldPackage defClass| |
5202 |
||
5203 |
class := Smalltalk classNamed:className. |
|
5204 |
class notNil ifTrue:[ |
|
5205 |
oldMethod := class compiledMethodAt:selector. |
|
5206 |
]. |
|
5207 |
oldMethod notNil ifTrue:[ |
|
5208 |
oldPackage := oldMethod package. |
|
5209 |
oldPackage ~= PackageId noProjectID ifTrue:[ |
|
5210 |
defClass := oldPackage asPackageId projectDefinitionClass. |
|
5211 |
defClass notNil ifTrue:[ |
|
5212 |
defClass rememberOverwrittenMethod:oldMethod inClass:class. |
|
5213 |
extensionOverwriteInfo isNil ifTrue:[ |
|
5214 |
extensionOverwriteInfo := Dictionary new. |
|
5215 |
]. |
|
5216 |
extensionOverwriteInfo at:(className,'>>',selector) put:oldPackage. |
|
5217 |
] |
|
5218 |
]. |
|
5219 |
]. |
|
12210 | 5220 |
]. |
5221 |
! |
|
5222 |
||
5223 |
rememberOverwrittenMethod:oldMethod inClass:aClass |
|
5224 |
"invoked from another projectDefinition, when that package is about to be loaded |
|
13419 | 5225 |
and about to overwrite one of my methods. |
5226 |
I will save the method locally, to allow for correct fileout of this class/project or |
|
12210 | 5227 |
to correctly reestablish my methods when the other package is unloaded later." |
5228 |
||
5229 |
|thisIsOneOfMyMethods selector| |
|
5230 |
||
5231 |
selector := oldMethod selector. |
|
5232 |
||
12293
983b9555f6e8
changed: #rememberOverwrittenMethod:inClass:
Claus Gittinger <cg@exept.de>
parents:
12286
diff
changeset
|
5233 |
thisIsOneOfMyMethods := (self classNames includes:aClass theNonMetaclass name) |
13419 | 5234 |
or:[ aClass isPrivate and:[ self classNames includes: aClass topOwningClass theNonMetaclass name ]]. |
12210 | 5235 |
thisIsOneOfMyMethods ifFalse:[ |
13419 | 5236 |
self extensionMethodNames pairWiseDo:[:extClassName :extSelector | |
5237 |
extClassName = aClass name ifTrue:[ |
|
5238 |
selector = extSelector ifTrue:[ |
|
5239 |
thisIsOneOfMyMethods := true |
|
5240 |
]. |
|
5241 |
]. |
|
5242 |
] |
|
12210 | 5243 |
]. |
5244 |
thisIsOneOfMyMethods ifFalse:[ |
|
13419 | 5245 |
self error:'oops - this is not one of my methods' mayProceed:true. |
5246 |
^ self |
|
12210 | 5247 |
]. |
5248 |
||
5249 |
safeForOverwrittenMethods isNil ifTrue:[ |
|
13419 | 5250 |
safeForOverwrittenMethods := Dictionary new. |
12210 | 5251 |
]. |
5252 |
safeForOverwrittenMethods at:(aClass name -> selector) put:oldMethod. |
|
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5253 |
! |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5254 |
|
12624 | 5255 |
restoreOverwrittenExtensionMethods |
5256 |
"after unloading, tell other packages to restore any safed reference to any method |
|
5257 |
which got overloaded by me." |
|
5258 |
||
5259 |
self extensionMethodNames pairWiseDo:[:className :selector | |
|
13419 | 5260 |
|class oldMethod oldPackage| |
5261 |
||
5262 |
oldPackage := extensionOverwriteInfo at:(className,'>>',selector). |
|
5263 |
oldPackage notNil ifTrue:[ |
|
5264 |
class := Smalltalk classNamed:className. |
|
5265 |
class notNil ifTrue:[ |
|
5266 |
oldMethod := oldPackage savedOverwrittenMethodForClass:class selector:selector. |
|
5267 |
oldMethod notNil ifTrue:[ |
|
5268 |
self breakPoint:#cg. |
|
5269 |
]. |
|
5270 |
] |
|
5271 |
]. |
|
12624 | 5272 |
]. |
5273 |
! |
|
5274 |
||
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5275 |
savedOverwrittenMethodForClass:aClass selector:aSelector |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5276 |
"return one of my saved original methods" |
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5277 |
|
12274 | 5278 |
^ safeForOverwrittenMethods at:(aClass name,'>>',aSelector) ifAbsent:nil |
12210 | 5279 |
! ! |
5280 |
||
5281 |
!ProjectDefinition class methodsFor:'private-loading'! |
|
5282 |
||
12262
24861bbf25fc
added: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12251
diff
changeset
|
5283 |
checkPrerequisitesForLoading |
12264 | 5284 |
|classesAlreadyWarned| |
5285 |
||
5286 |
classesAlreadyWarned := Set new. |
|
5287 |
||
13419 | 5288 |
self extensionMethodNames |
5289 |
pairWiseDo:[:className :selector | |
|
5290 |
|class | |
|
5291 |
||
5292 |
class := Smalltalk classNamed:className. |
|
5293 |
class isNil ifTrue:[ |
|
5294 |
(classesAlreadyWarned includes:className) ifFalse:[ |
|
5295 |
self error:'missing class for extension: ', className mayProceed:true. |
|
5296 |
classesAlreadyWarned add:className. |
|
5297 |
]. |
|
5298 |
]. |
|
5299 |
] |
|
12263
c6d50824fbba
comment/format in: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12262
diff
changeset
|
5300 |
|
c6d50824fbba
comment/format in: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12262
diff
changeset
|
5301 |
"/ todo: more needed here... |
12731 | 5302 |
|
5303 |
" |
|
5304 |
stx_libjavascript checkPrerequisitesForLoading |
|
5305 |
" |
|
12262
24861bbf25fc
added: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12251
diff
changeset
|
5306 |
! |
24861bbf25fc
added: #checkPrerequisitesForLoading
Claus Gittinger <cg@exept.de>
parents:
12251
diff
changeset
|
5307 |
|
12294
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5308 |
extensionOverwriteInfo |
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5309 |
^ extensionOverwriteInfo |
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5310 |
! |
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5311 |
|
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5312 |
fetchSlotsFrom:myFirstIncarnation |
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5313 |
"this is invoked in a just loaded instance of myself, |
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5314 |
to fetch the safe and extensionInfo from my first incarnation" |
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5315 |
|
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5316 |
safeForOverwrittenMethods := myFirstIncarnation safeForOverwrittenMethods. |
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5317 |
extensionOverwriteInfo := myFirstIncarnation extensionOverwriteInfo. |
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5318 |
! |
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5319 |
|
13614
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5320 |
loadAllAutoloadedClasses |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5321 |
self allClasses do:[:cls | cls autoload] |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5322 |
|
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5323 |
"Created: / 21-08-2011 / 17:24:13 / cg" |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5324 |
! |
5606bfa8cbec
added: #loadAllAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13610
diff
changeset
|
5325 |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5326 |
loadAllClassesAsAutoloaded:asAutoloaded |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5327 |
"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
|
5328 |
install as autoloaded classes marked to be autoloaded. |
10401 | 5329 |
If asAutoloaded == true, all classes will be installed as autoloaded, even if not marked. |
5330 |
||
5331 |
Answer true, if classes have been loaded" |
|
12028 | 5332 |
|
13411 | 5333 |
^self loadAllClassesAsAutoloaded:asAutoloaded languages: ProgrammingLanguage all |
5334 |
||
5335 |
"Created: / 17-08-2006 / 01:01:14 / cg" |
|
5336 |
"Modified: / 26-10-2006 / 12:30:01 / cg" |
|
5337 |
"Modified: / 16-08-2009 / 13:31:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
5338 |
"Modified: / 19-06-2010 / 11:37:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5339 |
! |
|
5340 |
||
5341 |
loadAllClassesAsAutoloaded:asAutoloaded languages: langs |
|
5342 |
"load (fileIn) classes in given languages that should be present - |
|
5343 |
install as autoloaded classes marked to be autoloaded. |
|
5344 |
If asAutoloaded == true, all classes will be installed as autoloaded, even if not marked. |
|
5345 |
langs should be collection of ProgrammingLanguage available in the system. |
|
5346 |
||
5347 |
Answer true, if classes have been loaded" |
|
5348 |
||
5349 |
|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
|
5350 |
classesWhichFailedToLoad| |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5351 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5352 |
platformName := OperatingSystem platformName. |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5353 |
classNamesToLoad := OrderedCollection new. |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5354 |
classNamesToAutoload := OrderedCollection new. |
13411 | 5355 |
classNamesToLangs := Dictionary new. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5356 |
|
12315
71599fb91dcf
comment/format in: #packageDirectory
Claus Gittinger <cg@exept.de>
parents:
12314
diff
changeset
|
5357 |
hasClassesToLoad := false. |
13419 | 5358 |
self classNamesAndAttributesDo:[:eachClassname :eachAttributes | |
5359 |
|eachClassnameSym isAutoload clsLangAttr clsLang cls | |
|
5360 |
||
5361 |
eachClassnameSym := eachClassname asSymbol. |
|
5362 |
isAutoload := asAutoloaded or:[eachAttributes includes:#autoload]. |
|
5363 |
clsLangAttr := eachAttributes detect:[:a|a isArray and: [a size == 2 and:[a first == #lang]]] ifNone:[nil]. |
|
5364 |
clsLang := clsLangAttr |
|
5365 |
ifNil:[SmalltalkLanguage instance] |
|
5366 |
ifNotNil:[ProgrammingLanguage named: clsLangAttr second ifNone:[nil]]. |
|
5367 |
classNamesToLangs at: eachClassname put: clsLang. |
|
5368 |
||
5369 |
"no need to (re-)load an existing class, but install if should be loaded" |
|
5370 |
cls := Smalltalk loadedClassNamed:eachClassnameSym. |
|
5371 |
((cls isNil or:[cls isLoaded not and:[isAutoload not]]) and:[clsLang notNil and:[langs includes: clsLang]]) ifTrue:[ |
|
5372 |
(eachAttributes isEmpty |
|
5373 |
or:[(eachAttributes size == 1 and:[isAutoload]) |
|
5374 |
or:[(eachAttributes includes:platformName) |
|
5375 |
or:[eachAttributes contains:[:a|a isArray]]]]) "/FIXME: Hack." |
|
5376 |
ifTrue:[ |
|
5377 |
hasClassesToLoad := true. |
|
5378 |
isAutoload ifTrue:[ |
|
5379 |
classNamesToAutoload add:eachClassnameSym. |
|
5380 |
] ifFalse:[ |
|
5381 |
classNamesToLoad add:eachClassnameSym. |
|
5382 |
]. |
|
5383 |
]. |
|
5384 |
]. |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5385 |
]. |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5386 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5387 |
hasClassesToLoad ifTrue:[ |
13419 | 5388 |
loadedClasses := OrderedCollection new. |
5389 |
||
5390 |
self packageDirectory isNil ifTrue:[ |
|
5391 |
classNamesToLoad notEmpty ifTrue:[ |
|
5392 |
"required classes are missing. |
|
5393 |
Autoloaded classes are considered as optional..." |
|
5394 |
self |
|
5395 |
error:(self name,'[error] cannot install because packageDirectory is unknown for missing classes: ', classNamesToLoad printString) |
|
5396 |
mayProceed:true. |
|
5397 |
^ false. |
|
5398 |
]. |
|
5399 |
(self name,'[info] cannot install autoloaded classes because packageDirectory is unknown') infoPrintCR. |
|
5400 |
^ true. |
|
5401 |
]. |
|
5402 |
||
5403 |
"we need the abbreviations, since sometimes there is no 1-to-1 mapping |
|
5404 |
of class name to file name" |
|
5405 |
||
5406 |
Smalltalk recursiveReadAllAbbreviationsFrom:self packageDirectory maxLevels:1. |
|
5407 |
||
5408 |
"install autoloaded classes first, |
|
5409 |
some others may depend on them" |
|
5410 |
||
5411 |
classNamesToAutoload withIndexDo:[:eachClassName :index| |
|
5412 |
ActivityNotification |
|
5413 |
raiseRequestWith: ((100 / classNamesToAutoload size ) * index) rounded |
|
5414 |
errorString: 'Autoloading class ', eachClassName. |
|
5415 |
||
5416 |
self loadClass: eachClassName asAutoloaded: true language: (classNamesToLangs at: eachClassName) . |
|
5417 |
]. |
|
5418 |
||
5419 |
classesWhichFailedToLoad := OrderedCollection new. |
|
5420 |
classNamesToLoad notEmpty ifTrue:[ |
|
5421 |
Verbose == true ifTrue:[ |
|
5422 |
Transcript showCR:(' %1: filing in missing classes (%2) individually...' |
|
5423 |
bindWith:self name with:classNamesToLoad size). |
|
5424 |
] |
|
5425 |
]. |
|
5426 |
classNamesToLoad withIndexDo:[:eachClassName :index| |
|
5427 |
|cls| |
|
5428 |
ActivityNotification |
|
5429 |
raiseRequestWith: ((100 / classNamesToLoad size) * index) rounded |
|
5430 |
errorString: 'Loading class ', eachClassName. |
|
5431 |
||
5432 |
Error handle:[:ex | |
|
5433 |
"maybe, fileIn failed, because the load order is wrong. |
|
5434 |
Work around this by installing the class as autoloaded and |
|
5435 |
loading it" |
|
5436 |
||
5437 |
classesWhichFailedToLoad add:eachClassName. |
|
5438 |
self loadClass: eachClassName asAutoloaded: true language: (classNamesToLangs at: eachClassName). |
|
5439 |
] do:[ |
|
5440 |
Verbose == true ifTrue:[ |
|
5441 |
Transcript showCR:(' %1: filing in %2...' bindWith:self name with:eachClassName). |
|
5442 |
]. |
|
5443 |
cls := self loadClass: eachClassName asAutoloaded: false language: (classNamesToLangs at: eachClassName). |
|
5444 |
cls notNil ifTrue:[ |
|
5445 |
loadedClasses add:cls |
|
5446 |
]. |
|
5447 |
]. |
|
5448 |
]. |
|
5449 |
||
5450 |
classesWhichFailedToLoad do:[:eachClassName | |
|
5451 |
(Smalltalk at:eachClassName) autoload. |
|
5452 |
]. |
|
5453 |
||
5454 |
loadedClasses do:[:eachLoadedClass | |
|
5455 |
"do not initialize, if initialize method is inherited" |
|
5456 |
(eachLoadedClass theMetaclass includesSelector:#initialize) ifTrue:[ |
|
5457 |
eachLoadedClass initialize |
|
5458 |
]. |
|
5459 |
]. |
|
5460 |
^ true. |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5461 |
]. |
10401 | 5462 |
^ false. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5463 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5464 |
"Modified: / 26-10-2006 / 12:30:01 / cg" |
12028 | 5465 |
"Modified: / 16-08-2009 / 13:31:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
13411 | 5466 |
"Created: / 19-06-2010 / 11:35:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5467 |
"Modified: / 19-06-2010 / 15:06:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5468 |
! |
|
5469 |
||
5470 |
loadClass: className asAutoloaded: asAutoloaded language: lang |
|
13592 | 5471 |
| packageDir classFile entry category numClassInstVars cls| |
5472 |
||
5473 |
"Handle smalltalk classes specially to provide backward compatibility" |
|
13411 | 5474 |
lang isSmalltalk ifTrue:[ |
13592 | 5475 |
entry := self abbrevs at: className ifAbsent:[nil]. |
5476 |
||
5477 |
asAutoloaded ifTrue:[ |
|
5478 |
category := entry isNil ifTrue:[#autoloaded] ifFalse:[entry category]. |
|
5479 |
numClassInstVars := entry isNil ifTrue:[0] ifFalse:[entry numClassInstVars]. |
|
5480 |
cls := Smalltalk |
|
5481 |
installAutoloadedClassNamed: className |
|
5482 |
category: category |
|
5483 |
package: self package |
|
5484 |
revision: nil |
|
5485 |
numClassInstVars:numClassInstVars. |
|
5486 |
entry notNil ifTrue:[ |
|
5487 |
cls setClassFilename:(entry fileName,'.st'). |
|
5488 |
]. |
|
5489 |
^ cls. |
|
5490 |
]. |
|
5491 |
^ Smalltalk |
|
5492 |
fileInClass:className |
|
5493 |
package:self package |
|
5494 |
initialize:false |
|
5495 |
lazy:false |
|
5496 |
silent:true |
|
13411 | 5497 |
]. |
5498 |
||
5499 |
"For non-smalltalk language do" |
|
5500 |
asAutoloaded ifTrue:[^self error:'Only Smalltalk classes may be autoloaded (yet)']. |
|
5501 |
||
5502 |
packageDir := self packageDirectory asFilename. |
|
5503 |
classFile := packageDir / ((Smalltalk fileNameForClass: className) , '.' , lang sourceFileSuffix). |
|
5504 |
classFile exists ifFalse:[^nil]. |
|
5505 |
lang fileIn: classFile. |
|
5506 |
^nil "FIXME: should return the class" |
|
5507 |
||
5508 |
"Created: / 19-06-2010 / 09:11:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5509 |
"Modified: / 06-03-2011 / 18:29:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13592 | 5510 |
"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
|
5511 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5512 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5513 |
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
|
5514 |
"try to load a binary class library |
fc34b59eca00
Don not try to load a class library already linked to the executable
Stefan Vogel <sv@exept.de>
parents:
10426
diff
changeset
|
5515 |
Return true if ok, false if not." |
fc34b59eca00
Don not try to load a class library already linked to the executable
Stefan Vogel <sv@exept.de>
parents:
10426
diff
changeset
|
5516 |
|
12295 | 5517 |
|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
|
5518 |
|
fc34b59eca00
Don not try to load a class library already linked to the executable
Stefan Vogel <sv@exept.de>
parents:
10426
diff
changeset
|
5519 |
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
|
5520 |
|
fc34b59eca00
Don not try to load a class library already linked to the executable
Stefan Vogel <sv@exept.de>
parents:
10426
diff
changeset
|
5521 |
(Smalltalk isClassLibraryLoaded:libraryName) ifTrue:[ |
13419 | 5522 |
"already loaded" |
5523 |
^ true |
|
5524 |
]. |
|
12743 | 5525 |
Verbose == true ifTrue:[ |
13419 | 5526 |
Transcript showCR:(' %1: loading classLibrary...' bindWith:self name). |
5527 |
]. |
|
12743 | 5528 |
self activityNotification:'Loading classLibrary'. |
5529 |
||
12295 | 5530 |
^ 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
|
5531 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5532 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5533 |
loadExtensions |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5534 |
"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
|
5535 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5536 |
self hasAllExtensionsLoaded ifFalse:[ |
13419 | 5537 |
self breakPoint:#cg. |
5538 |
Verbose == true ifTrue:[ |
|
5539 |
Transcript showCR:(' %1: filing in extensions...' bindWith:self name). |
|
5540 |
]. |
|
5541 |
Smalltalk loadExtensionsForPackage:self package. |
|
5542 |
^ true. |
|
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5543 |
]. |
10401 | 5544 |
^ false. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5545 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5546 |
"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
|
5547 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5548 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5549 |
loadPackages:aListOfPackages asAutoloaded:asAutoloaded |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5550 |
"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
|
5551 |
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
|
5552 |
|
13166
aa93e348e5d3
changed: #loadPackages:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13154
diff
changeset
|
5553 |
|packagesToLoad packagesBefore| |
aa93e348e5d3
changed: #loadPackages:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13154
diff
changeset
|
5554 |
|
13419 | 5555 |
packagesToLoad := aListOfPackages |
5556 |
reject:[:packageID | |
|
5557 |
|cls| |
|
5558 |
||
5559 |
cls := ProjectDefinition definitionClassForPackage:packageID. |
|
5560 |
cls notNil and:[cls projectIsLoaded] |
|
5561 |
]. |
|
13166
aa93e348e5d3
changed: #loadPackages:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13154
diff
changeset
|
5562 |
packagesToLoad isEmpty ifTrue:[^ self]. |
12558 | 5563 |
|
5564 |
packagesBefore := PackagesBeingLoaded copy. |
|
5565 |
PackagesBeingLoaded isNil ifTrue:[ |
|
13419 | 5566 |
PackagesBeingLoaded := Set new |
12558 | 5567 |
]. |
5568 |
[ |
|
13419 | 5569 |
Class withoutUpdatingChangesDo:[ |
5570 |
packagesToLoad do:[:aPackage | |
|
5571 |
(PackagesBeingLoaded includes:aPackage) ifFalse:[ |
|
5572 |
PackagesBeingLoaded add:aPackage. |
|
5573 |
Smalltalk loadPackage:aPackage asAutoloaded:asAutoloaded. |
|
5574 |
] |
|
5575 |
]. |
|
5576 |
]. |
|
12558 | 5577 |
] ensure:[ |
13419 | 5578 |
PackagesBeingLoaded := packagesBefore. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5579 |
]. |
13166
aa93e348e5d3
changed: #loadPackages:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13154
diff
changeset
|
5580 |
|
13167 | 5581 |
"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
|
5582 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5583 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5584 |
loadPreRequisitesAsAutoloaded:asAutoloaded |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5585 |
"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
|
5586 |
|
12743 | 5587 |
|prereq| |
5588 |
||
5589 |
prereq := self effectivePreRequisites. |
|
5590 |
prereq notEmptyOrNil ifTrue:[ |
|
13419 | 5591 |
Verbose == true ifTrue:[ |
5592 |
Transcript showCR:(' %1 loading prerequisites...' bindWith:self name). |
|
5593 |
]. |
|
5594 |
self loadPackages:prereq asAutoloaded:asAutoloaded |
|
12743 | 5595 |
]. |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5596 |
! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5597 |
|
12596 | 5598 |
loadSubProjects |
5599 |
"load other packages (at least the projectDefinitions and their extensions)" |
|
5600 |
||
5601 |
self loadSubProjectsAsAutoloaded:false. |
|
5602 |
self subProjects do:[:p | |
|
13419 | 5603 |
|subDef| |
5604 |
||
5605 |
subDef := self definitionClassForPackage:p. |
|
5606 |
subDef notNil ifTrue:[ |
|
5607 |
subDef loadSubProjects |
|
5608 |
]. |
|
12596 | 5609 |
]. |
5610 |
! |
|
5611 |
||
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5612 |
loadSubProjectsAsAutoloaded:asAutoloaded |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5613 |
"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
|
5614 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5615 |
self loadPackages:(self subProjects) asAutoloaded:asAutoloaded |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5616 |
|
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5617 |
"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
|
5618 |
! |
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
5619 |
|
13411 | 5620 |
old_loadAllClassesAsAutoloaded:asAutoloaded |
5621 |
"load (fileIn) classes that should be present - |
|
5622 |
install as autoloaded classes marked to be autoloaded. |
|
5623 |
If asAutoloaded == true, all classes will be installed as autoloaded, even if not marked. |
|
5624 |
||
5625 |
Answer true, if classes have been loaded" |
|
5626 |
||
5627 |
|classNamesToLoad classNamesToAutoload hasClassesToLoad loadedClasses platformName |
|
5628 |
classesWhichFailedToLoad| |
|
5629 |
||
5630 |
platformName := OperatingSystem platformName. |
|
5631 |
classNamesToLoad := OrderedCollection new. |
|
5632 |
classNamesToAutoload := OrderedCollection new. |
|
5633 |
||
5634 |
hasClassesToLoad := false. |
|
13419 | 5635 |
self classNamesAndAttributesDo:[:eachClassname :eachAttributes | |
5636 |
|eachClassnameSym isAutoload cls| |
|
5637 |
||
5638 |
eachClassnameSym := eachClassname asSymbol. |
|
5639 |
isAutoload := asAutoloaded or:[eachAttributes includes:#autoload]. |
|
5640 |
||
5641 |
"no need to (re-)load an existing class, but install if should be loaded" |
|
5642 |
cls := Smalltalk loadedClassNamed:eachClassnameSym. |
|
5643 |
(cls isNil or:[cls isLoaded not and:[isAutoload not]]) ifTrue:[ |
|
5644 |
(eachAttributes isEmpty |
|
5645 |
or:[(eachAttributes size == 1 and:[isAutoload]) |
|
5646 |
or:[eachAttributes includes:platformName]]) ifTrue:[ |
|
5647 |
hasClassesToLoad := true. |
|
5648 |
isAutoload ifTrue:[ |
|
5649 |
classNamesToAutoload add:eachClassnameSym. |
|
5650 |
] ifFalse:[ |
|
5651 |
classNamesToLoad add:eachClassnameSym. |
|
5652 |
]. |
|
5653 |
]. |
|
5654 |
]. |
|
13411 | 5655 |
]. |
5656 |
||
5657 |
hasClassesToLoad ifTrue:[ |
|
13419 | 5658 |
loadedClasses := OrderedCollection new. |
5659 |
||
5660 |
self packageDirectory isNil ifTrue:[ |
|
5661 |
self |
|
5662 |
error:(self name,'[error] cannot install because packageDirectory is unknown') |
|
5663 |
mayProceed:true. |
|
5664 |
^ false. |
|
5665 |
]. |
|
5666 |
||
5667 |
"we need the abbreviations, since sometimes there is no 1-to-1 mapping |
|
5668 |
of class name to file name" |
|
5669 |
||
5670 |
Smalltalk recursiveReadAllAbbreviationsFrom:self packageDirectory maxLevels:1. |
|
5671 |
||
5672 |
"install autoloaded classes first, |
|
5673 |
some others may depend on them" |
|
5674 |
||
5675 |
classNamesToAutoload withIndexDo:[:eachClassName :index| |
|
5676 |
ActivityNotification |
|
5677 |
raiseRequestWith: ((100 / classNamesToAutoload size ) * index) rounded |
|
5678 |
errorString: 'Autoloading class ', eachClassName. |
|
5679 |
||
5680 |
Smalltalk |
|
5681 |
installAutoloadedClassNamed:eachClassName |
|
5682 |
category:#autoloaded "FIXME" |
|
5683 |
package:self package |
|
5684 |
revision:nil |
|
5685 |
numClassInstVars:0. "FIXME" |
|
5686 |
]. |
|
5687 |
||
5688 |
classesWhichFailedToLoad := OrderedCollection new. |
|
5689 |
classNamesToLoad notEmpty ifTrue:[ |
|
5690 |
Verbose == true ifTrue:[ |
|
5691 |
Transcript showCR:(' %1: filing in missing classes (%2) individually...' |
|
5692 |
bindWith:self name with:classNamesToLoad size). |
|
5693 |
] |
|
5694 |
]. |
|
5695 |
classNamesToLoad withIndexDo:[:eachClassName :index| |
|
5696 |
|cls| |
|
5697 |
ActivityNotification |
|
5698 |
raiseRequestWith: ((100 / classNamesToLoad size) * index) rounded |
|
5699 |
errorString: 'Loading class ', eachClassName. |
|
5700 |
||
5701 |
Error handle:[:ex | |
|
5702 |
"maybe, fileIn failed, because the load order is wrong. |
|
5703 |
Work around this by installing the class as autoloaded and |
|
5704 |
loading it" |
|
5705 |
||
5706 |
classesWhichFailedToLoad add:eachClassName. |
|
5707 |
Smalltalk |
|
5708 |
installAutoloadedClassNamed:eachClassName |
|
5709 |
category:#autoloaded "FIXME" |
|
5710 |
package:self package |
|
5711 |
revision:nil |
|
5712 |
numClassInstVars:0. "FIXME" |
|
5713 |
] do:[ |
|
5714 |
Verbose == true ifTrue:[ |
|
5715 |
Transcript showCR:(' %1: filing in %2...' bindWith:self name with:eachClassName). |
|
5716 |
]. |
|
5717 |
cls := Smalltalk |
|
5718 |
fileInClass:eachClassName |
|
5719 |
package:self package |
|
5720 |
initialize:false |
|
5721 |
lazy:false |
|
5722 |
silent:true. |
|
5723 |
cls notNil ifTrue:[ |
|
5724 |
loadedClasses add:cls |
|
5725 |
]. |
|
5726 |
]. |
|
5727 |
]. |
|
5728 |
||
5729 |
classesWhichFailedToLoad do:[:eachClassName | |
|
5730 |
(Smalltalk at:eachClassName) autoload. |
|
5731 |
]. |
|
5732 |
||
5733 |
loadedClasses do:[:eachLoadedClass | |
|
5734 |
"do not initialize, if initialize method is inherited" |
|
5735 |
(eachLoadedClass theMetaclass includesSelector:#initialize) ifTrue:[ |
|
5736 |
eachLoadedClass initialize |
|
5737 |
]. |
|
5738 |
]. |
|
5739 |
^ true. |
|
13411 | 5740 |
]. |
5741 |
^ false. |
|
5742 |
||
5743 |
"Modified: / 26-10-2006 / 12:30:01 / cg" |
|
5744 |
"Modified: / 16-08-2009 / 13:31:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
5745 |
"Created: / 19-06-2010 / 11:36:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5746 |
! |
|
5747 |
||
12294
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5748 |
safeForOverwrittenMethods |
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5749 |
^ safeForOverwrittenMethods |
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5750 |
! |
c46be62dee24
when loading a class, the original definition's state is lost; move it over
Claus Gittinger <cg@exept.de>
parents:
12293
diff
changeset
|
5751 |
|
12624 | 5752 |
unloadAllClasses |
5753 |
Transcript showCR:'unloading not yet fully supported' |
|
5754 |
! |
|
5755 |
||
5756 |
unloadClassLibrary |
|
5757 |
Transcript showCR:'unloading not yet fully supported' |
|
5758 |
! |
|
5759 |
||
5760 |
unloadSubProjects |
|
5761 |
"unload other packages" |
|
5762 |
||
5763 |
self subProjects do:[:p | |
|
13419 | 5764 |
|subDef| |
5765 |
||
5766 |
subDef := self definitionClassForPackage:p. |
|
5767 |
subDef notNil ifTrue:[ |
|
5768 |
subDef unloadSubProjects. |
|
5769 |
subDef unloadPackage. |
|
5770 |
]. |
|
12624 | 5771 |
]. |
5772 |
! |
|
5773 |
||
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
5774 |
update:anAspectSymbol with:argument from:changedObject |
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
5775 |
"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
|
5776 |
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
|
5777 |
|
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
5778 |
(changedObject == self class and:[anAspectSymbol == #methodDictionary]) ifTrue:[ |
13419 | 5779 |
self projectIsLoaded:false. |
10434
25f76184bf81
project definition change marks project as unloaded
Stefan Vogel <sv@exept.de>
parents:
10433
diff
changeset
|
5780 |
] |
10399
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5781 |
! ! |
6c16947a05ca
Allow to load all classes of a project as autoloaded
Stefan Vogel <sv@exept.de>
parents:
10397
diff
changeset
|
5782 |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5783 |
!ProjectDefinition class methodsFor:'private-prerequisites'! |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5784 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5785 |
addReferencesToClassesFromGlobalsIn:aSetOfClasses to:usedClassReasons |
12371 | 5786 |
"helper for searchForPreRequisites" |
5787 |
||
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5788 |
aSetOfClasses |
13419 | 5789 |
do:[:aClass | |
5790 |
self |
|
5791 |
addReferencesToClassesFromGlobalsInMethods: |
|
5792 |
(aClass theNonMetaclass methodDictionary values |
|
5793 |
select:[:m | m package = aClass package]) |
|
5794 |
to:usedClassReasons. |
|
5795 |
||
5796 |
self |
|
5797 |
addReferencesToClassesFromGlobalsInMethods: |
|
5798 |
(aClass theMetaclass methodDictionary values |
|
5799 |
select:[:m | m package = aClass package]) |
|
5800 |
to:usedClassReasons. |
|
5801 |
]. |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5802 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5803 |
"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
|
5804 |
! |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5805 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5806 |
addReferencesToClassesFromGlobalsInMethods:someMethods to:usedClassReasons |
12371 | 5807 |
"helper for searchForPreRequisites" |
5808 |
||
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5809 |
someMethods do:[:method | |
13419 | 5810 |
|resources| |
5811 |
||
5812 |
resources := method resources. |
|
5813 |
(resources isNil |
|
5814 |
or:[ ((resources includesKey:#'ignoreInPrerequisites') not |
|
5815 |
and:[(resources includesKey:#'example') not])]) |
|
5816 |
ifTrue:[ |
|
5817 |
method usedGlobals |
|
5818 |
do:[:global | |
|
5819 |
|globalsName usedClass| |
|
5820 |
||
5821 |
globalsName := global asSymbol. |
|
5822 |
usedClass := Smalltalk at:globalsName. |
|
5823 |
(usedClass notNil and:[usedClass isClass and:[usedClass isNameSpace not]]) ifTrue:[ |
|
5824 |
usedClass name == globalsName ifTrue:[ "/ skip aliases |
|
5825 |
(usedClassReasons at:usedClass ifAbsentPut:[Set new]) |
|
5826 |
add:(usedClass name, ' - referenced by ', method mclass name,'>>',method selector) |
|
5827 |
] |
|
5828 |
] |
|
5829 |
] |
|
5830 |
] |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5831 |
] |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5832 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5833 |
"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
|
5834 |
"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
|
5835 |
! |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5836 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5837 |
searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5838 |
"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
|
5839 |
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
|
5840 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5841 |
|requiredClasses requiredPackageReasons usedClassesWithReasons ignoredPackages| |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5842 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5843 |
usedClassesWithReasons := Dictionary new. |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5844 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5845 |
"my classes are required" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5846 |
requiredClasses := (self searchForClassesWithProject:self package) asSet. |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5847 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5848 |
"my subproject's classes are required" |
13419 | 5849 |
self subProjects do:[:eachProjectName | |
5850 |
requiredClasses addAll: (self searchForClassesWithProject:eachProjectName asSymbol) |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5851 |
]. |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5852 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5853 |
"all superclasses of my classes and my subProject's classes are required" |
13419 | 5854 |
requiredClasses do:[:cls | |
5855 |
cls allSuperclassesDo:[:eachSuperclass | |
|
5856 |
(usedClassesWithReasons at: eachSuperclass ifAbsentPut:[Set new]) |
|
5857 |
add: (eachSuperclass name, ' - superclass of ', cls name). |
|
5858 |
] |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5859 |
]. |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5860 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5861 |
"all classes referenced by my classes or my subproject's classes |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5862 |
are required. But: |
13419 | 5863 |
only search for locals refered to by my methods (assuming that superclasses' |
5864 |
prerequisites are specified in their package)." |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5865 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5866 |
self addReferencesToClassesFromGlobalsIn:requiredClasses to:usedClassesWithReasons. |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5867 |
self addReferencesToClassesFromGlobalsInMethods:(self searchForExtensionsWithProject:self package) to:usedClassesWithReasons. |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5868 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5869 |
"don't put classes from subProjects into the required list" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5870 |
ignoredPackages := (self siblingsAreSubProjects |
13419 | 5871 |
ifTrue:[ self searchForSiblingProjects ] |
5872 |
ifFalse:[ self searchForSubProjects ]) asSet. |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5873 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5874 |
ignoredPackages add:self package. |
12213
73371949b807
overwrittenExtensionMethods handling
Claus Gittinger <cg@exept.de>
parents:
12210
diff
changeset
|
5875 |
ignoredPackages add:PackageId noProjectID. |
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5876 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5877 |
"now map classes to packages and collect the reasons" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5878 |
requiredPackageReasons := Dictionary new. |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5879 |
usedClassesWithReasons keysAndValuesDo:[:usedClass :reasonsPerClass | |usedClassPackage| |
13419 | 5880 |
usedClassPackage := usedClass package. |
5881 |
(ignoredPackages includes:usedClassPackage) ifFalse:[ |
|
5882 |
(requiredPackageReasons at:usedClassPackage ifAbsentPut:[Set new]) |
|
5883 |
addAll:reasonsPerClass. |
|
5884 |
]. |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5885 |
]. |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5886 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5887 |
^ requiredPackageReasons |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5888 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5889 |
" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5890 |
self searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5891 |
stx_libbasic3 searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5892 |
bosch_dapasx_Application searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5893 |
bosch_dapasx_pav_browser searchForPreRequisites |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5894 |
" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5895 |
|
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5896 |
"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
|
5897 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5898 |
"Modified: / 20-09-2006 / 17:29:59 / cg" |
13411 | 5899 |
! |
5900 |
||
5901 |
searchForPreRequisites: packageId |
|
5902 |
"answer a Dictionary where the keys are the prerequisite package for this package |
|
5903 |
and the values are a Set of reasons, why each package is required" |
|
5904 |
||
5905 |
|requiredClasses requiredPackageReasons usedClassesWithReasons ignoredPackages| |
|
5906 |
||
5907 |
usedClassesWithReasons := Dictionary new. |
|
5908 |
||
5909 |
"my classes are required" |
|
5910 |
requiredClasses := (self searchForClassesWithProject: packageId) asSet. |
|
5911 |
||
5912 |
"my subproject's classes are required" |
|
13419 | 5913 |
"self subProjects do:[:eachProjectName | |
5914 |
requiredClasses addAll: (self searchForClassesWithProject:eachProjectName asSymbol) |
|
13411 | 5915 |
]." |
5916 |
||
5917 |
"all superclasses of my classes and my subProject's classes are required" |
|
13419 | 5918 |
requiredClasses do:[:cls | |
5919 |
cls allSuperclassesDo:[:eachSuperclass | |
|
5920 |
(usedClassesWithReasons at: eachSuperclass ifAbsentPut:[Set new]) |
|
5921 |
add: (eachSuperclass name, ' - superclass of ', cls name). |
|
5922 |
] |
|
13411 | 5923 |
]. |
5924 |
||
5925 |
"all classes referenced by my classes or my subproject's classes |
|
5926 |
are required. But: |
|
13419 | 5927 |
only search for locals refered to by my methods (assuming that superclasses' |
5928 |
prerequisites are specified in their package)." |
|
13411 | 5929 |
|
5930 |
self addReferencesToClassesFromGlobalsIn:requiredClasses to:usedClassesWithReasons. |
|
5931 |
self addReferencesToClassesFromGlobalsInMethods:(self searchForExtensionsWithProject:self package) to:usedClassesWithReasons. |
|
5932 |
||
5933 |
"don't put classes from subProjects into the required list" |
|
5934 |
ignoredPackages := (self siblingsAreSubProjects |
|
13419 | 5935 |
ifTrue:[ self searchForSiblingProjects ] |
5936 |
ifFalse:[ self searchForSubProjects ]) asSet. |
|
13411 | 5937 |
|
5938 |
ignoredPackages add:self package. |
|
5939 |
ignoredPackages add:PackageId noProjectID. |
|
5940 |
||
5941 |
"now map classes to packages and collect the reasons" |
|
5942 |
requiredPackageReasons := Dictionary new. |
|
5943 |
usedClassesWithReasons keysAndValuesDo:[:usedClass :reasonsPerClass | |usedClassPackage| |
|
13419 | 5944 |
usedClassPackage := usedClass package. |
5945 |
(ignoredPackages includes:usedClassPackage) ifFalse:[ |
|
5946 |
(requiredPackageReasons at:usedClassPackage ifAbsentPut:[Set new]) |
|
5947 |
addAll:reasonsPerClass. |
|
5948 |
]. |
|
13411 | 5949 |
]. |
5950 |
||
5951 |
^ requiredPackageReasons |
|
5952 |
||
5953 |
" |
|
5954 |
self searchForPreRequisites |
|
5955 |
self searchForPreRequisites:#'stx:libwidg3' |
|
5956 |
bosch_dapasx_Application searchForPreRequisites |
|
5957 |
bosch_dapasx_pav_browser searchForPreRequisites |
|
5958 |
" |
|
5959 |
||
5960 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
5961 |
"Modified: / 20-09-2006 / 17:29:59 / cg" |
|
5962 |
"Created: / 17-11-2010 / 18:27:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11147
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5963 |
! ! |
ea616118c5b6
if method is marked as example- or ignoreInPreRequisite
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
5964 |
|
9585 | 5965 |
!ProjectDefinition class methodsFor:'queries'! |
5966 |
||
13419 | 5967 |
allClassNames |
12368 | 5968 |
^ self classNamesForWhich:[:nm :attr | true ]. |
5969 |
! |
|
5970 |
||
13559 | 5971 |
allClasses |
5972 |
^ self allClassNames collect:[:nm | Smalltalk classNamed:nm] |
|
5973 |
||
5974 |
"Created: / 06-08-2011 / 15:47:36 / cg" |
|
5975 |
! |
|
5976 |
||
13419 | 5977 |
autoloaded_classNames |
12368 | 5978 |
^ self classNamesForWhich:[:nm :attr | attr notEmptyOrNil and:[attr includes:#autoload]]. |
5979 |
||
5980 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
5981 |
"Created: / 30-08-2007 / 18:48:09 / cg" |
|
5982 |
! |
|
5983 |
||
13419 | 5984 |
classNames |
12368 | 5985 |
"answer an array containing all the class names of the project's classes" |
5986 |
||
5987 |
^ self classNamesAndAttributesAsSpecArray collect:[:entry | entry first]. |
|
5988 |
||
5989 |
" |
|
5990 |
stx_libhtml classNames |
|
5991 |
stx_libhtml classNamesAndAttributesAsSpecArray |
|
5992 |
" |
|
5993 |
! |
|
5994 |
||
13419 | 5995 |
classNamesForWhich:aBlock |
12368 | 5996 |
"a correponding method with real names is generated in my subclasses" |
5997 |
||
5998 |
|coll| |
|
5999 |
||
6000 |
coll := OrderedCollection new. |
|
6001 |
self classNamesAndAttributesDo:[:nm :attributes | |
|
13419 | 6002 |
(aBlock value:nm value:attributes) ifTrue:[ |
6003 |
coll add:nm. |
|
6004 |
]. |
|
12368 | 6005 |
]. |
6006 |
^ coll |
|
6007 |
||
6008 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
6009 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
6010 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
|
6011 |
! |
|
6012 |
||
6013 |
classes |
|
6014 |
"list my classes. |
|
6015 |
Project must be loaded - otherwise an error is reported here. |
|
6016 |
Use #classNames if you are only interested in the names" |
|
6017 |
||
6018 |
^ self classNames collect:[:nm | Smalltalk at:nm ifAbsent:[self error:'Missing class']] |
|
6019 |
||
6020 |
" |
|
6021 |
stx_libbasic3 classNames |
|
6022 |
stx_libbasic3 classes |
|
6023 |
" |
|
6024 |
! |
|
6025 |
||
13419 | 6026 |
compiled_classNames |
12368 | 6027 |
^ self classNamesForWhich:[:nm :attr | attr isEmptyOrNil or:[(attr includes:#autoload) not]]. |
6028 |
||
6029 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
6030 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
6031 |
"Modified: / 21-08-2006 / 18:48:31 / cg" |
|
6032 |
! |
|
6033 |
||
6034 |
compiled_classNamesForPlatform |
|
6035 |
"answer the classes to be compiled only for the current platformName" |
|
6036 |
||
6037 |
^ self compiled_classNamesForPlatform:OperatingSystem platformName |
|
6038 |
! |
|
6039 |
||
6040 |
compiled_classNamesForPlatform:platformName |
|
6041 |
"answer the classes to be compiled only for platformName |
|
6042 |
platformName is one of #unix, #win32 (OperatingSystem platformName)" |
|
6043 |
||
13419 | 6044 |
^ self |
6045 |
classNamesForWhich:[:nm :attr | |
|
6046 |
(attr includes:#autoload) not and:[attr includes:platformName] |
|
6047 |
]. |
|
12368 | 6048 |
|
6049 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
6050 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
6051 |
"Modified: / 09-10-2006 / 13:30:08 / cg" |
|
6052 |
! |
|
6053 |
||
6054 |
compiled_classNames_common |
|
6055 |
"classes to be compiled for any platform" |
|
6056 |
||
13419 | 6057 |
^ self |
6058 |
classNamesForWhich:[:nm :attr | |
|
6059 |
attr isEmptyOrNil |
|
6060 |
]. |
|
12368 | 6061 |
|
6062 |
"Created: / 18-08-2006 / 13:37:51 / cg" |
|
6063 |
! |
|
6064 |
||
6065 |
compiled_classNames_unix |
|
6066 |
"class, only to be compiled under unix" |
|
13419 | 6067 |
|
12368 | 6068 |
^ self compiled_classNamesForPlatform:#unix. |
6069 |
||
6070 |
"Created: / 18-08-2006 / 13:37:51 / cg" |
|
6071 |
! |
|
6072 |
||
6073 |
compiled_classNames_windows |
|
6074 |
"class, only to be compiled under windows" |
|
13419 | 6075 |
|
12368 | 6076 |
^ self compiled_classNamesForPlatform:#win32. |
6077 |
||
6078 |
"Created: / 18-08-2006 / 13:37:56 / cg" |
|
6079 |
! |
|
6080 |
||
13081 | 6081 |
extensionClasses |
6082 |
"answer the set of classes, which are extended by the package" |
|
6083 |
||
6084 |
|classes| |
|
6085 |
||
6086 |
classes := IdentitySet new. |
|
6087 |
||
13419 | 6088 |
self extensionMethodNames pairWiseDo:[:className :selector | |
6089 |
|mthdCls cls| |
|
6090 |
||
6091 |
mthdCls := Smalltalk classNamed:className. |
|
6092 |
(mthdCls notNil and:[mthdCls isLoaded]) ifTrue:[ |
|
6093 |
cls := mthdCls theNonMetaclass. |
|
6094 |
(classes includes:cls) ifFalse:[ |
|
6095 |
cls withAllSuperclassesDo:[:eachClass | |
|
6096 |
classes add:eachClass. |
|
6097 |
]. |
|
6098 |
]. |
|
6099 |
]. |
|
13081 | 6100 |
]. |
6101 |
^ classes. |
|
6102 |
||
6103 |
" |
|
13419 | 6104 |
stx_libboss extensionClasses |
13081 | 6105 |
" |
6106 |
! |
|
6107 |
||
12368 | 6108 |
extensionMethods |
6109 |
"list my extension methods. |
|
6110 |
Project must be loaded - otherwise an error is reported here. |
|
6111 |
Use #extensionMethodsNames if you are only interested in the names" |
|
6112 |
||
13419 | 6113 |
^ self extensionMethodNames |
6114 |
pairWiseCollect:[:className :selector | |
|
6115 |
(Smalltalk classNamed:className) compiledMethodAt:selector. |
|
6116 |
]. |
|
12368 | 6117 |
|
6118 |
" |
|
6119 |
stx_libbasic2 extensionMethodNames |
|
6120 |
stx_libbasic2 extensionMethods |
|
6121 |
" |
|
6122 |
! |
|
6123 |
||
13081 | 6124 |
extensionPackages |
6125 |
"answer the set of packages, which are extended by this package" |
|
6126 |
||
6127 |
^ self extensionClasses collect:[:eachClass| eachClass package] |
|
6128 |
||
6129 |
" |
|
13419 | 6130 |
stx_libboss extensionPackages |
13081 | 6131 |
" |
6132 |
! |
|
6133 |
||
10144 | 6134 |
hasAllClassesFullyLoaded |
6135 |
"return true, if all classes are present and loaded" |
|
6136 |
||
6137 |
^ self hasAllClassesLoaded:true |
|
6138 |
||
6139 |
"Created: / 25-10-2006 / 16:08:25 / cg" |
|
6140 |
! |
|
6141 |
||
9627 | 6142 |
hasAllClassesLoaded |
10205 | 6143 |
"return true, if all classes are present (although, some might be autoloaded)" |
10144 | 6144 |
|
6145 |
^ self hasAllClassesLoaded:false |
|
6146 |
||
6147 |
"Modified: / 25-10-2006 / 16:08:11 / cg" |
|
6148 |
! |
|
6149 |
||
6150 |
hasAllClassesLoaded:checkIfFullyLoaded |
|
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
6151 |
"check if all classes for this platform are present. |
12421
67898c88eceb
comment/format in: #hasAllClassesLoaded:
Claus Gittinger <cg@exept.de>
parents:
12416
diff
changeset
|
6152 |
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
|
6153 |
|
13419 | 6154 |
^ (self |
6155 |
hasClasses:(self classNamesForWhich:[:nm :attr | attr isEmptyOrNil or:[ attr includes:#autoload]]) |
|
6156 |
loaded:checkIfFullyLoaded) |
|
10154 | 6157 |
and:[ |
13419 | 6158 |
self |
6159 |
hasClasses:(self compiled_classNamesForPlatform:OperatingSystem platformName) |
|
6160 |
loaded:checkIfFullyLoaded ] |
|
10154 | 6161 |
|
6162 |
"Modified: / 07-11-2006 / 11:47:30 / cg" |
|
6163 |
! |
|
6164 |
||
6165 |
hasAllCompiledClassesFullyLoaded |
|
6166 |
"return true, if all compiled classes are present and loaded" |
|
6167 |
||
6168 |
^ self hasAllCompiledClassesLoaded:true |
|
6169 |
||
6170 |
"Created: / 07-11-2006 / 11:48:02 / cg" |
|
6171 |
! |
|
6172 |
||
6173 |
hasAllCompiledClassesLoaded:checkIfFullyLoaded |
|
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
6174 |
"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
|
6175 |
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
|
6176 |
|
13419 | 6177 |
^ (self |
6178 |
hasClasses:(self classNamesForWhich:[:nm :attr | attr isEmptyOrNil]) |
|
6179 |
loaded:checkIfFullyLoaded) |
|
10154 | 6180 |
and:[ |
13419 | 6181 |
self |
6182 |
hasClasses:(self compiled_classNamesForPlatform:OperatingSystem platformName) |
|
6183 |
loaded:checkIfFullyLoaded |
|
10366
8990764f8911
#compiled_classNamesForPlatform: does not return classes names,
Stefan Vogel <sv@exept.de>
parents:
10350
diff
changeset
|
6184 |
] |
9585 | 6185 |
! |
6186 |
||
9627 | 6187 |
hasAllExtensionsLoaded |
10203
b210e7832fe1
Do not autoload when checking for extensions
Stefan Vogel <sv@exept.de>
parents:
10200
diff
changeset
|
6188 |
"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
|
6189 |
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
|
6190 |
|
9627 | 6191 |
self extensionMethodNames pairWiseDo:[:className :selector | |
13419 | 6192 |
|cls| |
6193 |
||
6194 |
cls := Smalltalk loadedClassNamed:className. |
|
6195 |
cls isNil ifTrue:[ |
|
6196 |
Verbose == true ifTrue:[ |
|
6197 |
Transcript showCR:(self name,' missing extension class "',className,'".'). |
|
6198 |
]. |
|
6199 |
^ false |
|
6200 |
]. |
|
6201 |
"there is no possibility that we installed an extension method in an unloaded class" |
|
6202 |
(cls isLoaded not or:[(cls compiledMethodAt:selector) isNil]) ifTrue:[ |
|
6203 |
Verbose == true ifTrue:[ |
|
6204 |
Transcript showCR:(self name,' missing extension method "',className,'>>',selector,'".'). |
|
6205 |
]. |
|
6206 |
^ false |
|
6207 |
]. |
|
9627 | 6208 |
]. |
6209 |
^ true. |
|
6210 |
||
6211 |
"Created: / 17-08-2006 / 00:50:01 / cg" |
|
10140 | 6212 |
"Modified: / 25-10-2006 / 00:01:10 / cg" |
9850 | 6213 |
! |
6214 |
||
10369
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
6215 |
hasClasses:classNames loaded:checkIfFullyLoaded |
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
6216 |
"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
|
6217 |
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
|
6218 |
are not considered" |
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
6219 |
|
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
6220 |
classNames do:[:eachClassName | |
13419 | 6221 |
|cls| |
6222 |
||
6223 |
cls := Smalltalk loadedClassNamed:eachClassName. |
|
6224 |
cls isNil ifTrue:[ |
|
6225 |
(self name,' [info]: missing class: ',eachClassName) infoPrintCR. |
|
6226 |
^ false |
|
6227 |
]. |
|
6228 |
(checkIfFullyLoaded and:[cls isLoaded not]) ifTrue:[ |
|
6229 |
(self name,' [info]: unloaded class: ',eachClassName) infoPrintCR. |
|
6230 |
^ false. |
|
6231 |
]. |
|
10369
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
6232 |
]. |
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
6233 |
|
14baf6dc8ba6
No diag message about "unloaded classes" when loading packages
Stefan Vogel <sv@exept.de>
parents:
10368
diff
changeset
|
6234 |
^ true |
10154 | 6235 |
! |
6236 |
||
9906
9efd21c9b1b6
hasExtensions is a bad name (conflicts with the other query)
Claus Gittinger <cg@exept.de>
parents:
9904
diff
changeset
|
6237 |
hasExtensionMethods |
9850 | 6238 |
^ self extensionMethodNames notEmpty |
6239 |
||
6240 |
"Created: / 14-09-2006 / 14:19:35 / cg" |
|
10005 | 6241 |
! |
6242 |
||
12369 | 6243 |
hasPostLoadAction |
6244 |
"/ true if postLoadAction has been redefined |
|
6245 |
^ (self class whichClassIncludesSelector:#postLoadAction) theNonMetaclass isAbstract not |
|
6246 |
! |
|
6247 |
||
6248 |
hasPostUnloadAction |
|
6249 |
"/ true if postUnloadAction has been redefined |
|
6250 |
^ (self class whichClassIncludesSelector:#postUnloadAction) theNonMetaclass isAbstract not |
|
6251 |
! |
|
6252 |
||
6253 |
hasPreLoadAction |
|
6254 |
"/ true if preLoadAction has been redefined |
|
6255 |
^ (self class whichClassIncludesSelector:#preLoadAction) theNonMetaclass isAbstract not |
|
6256 |
! |
|
6257 |
||
6258 |
hasPreUnloadAction |
|
6259 |
"/ true if preUnloadAction has been redefined |
|
6260 |
^ (self class whichClassIncludesSelector:#preUnloadAction) theNonMetaclass isAbstract not |
|
6261 |
! |
|
6262 |
||
13609 | 6263 |
isAbstract |
6264 |
^ self == ProjectDefinition |
|
6265 |
||
6266 |
"Modified (format): / 20-08-2011 / 22:47:46 / cg" |
|
6267 |
! |
|
6268 |
||
10140 | 6269 |
isFullyLoaded |
13419 | 6270 |
^ self hasAllCompiledClassesFullyLoaded |
13167 | 6271 |
and:[self hasAllClassesLoaded and:[self hasAllExtensionsLoaded]] |
10140 | 6272 |
|
6273 |
"Created: / 24-10-2006 / 23:52:23 / cg" |
|
13609 | 6274 |
"Modified: / 20-08-2011 / 22:47:16 / cg" |
12331 | 6275 |
! |
6276 |
||
6277 |
projectType |
|
6278 |
^ self subclassResponsibility |
|
9585 | 6279 |
! ! |
6280 |
||
10774 | 6281 |
!ProjectDefinition class methodsFor:'queries-privacy'! |
6282 |
||
6283 |
showClassDocumentationOf:aClass |
|
12198
f3f15cc6a32e
changed: #showClassDocumentationOf:
Claus Gittinger <cg@exept.de>
parents:
12192
diff
changeset
|
6284 |
"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
|
6285 |
or hidden. |
f3f15cc6a32e
changed: #showClassDocumentationOf:
Claus Gittinger <cg@exept.de>
parents:
12192
diff
changeset
|
6286 |
(used for expecco, to suppress documentation of workflow- and expecco classes |
f3f15cc6a32e
changed: #showClassDocumentationOf:
Claus Gittinger <cg@exept.de>
parents:
12192
diff
changeset
|
6287 |
in the expecco-class browser)" |
10774 | 6288 |
|
6289 |
^ true |
|
6290 |
||
6291 |
"Created: / 05-11-2007 / 16:44:16 / cg" |
|
6292 |
! ! |
|
6293 |
||
9726 | 6294 |
!ProjectDefinition class methodsFor:'sanity checks'! |
6295 |
||
6296 |
validateDescription |
|
9956 | 6297 |
|emptyProjects nonProjects emptyOrNonProjects| |
6298 |
||
6299 |
emptyProjects := Set withAll:self subProjects. |
|
6300 |
Smalltalk allClassesDo:[:cls | |
|
13419 | 6301 |
emptyProjects remove:(cls package) ifAbsent:[]. |
9956 | 6302 |
]. |
6303 |
nonProjects := self subProjects select:[:p | |
|
13419 | 6304 |
(ProjectDefinition definitionClassForPackage: p) isNil |
6305 |
]. |
|
9956 | 6306 |
|
6307 |
emptyOrNonProjects := Set withAll:emptyProjects. |
|
6308 |
emptyOrNonProjects addAll:nonProjects. |
|
6309 |
||
6310 |
emptyOrNonProjects notEmpty ifTrue:[ |
|
13419 | 6311 |
(Dialog |
6312 |
confirm:('The following projects are non-existent, empty or without description:\\ ' |
|
6313 |
, ((emptyOrNonProjects |
|
6314 |
asSortedCollection |
|
6315 |
collect:[:p | p allBold]) |
|
6316 |
asStringWith:'\ ') |
|
6317 |
, '\\Continue ?') withCRs |
|
6318 |
yesLabel:'OK' noLabel:'Cancel') |
|
6319 |
ifFalse:[ |
|
6320 |
AbortSignal raise |
|
6321 |
]. |
|
9956 | 6322 |
]. |
6323 |
||
6324 |
"Modified: / 19-09-2006 / 20:30:39 / cg" |
|
9726 | 6325 |
! ! |
6326 |
||
9585 | 6327 |
!ProjectDefinition class methodsFor:'testing'! |
6328 |
||
9664 | 6329 |
isApplicationDefinition |
6330 |
^ false |
|
6331 |
||
6332 |
"Created: / 23-08-2006 / 15:17:32 / cg" |
|
9983 | 6333 |
"Modified: / 20-09-2006 / 14:59:56 / cg" |
6334 |
! |
|
6335 |
||
12309
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
6336 |
isConsoleApplication |
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
6337 |
^ false |
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
6338 |
|
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
6339 |
"Created: / 20-09-2006 / 14:59:49 / cg" |
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
6340 |
! |
f51aaafd2131
added: #isConsoleApplication
Claus Gittinger <cg@exept.de>
parents:
12305
diff
changeset
|
6341 |
|
9983 | 6342 |
isGUIApplication |
6343 |
^ false |
|
6344 |
||
6345 |
"Created: / 20-09-2006 / 14:59:49 / cg" |
|
9664 | 6346 |
! |
6347 |
||
6348 |
isLibraryDefinition |
|
6349 |
^ false |
|
6350 |
||
6351 |
"Created: / 23-08-2006 / 15:17:46 / cg" |
|
9983 | 6352 |
"Modified: / 20-09-2006 / 15:00:00 / cg" |
9664 | 6353 |
! |
6354 |
||
9627 | 6355 |
isProjectDefinition |
9664 | 6356 |
"concrete i.e. not abstract" |
6357 |
||
13285 | 6358 |
^ self ~~ ProjectDefinition "/ skip myself - I am abstract |
9627 | 6359 |
|
6360 |
"Created: / 10-08-2006 / 16:24:02 / cg" |
|
13285 | 6361 |
"Modified: / 08-02-2011 / 10:03:49 / cg" |
9585 | 6362 |
! ! |
6363 |
||
13592 | 6364 |
!ProjectDefinition::AbbrevEntry methodsFor:'accessing'! |
6365 |
||
6366 |
category |
|
6367 |
^ category |
|
6368 |
! |
|
6369 |
||
6370 |
className |
|
6371 |
^ className |
|
6372 |
! |
|
6373 |
||
6374 |
className:classNameArg fileName:fileNameArg category:categoryArg numClassInstVars:numClassInstVarsArg |
|
6375 |
className := classNameArg. |
|
6376 |
fileName := fileNameArg. |
|
6377 |
category := categoryArg. |
|
6378 |
numClassInstVars := numClassInstVarsArg. |
|
6379 |
||
6380 |
"Created: / 18-08-2011 / 14:18:30 / cg" |
|
6381 |
! |
|
6382 |
||
6383 |
fileName |
|
6384 |
^ fileName |
|
6385 |
! |
|
6386 |
||
6387 |
numClassInstVars |
|
6388 |
^ numClassInstVars |
|
6389 |
||
6390 |
"Created: / 18-08-2011 / 14:18:37 / cg" |
|
6391 |
! ! |
|
6392 |
||
9569 | 6393 |
!ProjectDefinition class methodsFor:'documentation'! |
9536 | 6394 |
|
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
6395 |
version |
13623
46625f58d8ee
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13614
diff
changeset
|
6396 |
^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.347 2011-09-04 09:15:48 cg Exp $' |
13610
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
6397 |
! |
ec7ea708ebd2
changed: #installAutoloadedClasses
Claus Gittinger <cg@exept.de>
parents:
13609
diff
changeset
|
6398 |
|
12086 | 6399 |
version_CVS |
13623
46625f58d8ee
changed: #loadAsAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
13614
diff
changeset
|
6400 |
^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.347 2011-09-04 09:15:48 cg Exp $' |
13411 | 6401 |
! |
6402 |
||
6403 |
version_SVN |
|
13485
60df70976373
changed: #classNamesByCategory
Claus Gittinger <cg@exept.de>
parents:
13419
diff
changeset
|
6404 |
^ '§ Id: ProjectDefinition.st 10645 2011-06-09 15:28:45Z vranyj1 §' |
9536 | 6405 |
! ! |
9714 | 6406 |
|
6407 |
ProjectDefinition initialize! |