author | Stefan Vogel <sv@exept.de> |
Tue, 26 Sep 2006 14:10:02 +0200 | |
changeset 10013 | c6cd8f035693 |
parent 10011 | 4df81726da18 |
child 10022 | e0df2092b978 |
permissions | -rw-r--r-- |
9553 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
" |
|
12 |
||
9671 | 13 |
"{ Package: 'stx:libbasic' }" |
9536 | 14 |
|
9569 | 15 |
Object subclass:#ProjectDefinition |
9984 | 16 |
instanceVariableNames:'' |
17 |
classVariableNames:'LibraryType GUIApplicationType NonGUIApplicationType' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'System-Support-Projects' |
|
9536 | 20 |
! |
21 |
||
9607 | 22 |
ProjectDefinition class instanceVariableNames:'overwrittenMethods' |
23 |
||
24 |
" |
|
25 |
No other class instance variables are inherited by this class. |
|
26 |
" |
|
27 |
! |
|
28 |
||
9569 | 29 |
!ProjectDefinition class methodsFor:'documentation'! |
9553 | 30 |
|
31 |
copyright |
|
32 |
" |
|
33 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
34 |
All Rights Reserved |
|
35 |
||
36 |
This software is furnished under a license and may be used |
|
37 |
only in accordance with the terms of that license and with the |
|
38 |
inclusion of the above copyright notice. This software may not |
|
39 |
be provided or otherwise made available to, or used by, any |
|
40 |
other person. No title to or ownership of the software is |
|
41 |
hereby transferred. |
|
42 |
" |
|
9714 | 43 |
! |
44 |
||
45 |
documentation |
|
46 |
" |
|
47 |
redefinable build-file attributes: |
|
48 |
||
49 |
stcOptimizationOptions -> STCLOCALOPT |
|
50 |
stcWarningOptions -> STCLOCALOPT |
|
51 |
localIncludes_unix -> LOCALINCLUDES (Make.proto) |
|
52 |
localIncludes_win32 -> LOCALINCLUDES (nt.mak) |
|
53 |
||
54 |
for applications: |
|
55 |
startupClassName |
|
56 |
startupSelector |
|
57 |
||
58 |
for libraries: |
|
59 |
||
60 |
" |
|
9553 | 61 |
! ! |
9536 | 62 |
|
9569 | 63 |
!ProjectDefinition class methodsFor:'instance creation'! |
9559 | 64 |
|
65 |
newForPackage:packageID |
|
66 |
^ self |
|
67 |
newNamed:(self initialClassNameForDefinitionOf:packageID) |
|
68 |
package:packageID. |
|
69 |
||
70 |
"Created: / 11-08-2006 / 14:27:19 / cg" |
|
71 |
! |
|
72 |
||
73 |
newNamed:newName package:packageID |
|
74 |
|newClass| |
|
75 |
||
76 |
"/ for now, we are strict. |
|
77 |
self assert:(self initialClassNameForDefinitionOf:packageID) = newName. |
|
9569 | 78 |
self assert:(self ~~ ProjectDefinition). "ProjectDefinition is abstract" |
9559 | 79 |
|
80 |
newClass := self |
|
81 |
subclass:(newName asSymbol) |
|
82 |
instanceVariableNames:'' |
|
83 |
classVariableNames:'' |
|
84 |
poolDictionaries:'' |
|
85 |
category:(self defaultCategory). |
|
86 |
||
87 |
newClass package:packageID asSymbol. |
|
88 |
^ newClass |
|
89 |
||
90 |
"Created: / 09-08-2006 / 17:57:37 / fm" |
|
91 |
"Modified: / 09-08-2006 / 19:27:53 / fm" |
|
9569 | 92 |
"Modified: / 17-08-2006 / 17:24:23 / cg" |
9559 | 93 |
! ! |
94 |
||
9569 | 95 |
!ProjectDefinition class methodsFor:'accessing'! |
9536 | 96 |
|
97 |
defaultCategory |
|
98 |
^'* Projects *' |
|
99 |
||
100 |
"Created: / 11-08-2006 / 14:16:49 / cg" |
|
101 |
! |
|
102 |
||
103 |
initialClassNameForDefinitionOf:aPackageId |
|
104 |
|s| |
|
105 |
||
106 |
s := aPackageId asString copy replaceAny:':/' with:$_. |
|
107 |
(s endsWith:$_) ifTrue:[ |
|
108 |
s := s copyWithoutLast:1 |
|
109 |
]. |
|
110 |
^ s |
|
111 |
||
112 |
" |
|
113 |
DapasXProject initialClassNameForDefinitionOf:'bosch:dapasx/interactiver_editor' |
|
114 |
DapasXProject initialClassNameForDefinitionOf:'stx:libbasic' |
|
115 |
DapasXProject initialClassNameForDefinitionOf:'stx:goodies/xml' |
|
116 |
" |
|
117 |
||
118 |
"Created: / 09-08-2006 / 17:44:47 / fm" |
|
119 |
"Modified: / 11-08-2006 / 14:00:05 / cg" |
|
120 |
! |
|
121 |
||
122 |
libraryName |
|
9575 | 123 |
^ self package asPackageId libraryName |
9536 | 124 |
|
9559 | 125 |
" |
9688 | 126 |
bosch_dapasx_datenbasis libraryName |
9575 | 127 |
stx_libbasic3 libraryName |
9559 | 128 |
" |
9536 | 129 |
|
130 |
"Modified: / 09-08-2006 / 18:20:29 / fm" |
|
9575 | 131 |
"Modified: / 18-08-2006 / 12:36:45 / cg" |
9536 | 132 |
! |
133 |
||
9559 | 134 |
libraryNameFor:aProjectID |
9575 | 135 |
^ aProjectID asPackageId libraryName |
9536 | 136 |
|
9559 | 137 |
" |
9575 | 138 |
bosch_dapasx_datenbasis libraryName |
139 |
stx_libbasic3 libraryNameFor:'stx:libbasic' |
|
9688 | 140 |
stx_libbasic3 libraryNameFor:'bosch:dapasx/datenbasis' |
9559 | 141 |
" |
9536 | 142 |
|
143 |
"Modified: / 09-08-2006 / 18:20:29 / fm" |
|
9575 | 144 |
"Modified: / 18-08-2006 / 12:37:02 / cg" |
9536 | 145 |
! |
146 |
||
147 |
module |
|
9559 | 148 |
^ self moduleOfClass:self |
9536 | 149 |
|
9559 | 150 |
" |
151 |
bosch_dapasx_datenbasis_Definition module |
|
152 |
DapasX_Datenbasis module |
|
9575 | 153 |
stx_libbasic3 module |
9559 | 154 |
" |
9536 | 155 |
|
156 |
"Created: / 08-08-2006 / 20:24:53 / fm" |
|
157 |
"Modified: / 09-08-2006 / 16:16:37 / fm" |
|
9575 | 158 |
"Modified: / 17-08-2006 / 20:50:46 / cg" |
9536 | 159 |
! |
160 |
||
161 |
moduleDirectory |
|
9575 | 162 |
^ (PackageId from:self package) directory |
9536 | 163 |
|
9559 | 164 |
" |
9575 | 165 |
bosch_dapasx_datenbasis_Definition moduleDirectory |
166 |
bosch_dapasx_parameter_system_Definition moduleDirectory |
|
167 |
stx_libbasic3 moduleDirectory |
|
9559 | 168 |
" |
9536 | 169 |
|
170 |
"Created: / 08-08-2006 / 20:25:39 / fm" |
|
9575 | 171 |
"Modified: / 18-08-2006 / 12:18:33 / cg" |
9536 | 172 |
! |
173 |
||
9559 | 174 |
moduleDirectoryFor:aProjectID |
175 |
^ (aProjectID subStrings:$:) last |
|
9536 | 176 |
|
9559 | 177 |
" |
178 |
bosch_dapasx_datenbasis_Definition moduleDirectory |
|
179 |
bosch_dapasx_parameter_system_Definition moduleDirectory |
|
180 |
" |
|
9536 | 181 |
|
182 |
"Created: / 08-08-2006 / 20:25:39 / fm" |
|
9559 | 183 |
"Modified: / 17-08-2006 / 14:13:41 / cg" |
9536 | 184 |
! |
185 |
||
9891 | 186 |
moduleDirectory_win32 |
187 |
^ (PackageId from:self package) directory copy replaceAll:$/ with:$\ |
|
188 |
||
189 |
" |
|
190 |
bosch_dapasx_datenbasis moduleDirectory_win32 |
|
191 |
bosch_dapasx_parameter_system moduleDirectory_win32 |
|
192 |
stx_libbasic3 moduleDirectory_win32 |
|
193 |
" |
|
194 |
||
195 |
"Created: / 14-09-2006 / 20:19:17 / cg" |
|
196 |
! |
|
197 |
||
9559 | 198 |
moduleFor:aProjectID |
199 |
^ (aProjectID subStrings:$:) first |
|
9536 | 200 |
|
9559 | 201 |
" |
202 |
DapasXProject module |
|
203 |
DapasX_Datenbasis module |
|
204 |
" |
|
9536 | 205 |
|
206 |
"Created: / 09-08-2006 / 16:16:16 / fm" |
|
9559 | 207 |
"Modified: / 17-08-2006 / 14:13:46 / cg" |
9536 | 208 |
! |
209 |
||
9559 | 210 |
moduleOfClass:aClass |
211 |
^ self moduleFor:aClass package |
|
9536 | 212 |
|
9559 | 213 |
" |
214 |
DapasXProject module |
|
215 |
DapasX_Datenbasis module |
|
216 |
" |
|
9536 | 217 |
|
218 |
"Created: / 09-08-2006 / 16:16:16 / fm" |
|
9559 | 219 |
"Modified: / 17-08-2006 / 14:13:51 / cg" |
9536 | 220 |
! |
221 |
||
9559 | 222 |
msdosPathToPackage:toPackageID from:fromPackageID |
223 |
"Returns the path to the package defined by aPackageID relative to my path" |
|
224 |
||
9901 | 225 |
|pTop parts1 parts2 common up down rel| |
9852 | 226 |
|
227 |
parts1 := fromPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
228 |
parts2 := toPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
229 |
common := parts1 commonPrefixWith:parts2. |
|
230 |
common notEmpty ifTrue:[ |
|
9880 | 231 |
up := ((1 to:parts1 size - common size) collect:[:p | '..\']) asStringWith:''. |
232 |
down := (parts2 copyFrom:common size+1) asStringWith:'\'. |
|
233 |
(up isEmpty and:[down isEmpty]) ifTrue:[^ '.']. |
|
234 |
^ up,down |
|
9852 | 235 |
]. |
9714 | 236 |
|
9901 | 237 |
rel := (self topRelativePathToPackage_win32:toPackageID). |
238 |
(rel startsWith:'stx\') ifTrue:[ |
|
239 |
^ '$(TOP)',(rel copyFrom:'stx' size+1) |
|
9714 | 240 |
]. |
9536 | 241 |
|
9901 | 242 |
^ '$(TOP)\..\',rel. |
243 |
||
244 |
"/ pTop := self msdosPathToTopFor:fromPackageID. |
|
245 |
"/ (pTop endsWith:'\stx') ifTrue:[ |
|
246 |
"/ ^ (pTop copyButLast:'stx' size),(self topRelativePathToPackage_win32:toPackageID) |
|
247 |
"/ ] ifFalse:[ |
|
248 |
"/ ^ pTop,'\..\',(self topRelativePathToPackage_win32:toPackageID) |
|
249 |
"/ ]. |
|
250 |
||
9559 | 251 |
" |
252 |
self msdosPathToPackage:'bosch:dapasx/kernel' from:'bosch:dapasx/application' |
|
9852 | 253 |
self msdosPathToPackage:'stx:libbasic' from:'bosch:dapasx/application' |
254 |
self msdosPathToPackage:'bosch:dapasx/application' from:'stx:libbasic' |
|
9559 | 255 |
" |
9536 | 256 |
|
9559 | 257 |
"Created: / 17-08-2006 / 14:26:39 / cg" |
9901 | 258 |
"Modified: / 14-09-2006 / 22:04:56 / cg" |
9536 | 259 |
! |
260 |
||
9714 | 261 |
msdosPathToTopFor:aProjectID |
9559 | 262 |
"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 | 263 |
|
9852 | 264 |
|parts| |
265 |
||
266 |
parts := aProjectID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
267 |
||
268 |
aProjectID asPackageId module = 'stx' ifTrue:[ |
|
269 |
parts size == 1 ifTrue:[^ '.']. |
|
270 |
^ (((2 to:parts size-1) collect:[:p | '..\']) asStringWith:'') , '..' |
|
271 |
]. |
|
272 |
||
273 |
^ ((parts collect:[:p | '..\']) asStringWith:'') , 'stx' |
|
9536 | 274 |
|
9559 | 275 |
" |
9852 | 276 |
self msdosPathToTopFor: #'bosch' |
277 |
self msdosPathToTopFor: #'bosch:dapasx' |
|
9559 | 278 |
self msdosPathToTopFor: #'bosch:dapasx/datenbasis' |
9852 | 279 |
self msdosPathToTopFor: #'stx' |
280 |
self msdosPathToTopFor: #'stx:libview' |
|
281 |
self msdosPathToTopFor: #'stx:goodies/foo' |
|
9559 | 282 |
" |
9536 | 283 |
|
284 |
"Created: / 09-08-2006 / 15:45:54 / fm" |
|
9852 | 285 |
"Modified: / 14-09-2006 / 14:49:17 / cg" |
9559 | 286 |
! |
287 |
||
9536 | 288 |
packageName |
9688 | 289 |
"the last component" |
9536 | 290 |
|
9688 | 291 |
^ self packageNameFor: self package |
9536 | 292 |
|
9688 | 293 |
" |
294 |
bosch_dapasx_hw_schnittstellen packageName |
|
295 |
bosch_dapasx_datenbasis packageName |
|
296 |
bosch_dapasx_parameter_system packageName |
|
297 |
" |
|
9536 | 298 |
|
299 |
"Created: / 08-08-2006 / 20:24:53 / fm" |
|
300 |
"Modified: / 09-08-2006 / 16:16:37 / fm" |
|
301 |
! |
|
302 |
||
303 |
packageNameFor: aProjectID |
|
9688 | 304 |
^ (aProjectID asCollectionOfSubstringsSeparatedByAny:':/') last. |
9536 | 305 |
|
9688 | 306 |
" |
307 |
bosch_dapasx_hw_schnittstellen packageName |
|
308 |
bosch_dapasx_datenbasis packageName |
|
309 |
bosch_dapasx_parameter_system packageName |
|
310 |
" |
|
9536 | 311 |
|
312 |
"Created: / 08-08-2006 / 20:24:53 / fm" |
|
313 |
"Modified: / 09-08-2006 / 16:16:37 / fm" |
|
314 |
"Modified: / 11-08-2006 / 14:02:32 / cg" |
|
315 |
! |
|
316 |
||
317 |
parentProject |
|
318 |
||
319 |
^(self parentProjectFor: self package) |
|
320 |
||
321 |
" |
|
322 |
bosch_dapasx_hw_schnittstellen_Definition parentProject |
|
323 |
DapasX_Datenbasis parentProject |
|
324 |
" |
|
325 |
||
326 |
"Created: / 07-08-2006 / 20:18:27 / fm" |
|
327 |
"Modified: / 08-08-2006 / 10:47:37 / fm" |
|
328 |
! |
|
329 |
||
330 |
parentProjectFor: aProjectID |
|
331 |
||
332 |
^(aProjectID subStrings: $/) first |
|
333 |
||
334 |
" |
|
9664 | 335 |
bosch_dapasx_hw_schnittstellen parentProject |
9536 | 336 |
" |
337 |
||
338 |
"Created: / 07-08-2006 / 20:18:27 / fm" |
|
339 |
"Modified: / 08-08-2006 / 10:47:37 / fm" |
|
9664 | 340 |
"Modified: / 23-08-2006 / 15:07:36 / cg" |
9536 | 341 |
! |
342 |
||
9850 | 343 |
pathSeparator:architecture |
344 |
architecture == #unix ifTrue:[ |
|
345 |
^ self pathSeparator_unix |
|
346 |
]. |
|
347 |
architecture == #win32 ifTrue:[ |
|
348 |
^ self pathSeparator_win32 |
|
349 |
]. |
|
350 |
self error. |
|
351 |
||
352 |
"Created: / 14-09-2006 / 13:38:00 / cg" |
|
353 |
! |
|
354 |
||
355 |
pathSeparator_unix |
|
356 |
^ $/ |
|
357 |
||
358 |
"Created: / 14-09-2006 / 13:37:18 / cg" |
|
359 |
! |
|
360 |
||
361 |
pathSeparator_win32 |
|
362 |
^ $\ |
|
363 |
||
364 |
"Created: / 14-09-2006 / 13:37:23 / cg" |
|
365 |
! |
|
366 |
||
367 |
pathTo:aBaseFilename inPackage:aPackageID architecture:arch |
|
368 |
"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" |
|
369 |
||
370 |
|p| |
|
371 |
||
372 |
arch == #unix ifTrue:[ |
|
373 |
p := (self pathToPackage_unix:aPackageID). |
|
374 |
aBaseFilename isNil ifTrue:[^ p]. |
|
375 |
^ p , '/' , aBaseFilename |
|
376 |
]. |
|
377 |
arch == #win32 ifTrue:[ |
|
378 |
p := self pathToPackage_win32:aPackageID. |
|
379 |
aBaseFilename isNil ifTrue:[^ p]. |
|
380 |
^ p , '\' , aBaseFilename |
|
381 |
]. |
|
382 |
self error |
|
383 |
||
384 |
"Created: / 14-09-2006 / 13:29:20 / cg" |
|
385 |
! |
|
386 |
||
387 |
pathToPackage_unix:aPackageID |
|
388 |
"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" |
|
389 |
||
390 |
|pTop| |
|
391 |
||
9880 | 392 |
aPackageID asPackageId module = self package asPackageId module ifTrue:[ |
393 |
^ self unixPathToPackage:aPackageID from:self package |
|
394 |
]. |
|
9850 | 395 |
pTop := self pathToTop_unix. |
396 |
(pTop endsWith:'/stx') ifTrue:[ |
|
397 |
^ (pTop copyWithoutLast:'stx' size),(self topRelativePathToPackage_unix:aPackageID) |
|
398 |
] ifFalse:[ |
|
399 |
^ pTop,'/../',(self topRelativePathToPackage_unix:aPackageID) |
|
400 |
] |
|
401 |
||
402 |
" |
|
9880 | 403 |
bosch_dapasx_kernel pathToPackage_unix:'bosch:dapasx/kernel' |
404 |
bosch_dapasx_kernel pathToPackage_unix:'bosch:dapasx/support' |
|
405 |
stx_libbasic pathToPackage_unix:'bosch:dapasx/kernel' |
|
9850 | 406 |
" |
407 |
||
408 |
"Modified: / 16-08-2006 / 18:55:41 / User" |
|
409 |
"Created: / 14-09-2006 / 13:21:23 / cg" |
|
9880 | 410 |
"Modified: / 14-09-2006 / 15:23:59 / cg" |
9850 | 411 |
! |
412 |
||
413 |
pathToPackage_win32:aPackageID |
|
414 |
"Returns the path to the package defined by aPackageID relative to my path" |
|
415 |
||
416 |
|pTop| |
|
417 |
||
9880 | 418 |
aPackageID asPackageId module = self package asPackageId module ifTrue:[ |
419 |
^ self msdosPathToPackage:aPackageID from:self package |
|
420 |
]. |
|
421 |
||
9850 | 422 |
pTop := self pathToTop_win32. |
423 |
(pTop endsWith:'\stx') ifTrue:[ |
|
424 |
^ (pTop copyWithoutLast:'stx' size),(self topRelativePathToPackage_win32:aPackageID) |
|
425 |
] ifFalse:[ |
|
426 |
^ pTop,'\..\',(self topRelativePathToPackage_win32:aPackageID) |
|
427 |
]. |
|
428 |
||
429 |
" |
|
9880 | 430 |
self pathToPackage_win32:'bosch:dapasx/kernel' |
431 |
bosch_dapasx_kernel pathToPackage_win32:'bosch:dapasx/kernel' |
|
432 |
bosch_dapasx_kernel pathToPackage_win32:'bosch:dapasx/support' |
|
433 |
stx_libbasic pathToPackage_win32:'bosch:dapasx/kernel' |
|
9850 | 434 |
" |
435 |
||
436 |
"Created: / 14-09-2006 / 13:22:52 / cg" |
|
9880 | 437 |
"Modified: / 14-09-2006 / 15:28:45 / cg" |
9850 | 438 |
! |
439 |
||
9714 | 440 |
pathToTop_unix |
441 |
"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" |
|
442 |
||
9852 | 443 |
^ self unixPathToTopFor:self package. |
9714 | 444 |
|
445 |
" |
|
9852 | 446 |
bosch_dapasx_kernel pathToTop_unix |
447 |
stx_goodies_xml pathToTop_unix |
|
448 |
stx_libhtml pathToTop_unix |
|
449 |
stx_goodies_refactoryBrowser_changes pathToTop_unix |
|
9714 | 450 |
" |
451 |
||
452 |
"Created: / 09-08-2006 / 15:45:54 / fm" |
|
9852 | 453 |
"Modified: / 14-09-2006 / 15:01:47 / cg" |
9714 | 454 |
! |
455 |
||
456 |
pathToTop_win32 |
|
457 |
"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" |
|
458 |
||
459 |
^self msdosPathToTopFor: self package |
|
460 |
||
461 |
" |
|
462 |
bosch_dapasx_datenbasis pathToTop_win32 |
|
463 |
stx_libbasic pathToTop_win32 |
|
464 |
" |
|
465 |
||
466 |
"Created: / 09-08-2006 / 15:45:54 / fm" |
|
9831 | 467 |
"Modified: / 07-09-2006 / 15:51:00 / cg" |
9714 | 468 |
! |
469 |
||
9536 | 470 |
requiredProjects |
471 |
||
472 |
^self preRequisites, self subProjects |
|
473 |
! |
|
474 |
||
9850 | 475 |
topRelativePathTo:aBaseFilename inPackage:aPackageID architecture:arch |
476 |
"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" |
|
477 |
||
478 |
|p| |
|
479 |
||
480 |
arch == #unix ifTrue:[ |
|
481 |
p := (self topRelativePathToPackage_unix:aPackageID). |
|
482 |
aBaseFilename isNil ifTrue:[^ p]. |
|
483 |
^ p , '/' , aBaseFilename |
|
484 |
]. |
|
485 |
arch == #win32 ifTrue:[ |
|
486 |
p := self topRelativePathToPackage_win32:aPackageID. |
|
487 |
aBaseFilename isNil ifTrue:[^ p]. |
|
488 |
^ p , '\' , aBaseFilename |
|
489 |
]. |
|
490 |
self error |
|
491 |
||
492 |
"Created: / 14-09-2006 / 13:34:05 / cg" |
|
493 |
! |
|
494 |
||
495 |
topRelativePathToPackage_unix:aPackageID |
|
496 |
"Returns the path to the package as specified by aPackageID relative to the top directory" |
|
497 |
||
498 |
^ aPackageID asString copy replaceAny:':/' with:$/ |
|
499 |
||
500 |
" |
|
501 |
self topRelativePathToPackage_unix:'stx:goodies/xml' |
|
502 |
self topRelativePathToPackage_unix:'bosch:dapasx/kernel' |
|
503 |
" |
|
504 |
||
505 |
"Created: / 14-09-2006 / 13:20:40 / cg" |
|
506 |
! |
|
507 |
||
508 |
topRelativePathToPackage_win32:aPackageID |
|
9559 | 509 |
"Returns the path to the package as specified by aPackageID relative to the top directory" |
510 |
||
511 |
^ aPackageID asString copy replaceAny:':/' with:$\ |
|
512 |
||
513 |
" |
|
9850 | 514 |
self topRelativePathToPackage_win32:'stx:goodies/xml' |
515 |
self topRelativePathToPackage_win32:'bosch:dapasx/kernel' |
|
9559 | 516 |
" |
9536 | 517 |
|
9850 | 518 |
"Created: / 14-09-2006 / 13:20:12 / cg" |
9852 | 519 |
! |
520 |
||
9880 | 521 |
unixPathToPackage:toPackageID from:fromPackageID |
522 |
"Returns the path to the package defined by aPackageID relative to my path" |
|
523 |
||
524 |
|pTop parts1 parts2 common up down| |
|
525 |
||
526 |
parts1 := fromPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
527 |
parts2 := toPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
528 |
common := parts1 commonPrefixWith:parts2. |
|
529 |
common notEmpty ifTrue:[ |
|
530 |
up := ((1 to:parts1 size - common size) collect:[:p | '../']) asStringWith:''. |
|
531 |
down := (parts2 copyFrom:common size+1) asStringWith:'/'. |
|
532 |
(up isEmpty and:[down isEmpty]) ifTrue:[^ '.']. |
|
533 |
^ up , down |
|
534 |
]. |
|
535 |
||
536 |
pTop := self unixPathToTopFor:fromPackageID. |
|
537 |
(pTop endsWith:'/stx') ifTrue:[ |
|
538 |
^ (pTop copyButLast:'stx' size),(self topRelativePathToPackage_unix:toPackageID) |
|
539 |
] ifFalse:[ |
|
540 |
^ pTop,'/../',(self topRelativePathToPackage_unix:toPackageID) |
|
541 |
]. |
|
542 |
||
543 |
" |
|
544 |
self msdosPathToPackage:'bosch:dapasx/kernel' from:'bosch:dapasx/application' |
|
545 |
self msdosPathToPackage:'stx:libbasic' from:'bosch:dapasx/application' |
|
546 |
self msdosPathToPackage:'bosch:dapasx/application' from:'stx:libbasic' |
|
547 |
" |
|
548 |
||
549 |
"Created: / 14-09-2006 / 15:21:10 / cg" |
|
550 |
! |
|
551 |
||
9852 | 552 |
unixPathToTopFor:aProjectID |
553 |
"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" |
|
554 |
||
555 |
|parts| |
|
556 |
||
557 |
parts := aProjectID asCollectionOfSubstringsSeparatedByAny:':/'. |
|
558 |
||
559 |
aProjectID asPackageId module = 'stx' ifTrue:[ |
|
560 |
parts size == 1 ifTrue:[^ '.']. |
|
561 |
^ (((2 to:parts size-1) collect:[:p | '../']) asStringWith:'') , '..' |
|
562 |
]. |
|
563 |
||
564 |
^ ((parts collect:[:p | '../']) asStringWith:'') , 'stx' |
|
565 |
||
566 |
" |
|
567 |
self unixPathToTopFor: #'bosch' |
|
568 |
self unixPathToTopFor: #'bosch:dapasx' |
|
569 |
self unixPathToTopFor: #'bosch:dapasx/datenbasis' |
|
570 |
self unixPathToTopFor: #'stx' |
|
571 |
self unixPathToTopFor: #'stx:libview' |
|
572 |
self unixPathToTopFor: #'stx:goodies/foo' |
|
573 |
" |
|
574 |
||
575 |
"Created: / 14-09-2006 / 14:59:53 / cg" |
|
9536 | 576 |
! ! |
577 |
||
9714 | 578 |
!ProjectDefinition class methodsFor:'class initialization'! |
579 |
||
580 |
initialize |
|
581 |
LibraryType := #'Library'. |
|
582 |
GUIApplicationType := #'GUI-Application'. |
|
583 |
NonGUIApplicationType := #'NonGUI-Application'. |
|
584 |
||
585 |
" |
|
586 |
self initialize |
|
587 |
" |
|
588 |
! ! |
|
589 |
||
9998 | 590 |
!ProjectDefinition class methodsFor:'code generation'! |
591 |
||
592 |
classNamesAndAttributes_code_ignoreOldDefinition:ignoreOldDefinition |
|
10010 | 593 |
"generate method code returning all classes of the project. |
594 |
Platform attributes are kept from the old definition. |
|
595 |
If ignoreOldDefinition is true, the autoload attribute is set/reset if |
|
596 |
the class is installed as autoloaded in the image. If false, it is taken |
|
597 |
from an existing definition in #classNamesAndAttributes" |
|
598 |
||
9998 | 599 |
^ String streamContents:[:s | |
10010 | 600 |
|oldSpec| |
601 |
oldSpec := self classNamesAndAttributes. |
|
602 |
||
9998 | 603 |
s nextPutLine:'classNamesAndAttributes'. |
10011 | 604 |
s nextPutLine:' "<className> or (<className> attributes...) in load order"'; cr. |
9998 | 605 |
s nextPutLine:' ^ #('. |
606 |
self searchForClasses do:[:eachClass | |
|
10010 | 607 |
|attributes oldSpecEntry| |
9998 | 608 |
|
609 |
(eachClass isLoaded not or:[eachClass isPrivate not]) ifTrue:[ |
|
610 |
oldSpecEntry := oldSpec detect:[:entry | entry first = eachClass name] ifNone:nil. |
|
611 |
ignoreOldDefinition ifTrue:[ |
|
10010 | 612 |
"take autoload attribute from classes state in the image" |
9998 | 613 |
oldSpecEntry notNil ifTrue:[ |
614 |
attributes := oldSpecEntry copyFrom:2. |
|
615 |
attributes := attributes copyWithout:#autoload. |
|
616 |
] ifFalse:[ |
|
617 |
attributes := #() |
|
618 |
]. |
|
619 |
eachClass isLoaded ifFalse:[ |
|
10010 | 620 |
attributes := attributes copyWith:#autoload. |
9998 | 621 |
]. |
622 |
] ifFalse:[ |
|
10010 | 623 |
"keep any existing attribute" |
9998 | 624 |
oldSpecEntry notNil ifTrue:[ |
625 |
attributes := oldSpecEntry copyFrom:2. |
|
626 |
] ifFalse:[ |
|
10010 | 627 |
attributes := eachClass isLoaded ifTrue:[ #() ] ifFalse:[ #(autoload) ]. |
9998 | 628 |
]. |
629 |
]. |
|
630 |
||
10011 | 631 |
s spaces:8. |
9998 | 632 |
attributes isEmptyOrNil ifTrue:[ |
10011 | 633 |
eachClass name storeArrayElementOn:s. |
9998 | 634 |
] ifFalse:[ |
10011 | 635 |
s nextPut:$(. eachClass name storeArrayElementOn:s. |
636 |
attributes do:[:eachAttribute | s space. eachAttribute storeOn:s.]. |
|
10010 | 637 |
s nextPut:$). |
9998 | 638 |
]. |
639 |
s cr. |
|
640 |
] |
|
641 |
]. |
|
642 |
s nextPutLine:' )' |
|
643 |
]. |
|
644 |
||
645 |
" |
|
10010 | 646 |
stx_libbasic3 classNamesAndAttributes_code_ignoreOldDefinition:true |
9998 | 647 |
" |
648 |
||
649 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
650 |
"Created: / 17-08-2006 / 21:03:07 / cg" |
|
651 |
"Modified: / 19-09-2006 / 17:14:17 / cg" |
|
652 |
! |
|
653 |
||
654 |
companyName_code |
|
655 |
^ String streamContents:[:s | |
|
656 |
s nextPutLine:'companyName'. |
|
657 |
s nextPutLine:' "Return a companyname which will appear in <lib>.rc"'. |
|
658 |
s cr; nextPutLine:' ^ ',self companyName storeString. |
|
659 |
]. |
|
660 |
||
661 |
" |
|
662 |
self companyName_code |
|
663 |
stx_libbasic3 companyName_code |
|
664 |
" |
|
665 |
||
666 |
"Created: / 18-08-2006 / 16:20:42 / cg" |
|
667 |
! |
|
668 |
||
669 |
compileDescriptionMethods |
|
670 |
(self isLibraryDefinition |
|
671 |
or:[ self isApplicationDefinition ] ) ifFalse:[ |
|
672 |
self error:'I am abstract - must be a subclass of Libray- or ApplicationDefinition.' |
|
673 |
]. |
|
674 |
||
675 |
self |
|
676 |
forEachMethodsCodeToCompileDo:[:code :category | |
|
677 |
self compile:code categorized:category |
|
678 |
]. |
|
679 |
||
680 |
"/ self instAndClassMethodsDo:[:m | m package:self package]. |
|
681 |
||
682 |
" |
|
683 |
DapasXProject compileDescriptionMethods |
|
684 |
DapasX_Datenbasis compileDescriptionMethods |
|
685 |
bosch_dapasx_interactiver_editor compileDescriptionMethods |
|
686 |
stx_libbasic compileDescriptionMethods |
|
687 |
" |
|
688 |
||
689 |
"Created: / 09-08-2006 / 18:00:31 / fm" |
|
690 |
"Modified: / 05-09-2006 / 13:46:29 / cg" |
|
691 |
! |
|
692 |
||
693 |
description_code |
|
694 |
^ String streamContents:[:s | |
|
695 |
s nextPutLine:'description'. |
|
696 |
s nextPutLine:' "Return a description string which will appear in nt.def / bc.def"'. |
|
697 |
s cr; nextPutLine:' ^ ',self description asString storeString. |
|
698 |
]. |
|
699 |
||
700 |
" |
|
701 |
self description_code |
|
702 |
stx_libbasic3 description_code |
|
703 |
" |
|
704 |
||
705 |
"Created: / 17-08-2006 / 21:24:01 / cg" |
|
706 |
"Modified: / 18-08-2006 / 16:16:24 / cg" |
|
707 |
! |
|
708 |
||
709 |
extensionMethodNames_code |
|
710 |
^ String streamContents:[:s | |
|
711 |
s nextPutLine:'extensionMethodNames'. |
|
712 |
s nextPutLine:' ^ #('. |
|
10011 | 713 |
self searchForExtensions do:[:eachMethod | |
714 |
s spaces:8. |
|
715 |
eachMethod mclass name storeArrayElementOn:s. |
|
9998 | 716 |
s nextPutAll:' '. |
10011 | 717 |
eachMethod selector storeArrayElementOn:s. |
718 |
s cr. |
|
9998 | 719 |
]. |
720 |
s nextPutLine:' )' |
|
721 |
]. |
|
722 |
||
723 |
" |
|
724 |
self extensionMethodNames_code |
|
725 |
" |
|
726 |
||
727 |
"Created: / 17-08-2006 / 21:21:48 / cg" |
|
728 |
! |
|
729 |
||
730 |
forEachContentsMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition |
|
731 |
aTwoArgBlock |
|
732 |
value:(self classNamesAndAttributes_code_ignoreOldDefinition:ignoreOldDefinition) |
|
733 |
value:'description - contents'. |
|
734 |
||
735 |
aTwoArgBlock |
|
736 |
value: self extensionMethodNames_code |
|
737 |
value: 'description - contents'. |
|
738 |
||
739 |
aTwoArgBlock |
|
740 |
value: self preRequisites_code |
|
741 |
value: 'description'. |
|
742 |
||
743 |
"Created: / 15-09-2006 / 16:47:54 / cg" |
|
744 |
"Modified: / 20-09-2006 / 14:58:59 / cg" |
|
745 |
! |
|
746 |
||
747 |
forEachMethodsCodeToCompileDo:aTwoArgBlock |
|
748 |
self forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:false |
|
749 |
! |
|
750 |
||
751 |
forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition |
|
752 |
aTwoArgBlock |
|
753 |
value:(self classNamesAndAttributes_code_ignoreOldDefinition:ignoreOldDefinition) |
|
754 |
value:'description - contents'. |
|
755 |
||
756 |
aTwoArgBlock |
|
757 |
value: self extensionMethodNames_code |
|
758 |
value: 'description - contents'. |
|
759 |
||
10013
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
760 |
aTwoArgBlock |
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
761 |
value: self preRequisites_code |
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
762 |
value: 'description'. |
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
763 |
|
9998 | 764 |
(self class implements:#description) ifFalse:[ |
765 |
aTwoArgBlock |
|
766 |
value: self description_code |
|
767 |
value: 'description - project information'. |
|
768 |
]. |
|
769 |
(self class implements:#productName) ifFalse:[ |
|
770 |
aTwoArgBlock |
|
771 |
value: self productName_code |
|
772 |
value: 'description - project information'. |
|
773 |
]. |
|
774 |
(self class implements:#companyName) ifFalse:[ |
|
775 |
aTwoArgBlock |
|
776 |
value: self companyName_code |
|
777 |
value: 'description - project information'. |
|
778 |
]. |
|
779 |
(self class implements:#legalCopyright) ifFalse:[ |
|
780 |
aTwoArgBlock |
|
781 |
value: self legalCopyright_code |
|
782 |
value: 'description - project information'. |
|
783 |
]. |
|
784 |
||
785 |
"Created: / 18-08-2006 / 16:22:37 / cg" |
|
786 |
"Modified: / 30-08-2006 / 19:04:11 / cg" |
|
787 |
! |
|
788 |
||
789 |
legalCopyright_code |
|
790 |
^ String streamContents:[:s | |
|
791 |
s nextPutLine:'legalCopyright'. |
|
792 |
s nextPutLine:' "Return a copyright string which will appear in <lib>.rc"'. |
|
793 |
s cr; nextPutLine:' ^ ',self legalCopyright storeString. |
|
794 |
]. |
|
795 |
||
796 |
" |
|
797 |
self legalCopyright_code |
|
798 |
stx_libbasic3 legalCopyright_code |
|
799 |
" |
|
800 |
||
801 |
"Created: / 18-08-2006 / 16:21:01 / cg" |
|
802 |
! |
|
803 |
||
804 |
preRequisites_code |
|
805 |
|preRequisites| |
|
806 |
||
807 |
preRequisites := self preRequisites asSet. |
|
808 |
preRequisites addAll: self searchForPreRequisites keys. |
|
809 |
||
810 |
self isApplicationDefinition ifTrue:[ |
|
10013
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
811 |
preRequisites add:#'stx:libcomp'. |
9998 | 812 |
self isGUIApplication ifTrue:[ |
10013
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
813 |
preRequisites add:#'stx:libbasic2'. |
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
814 |
preRequisites add:#'stx:libview'. |
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
815 |
preRequisites add:#'stx:libview2'. |
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
816 |
preRequisites add:#'stx:libwidg'. |
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
817 |
preRequisites add:#'stx:libwidg2'. |
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
818 |
preRequisites add:#'stx:libui'. |
9998 | 819 |
]. |
820 |
]. |
|
821 |
||
822 |
preRequisites removeAll: self excludedFromPreRequisites. |
|
823 |
preRequisites remove:self package. |
|
824 |
||
825 |
^ String streamContents:[:s | |
|
826 |
s nextPutLine:'preRequisites'. |
|
827 |
s nextPutLine:' ^ #('. |
|
10013
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
828 |
preRequisites asSortedCollection do:[:eachPackageID | |
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
829 |
s spaces:8. |
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
830 |
eachPackageID storeOn:s. |
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
831 |
s cr. |
9998 | 832 |
]. |
10013
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
833 |
s nextPutLine:' )' |
9998 | 834 |
]. |
835 |
||
836 |
" |
|
837 |
bosch_dapasx_application preRequisites_code |
|
838 |
demo_demoApp1 preRequisites_code |
|
10013
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
839 |
stx_libtool2 preRequisites_code |
9998 | 840 |
" |
841 |
||
842 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
843 |
"Created: / 17-08-2006 / 21:28:09 / cg" |
|
844 |
"Modified: / 21-09-2006 / 17:37:28 / cg" |
|
845 |
! |
|
846 |
||
847 |
productName_code |
|
848 |
^ String streamContents:[:s | |
|
849 |
s nextPutLine:'productName'. |
|
850 |
s nextPutLine:' "Return a product name which will appear in <lib>.rc"'. |
|
851 |
s cr; nextPutLine:' ^ ',self productName storeString. |
|
852 |
]. |
|
853 |
||
854 |
" |
|
855 |
self productName_code |
|
856 |
stx_libbasic3 productName_code |
|
857 |
" |
|
858 |
||
859 |
"Created: / 18-08-2006 / 16:14:19 / cg" |
|
860 |
! ! |
|
861 |
||
9569 | 862 |
!ProjectDefinition class methodsFor:'defaults'! |
9536 | 863 |
|
9664 | 864 |
applicationTypes |
9714 | 865 |
GUIApplicationType isNil ifTrue:[self initialize]. |
866 |
^ Array with:GUIApplicationType with:NonGUIApplicationType |
|
9664 | 867 |
|
9714 | 868 |
" |
869 |
self applicationTypes |
|
870 |
" |
|
9664 | 871 |
! |
872 |
||
9536 | 873 |
defaultDescription |
874 |
^ 'description' |
|
9664 | 875 |
! |
876 |
||
9714 | 877 |
defaultProjectType |
9745 | 878 |
^ self libraryTypes first |
879 |
"/ ^ self applicationTypes first |
|
9714 | 880 |
|
881 |
"Created: / 23-08-2006 / 14:27:32 / cg" |
|
882 |
! |
|
883 |
||
884 |
defaultProjectTypeForGUIApplication |
|
885 |
^ GUIApplicationType |
|
886 |
! |
|
887 |
||
888 |
defaultProjectTypeForNonGUIApplication |
|
889 |
^ NonGUIApplicationType |
|
890 |
! |
|
9664 | 891 |
|
9714 | 892 |
guiApplicationType |
893 |
^ GUIApplicationType |
|
894 |
! |
|
895 |
||
896 |
libraryType |
|
897 |
^ LibraryType |
|
898 |
! |
|
899 |
||
900 |
libraryTypes |
|
901 |
LibraryType isNil ifTrue:[self initialize]. |
|
902 |
^ Array with:LibraryType |
|
903 |
||
904 |
" |
|
905 |
self libraryTypes |
|
906 |
" |
|
907 |
! |
|
908 |
||
909 |
nonGuiApplicationType |
|
910 |
^ NonGUIApplicationType |
|
9664 | 911 |
! |
912 |
||
913 |
projectTypes |
|
914 |
^ self libraryTypes , self applicationTypes |
|
915 |
||
916 |
"Created: / 23-08-2006 / 14:27:32 / cg" |
|
9536 | 917 |
! ! |
918 |
||
9569 | 919 |
!ProjectDefinition class methodsFor:'description'! |
9536 | 920 |
|
9983 | 921 |
excludedFromPreRequisites |
922 |
"list packages which are to be explicitely excluded from the automatic constructed |
|
923 |
prerequisites list. If empty, everything that is found along the inheritance of any of |
|
924 |
my classes is considered to be a prerequisite package." |
|
925 |
||
926 |
^ #() |
|
927 |
||
928 |
"Modified: / 17-08-2006 / 19:48:59 / cg" |
|
929 |
! |
|
930 |
||
9575 | 931 |
postLoadAction |
932 |
"invoked after loading a project" |
|
933 |
||
934 |
"/ intentionally left blank |
|
935 |
||
936 |
"Created: / 08-08-2006 / 11:07:40 / fm" |
|
937 |
"Modified: / 17-08-2006 / 19:59:17 / cg" |
|
938 |
! |
|
939 |
||
940 |
preRequisites |
|
941 |
"list packages which are required as a prerequisite. This method is generated automatically, |
|
942 |
by searching along the inheritance chain of all of my classes. |
|
943 |
However, when generating automatically, packages are only added - never removed, unless listed |
|
944 |
in excludedFromPreRequisites." |
|
945 |
||
946 |
^ #() |
|
947 |
||
948 |
"Modified: / 17-08-2006 / 19:54:21 / cg" |
|
949 |
! |
|
950 |
||
951 |
preUnloadAction |
|
952 |
"invoked before unloading a project" |
|
953 |
||
954 |
"/ intentionally left blank |
|
955 |
||
956 |
"Created: / 08-08-2006 / 11:07:40 / fm" |
|
957 |
"Modified: / 17-08-2006 / 19:59:26 / cg" |
|
958 |
! |
|
959 |
||
9685 | 960 |
siblingsAreSubProjects |
961 |
^ false |
|
962 |
! |
|
963 |
||
9575 | 964 |
subProjects |
965 |
"list packages which are known as subprojects. This method is generated automatically. |
|
966 |
However, when generating automatically, packages are only added - never removed, unless listed |
|
967 |
in excludedFromSubProjects." |
|
968 |
||
969 |
^ #() |
|
970 |
||
971 |
"Modified: / 17-08-2006 / 19:57:46 / cg" |
|
972 |
! ! |
|
973 |
||
974 |
!ProjectDefinition class methodsFor:'description - classes'! |
|
975 |
||
9621 | 976 |
additionalClassNamesAndAttributes |
977 |
^ #() |
|
978 |
||
979 |
"Created: / 21-08-2006 / 19:53:04 / cg" |
|
980 |
! |
|
981 |
||
9607 | 982 |
allClassNames |
983 |
^ self classNamesForWhich:[:nm :attr | true ]. |
|
984 |
! |
|
9536 | 985 |
|
9607 | 986 |
classNames |
987 |
"a correponding method with real names is generated in my subclasses" |
|
988 |
||
989 |
self halt. |
|
9595 | 990 |
^ #() |
9536 | 991 |
|
992 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
993 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
9607 | 994 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
9536 | 995 |
! |
996 |
||
9607 | 997 |
classNamesAndAttributes |
9575 | 998 |
"a correponding method with real names is generated in my subclasses" |
999 |
||
9595 | 1000 |
^ #() |
9536 | 1001 |
|
9575 | 1002 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
1003 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
1004 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
|
1005 |
! |
|
1006 |
||
9607 | 1007 |
classNamesForWhich:aBlock |
1008 |
"a correponding method with real names is generated in my subclasses" |
|
1009 |
||
1010 |
|coll| |
|
1011 |
||
1012 |
coll := OrderedCollection new. |
|
1013 |
self classNamesAndAttributesDo:[:nm :attributes | |
|
1014 |
(aBlock value:nm value:attributes) ifTrue:[ |
|
1015 |
coll add:nm. |
|
1016 |
]. |
|
1017 |
]. |
|
1018 |
^ coll |
|
1019 |
||
1020 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
1021 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
1022 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
|
1023 |
! |
|
1024 |
||
1025 |
compiled_classNames |
|
9615 | 1026 |
^ self classNamesForWhich:[:nm :attr | attr isEmptyOrNil or:[(attr includes:#autoload) not]]. |
9607 | 1027 |
|
1028 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
1029 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
9615 | 1030 |
"Modified: / 21-08-2006 / 18:48:31 / cg" |
9607 | 1031 |
! |
1032 |
||
10005 | 1033 |
compiled_classNamesForPlatform:platformName |
1034 |
"answer the classes to be compiled only for platformName |
|
1035 |
platformName is one of #unix, #win32 (OperatingSystem platformName)" |
|
1036 |
||
9607 | 1037 |
^ self |
10005 | 1038 |
classNamesForWhich:[:nm :attr | |
1039 |
(attr includes:#autoload) not and:[ (attr includes:platformName) ] |
|
9607 | 1040 |
]. |
1041 |
||
1042 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
1043 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
1044 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
|
1045 |
! |
|
1046 |
||
10005 | 1047 |
compiled_classNames_common |
1048 |
"classes to be compiled for any platform" |
|
9607 | 1049 |
|
1050 |
^ self |
|
1051 |
classNamesForWhich:[:nm :attr | |
|
1052 |
attr isEmptyOrNil |
|
1053 |
]. |
|
1054 |
||
1055 |
"Created: / 18-08-2006 / 13:37:51 / cg" |
|
1056 |
! |
|
1057 |
||
10005 | 1058 |
compiled_classNames_unix |
9584 | 1059 |
"class, only to be compiled under unix" |
10005 | 1060 |
|
1061 |
^ self compiled_classNamesForPlatform:#unix. |
|
9584 | 1062 |
|
1063 |
"Created: / 18-08-2006 / 13:37:51 / cg" |
|
1064 |
! |
|
1065 |
||
10005 | 1066 |
compiled_classNames_windows |
9584 | 1067 |
"class, only to be compiled under windows" |
10005 | 1068 |
|
1069 |
^ self compiled_classNamesForPlatform:#win32. |
|
9584 | 1070 |
|
1071 |
"Created: / 18-08-2006 / 13:37:56 / cg" |
|
1072 |
! |
|
1073 |
||
9575 | 1074 |
extensionMethodNames |
1075 |
"list class/selector pairs of extensions. |
|
1076 |
A correponding method with real names is generated in my subclasses" |
|
1077 |
||
9595 | 1078 |
^ #() |
9575 | 1079 |
|
1080 |
"Modified: / 17-08-2006 / 20:49:51 / cg" |
|
1081 |
! ! |
|
1082 |
||
1083 |
!ProjectDefinition class methodsFor:'description - compilation'! |
|
9536 | 1084 |
|
9625 | 1085 |
additionalDefinitions_make_dot_proto |
1086 |
"allows for additional definitions/rules to be added to the make.proto file." |
|
1087 |
||
1088 |
^ '' |
|
1089 |
||
1090 |
"Created: / 22-08-2006 / 23:53:08 / cg" |
|
1091 |
! |
|
1092 |
||
1093 |
additionalDefinitions_nt_dot_mak |
|
1094 |
"allows for additional definitions/rules to be added to the nt.mak file." |
|
1095 |
||
1096 |
^ '' |
|
1097 |
||
1098 |
"Created: / 22-08-2006 / 23:59:32 / cg" |
|
1099 |
! |
|
1100 |
||
9733 | 1101 |
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
|
1102 |
"allows for additional static libraries to be added to the make.proto file." |
9733 | 1103 |
|
1104 |
^ '' |
|
1105 |
||
1106 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
|
1107 |
! |
|
1108 |
||
9625 | 1109 |
additionalRules_make_dot_proto |
1110 |
"allows for additional rules to be added to the make.proto file." |
|
1111 |
||
1112 |
^ '' |
|
1113 |
||
1114 |
"Created: / 22-08-2006 / 23:59:16 / cg" |
|
1115 |
! |
|
1116 |
||
1117 |
additionalRules_nt_dot_mak |
|
1118 |
"allows for additional rules to be added to the nt.mak file." |
|
1119 |
||
1120 |
^ '' |
|
1121 |
||
1122 |
"Created: / 22-08-2006 / 23:59:24 / cg" |
|
1123 |
! |
|
1124 |
||
9972
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
1125 |
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
|
1126 |
"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
|
1127 |
|
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
1128 |
^ '' |
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
1129 |
! |
c63164ec0584
Allow shared libraries to be defined for a class lib (needed for liboracle)
Stefan Vogel <sv@exept.de>
parents:
9964
diff
changeset
|
1130 |
|
9625 | 1131 |
additionalTargets_make_dot_proto |
1132 |
"allows for additional targets to be added to the make.proto file." |
|
1133 |
||
1134 |
^ '' |
|
1135 |
||
1136 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
|
1137 |
! |
|
1138 |
||
1139 |
additionalTargets_nt_dot_mak |
|
1140 |
"allows for additional targets to be added to the nt.mak file." |
|
1141 |
||
1142 |
^ '' |
|
1143 |
||
1144 |
"Created: / 23-08-2006 / 00:00:35 / cg" |
|
1145 |
! |
|
1146 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
1147 |
localIncludes |
9714 | 1148 |
"allow for the specification of addition include directories" |
1149 |
||
1150 |
^ '' |
|
1151 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
1152 |
"Created: / 06-09-2006 / 18:14:31 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
1153 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
1154 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
1155 |
localIncludes_unix |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
1156 |
"allow for the specification of addition include directories" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
1157 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
1158 |
^ self makeUnixIncludes:(self localIncludes) |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
1159 |
|
9714 | 1160 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
1161 |
"Modified: / 06-09-2006 / 18:15:26 / cg" |
9714 | 1162 |
! |
1163 |
||
1164 |
localIncludes_win32 |
|
1165 |
"allow for the specification of addition include directories" |
|
1166 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
1167 |
^ self makeWin32Includes:(self localIncludes) |
9714 | 1168 |
|
1169 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
|
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
1170 |
"Modified: / 06-09-2006 / 18:15:37 / cg" |
9714 | 1171 |
! |
1172 |
||
9575 | 1173 |
stcOptimizationOptions |
1174 |
"see the stc reference / stc usage for options. |
|
1175 |
For now, the following variants are useful: |
|
1176 |
+optspace3 most compact code |
|
1177 |
- use for all gui, application code. |
|
1178 |
||
9714 | 1179 |
+optinline +optinline2 +inlineNew |
1180 |
fastest code |
|
9575 | 1181 |
- use only for computation-intensive classes" |
1182 |
||
1183 |
^ '+optspace3' |
|
1184 |
||
1185 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
|
9536 | 1186 |
! |
1187 |
||
9575 | 1188 |
stcWarningOptions |
1189 |
"see the stc reference / stc usage for options. |
|
1190 |
For now, the following variants are useful: |
|
1191 |
-warn no warnings |
|
1192 |
-warnNonStandard no warnings about non-standard smalltalk features" |
|
1193 |
||
9714 | 1194 |
^ '-warnNonStandard' |
9575 | 1195 |
|
1196 |
"Created: / 18-08-2006 / 12:51:38 / cg" |
|
1197 |
! ! |
|
9536 | 1198 |
|
9575 | 1199 |
!ProjectDefinition class methodsFor:'description - project information'! |
1200 |
||
1201 |
companyName |
|
9584 | 1202 |
"Returns a company string which will appear in <lib>.rc. |
1203 |
Under win32, this is placed into the dlls file-info" |
|
9575 | 1204 |
|
1205 |
self module = 'stx' ifTrue:[ |
|
1206 |
^ 'eXept Software AG' |
|
1207 |
]. |
|
1208 |
||
1209 |
^ 'My Company' |
|
1210 |
||
9584 | 1211 |
"Modified: / 18-08-2006 / 16:08:20 / cg" |
9536 | 1212 |
! |
1213 |
||
1214 |
description |
|
9575 | 1215 |
"Returns a description string which will appear in nt.def / bc.def" |
9536 | 1216 |
|
9803 | 1217 |
^self productName,' ',self packageName |
1218 |
"/ ^ self name |
|
9536 | 1219 |
|
1220 |
"Created: / 08-08-2006 / 11:15:01 / fm" |
|
9575 | 1221 |
"Modified: / 17-08-2006 / 20:53:34 / cg" |
1222 |
! |
|
1223 |
||
1224 |
fileDescription |
|
1225 |
"Returns a description string which will appear in libName.rc" |
|
1226 |
||
9803 | 1227 |
^self description |
9575 | 1228 |
|
1229 |
"Modified: / 17-08-2006 / 20:27:07 / cg" |
|
1230 |
! |
|
1231 |
||
1232 |
fileMajorVersionNr |
|
1233 |
"Returns a versionNumber which will appear in libName.rc" |
|
1234 |
||
1235 |
^ Smalltalk majorVersionNr printString |
|
1236 |
||
1237 |
"Created: / 18-08-2006 / 12:03:32 / cg" |
|
9817 | 1238 |
"Modified: / 30-08-2006 / 18:50:51 / cg" |
9575 | 1239 |
! |
1240 |
||
1241 |
fileMinorVersionNr |
|
1242 |
"Returns a versionNumber which will appear in libName.rc" |
|
1243 |
||
9618 | 1244 |
^ Smalltalk minorVersionNr printString |
9575 | 1245 |
|
1246 |
"Created: / 18-08-2006 / 12:03:13 / cg" |
|
9817 | 1247 |
"Modified: / 30-08-2006 / 18:50:46 / cg" |
9575 | 1248 |
! |
1249 |
||
1250 |
fileReleaseNr |
|
1251 |
"Returns a releaseNumber which will appear in libName.rc" |
|
1252 |
||
9817 | 1253 |
"take the default revision from the cvs-version" |
9618 | 1254 |
^ self cvsRevision last |
9575 | 1255 |
|
1256 |
"Created: / 18-08-2006 / 12:02:58 / cg" |
|
9817 | 1257 |
"Modified: / 30-08-2006 / 18:54:48 / cg" |
9536 | 1258 |
! |
1259 |
||
9575 | 1260 |
fileRevisionNr |
1261 |
"Returns a revisionNumber which will appear in libName.rc" |
|
9536 | 1262 |
|
9817 | 1263 |
"take the default revision from the cvs-version" |
9618 | 1264 |
^ self cvsRevision first |
9575 | 1265 |
|
1266 |
"Created: / 18-08-2006 / 12:02:39 / cg" |
|
9817 | 1267 |
"Modified: / 30-08-2006 / 18:54:39 / cg" |
9536 | 1268 |
! |
1269 |
||
9575 | 1270 |
fileVersion |
1271 |
"Returns a fileVersion string which will appear in libName.rc" |
|
1272 |
||
1273 |
"<major>.<minor>.<rev>.<rel> (such as '1.2.17.1') " |
|
1274 |
||
9817 | 1275 |
^ self fileMajorVersionNr |
9575 | 1276 |
, '.' |
9817 | 1277 |
, self fileMinorVersionNr |
9575 | 1278 |
, '.' |
9817 | 1279 |
, self fileRevisionNr |
9575 | 1280 |
, '.' |
9817 | 1281 |
, self fileReleaseNr |
9575 | 1282 |
|
1283 |
" |
|
1284 |
self fileVersion |
|
1285 |
" |
|
1286 |
||
9817 | 1287 |
"Modified: / 30-08-2006 / 18:51:49 / cg" |
9575 | 1288 |
! |
9536 | 1289 |
|
9575 | 1290 |
fileVersionCommaSeparated |
1291 |
"Returns a fileVersion string which will appear in libName.rc" |
|
1292 |
||
9817 | 1293 |
"<major>,<minor>,<revision>,<release> (such as '2,17,1,2') " |
1294 |
||
1295 |
^ self fileMajorVersionNr |
|
9575 | 1296 |
, ',' |
9817 | 1297 |
, self fileMinorVersionNr |
9575 | 1298 |
, ',' |
9817 | 1299 |
, self fileRevisionNr |
9575 | 1300 |
, ',' |
9579 | 1301 |
, self fileReleaseNr |
9575 | 1302 |
|
1303 |
"Created: / 17-08-2006 / 20:16:17 / cg" |
|
9817 | 1304 |
"Modified: / 30-08-2006 / 18:54:20 / cg" |
1305 |
! |
|
1306 |
||
1307 |
iconFileName |
|
1308 |
"Returns the icon-filename for the application (nil if there is none)" |
|
1309 |
||
1310 |
^ nil |
|
1311 |
||
1312 |
"Created: / 30-08-2006 / 18:44:15 / cg" |
|
9575 | 1313 |
! |
1314 |
||
1315 |
internalName |
|
1316 |
"Returns a name string which will appear in libName.rc" |
|
1317 |
||
1318 |
^self packageName |
|
1319 |
||
1320 |
"Modified: / 17-08-2006 / 20:27:37 / cg" |
|
9536 | 1321 |
! |
1322 |
||
9575 | 1323 |
legalCopyright |
9584 | 1324 |
"Returns a copyright string which will appear in <lib>.rc. |
1325 |
Under win32, this is placed into the dlls file-info" |
|
9575 | 1326 |
|
1327 |
self module = 'stx' ifTrue:[ |
|
9817 | 1328 |
"hardwired-default" |
9625 | 1329 |
^ 'Copyright Claus Gittinger 1988-%1\nCopyright eXept Software AG 1998-%1' |
1330 |
bindWith:(Date today year printString) |
|
9575 | 1331 |
]. |
9817 | 1332 |
self module = 'exept' ifTrue:[ |
1333 |
"hardwired-default" |
|
1334 |
^ 'Copyright eXept Software AG 1998-%1' |
|
1335 |
bindWith:(Date today year printString) |
|
1336 |
]. |
|
9575 | 1337 |
|
1338 |
^ 'My CopyRight or CopyLeft' |
|
1339 |
||
9817 | 1340 |
"Modified: / 30-08-2006 / 18:53:36 / cg" |
9575 | 1341 |
! |
1342 |
||
1343 |
majorVersionNr |
|
1344 |
"Returns a versionNumber which will appear in libName.rc" |
|
1345 |
||
1346 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
|
1347 |
the default here takes smalltalks version number. |
|
1348 |
But thats probably not good for an end-user-app." |
|
1349 |
||
9817 | 1350 |
^ Smalltalk majorVersionNr printString |
9575 | 1351 |
|
1352 |
"Created: / 17-08-2006 / 20:20:18 / cg" |
|
9817 | 1353 |
"Modified: / 30-08-2006 / 18:52:13 / cg" |
9575 | 1354 |
! |
1355 |
||
1356 |
minorVersionNr |
|
1357 |
"Returns a versionNumber which will appear in libName.rc" |
|
9536 | 1358 |
|
9575 | 1359 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
1360 |
the default here takes smalltalks version number. |
|
1361 |
But thats probably not good for an end-user-app." |
|
1362 |
||
9817 | 1363 |
^ Smalltalk minorVersionNr printString |
9575 | 1364 |
|
1365 |
"Created: / 17-08-2006 / 20:20:32 / cg" |
|
9817 | 1366 |
"Modified: / 30-08-2006 / 18:52:16 / cg" |
9575 | 1367 |
! |
1368 |
||
1369 |
productDate |
|
1370 |
"Returns a product-date string which will appear in libName.rc" |
|
1371 |
||
1372 |
"take the current date - by default" |
|
9536 | 1373 |
|
9575 | 1374 |
^ Timestamp now printStringRFC1123Format |
1375 |
||
1376 |
"Created: / 17-08-2006 / 20:17:28 / cg" |
|
1377 |
! |
|
1378 |
||
9898 | 1379 |
productInstallDir |
1380 |
"Returns a product default installDir which will appear in <app>.nsi." |
|
1381 |
||
1382 |
^ '$PROGRAMFILES\',self module |
|
1383 |
||
1384 |
"Created: / 14-09-2006 / 21:23:01 / cg" |
|
1385 |
! |
|
1386 |
||
9575 | 1387 |
productName |
9584 | 1388 |
"Returns a product name which will appear in <lib>.rc. |
1389 |
Under win32, this is placed into the dlls file-info" |
|
9575 | 1390 |
|
1391 |
self module = 'stx' ifTrue:[ |
|
1392 |
^ 'Smalltalk/X' |
|
1393 |
]. |
|
1394 |
||
1395 |
^ 'My Product' |
|
1396 |
||
9584 | 1397 |
"Modified: / 18-08-2006 / 16:08:26 / cg" |
9536 | 1398 |
! |
1399 |
||
9898 | 1400 |
productPublisher |
1401 |
"Returns a product publisher which will appear in <app>.nsi." |
|
1402 |
||
1403 |
( #('exept' 'stx') includes:self module) ifTrue:[ |
|
1404 |
^ 'eXept Software AG' |
|
1405 |
]. |
|
1406 |
||
1407 |
^ 'thePublisher' |
|
1408 |
||
1409 |
"Created: / 14-09-2006 / 21:12:54 / cg" |
|
1410 |
! |
|
1411 |
||
9575 | 1412 |
productVersion |
1413 |
"Returns a product version which will appear in libName.rc" |
|
1414 |
||
1415 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1')" |
|
9536 | 1416 |
|
9817 | 1417 |
^ self majorVersionNr |
9575 | 1418 |
, '.' |
9817 | 1419 |
, self minorVersionNr |
9575 | 1420 |
, '.' |
9817 | 1421 |
, self revisionNr |
9575 | 1422 |
, '.' |
9817 | 1423 |
, self releaseNr |
9536 | 1424 |
|
9575 | 1425 |
" |
1426 |
self productVersion |
|
1427 |
" |
|
1428 |
||
9817 | 1429 |
"Modified: / 30-08-2006 / 18:52:47 / cg" |
9536 | 1430 |
! |
1431 |
||
9575 | 1432 |
productVersionCommaSeparated |
1433 |
"Returns a product version which will appear in libName.rc" |
|
1434 |
||
1435 |
"<major>.<minor>.<revision>.<release> (such as '0,1,1,1') " |
|
9536 | 1436 |
|
9817 | 1437 |
^ self majorVersionNr |
9575 | 1438 |
, ',' |
9817 | 1439 |
, self minorVersionNr |
9575 | 1440 |
, ',' |
9817 | 1441 |
, self revisionNr |
9575 | 1442 |
, ',' |
9817 | 1443 |
, self releaseNr |
9536 | 1444 |
|
9575 | 1445 |
"Created: / 17-08-2006 / 20:13:32 / cg" |
9817 | 1446 |
"Modified: / 30-08-2006 / 18:52:42 / cg" |
9536 | 1447 |
! |
1448 |
||
9898 | 1449 |
productWebSite |
1450 |
"Returns a product webSite which will appear in <app>.nsi." |
|
1451 |
||
1452 |
( #('exept' 'stx') includes:self module) ifTrue:[ |
|
1453 |
^ 'http://www.exept.de' |
|
1454 |
]. |
|
1455 |
||
1456 |
^ 'http://www.yoursite.com' |
|
1457 |
||
1458 |
"Created: / 14-09-2006 / 21:15:05 / cg" |
|
1459 |
! |
|
1460 |
||
9575 | 1461 |
releaseNr |
1462 |
"Returns a releaseNr which will appear in libName.rc" |
|
1463 |
||
1464 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
|
1465 |
the default here takes smalltalks version number. |
|
1466 |
But thats probably not good for an end-user-app." |
|
1467 |
||
9817 | 1468 |
^ Smalltalk releaseNr printString |
9536 | 1469 |
|
9575 | 1470 |
"Created: / 17-08-2006 / 20:20:51 / cg" |
9817 | 1471 |
"Modified: / 30-08-2006 / 18:52:22 / cg" |
9575 | 1472 |
! |
1473 |
||
1474 |
revisionNr |
|
1475 |
"Returns a revisionNr which will appear in libName.rc" |
|
9536 | 1476 |
|
9575 | 1477 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
1478 |
the default here takes smalltalks version number. |
|
1479 |
But thats probably not good for an end-user-app." |
|
1480 |
||
9817 | 1481 |
^ Smalltalk revisionNr printString |
9575 | 1482 |
|
1483 |
"Created: / 17-08-2006 / 20:20:40 / cg" |
|
9817 | 1484 |
"Modified: / 30-08-2006 / 18:52:32 / cg" |
9536 | 1485 |
! |
1486 |
||
1487 |
versionNumber |
|
9575 | 1488 |
"Returns a version string which will appear in nt.def " |
9536 | 1489 |
|
9575 | 1490 |
^'' |
9536 | 1491 |
|
1492 |
"Created: / 08-08-2006 / 11:35:52 / fm" |
|
9575 | 1493 |
"Modified: / 17-08-2006 / 19:46:29 / cg" |
9536 | 1494 |
! ! |
1495 |
||
9569 | 1496 |
!ProjectDefinition class methodsFor:'file generation'! |
9536 | 1497 |
|
9852 | 1498 |
basicFileNamesToGenerate |
1499 |
self subclassResponsibility |
|
1500 |
||
1501 |
"Created: / 14-09-2006 / 14:36:31 / cg" |
|
1502 |
! |
|
1503 |
||
9536 | 1504 |
fileNamesToGenerate |
9852 | 1505 |
^ self basicFileNamesToGenerate reject:[:p | self protectedFileNames includes:(p first) ]. |
1506 |
||
1507 |
"Modified: / 14-09-2006 / 14:36:10 / cg" |
|
9536 | 1508 |
! |
1509 |
||
9544 | 1510 |
forEachFileNameAndGeneratedContentsDo:aTwoArgBlock |
1511 |
|pairs| |
|
1512 |
||
1513 |
pairs := OrderedCollection new. |
|
1514 |
self forEachFileNameAndGeneratorMethodDo:[:fileName :generator | |
|
1515 |
|file| |
|
1516 |
||
1517 |
file := self perform:generator. |
|
1518 |
pairs add:(Array with:fileName with:file) |
|
1519 |
]. |
|
1520 |
||
1521 |
pairs pairsDo:aTwoArgBlock |
|
1522 |
||
1523 |
"Created: / 16-08-2006 / 18:37:52 / User" |
|
1524 |
! |
|
1525 |
||
9536 | 1526 |
forEachFileNameAndGeneratorMethodDo:aTwoArgBlock |
1527 |
|fileNamesAndSelectors| |
|
1528 |
||
9898 | 1529 |
fileNamesAndSelectors := self fileNamesToGenerate. |
9536 | 1530 |
fileNamesAndSelectors pairsDo:aTwoArgBlock |
9831 | 1531 |
|
9898 | 1532 |
"Modified: / 14-09-2006 / 21:02:37 / cg" |
9536 | 1533 |
! |
1534 |
||
1535 |
generateFile:filename |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
1536 |
self basicFileNamesToGenerate |
9817 | 1537 |
pairsDo:[:fn :action | |
1538 |
filename = fn ifTrue:[ |
|
1539 |
^ self perform:action |
|
1540 |
]. |
|
1541 |
]. |
|
9898 | 1542 |
(filename = 'app.rc' or:[filename = 'lib.rc' or:[filename = self rcFilename]]) ifTrue:[ |
9817 | 1543 |
^ self generate_packageName_dot_rc |
9607 | 1544 |
]. |
9898 | 1545 |
(filename = 'app.nsi' or:[filename = self nsiFilename]) ifTrue:[ |
1546 |
^ self generate_packageName_dot_nsi |
|
1547 |
]. |
|
1548 |
||
9850 | 1549 |
(filename = 'loadAll') ifTrue:[ |
1550 |
^ self generate_loadAll |
|
1551 |
]. |
|
9621 | 1552 |
self error:('File "%1" not appropriate (not generated) for this type of project.' |
1553 |
bindWith:filename) |
|
9575 | 1554 |
|
9898 | 1555 |
"Modified: / 14-09-2006 / 21:07:49 / cg" |
9536 | 1556 |
! |
1557 |
||
1558 |
generate_abbrev_dot_stc |
|
1559 |
^ String |
|
1560 |
streamContents:[:s | |
|
9621 | 1561 |
|addEntry| |
1562 |
||
1563 |
addEntry := |
|
1564 |
[:eachClassName | |
|
9681 | 1565 |
|cls fn wasLoaded failedToLoad numClassInstvars| |
9621 | 1566 |
|
1567 |
s nextPutAll:eachClassName. |
|
1568 |
s nextPutAll:' '. |
|
9536 | 1569 |
|
9621 | 1570 |
cls := Smalltalk classNamed:eachClassName. |
1571 |
cls isNil ifTrue:[ |
|
9678 | 1572 |
fn := (Smalltalk fileNameForClass:eachClassName) asFilename withoutSuffix. |
1573 |
fn suffix notEmptyOrNil ifTrue:[ |
|
1574 |
fn := fn withoutSuffix |
|
1575 |
]. |
|
1576 |
fn := fn baseName. |
|
1577 |
s nextPutAll:fn. |
|
9621 | 1578 |
s nextPutAll:' '; nextPutAll:'unknownPackage'; nextPutAll:' '. |
1579 |
s nextPutAll:' '; nextPutAll:'unknownCategory' storeString; nextPutAll:' '. |
|
1580 |
s nextPutAll:' '; nextPutAll:'0'. |
|
1581 |
] ifFalse:[ |
|
1582 |
wasLoaded := cls isLoaded. |
|
9714 | 1583 |
wasLoaded ifFalse:[ |
1584 |
failedToLoad := false. |
|
9681 | 1585 |
|
9714 | 1586 |
Error handle:[:ex | |
1587 |
failedToLoad := true. |
|
1588 |
] do:[ |
|
1589 |
ParserFlags |
|
1590 |
withSTCCompilation:#never |
|
1591 |
do:[ |
|
1592 |
cls autoload. |
|
1593 |
] |
|
1594 |
]. |
|
9681 | 1595 |
]. |
9584 | 1596 |
|
9678 | 1597 |
fn := cls classFilename asFilename withoutSuffix. |
1598 |
fn suffix notEmptyOrNil ifTrue:[ |
|
1599 |
fn := fn withoutSuffix |
|
1600 |
]. |
|
1601 |
fn := fn baseName. |
|
9621 | 1602 |
(fn includes:Character space) ifTrue:[ |
1603 |
s nextPutAll:fn storeString. |
|
1604 |
] ifFalse:[ |
|
1605 |
s nextPutAll:fn. |
|
1606 |
]. |
|
1607 |
s nextPutAll:' '; nextPutAll:(cls package); nextPutAll:' '. |
|
1608 |
s nextPutAll: (cls category asString storeString). |
|
9681 | 1609 |
failedToLoad ifTrue:[ |
1610 |
s nextPutAll:' 0'. |
|
1611 |
] ifFalse:[ |
|
1612 |
numClassInstvars := cls theMetaclass instSize - Class instSize. |
|
1613 |
s nextPutAll:' '; nextPutAll:numClassInstvars printString. |
|
1614 |
]. |
|
9714 | 1615 |
|
9621 | 1616 |
wasLoaded ifFalse:[ |
1617 |
cls unload |
|
1618 |
] |
|
1619 |
]. |
|
1620 |
s cr. |
|
9536 | 1621 |
]. |
9615 | 1622 |
|
9621 | 1623 |
self allClassNames do:addEntry. |
1624 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do: [:nm :attr | |
|
1625 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
|
1626 |
addEntry value:nm |
|
1627 |
]. |
|
1628 |
]. |
|
9536 | 1629 |
] |
1630 |
||
1631 |
" |
|
1632 |
DapasXProject generate_abbrev_dot_stc |
|
1633 |
DapasX_Datenbasis generate_abbrev_dot_stc |
|
1634 |
bosch_dapasx_interactiver_editor generate_abbrev_dot_stc |
|
1635 |
" |
|
1636 |
||
1637 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
9672 | 1638 |
"Modified: / 23-08-2006 / 16:49:42 / cg" |
9536 | 1639 |
! |
1640 |
||
1641 |
generate_bc_dot_def |
|
1642 |
||
1643 |
^self replaceMappings: self bc_dot_def_mappings |
|
1644 |
in: self bc_dot_def |
|
1645 |
||
1646 |
" |
|
1647 |
DapasXProject generate_bc_dot_def |
|
1648 |
DapasX_Datenbasis generate_bc_dot_def |
|
1649 |
||
1650 |
" |
|
1651 |
||
1652 |
"Modified: / 09-08-2006 / 11:30:42 / fm" |
|
1653 |
! |
|
1654 |
||
9575 | 1655 |
generate_bmake_dot_mak |
1656 |
||
1657 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
1658 |
in: self bmake_dot_mak |
|
1659 |
||
1660 |
"Created: / 17-08-2006 / 20:03:43 / cg" |
|
1661 |
! |
|
1662 |
||
9850 | 1663 |
generate_loadAll |
1664 |
^ String |
|
1665 |
streamContents:[:s | |
|
1666 |
|classNames classesLoaded classNamesUnloaded classesSorted classNamesSorted| |
|
1667 |
||
10005 | 1668 |
classNames := self compiled_classNames_common. |
9850 | 1669 |
classesLoaded := classNames |
10010 | 1670 |
collect:[:nm | Smalltalk classNamed:nm] |
9850 | 1671 |
thenSelect:[:cls | cls notNil and:[cls isLoaded] ]. |
1672 |
classNamesUnloaded := classNames |
|
1673 |
select:[:nm | |cls| cls := Smalltalk classNamed:nm. cls isNil or:[cls isLoaded not]]. |
|
1674 |
||
1675 |
classesSorted := Class classesSortedByLoadOrder:classesLoaded. |
|
10010 | 1676 |
classNamesSorted := classesSorted collect:[:cls | cls name]. |
9850 | 1677 |
|
1678 |
||
1679 |
s nextPutAll:'"/ |
|
1680 |
"/ $' , 'Header' , '$ |
|
1681 |
"/ |
|
1682 |
"/ loadAll-file to fileIn code for: ' , self package , ' |
|
1683 |
"/ |
|
1684 |
"/ Automatically generated from the ProjectDefinition. |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
1685 |
"/ DO NOT MODIFY THIS FILE; |
9850 | 1686 |
"/ |
1687 |
"/ |
|
1688 |
"/ Prerequisites: |
|
1689 |
"/ |
|
1690 |
"/ Smalltalk loadPackage:''module:directory''. |
|
1691 |
"/ Smalltalk loadPackage:''....''. |
|
1692 |
!! |
|
1693 |
||
1694 |
"{ package:''' , self package, ''' }" |
|
1695 |
!! |
|
1696 |
||
1697 |
|files| |
|
1698 |
||
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
1699 |
''loading package ' , self package ,'...'' infoPrint. |
9850 | 1700 |
|
1701 |
files := #( |
|
1702 |
'. |
|
1703 |
||
1704 |
classesSorted do:[:eachClass | |
|
1705 |
s nextPutLine:' ''' , eachClass classFilename asFilename baseName, ''''. |
|
1706 |
]. |
|
1707 |
classNamesUnloaded do:[:nm | |
|
1708 |
s nextPutLine:' ''' , (Smalltalk fileNameForClass: nm) asFilename baseName, ''''. |
|
1709 |
]. |
|
1710 |
||
1711 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do:[:nm :attr | |
|
1712 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
|
1713 |
s nextPutLine:' ''' , (Smalltalk fileNameForClass: nm) asFilename baseName, ''''. |
|
1714 |
]. |
|
1715 |
]. |
|
1716 |
||
9906
9efd21c9b1b6
hasExtensions is a bad name (conflicts with the other query)
Claus Gittinger <cg@exept.de>
parents:
9904
diff
changeset
|
1717 |
self hasExtensionMethods ifTrue:[ |
9850 | 1718 |
s nextPutLine:' ''extensions.st'''. |
1719 |
]. |
|
1720 |
||
1721 |
s nextPutAll:' |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
1722 |
). |
9850 | 1723 |
|
1724 |
"/ see if there is a classLibrary |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
1725 |
(Smalltalk fileInClassLibrary:''' , (self libraryName) , ''') ifTrue:[ |
9850 | 1726 |
|handle loaded| |
1727 |
||
1728 |
handle := ObjectFileLoader loadedObjectHandles |
|
1729 |
detect:[:h | h package = ''' , self package , '''] ifNone:nil. |
|
1730 |
handle ifNotNil:[ |
|
1731 |
loaded := Set new:(handle classes size). |
|
1732 |
handle classes do:[:c| c isMeta ifFalse:[loaded add:c classFilename]]. |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
1733 |
files := files \ loaded. |
9850 | 1734 |
]. |
1735 |
]. |
|
1736 |
||
1737 |
"/ 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
|
1738 |
files notEmpty ifTrue:[ |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
1739 |
'''' infoPrintCR. |
9850 | 1740 |
files do:[:f | |
1741 |
''.'' infoPrint. |
|
1742 |
f asFilename exists ifTrue:[ |
|
1743 |
Smalltalk fileIn:f. |
|
1744 |
] ifFalse:[ |
|
1745 |
Smalltalk fileIn:(''source/'' , f) |
|
1746 |
] |
|
1747 |
]. |
|
1748 |
'' '' infoPrintCR. |
|
1749 |
]. |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
1750 |
''done (' , self package ,').'' infoPrintCR. |
9850 | 1751 |
'. |
1752 |
]. |
|
1753 |
||
1754 |
"Created: / 14-09-2006 / 14:21:31 / cg" |
|
1755 |
! |
|
1756 |
||
9536 | 1757 |
generate_make_dot_proto |
1758 |
||
9733 | 1759 |
^ (self |
1760 |
replaceMappings: self make_dot_proto_mappings |
|
1761 |
in: self make_dot_proto) asStringCollection withTabs asString |
|
9536 | 1762 |
|
9733 | 1763 |
" |
1764 |
stx:libbasic2 generate_make_dot_proto |
|
1765 |
" |
|
9536 | 1766 |
|
1767 |
"Modified: / 09-08-2006 / 11:31:01 / fm" |
|
1768 |
! |
|
1769 |
||
1770 |
generate_make_dot_spec |
|
9733 | 1771 |
^ (self |
1772 |
replaceMappings: self make_dot_spec_mappings |
|
1773 |
in: self make_dot_spec) asStringCollection withTabs asString |
|
9536 | 1774 |
|
9733 | 1775 |
" |
1776 |
DapasXProject generate_make_dot_spec |
|
1777 |
DapasX_Datenbasis generate_make_dot_spec |
|
1778 |
bosch_dapasx_kernel_Definition generate_make_dot_spec |
|
1779 |
" |
|
9536 | 1780 |
|
1781 |
"Modified: / 09-08-2006 / 11:31:09 / fm" |
|
1782 |
! |
|
1783 |
||
1784 |
generate_modules_dot_stx |
|
1785 |
||
1786 |
^self replaceMappings: self modules_dot_stx_mappings |
|
1787 |
in: self modules_dot_stx |
|
1788 |
||
1789 |
" |
|
1790 |
bosch_dapasx_application generate_modules_dot_stx |
|
1791 |
||
1792 |
" |
|
1793 |
||
1794 |
"Modified: / 09-08-2006 / 11:31:09 / fm" |
|
1795 |
"Modified: / 11-08-2006 / 14:01:56 / cg" |
|
1796 |
! |
|
1797 |
||
1798 |
generate_nt_dot_def |
|
1799 |
||
1800 |
^self replaceMappings: self nt_dot_def_mappings |
|
1801 |
in: self nt_dot_def |
|
1802 |
||
1803 |
" |
|
1804 |
DapasXProject generate_nt_dot_def |
|
1805 |
DapasX_Datenbasis generate_nt_dot_def |
|
1806 |
||
1807 |
" |
|
1808 |
||
1809 |
"Modified: / 09-08-2006 / 11:31:21 / fm" |
|
1810 |
! |
|
1811 |
||
1812 |
generate_nt_dot_mak |
|
9733 | 1813 |
^ (self |
1814 |
replaceMappings: self nt_dot_mak_mappings |
|
1815 |
in: self nt_dot_mak) asStringCollection withTabs asString |
|
9536 | 1816 |
|
9733 | 1817 |
" |
1818 |
DapasXProject generate_nt_dot_mak |
|
1819 |
DapasX_Datenbasis generate_nt_dot_mak |
|
1820 |
" |
|
9536 | 1821 |
|
1822 |
"Modified: / 09-08-2006 / 11:46:14 / fm" |
|
1823 |
! |
|
1824 |
||
1825 |
generate_packageName_dot_rc |
|
1826 |
||
1827 |
^self replaceMappings: self packageName_dot_rc_mappings |
|
1828 |
in: self packageName_dot_rc |
|
1829 |
||
1830 |
" |
|
1831 |
bosch_dapasx_datenbasis generate_packageName_dot_rc |
|
1832 |
bosch_dapasx_hw_schnittstellen generate_packageName_dot_rc |
|
9575 | 1833 |
stx_libbasic3 generate_packageName_dot_rc |
9618 | 1834 |
stx_libwidg3 generate_packageName_dot_rc |
1835 |
stx_libwidg3 productVersion |
|
9536 | 1836 |
|
1837 |
" |
|
1838 |
||
1839 |
"Modified: / 09-08-2006 / 11:31:09 / fm" |
|
9618 | 1840 |
"Modified: / 21-08-2006 / 19:33:21 / cg" |
9831 | 1841 |
! |
1842 |
||
9898 | 1843 |
nsiFilename |
1844 |
^ self packageName,'.nsi'. |
|
1845 |
||
1846 |
"Created: / 14-09-2006 / 21:03:41 / cg" |
|
1847 |
! |
|
1848 |
||
9852 | 1849 |
protectedFileNames |
1850 |
"names of files which should NOT be generated |
|
1851 |
- redefine this to protect a hand-written Make.proto" |
|
1852 |
||
1853 |
^ #() |
|
1854 |
||
1855 |
"Created: / 14-09-2006 / 14:38:40 / cg" |
|
1856 |
! |
|
1857 |
||
9831 | 1858 |
rcFilename |
1859 |
^ self packageName,'.rc'. |
|
1860 |
||
1861 |
"Created: / 07-09-2006 / 17:07:00 / cg" |
|
9536 | 1862 |
! ! |
1863 |
||
9569 | 1864 |
!ProjectDefinition class methodsFor:'file templates'! |
9536 | 1865 |
|
9575 | 1866 |
bmake_dot_mak |
1867 |
"the template code for the bmake.bat file" |
|
1868 |
||
1869 |
^ |
|
9888 | 1870 |
'%(SUBPROJECT_BMAKE_CALLS) |
1871 |
make.exe -N -f nt.mak %%1 %%2 |
|
9575 | 1872 |
' |
1873 |
||
1874 |
"Created: / 17-08-2006 / 20:04:14 / cg" |
|
9888 | 1875 |
"Modified: / 14-09-2006 / 19:46:40 / cg" |
9575 | 1876 |
! |
1877 |
||
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
1878 |
classLine_libInit_dot_cc |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
1879 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
1880 |
^'_%(CLASS)_Init(pass,__pRT__,snd);' |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
1881 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
1882 |
"Created: / 08-08-2006 / 12:51:44 / fm" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
1883 |
"Modified: / 08-08-2006 / 15:46:05 / fm" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
1884 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
1885 |
|
9817 | 1886 |
make_dot_spec |
1887 |
||
1888 |
^ |
|
1889 |
'# $','Header','$ |
|
1890 |
# |
|
1891 |
# DO NOT EDIT |
|
1892 |
# automagically generated from the projectDefinition: ',self name,'. |
|
1893 |
# |
|
1894 |
# Warning: once you modify this file, do not rerun |
|
1895 |
# stmkmp or projectDefinition-build again - otherwise, your changes are lost. |
|
1896 |
# |
|
1897 |
# This file contains specifications which are common to all platforms. |
|
1898 |
# |
|
1899 |
||
1900 |
# Do NOT CHANGE THESE DEFINITIONS |
|
1901 |
# (otherwise, ST/X will have a hard time to find out the packages location from its packageID, |
|
1902 |
# to find the source code of a class and to find the library for a package) |
|
1903 |
MODULE=%(MODULE) |
|
1904 |
MODULE_DIR=%(MODULE_DIRECTORY) |
|
1905 |
PACKAGE=$(MODULE):$(MODULE_DIR) |
|
1906 |
||
1907 |
||
1908 |
# Argument(s) to the stc compiler (stc --usage). |
|
1909 |
# -H. : create header files locally |
|
1910 |
# (if removed, they will be created as common |
|
1911 |
# -Pxxx : defines the package |
|
1912 |
# -Zxxx : a prefix for variables within the classLib |
|
1913 |
# -Dxxx : defines passed to to CC for inline C-code |
|
1914 |
# -Ixxx : include path passed to CC for inline C-code |
|
1915 |
# +optspace : optimized for space |
|
1916 |
# +optspace2 : optimized more for space |
|
1917 |
# +optspace3 : optimized even more for space |
|
1918 |
# +optinline : generate inline code for some ST constructs |
|
1919 |
# +inlineNew : additionally inline new |
|
1920 |
# +inlineMath : additionally inline some floatPnt math stuff |
|
1921 |
# |
|
1922 |
# ********** OPTIONAL: MODIFY the next line(s) *** |
|
1923 |
# STCLOCALOPTIMIZATIONS=+optinline +inlineNew |
|
1924 |
# STCLOCALOPTIMIZATIONS=+optspace3 |
|
1925 |
STCLOCALOPTIMIZATIONS=%(STCOPTIMIZATIONOPTIONS) |
|
1926 |
||
1927 |
||
1928 |
# Argument(s) to the stc compiler (stc --usage). |
|
1929 |
# -warn : no warnings |
|
1930 |
# -warnNonStandard : no warnings about ST/X extensions |
|
1931 |
# -warnEOLComments : no warnings about EOL comment extension |
|
1932 |
# -warnPrivacy : no warnings about privateClass extension |
|
1933 |
# |
|
1934 |
# ********** OPTIONAL: MODIFY the next line(s) *** |
|
1935 |
# STCWARNINGS=-warn |
|
1936 |
# STCWARNINGS=-warnNonStandard |
|
1937 |
# STCWARNINGS=-warnEOLComments |
|
1938 |
STCWARNINGS=%(STCWARNINGOPTIONS) |
|
1939 |
||
1940 |
%(OBJECTS) |
|
1941 |
' |
|
1942 |
||
1943 |
"Created: / 08-08-2006 / 19:31:29 / fm" |
|
1944 |
"Modified: / 09-08-2006 / 15:10:57 / fm" |
|
1945 |
"Modified: / 30-08-2006 / 19:07:26 / cg" |
|
1946 |
! |
|
1947 |
||
1948 |
objectLine_make_dot_spec |
|
1949 |
||
1950 |
^' $(OUTDIR)%(CLASSFILE).$(O) \' |
|
1951 |
||
1952 |
"Created: / 08-08-2006 / 20:16:46 / fm" |
|
1953 |
"Modified: / 23-08-2006 / 11:11:38 / cg" |
|
1954 |
! |
|
1955 |
||
9627 | 1956 |
packageName_dot_rc |
1957 |
"the template code for the <libName>.rc file" |
|
1958 |
||
1959 |
^ |
|
1960 |
'// |
|
1961 |
// DO NOT EDIT |
|
1962 |
// automagically generated from the projectDefinition: ',self name,'. |
|
1963 |
// |
|
1964 |
VS_VERSION_INFO VERSIONINFO |
|
1965 |
FILEVERSION %(FILE_VERSION_COMMASEPARATED) |
|
1966 |
PRODUCTVERSION %(PRODUCT_VERSION_COMMASEPARATED) |
|
1967 |
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE |
|
1968 |
FILEFLAGS VS_FF_PRERELEASE | VS_FF_SPECIALBUILD |
|
1969 |
FILEOS VOS_NT_WINDOWS32 |
|
1970 |
FILETYPE %(FILETYPE) |
|
1971 |
FILESUBTYPE VS_USER_DEFINED |
|
1972 |
||
1973 |
BEGIN |
|
1974 |
BLOCK "StringFileInfo" |
|
1975 |
BEGIN |
|
1976 |
BLOCK "040904E4" |
|
1977 |
BEGIN |
|
1978 |
VALUE "CompanyName", "%(COMPANY_NAME)\0" |
|
1979 |
VALUE "FileDescription", "%(FILE_DESCRIPTION)\0" |
|
1980 |
VALUE "FileVersion", "%(FILE_VERSION)\0" |
|
1981 |
VALUE "InternalName", "%(INTERNAL_NAME)\0" |
|
9630 | 1982 |
%(LEGAL_COPYRIGHT_LINE) |
9627 | 1983 |
VALUE "ProductName", "%(PRODUCT_NAME)\0" |
1984 |
VALUE "ProductVersion", "%(PRODUCT_VERSION)\0" |
|
1985 |
VALUE "ProductDate", "%(PRODUCT_DATE)\0" |
|
1986 |
END |
|
1987 |
||
1988 |
END |
|
1989 |
||
1990 |
BLOCK "VarFileInfo" |
|
1991 |
BEGIN // Language | Translation |
|
1992 |
VALUE "Translation", 0x409, 0x4E4 // U.S. English, Windows Multilingual |
|
1993 |
END |
|
1994 |
END |
|
1995 |
' |
|
1996 |
" |
|
1997 |
stx_libbasic3 packageName_dot_rc |
|
1998 |
stx_libbasic3 generate_packageName_dot_rc |
|
1999 |
" |
|
2000 |
||
2001 |
"Created: / 08-08-2006 / 19:31:29 / fm" |
|
2002 |
"Modified: / 09-08-2006 / 15:10:57 / fm" |
|
9630 | 2003 |
"Modified: / 23-08-2006 / 01:32:23 / cg" |
9536 | 2004 |
! ! |
2005 |
||
9569 | 2006 |
!ProjectDefinition class methodsFor:'loading'! |
9551 | 2007 |
|
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2008 |
load |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2009 |
"load the project" |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2010 |
|
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2011 |
"try to load a binary class library first. |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2012 |
If this fails, classes are filed in, as well as classes not present |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2013 |
in the class library" |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2014 |
|
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2015 |
self loadClassLibrary. |
9627 | 2016 |
self loadExtensions. |
2017 |
self loadAllClasses. |
|
9579 | 2018 |
|
9627 | 2019 |
"Created: / 17-08-2006 / 01:01:41 / cg" |
9579 | 2020 |
! |
2021 |
||
9627 | 2022 |
loadAllClasses |
10005 | 2023 |
"load (fileIn) classes that should be present - |
2024 |
install as autoloaded classes marked to be autoloaded" |
|
2025 |
||
2026 |
|classNamesToLoad classNamesToAutoload hasClassesToLoad loadedClasses platformName| |
|
2027 |
||
2028 |
platformName := OperatingSystem platformName. |
|
2029 |
classNamesToLoad := OrderedCollection new. |
|
2030 |
classNamesToAutoload := OrderedCollection new. |
|
2031 |
||
10007
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2032 |
self classNamesAndAttributesDo:[:eachClassname :eachAttributes | |eachClassnameSym isAutoload cls| |
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2033 |
eachClassnameSym := eachClassname asSymbol. |
10005 | 2034 |
isAutoload := eachAttributes includes:#autoload. |
2035 |
||
10007
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2036 |
"no need to (re-)load an existing class, but install if should be loaded" |
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2037 |
((cls := Smalltalk loadedClassNamed:eachClassnameSym) isNil |
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2038 |
or:[cls isLoaded not and:[isAutoload not]] |
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2039 |
) ifTrue:[ |
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2040 |
(eachAttributes isEmpty |
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2041 |
or:[(eachAttributes size == 1 and:[isAutoload]) |
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2042 |
or:[eachAttributes includes:platformName]]) ifTrue:[ |
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2043 |
hasClassesToLoad := true. |
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2044 |
isAutoload ifTrue:[ |
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2045 |
classNamesToAutoload add:eachClassnameSym. |
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2046 |
] ifFalse:[ |
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2047 |
classNamesToLoad add:eachClassnameSym. |
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2048 |
]. |
10005 | 2049 |
]. |
10007
93f73465ef11
Fix class loading (if class is already present)
Stefan Vogel <sv@exept.de>
parents:
10005
diff
changeset
|
2050 |
]. |
10005 | 2051 |
]. |
2052 |
||
2053 |
hasClassesToLoad ifTrue:[ |
|
2054 |
loadedClasses := OrderedCollection new. |
|
2055 |
||
2056 |
"we need the abbreviations, since sometimes there is no 1-to-1 mapping |
|
2057 |
of class name to file name" |
|
2058 |
||
2059 |
Smalltalk recursiveReadAllAbbreviationsFrom:self packageDirectory maxLevels:1. |
|
2060 |
||
2061 |
"install autoloaded classes first, |
|
2062 |
some others may depend on them" |
|
2063 |
||
2064 |
classNamesToAutoload do:[:eachClassName | |
|
2065 |
Smalltalk |
|
2066 |
installAutoloadedClassNamed:eachClassName |
|
2067 |
category:#autoloaded "FIXME" |
|
2068 |
package:self package |
|
2069 |
revision:nil |
|
2070 |
numClassInstVars:0. "FIXME" |
|
2071 |
]. |
|
2072 |
||
2073 |
classNamesToLoad do:[:eachClassName | |
|
9627 | 2074 |
|cls| |
2075 |
||
10005 | 2076 |
cls := Smalltalk |
2077 |
fileInClass:eachClassName |
|
2078 |
package:self package |
|
2079 |
initialize:false |
|
2080 |
lazy:false |
|
2081 |
silent:false. |
|
2082 |
cls notNil ifTrue:[ |
|
2083 |
loadedClasses add:cls |
|
9627 | 2084 |
]. |
2085 |
]. |
|
10005 | 2086 |
loadedClasses do:[:eachLoadedClass | |
2087 |
"do not initialize, if initialize method is inherited" |
|
2088 |
(eachLoadedClass theMetaclass implements:#initialize) ifTrue:[ |
|
2089 |
eachLoadedClass initialize |
|
2090 |
]. |
|
9627 | 2091 |
]. |
2092 |
]. |
|
2093 |
||
2094 |
"Created: / 17-08-2006 / 01:01:14 / cg" |
|
9817 | 2095 |
"Modified: / 30-08-2006 / 18:32:56 / cg" |
9551 | 2096 |
! |
2097 |
||
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2098 |
loadClassLibrary |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2099 |
"try to load a binary class library" |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2100 |
|
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2101 |
(Smalltalk fileInClassLibrary:self libraryName inPackage:self package) ifTrue:[ |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2102 |
"/ |handle loaded| |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2103 |
"/ |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2104 |
"/ handle := ObjectFileLoader loadedObjectHandles |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2105 |
"/ detect:[:h | h package = self package] ifNone:nil. |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2106 |
"/ handle ifNotNil:[ |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2107 |
"/ loaded := Set new:(handle classes size). |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2108 |
"/ handle classes do:[:c| c isMeta ifFalse:[loaded add:c classFilename]]. |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2109 |
"/ files := files \ loaded. |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2110 |
"/ ]. |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2111 |
]. |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2112 |
! |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2113 |
|
9627 | 2114 |
loadExtensions |
9911
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2115 |
"load extension methods - do not load if they are already present" |
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2116 |
|
114cf30d0561
Handle (load) binary class libraryies.
Stefan Vogel <sv@exept.de>
parents:
9909
diff
changeset
|
2117 |
self hasAllExtensionsLoaded ifFalse:[ |
9909
a92096c60681
Do not try to load extensions, if there are none
Stefan Vogel <sv@exept.de>
parents:
9908
diff
changeset
|
2118 |
Smalltalk loadExtensionsForPackage:self package. |
a92096c60681
Do not try to load extensions, if there are none
Stefan Vogel <sv@exept.de>
parents:
9908
diff
changeset
|
2119 |
]. |
9627 | 2120 |
|
2121 |
"Created: / 17-08-2006 / 00:21:39 / cg" |
|
2122 |
! |
|
2123 |
||
2124 |
postAutoload |
|
9906
9efd21c9b1b6
hasExtensions is a bad name (conflicts with the other query)
Claus Gittinger <cg@exept.de>
parents:
9904
diff
changeset
|
2125 |
self hasExtensionMethods ifTrue:[ |
9627 | 2126 |
self loadExtensions |
2127 |
]. |
|
2128 |
||
2129 |
"Created: / 17-08-2006 / 00:21:29 / cg" |
|
9850 | 2130 |
"Modified: / 14-09-2006 / 14:20:33 / cg" |
9551 | 2131 |
! ! |
2132 |
||
9569 | 2133 |
!ProjectDefinition class methodsFor:'mappings'! |
9536 | 2134 |
|
9627 | 2135 |
bc_dot_def_mappings |
2136 |
^ (Dictionary new) |
|
9887 | 2137 |
at:'DESCRIPTION' |
9627 | 2138 |
put:[ |
2139 |
|d| |
|
2140 |
||
2141 |
d := self description. |
|
2142 |
(d isEmptyOrNil ifTrue:[ self defaultDescription ] ifFalse:[ d ]) storeString. |
|
2143 |
]; |
|
2144 |
yourself |
|
2145 |
||
2146 |
"Created: / 09-08-2006 / 11:17:59 / fm" |
|
9887 | 2147 |
"Modified: / 14-09-2006 / 18:51:17 / cg" |
9536 | 2148 |
! |
2149 |
||
9627 | 2150 |
bmake_dot_mak_mappings |
2151 |
^ (Dictionary new) |
|
9887 | 2152 |
at:'SUBPROJECT_BMAKE_CALLS' put:(self subProjectBmakeCalls); |
9627 | 2153 |
yourself |
2154 |
||
2155 |
"Created: / 17-08-2006 / 21:41:56 / cg" |
|
9887 | 2156 |
"Modified: / 14-09-2006 / 18:55:33 / cg" |
9575 | 2157 |
! |
2158 |
||
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2159 |
classLine_mappings: aClassName |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2160 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2161 |
^Dictionary new |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2162 |
at: 'CLASS' put: ( self st2c:aClassName ); |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2163 |
yourself |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2164 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2165 |
"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
|
2166 |
"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
|
2167 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2168 |
|
9627 | 2169 |
make_dot_spec_mappings |
2170 |
^ Dictionary new |
|
9887 | 2171 |
at: 'TAB' put: ( Character tab asString ); |
2172 |
at: 'MODULE' put: ( self module ); |
|
2173 |
at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); |
|
2174 |
at: 'STCWARNINGOPTIONS' put: (self stcWarningOptions); |
|
2175 |
at: 'STCOPTIMIZATIONOPTIONS' put: (self stcOptimizationOptions); |
|
2176 |
at: 'OBJECTS' put: [self generateObjects_make_dot_spec]; |
|
9627 | 2177 |
yourself |
2178 |
||
2179 |
"Created: / 18-08-2006 / 11:44:23 / cg" |
|
9887 | 2180 |
"Modified: / 14-09-2006 / 18:51:24 / cg" |
9575 | 2181 |
! |
2182 |
||
9627 | 2183 |
nt_dot_mak_mappings |
2184 |
|d| |
|
2185 |
||
2186 |
d := Dictionary new. |
|
2187 |
d |
|
9887 | 2188 |
at: 'TAB' put: ( Character tab asString ); |
2189 |
at: 'TOP' put: ( self pathToTop_win32 ); |
|
2190 |
at: 'MODULE' put: ( self module ); |
|
9891 | 2191 |
at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); |
2192 |
at: 'MODULE_PATH' put: ( self moduleDirectory_win32 ). |
|
9627 | 2193 |
^ d |
2194 |
||
2195 |
"Created: / 18-08-2006 / 11:43:39 / cg" |
|
9891 | 2196 |
"Modified: / 14-09-2006 / 20:20:19 / cg" |
9575 | 2197 |
! |
2198 |
||
9817 | 2199 |
objectLine_make_dot_spec_mappings: aClassName |
2200 |
^ Dictionary new |
|
9887 | 2201 |
at: 'CLASSFILE' |
2202 |
put: ( (Smalltalk classNamed:aClassName) classFilename asFilename withoutSuffix baseName ); |
|
9817 | 2203 |
yourself |
2204 |
||
2205 |
"Created: / 08-08-2006 / 20:17:28 / fm" |
|
2206 |
"Modified: / 09-08-2006 / 18:26:52 / fm" |
|
9887 | 2207 |
"Modified: / 14-09-2006 / 18:51:49 / cg" |
9817 | 2208 |
! |
2209 |
||
9627 | 2210 |
packageName_dot_rc_mappings |
9630 | 2211 |
|d s| |
9627 | 2212 |
|
9630 | 2213 |
d := Dictionary new. |
2214 |
d |
|
9887 | 2215 |
at: 'PRODUCT_NAME' put: (self productName); |
2216 |
at: 'PRODUCT_VERSION' put: (self productVersion); |
|
2217 |
at: 'PRODUCT_DATE' put: (self productDate); |
|
2218 |
at: 'FILETYPE' put: ( 'VFT_DLL' ); |
|
2219 |
at: 'FILE_VERSION_COMMASEPARATED' put: (self fileVersionCommaSeparated); |
|
2220 |
at: 'PRODUCT_VERSION_COMMASEPARATED' put: (self productVersionCommaSeparated); |
|
2221 |
||
2222 |
at: 'COMPANY_NAME' put: (self companyName); |
|
2223 |
at: 'FILE_DESCRIPTION' put: (self fileDescription); |
|
2224 |
at: 'FILE_VERSION' put: (self fileVersion); |
|
2225 |
at: 'INTERNAL_NAME' put: (self internalName). |
|
9630 | 2226 |
s := self legalCopyright. |
2227 |
s notNil ifTrue:[ |
|
2228 |
d |
|
9887 | 2229 |
at: 'LEGAL_COPYRIGHT_LINE' put: ' VALUE "LegalCopyright", "',s,'\0"' |
9630 | 2230 |
]. |
9817 | 2231 |
s := self iconFileName. |
2232 |
s notNil ifTrue:[ |
|
2233 |
d |
|
2234 |
at: #'ICONDEFINITION_LINE' put: 'IDR_MAINFRAME ICON DISCARDABLE "',s,'"' |
|
2235 |
]. |
|
2236 |
||
9630 | 2237 |
^ d |
9627 | 2238 |
|
2239 |
"Created: / 09-08-2006 / 11:21:21 / fm" |
|
9887 | 2240 |
"Modified: / 14-09-2006 / 18:52:37 / cg" |
9536 | 2241 |
! |
2242 |
||
9627 | 2243 |
replaceMappings: mappings in: fileTemplate |
9733 | 2244 |
"Replaces the defined variable mappings found in a file template with the corresponding information" |
9627 | 2245 |
|
9733 | 2246 |
^ fileTemplate bindWithArguments:mappings. |
9627 | 2247 |
|
9733 | 2248 |
" |
2249 |
self replaceMappings: (self nt_dot_def_mappingsFor: self) in: self nt_dot_def |
|
2250 |
" |
|
9627 | 2251 |
|
2252 |
"Created: / 08-08-2006 / 11:44:27 / fm" |
|
2253 |
"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
|
2254 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2255 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2256 |
st2c:aString |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2257 |
^ (aString asString |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2258 |
copyReplaceString:'_' withString:('_',($_ codePoint printStringRadix:8))) |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2259 |
replaceAny:':' with:$_ |
9536 | 2260 |
! ! |
2261 |
||
9817 | 2262 |
!ProjectDefinition class methodsFor:'mappings support'! |
2263 |
||
10005 | 2264 |
generateClassLines:classLineTemplate |
2265 |
^ String |
|
2266 |
streamContents:[:s | |
|
2267 |
|classNames classesLoaded classNamesUnloaded classNamesSorted putLineForClassName| |
|
2268 |
||
2269 |
putLineForClassName := [:className | |
|
2270 |
|newClassLine mappings| |
|
2271 |
||
2272 |
mappings := self classLine_mappings:className. |
|
2273 |
newClassLine := self replaceMappings:mappings in:classLineTemplate. |
|
2274 |
s nextPutLine:newClassLine |
|
2275 |
]. |
|
2276 |
classNames := self compiled_classNames_common. |
|
10010 | 2277 |
classesLoaded := classNames collect:[:eachClassName | Smalltalk classNamed:eachClassName] |
2278 |
thenSelect:[:eachClass | eachClass notNil and:[eachClass isLoaded]]. |
|
10005 | 2279 |
classNamesUnloaded := classNames |
2280 |
select:[:nm | |
|
2281 |
|cls| |
|
2282 |
||
2283 |
cls := Smalltalk classNamed:nm. |
|
2284 |
cls isNil or:[ cls isLoaded not ] |
|
2285 |
]. |
|
10010 | 2286 |
classNamesSorted := (Class classesSortedByLoadOrder:classesLoaded) collect:[:cls | cls name]. |
10005 | 2287 |
classNamesSorted do:putLineForClassName. |
2288 |
classNamesUnloaded do:putLineForClassName. |
|
2289 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) |
|
2290 |
do:[:nm :attr | |
|
2291 |
(attr isEmptyOrNil or:[ (attr includes:#autoload) not ]) ifTrue:[ |
|
2292 |
putLineForClassName value:nm. |
|
2293 |
]. |
|
2294 |
]. |
|
10010 | 2295 |
#( ('UNIX' unix) |
2296 |
('WIN32' win32) |
|
2297 |
('VMS' vms) |
|
2298 |
('BEOS' beos) ) |
|
2299 |
pairsDo:[:ifdef :platformName | |
|
10005 | 2300 |
|archClassNames archClassesLoaded| |
2301 |
||
10010 | 2302 |
archClassNames := self compiled_classNamesForPlatform:platformName. |
10005 | 2303 |
archClassNames notEmpty ifTrue:[ |
2304 |
s nextPutLine:'#ifdef ' , ifdef. |
|
2305 |
archClassNames do:[:clsName | |
|
2306 |
putLineForClassName value:clsName |
|
2307 |
]. |
|
2308 |
s nextPutLine:'#endif /* ' , ifdef , ' */'. |
|
2309 |
]. |
|
2310 |
]. |
|
2311 |
] |
|
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2312 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2313 |
" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2314 |
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
|
2315 |
bosch_dapasx_kernel generateClassLines_libInit_dot_cc |
10010 | 2316 |
stx_libbasic3 generateClassLines_libInit_dot_cc |
2317 |
" |
|
2318 |
||
9962
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2319 |
"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
|
2320 |
"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
|
2321 |
"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
|
2322 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2323 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2324 |
generateClassLines_libInit_dot_cc |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2325 |
^ 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
|
2326 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2327 |
" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2328 |
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
|
2329 |
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
|
2330 |
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
|
2331 |
" |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2332 |
|
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2333 |
"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
|
2334 |
"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
|
2335 |
"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
|
2336 |
! |
905898cca08c
also generate modules.c (precompiled-in init list for app)
Claus Gittinger <cg@exept.de>
parents:
9956
diff
changeset
|
2337 |
|
10005 | 2338 |
generateDependencies:whichArchitecture |
2339 |
^ String |
|
2340 |
streamContents:[:s | |
|
2341 |
|classNames classesLoaded classesSorted classNamesSorted putDependencyForClass archClassNames archClassesLoaded putSingleClassDependencyEntry putDependencyForExtensions| |
|
2342 |
||
2343 |
putSingleClassDependencyEntry := [:cls | |
|
2344 |
|sclsBaseName| |
|
2345 |
||
2346 |
s nextPutAll:' $(INCLUDE_TOP)'. |
|
2347 |
s nextPutAll:(self pathSeparator:whichArchitecture) asString. |
|
2348 |
sclsBaseName := cls classFilename asFilename withoutSuffix baseName. |
|
2349 |
s nextPutAll:(self |
|
2350 |
topRelativePathTo:sclsBaseName |
|
2351 |
inPackage:cls package |
|
2352 |
architecture:whichArchitecture). |
|
2353 |
s nextPutAll:'.$(H)'. |
|
9887 | 2354 |
]. |
10005 | 2355 |
putDependencyForClass := [:cls | |
2356 |
|clsBaseName already| |
|
2357 |
||
2358 |
clsBaseName := cls classFilename asFilename withoutSuffix baseName. |
|
2359 |
s nextPutAll:'$(OUTDIR)'. |
|
2360 |
s nextPutAll:clsBaseName. |
|
2361 |
s nextPutAll:'.$(O)'. |
|
2362 |
s nextPutAll:' '. |
|
2363 |
s nextPutAll:clsBaseName. |
|
2364 |
s nextPutAll:'.$(H)'. |
|
2365 |
s nextPutAll:': '. |
|
2366 |
s nextPutAll:clsBaseName. |
|
2367 |
s nextPutAll:'.st'. |
|
2368 |
already := Set new. |
|
2369 |
cls |
|
2370 |
allSuperclassesDo:[:scls | |
|
2371 |
putSingleClassDependencyEntry value:scls. |
|
2372 |
already add:scls. |
|
9887 | 2373 |
]. |
10005 | 2374 |
cls |
2375 |
privateClassesDo:[:eachPrivateClass | |
|
2376 |
eachPrivateClass |
|
2377 |
allSuperclassesDo:[:scls | |
|
2378 |
|sclsBaseName| |
|
2379 |
||
2380 |
scls ~~ cls ifTrue:[ |
|
2381 |
scls isPrivate ifFalse:[ |
|
2382 |
(already includes:scls) ifFalse:[ |
|
2383 |
putSingleClassDependencyEntry value:scls. |
|
2384 |
already add:scls. |
|
2385 |
]. |
|
2386 |
]. |
|
2387 |
]. |
|
2388 |
] |
|
2389 |
]. |
|
2390 |
s nextPutAll:' $(STCHDR)'. |
|
2391 |
s cr. |
|
9887 | 2392 |
]. |
10005 | 2393 |
putDependencyForExtensions := [ |
2394 |
|already| |
|
2395 |
||
2396 |
s nextPutAll:'$(OUTDIR)extensions.$(O): extensions.st'. |
|
2397 |
already := Set new. |
|
2398 |
self extensionMethodNames |
|
2399 |
pairWiseDo:[:className :selector | |
|
2400 |
|mthdCls cls| |
|
2401 |
||
2402 |
((mthdCls := Smalltalk classNamed:className) notNil |
|
2403 |
and:[ mthdCls isLoaded ]) |
|
2404 |
ifTrue:[ |
|
2405 |
cls := mthdCls theNonMetaclass. |
|
2406 |
(already includes:cls) ifFalse:[ |
|
2407 |
cls |
|
2408 |
allSuperclassesDo:[:scls | |
|
2409 |
(already includes:scls) ifFalse:[ |
|
2410 |
putSingleClassDependencyEntry value:scls. |
|
2411 |
already add:scls. |
|
2412 |
]. |
|
2413 |
]. |
|
2414 |
]. |
|
2415 |
]. |
|
9887 | 2416 |
]. |
10005 | 2417 |
s nextPutAll:' $(STCHDR)'. |
2418 |
s cr. |
|
2419 |
]. |
|
2420 |
classNames := self compiled_classNames_common. |
|
2421 |
classesLoaded := classNames |
|
10010 | 2422 |
collect:[:className | Smalltalk classNamed:className] |
2423 |
thenSelect:[:cls | cls notNil and:[cls isLoaded]]. |
|
2424 |
||
10005 | 2425 |
classesSorted := Class classesSortedByLoadOrder:classesLoaded. |
2426 |
classesSorted do:putDependencyForClass. |
|
2427 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) |
|
2428 |
do:[:className :attr | |
|
2429 |
|cls| |
|
2430 |
||
2431 |
(attr isEmptyOrNil or:[ (attr includes:#autoload) not ]) ifTrue:[ |
|
2432 |
((cls := Smalltalk classNamed:className) notNil and:[ cls isLoaded ]) ifTrue:[ |
|
2433 |
putDependencyForClass value:cls. |
|
2434 |
] |
|
9887 | 2435 |
]. |
2436 |
]. |
|
10005 | 2437 |
archClassNames := self compiled_classNamesForPlatform:whichArchitecture. |
2438 |
archClassesLoaded := archClassNames |
|
10010 | 2439 |
collect:[:className | Smalltalk classNamed:className] |
10005 | 2440 |
thenSelect:[:cls | cls notNil and:[ cls isLoaded ] ]. |
10010 | 2441 |
|
10005 | 2442 |
archClassesLoaded notEmpty ifTrue:[ |
10010 | 2443 |
(Class classesSortedByLoadOrder:archClassesLoaded) do:putDependencyForClass. |
9887 | 2444 |
]. |
10005 | 2445 |
self hasExtensionMethods ifTrue:putDependencyForExtensions. |
2446 |
] |
|
9887 | 2447 |
|
2448 |
" |
|
2449 |
stx_libbasic3 generateDependencies:#unix |
|
10010 | 2450 |
stx_libbasic3 generateDependencies:#win32 |
2451 |
" |
|
2452 |
||
9887 | 2453 |
"Modified: / 16-08-2006 / 18:52:10 / User" |
2454 |
"Created: / 14-09-2006 / 12:38:57 / cg" |
|
2455 |
"Modified: / 14-09-2006 / 17:04:21 / cg" |
|
2456 |
! |
|
2457 |
||
2458 |
generateDependencies_unix |
|
2459 |
^ self generateDependencies:#unix |
|
2460 |
||
2461 |
" |
|
2462 |
stx_libbasic3 generateDependencies:#unix |
|
2463 |
stx_libbasic3 generateDependencies:#win32 |
|
2464 |
" |
|
2465 |
||
2466 |
"Modified: / 14-09-2006 / 13:32:34 / cg" |
|
2467 |
! |
|
2468 |
||
2469 |
generateDependencies_win32 |
|
2470 |
^ self generateDependencies:#win32 |
|
2471 |
||
2472 |
"Created: / 14-09-2006 / 12:39:18 / cg" |
|
2473 |
! |
|
2474 |
||
9956 | 2475 |
generateLocalIncludes_unix |
2476 |
^ String streamContents:[:s | |
|
2477 |
s nextPutAll:(self localIncludes_unix). |
|
2478 |
self searchForProjectsWhichProvideHeaderFiles |
|
2479 |
do:[:includeProject | |
|
2480 |
s nextPutAll:' -I$(INCLUDE_TOP)/',(self topRelativePathToPackage_unix: includeProject) |
|
2481 |
] |
|
2482 |
] |
|
2483 |
||
2484 |
" |
|
2485 |
bosch_dapasx generateLocalIncludes_unix |
|
2486 |
bosch_dapasx_datenbasis generateLocalIncludes_unix |
|
2487 |
stx_libbasic generateLocalIncludes_unix |
|
2488 |
stx_libview generateLocalIncludes_unix |
|
2489 |
stx_libtool2 generateLocalIncludes_unix |
|
2490 |
stx_libui generateLocalIncludes_unix |
|
2491 |
" |
|
2492 |
||
2493 |
"Created: / 09-08-2006 / 16:46:49 / fm" |
|
2494 |
"Modified: / 14-09-2006 / 15:38:16 / cg" |
|
2495 |
! |
|
2496 |
||
9887 | 2497 |
generateLocalIncludes_win32 |
2498 |
^ String streamContents:[:s | |
|
2499 |
s nextPutAll:(self localIncludes_win32). |
|
2500 |
self searchForProjectsWhichProvideHeaderFiles |
|
2501 |
do:[:includeProject | |
|
2502 |
s nextPutAll:' -I$(INCLUDE_TOP)\',(self topRelativePathToPackage_win32: includeProject) |
|
2503 |
] |
|
2504 |
] |
|
2505 |
||
2506 |
" |
|
2507 |
bosch_dapasx_application generateLocalIncludes_win32 |
|
2508 |
bosch_dapasx_datenbasis generateLocalIncludes_win32 |
|
2509 |
stx_libbasic generateLocalIncludes_win32 |
|
2510 |
stx_libview generateLocalIncludes_win32 |
|
2511 |
stx_libtool2 generateLocalIncludes_win32 |
|
2512 |
" |
|
2513 |
||
2514 |
"Created: / 09-08-2006 / 16:46:49 / fm" |
|
2515 |
"Modified: / 14-09-2006 / 15:37:35 / cg" |
|
2516 |
! |
|
2517 |
||
9817 | 2518 |
generateObjects_make_dot_spec |
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2519 |
|pivateClassesOf sorter classes| |
9817 | 2520 |
|
2521 |
classes := self compiled_classes_common. |
|
2522 |
pivateClassesOf := IdentityDictionary new. |
|
2523 |
classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)]. |
|
2524 |
||
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2525 |
sorter := [:a :b | |
9817 | 2526 |
"/ a must come before b iff: |
2527 |
"/ b is a subclass of a |
|
2528 |
"/ b has a private class which is a subclass of a |
|
2529 |
"/ a is a sharedPool, used by b |
|
2530 |
||
2531 |
|mustComeBefore pivateClassesOfB| |
|
2532 |
||
2533 |
mustComeBefore := false. |
|
2534 |
mustComeBefore := (a isSharedPool and:[(b sharedPools includes: a name)]). |
|
2535 |
mustComeBefore := mustComeBefore or:[b isSubclassOf:a]. |
|
2536 |
mustComeBefore ifFalse:[ |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2537 |
pivateClassesOfB := pivateClassesOf at:b ifAbsent:[ #() ]. |
9817 | 2538 |
pivateClassesOfB do:[:eachClassInB | |
2539 |
mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a] |
|
2540 |
]. |
|
2541 |
]. |
|
2542 |
mustComeBefore |
|
2543 |
]. |
|
2544 |
||
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2545 |
classes topologicalSort:sorter. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2546 |
|
9817 | 2547 |
^ String streamContents:[:s | |
2548 |
|putLineForClass sysDepOrNil| |
|
2549 |
||
2550 |
putLineForClass := |
|
2551 |
[:eachClass | |
|
2552 |
|mappings newObjectLine| |
|
2553 |
mappings := self objectLine_make_dot_spec_mappings: eachClass name. |
|
2554 |
newObjectLine := self replaceMappings: mappings in: self objectLine_make_dot_spec. |
|
2555 |
s nextPutLine:newObjectLine. |
|
2556 |
]. |
|
2557 |
||
2558 |
sysDepOrNil := nil. |
|
2559 |
OperatingSystem knownPlatformNames do:[:platformID | |
|
2560 |
|define prefix depClasses| |
|
2561 |
||
2562 |
define := OperatingSystem platformDefineForPlatformName:platformID. |
|
2563 |
prefix := define copyFrom:('-D' size + 1). |
|
2564 |
depClasses := self compiled_classesForArchitecture:platformID. |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2565 |
depClasses topologicalSort:sorter. |
9817 | 2566 |
depClasses notEmpty ifTrue:[ |
2567 |
sysDepOrNil := prefix,'_OBJS'. |
|
2568 |
s nextPutLine:sysDepOrNil,'= \'. |
|
2569 |
depClasses do:putLineForClass. |
|
2570 |
s cr. |
|
2571 |
s cr. |
|
2572 |
] |
|
2573 |
]. |
|
2574 |
||
2575 |
s nextPutLine:'COMMON_OBJS= \'. |
|
2576 |
||
2577 |
classes do:putLineForClass. |
|
2578 |
||
2579 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do: [:nm :attr | |
|
2580 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
|
2581 |
s nextPutLine:(' $(OUTDIR)',(Smalltalk fileNameForClass:nm),'.$(O) \'). |
|
2582 |
]. |
|
2583 |
]. |
|
2584 |
||
9906
9efd21c9b1b6
hasExtensions is a bad name (conflicts with the other query)
Claus Gittinger <cg@exept.de>
parents:
9904
diff
changeset
|
2585 |
self hasExtensionMethods ifTrue:[ |
9850 | 2586 |
s nextPutLine:' $(OUTDIR)extensions.$(O) \'. |
2587 |
]. |
|
9817 | 2588 |
s cr. |
2589 |
] |
|
2590 |
||
2591 |
" |
|
2592 |
bosch_dapasx_hw_schnittstellen_Definition generateObjects_make_dot_spec |
|
2593 |
DapasXProject generateObjects_make_dot_spec |
|
2594 |
stx_libbasic3 generateObjects_make_dot_spec |
|
2595 |
" |
|
2596 |
||
2597 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2598 |
"Modified: / 14-09-2006 / 16:21:46 / cg" |
9887 | 2599 |
! |
2600 |
||
2601 |
subProjectBmakeCalls |
|
2602 |
^ String streamContents:[:s | |
|
2603 |
self subProjects do:[:packageID | |
|
2604 |
s nextPutLine:'cd ', (self msdosPathToPackage:packageID from:(self package)). |
|
2605 |
s nextPutLine:'call bmake %1 %2'. |
|
2606 |
s nextPutLine:'cd ', (self msdosPathToPackage:(self package) from:packageID). |
|
9888 | 2607 |
s cr. |
9887 | 2608 |
] |
2609 |
] |
|
2610 |
||
2611 |
"Created: / 14-09-2006 / 18:40:09 / cg" |
|
9888 | 2612 |
"Modified: / 14-09-2006 / 19:46:57 / cg" |
9817 | 2613 |
! ! |
2614 |
||
9575 | 2615 |
!ProjectDefinition class methodsFor:'private'! |
9536 | 2616 |
|
9996 | 2617 |
addReferencesToClassesFromGlobalsIn:aSetOfClasses to:usedClassReasons |
2618 |
aSetOfClasses |
|
2619 |
do:[:aClass | |
|
2620 |
aClass methodsDo:[:method | |
|
2621 |
method usedGlobals |
|
2622 |
do:[:global | |usedClass| |
|
2623 |
usedClass := Smalltalk at: global asSymbol. |
|
2624 |
(usedClass notNil and:[usedClass isClass and:[usedClass isNameSpace not]]) |
|
2625 |
ifTrue:[ |
|
2626 |
(usedClassReasons at: usedClass ifAbsentPut:[Set new]) |
|
2627 |
add: (usedClass name, ' - Referenced by ', aClass name,'>>',method name) |
|
2628 |
] |
|
2629 |
] |
|
2630 |
] |
|
2631 |
]. |
|
2632 |
! |
|
2633 |
||
9627 | 2634 |
classNamesAndAttributesDo: aBlock |
2635 |
self namesAndAttributesIn:(self classNamesAndAttributes) do: aBlock |
|
2636 |
||
2637 |
"Modified: / 22-08-2006 / 18:20:21 / cg" |
|
9607 | 2638 |
! |
2639 |
||
9664 | 2640 |
compile:someCode categorized:category |
2641 |
Class packageQuerySignal |
|
2642 |
answer:self package |
|
2643 |
do:[ |
|
2644 |
self theMetaclass compilerClass |
|
2645 |
compile:someCode |
|
2646 |
forClass:self theMetaclass |
|
2647 |
inCategory:category |
|
2648 |
notifying:nil |
|
2649 |
install:true |
|
2650 |
skipIfSame:true |
|
2651 |
silent:true. |
|
2652 |
] |
|
2653 |
||
2654 |
"Created: / 23-08-2006 / 14:36:53 / cg" |
|
2655 |
! |
|
2656 |
||
9627 | 2657 |
compiled_classes |
2658 |
^ self compiled_classNames collect:[:eachName| (Smalltalk at:eachName asSymbol)] |
|
2659 |
||
2660 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
2661 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
9536 | 2662 |
! |
2663 |
||
9627 | 2664 |
compiled_classesDo:aBlock |
2665 |
self compiled_classes do:aBlock. |
|
2666 |
||
2667 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
2668 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
2669 |
! |
|
2670 |
||
10005 | 2671 |
compiled_classesForArchitecture:arch |
2672 |
^ (self compiled_classNamesForPlatform:arch) |
|
2673 |
collect:[:eachName | (Smalltalk at:eachName asSymbol) ] |
|
9627 | 2674 |
|
2675 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
2676 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
2677 |
! |
|
2678 |
||
2679 |
compiled_classes_common |
|
2680 |
^ self compiled_classNames_common collect:[:eachName| (Smalltalk at:eachName asSymbol)] |
|
2681 |
||
2682 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
2683 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
9607 | 2684 |
! |
2685 |
||
9627 | 2686 |
cvsRevision |
2687 |
|rev| |
|
2688 |
||
2689 |
rev := self revision. |
|
2690 |
rev isNil ifTrue:[ |
|
2691 |
"not yet pubplished" |
|
2692 |
^ #( '0' '1' ) |
|
2693 |
]. |
|
2694 |
^ rev asCollectionOfSubstringsSeparatedBy:$. . |
|
2695 |
||
2696 |
" |
|
2697 |
self cvsRevision |
|
2698 |
stx_libbasic3 cvsRevision |
|
2699 |
" |
|
2700 |
||
2701 |
"Created: / 17-08-2006 / 20:19:03 / cg" |
|
9575 | 2702 |
! |
2703 |
||
9627 | 2704 |
inconsistency:message |
2705 |
Dialog warn:message |
|
9536 | 2706 |
|
9627 | 2707 |
" |
2708 |
self searchForNeverCompiledSuperclasses |
|
2709 |
DapasX_Datenbasis searchForNeverCompiledSuperclasses |
|
2710 |
" |
|
2711 |
||
2712 |
"Created: / 09-08-2006 / 16:32:31 / fm" |
|
9536 | 2713 |
! |
2714 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2715 |
makeOSIncludesWith:fileSeparator from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2716 |
^ aString copy replaceAny:'/\' with:fileSeparator |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2717 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2718 |
" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2719 |
self makeOSIncludesWith:$/ from:'-I$(TOP)/foo/bar' |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2720 |
self makeOSIncludesWith:$\ from:'-I$(TOP)/foo/bar' |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2721 |
" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2722 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2723 |
"Created: / 06-09-2006 / 18:17:03 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2724 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2725 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2726 |
makeUnixIncludes:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2727 |
^ self makeOSIncludesWith:$/ from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2728 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2729 |
"Created: / 06-09-2006 / 18:16:19 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2730 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2731 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2732 |
makeWin32Includes:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2733 |
^ self makeOSIncludesWith:$\ from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2734 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2735 |
"Created: / 06-09-2006 / 18:16:13 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2736 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2737 |
|
9627 | 2738 |
namesAndAttributesIn:aCollection do: aBlock |
2739 |
aCollection do:[:entry | |
|
2740 |
|className attributes| |
|
2741 |
||
2742 |
entry isArray ifFalse:[ |
|
2743 |
className := entry. |
|
2744 |
attributes := #(). |
|
2745 |
] ifTrue:[ |
|
2746 |
className := entry first. |
|
2747 |
attributes := entry copyFrom:2. |
|
2748 |
]. |
|
2749 |
aBlock value: className value: attributes |
|
2750 |
]. |
|
2751 |
||
2752 |
"Created: / 22-08-2006 / 18:20:09 / cg" |
|
9621 | 2753 |
! |
2754 |
||
9627 | 2755 |
searchForClasses |
10010 | 2756 |
"answer all non-private classes that belong to this project. |
10005 | 2757 |
They are sorted in load order" |
2758 |
||
2759 |
^ Class classesSortedByLoadOrder:(self searchForClassesWithProject: self package) |
|
9627 | 2760 |
|
2761 |
" |
|
10010 | 2762 |
stx_libbasic3 searchForClasses |
9627 | 2763 |
" |
2764 |
||
2765 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
2766 |
"Created: / 17-08-2006 / 21:18:30 / cg" |
|
9536 | 2767 |
! |
2768 |
||
9627 | 2769 |
searchForClassesWithProject: aProjectID |
2770 |
||
2771 |
^ Smalltalk allClasses |
|
9829 | 2772 |
select:[:cls | (cls package = aProjectID) ]. |
9627 | 2773 |
|
2774 |
" |
|
2775 |
self searchForClassesWithProject: #'bosch:dapasx' |
|
2776 |
self searchForClassesWithProject: #'bosch:dapasx/datenbasis' |
|
2777 |
self searchForClassesWithProject: #'bosch:dapasx/kernel' |
|
2778 |
" |
|
2779 |
||
2780 |
"Created: / 07-08-2006 / 20:42:39 / fm" |
|
2781 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
2782 |
"Modified: / 16-08-2006 / 18:50:48 / User" |
|
9536 | 2783 |
! |
2784 |
||
9627 | 2785 |
searchForExtensions |
2786 |
^ self searchForExtensionsWithProject:self package |
|
2787 |
||
2788 |
" |
|
2789 |
self searchForExtensions |
|
2790 |
DapasXProject searchForExtensions |
|
2791 |
DapasX_Datenbasis searchForExtensions |
|
2792 |
" |
|
2793 |
||
2794 |
"Modified: / 09-08-2006 / 13:01:26 / fm" |
|
2795 |
"Created: / 17-08-2006 / 21:17:46 / cg" |
|
9575 | 2796 |
! |
2797 |
||
9627 | 2798 |
searchForExtensionsWithProject:aProjectID |
2799 |
"search for any class which has extensions from aProjectID. |
|
2800 |
Return the extension-methods" |
|
2801 |
||
2802 |
|methods| |
|
2803 |
||
9904 | 2804 |
methods := OrderedCollection new. |
9627 | 2805 |
Smalltalk allClassesDo:[:eachClass | |
2806 |
|classPackage| |
|
2807 |
||
2808 |
classPackage := eachClass package. |
|
9908
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2809 |
classPackage ~= aProjectID ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2810 |
eachClass instAndClassMethodsDo:[:mthd | |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2811 |
|methodsPackage| |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2812 |
|
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2813 |
methodsPackage := mthd package. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2814 |
methodsPackage ~= classPackage ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2815 |
methodsPackage = aProjectID ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2816 |
methods add:mthd |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2817 |
] |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2818 |
]. |
9627 | 2819 |
]. |
2820 |
]. |
|
2821 |
]. |
|
9908
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2822 |
"/ methods |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2823 |
"/ sort:[:m1 :m2 | |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2824 |
"/ |c1 c2| |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2825 |
"/ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2826 |
"/ c1 := m1 mclass theNonMetaclass. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2827 |
"/ c2 := m2 mclass theNonMetaclass. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2828 |
"/ c1 name < c2 name |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2829 |
"/ ]. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2830 |
methods |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2831 |
sort:[:m1 :m2 | |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2832 |
|c1 c2| |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2833 |
|
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2834 |
c1 := m1 mclass. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2835 |
c2 := m2 mclass. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2836 |
c1 == c2 ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2837 |
m1 selector < m2 selector |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2838 |
] ifFalse:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2839 |
(c2 isMeta and:[c1 isMeta not]) ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2840 |
true |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2841 |
] ifFalse:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2842 |
(c1 isMeta and:[c2 isMeta not]) ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2843 |
false |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2844 |
] ifFalse:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2845 |
c1 name < c2 name |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2846 |
"/ (c2 isSubclassOf:c1) ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2847 |
"/ true |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2848 |
"/ ] ifFalse:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2849 |
"/ (c1 isSubclassOf:c2) ifTrue:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2850 |
"/ false |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2851 |
"/ ] ifFalse:[ |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2852 |
"/ "/ leave as is |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2853 |
"/ true |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2854 |
"/ ]. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2855 |
"/ ]. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2856 |
]. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2857 |
]. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2858 |
]. |
eede5b535b1e
extensions sorted by name (to avoid confusing cvs-diff)
Claus Gittinger <cg@exept.de>
parents:
9906
diff
changeset
|
2859 |
]. |
9627 | 2860 |
^ methods |
2861 |
||
2862 |
" |
|
2863 |
self searchForExtensionsWithProject:#'bosch:dapasx' |
|
2864 |
self searchForExtensionsWithProject:#'cg:oyster' |
|
2865 |
" |
|
2866 |
||
2867 |
"Created: / 17-08-2006 / 21:19:04 / cg" |
|
9904 | 2868 |
"Modified: / 15-09-2006 / 16:56:57 / cg" |
9536 | 2869 |
! |
2870 |
||
9983 | 2871 |
searchForPreRequisites |
2872 |
|includedClasses requiredPackageReasons usedClassReasons allSubProjects| |
|
2873 |
||
2874 |
requiredPackageReasons := Dictionary new. |
|
2875 |
usedClassReasons := Dictionary new. |
|
2876 |
||
2877 |
includedClasses := Set new. |
|
9984 | 2878 |
includedClasses addAll:(self searchForClassesWithProject:self package). |
9983 | 2879 |
|
2880 |
self subProjects do:[:projectID | |
|
2881 |
includedClasses addAll: (self searchForClassesWithProject: projectID asSymbol) |
|
2882 |
]. |
|
2883 |
||
2884 |
"/ only search for locals referred to by my methods (assuming that superclasses' |
|
2885 |
"/ requisites are specifief in their package. |
|
2886 |
self addReferencesToClassesFromGlobalsIn:includedClasses to:usedClassReasons. |
|
2887 |
||
2888 |
includedClasses do:[:cls | |
|
2889 |
cls allSuperclassesDo:[:superClass | |
|
2890 |
(usedClassReasons at: superClass ifAbsentPut:[Set new]) |
|
2891 |
add: (superClass name, ' - Superclass of ', cls name). |
|
2892 |
] |
|
2893 |
]. |
|
2894 |
includedClasses addAll: (usedClassReasons keys). |
|
2895 |
||
2896 |
allSubProjects := |
|
2897 |
(self siblingsAreSubProjects) |
|
2898 |
ifTrue:[ self searchForSiblingProjects ] |
|
2899 |
ifFalse:[ self searchForSubProjects ]. |
|
2900 |
||
2901 |
usedClassReasons |
|
2902 |
keysAndValuesDo:[:usedClass :reasonsPerClass | |
|
2903 |
(allSubProjects includes: usedClass package asString) |
|
2904 |
ifFalse:[ |
|
2905 |
usedClass package == Project noProjectID |
|
2906 |
ifFalse:[(requiredPackageReasons at:usedClass package ifAbsentPut:[Set new]) |
|
2907 |
addAll:reasonsPerClass.] |
|
2908 |
]. |
|
2909 |
]. |
|
2910 |
||
2911 |
"/ Transcript showCR:requiredPackageReasons. |
|
2912 |
^requiredPackageReasons |
|
2913 |
||
2914 |
" |
|
2915 |
self searchForPreRequisites |
|
2916 |
bosch_dapasx_Application searchForPreRequisites |
|
2917 |
cg_testproject1 searchForPreRequisites |
|
2918 |
" |
|
2919 |
||
2920 |
"Created: / 07-08-2006 / 20:42:39 / fm" |
|
2921 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
9984 | 2922 |
"Modified: / 20-09-2006 / 17:29:59 / cg" |
9983 | 2923 |
! |
2924 |
||
9627 | 2925 |
searchForProjectsWhichProvideHeaderFiles |
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2926 |
|addPackage myPackageID requiredPackages| |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2927 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2928 |
myPackageID := self package. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2929 |
requiredPackages := Set new. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2930 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2931 |
addPackage := |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2932 |
[:package | |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2933 |
(package ~= myPackageID) ifTrue:[ |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2934 |
true "(package startsWith:'stx:') not" ifTrue:[ |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2935 |
package ~= Project noProjectID ifTrue:[ |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2936 |
requiredPackages add:package. |
9627 | 2937 |
] |
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2938 |
] |
9627 | 2939 |
] |
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2940 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2941 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2942 |
self compiled_classesDo:[:cls | |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2943 |
cls allSuperclassesDo:[:eachSuperClass | |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2944 |
addPackage value:(eachSuperClass package) |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2945 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2946 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2947 |
cls privateClassesDo:[:eachPrivateClass | |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2948 |
eachPrivateClass allSuperclassesDo:[:eachSuperClass | |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2949 |
eachSuperClass isPrivate ifFalse:[ |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2950 |
addPackage value:(eachSuperClass package) |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2951 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2952 |
] |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2953 |
]. |
9956 | 2954 |
|
2955 |
cls sharedPools do:[:eachPoolName | |
|
2956 |
|eachPoolClass| |
|
2957 |
||
2958 |
eachPoolClass := Smalltalk classNamed:eachPoolName. |
|
2959 |
eachPoolClass withAllSuperclassesDo:[:eachPoolSuperClass | |
|
2960 |
addPackage value:(eachPoolSuperClass package) |
|
2961 |
] |
|
2962 |
]. |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2963 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2964 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2965 |
self extensionMethodNames pairWiseDo:[:className :selector | |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2966 |
|cls| |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2967 |
((cls := Smalltalk classNamed:className) notNil and:[cls isLoaded]) ifTrue:[ |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2968 |
addPackage value:(cls package) |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2969 |
] |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2970 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2971 |
^ requiredPackages |
9627 | 2972 |
|
9880 | 2973 |
" |
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2974 |
stx_libtool searchForProjectsWhichProvideHeaderFiles |
9880 | 2975 |
" |
9627 | 2976 |
|
2977 |
"Created: / 09-08-2006 / 16:26:37 / fm" |
|
9956 | 2978 |
"Modified: / 19-09-2006 / 20:57:54 / cg" |
9664 | 2979 |
! |
2980 |
||
9667 | 2981 |
searchForSiblingProjects |
2982 |
|myPackage myParentPackage| |
|
2983 |
||
2984 |
myPackage := self package asPackageId. |
|
2985 |
myParentPackage := myPackage parentPackage. |
|
2986 |
myParentPackage isNil ifTrue:[^ #() ]. |
|
2987 |
||
2988 |
^ Smalltalk allProjectIDs |
|
2989 |
select:[:projectID | |
|
2990 |
|thisPackage| |
|
2991 |
thisPackage := projectID asPackageId. |
|
2992 |
(thisPackage parentPackage = myParentPackage) |
|
2993 |
and:[ thisPackage ~= myPackage ]. |
|
2994 |
] |
|
2995 |
||
2996 |
" |
|
2997 |
self searchForSiblingProjects |
|
2998 |
bosch_dapasx_Application searchForSiblingProjects |
|
2999 |
stx_goodies_refactoryBrowser_changes searchForSiblingProjects |
|
3000 |
" |
|
3001 |
||
3002 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
3003 |
"Created: / 23-08-2006 / 15:06:12 / cg" |
|
3004 |
! |
|
3005 |
||
9664 | 3006 |
searchForSubProjects |
3007 |
|myPackage| |
|
3008 |
||
3009 |
myPackage := self package. |
|
3010 |
^ Smalltalk allProjectIDs select:[:projectID | |
|
3011 |
(projectID asPackageId parentPackage) = myPackage]. |
|
3012 |
||
3013 |
" |
|
3014 |
self searchForSubProjects |
|
3015 |
bosch_dapasx_Application searchForSubProjects |
|
3016 |
stx_goodies_refactoryBrowser_changes searchForSubProjects |
|
3017 |
" |
|
3018 |
||
3019 |
"Created: / 07-08-2006 / 20:42:39 / fm" |
|
3020 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
3021 |
"Modified: / 23-08-2006 / 15:11:50 / cg" |
|
3022 |
! |
|
3023 |
||
3024 |
setupForType:typeOrNil |
|
9714 | 3025 |
typeOrNil = GUIApplicationType ifTrue:[ |
9664 | 3026 |
self compile:'isGUIApplication\ ^ true' withCRs |
3027 |
categorized:'description'. |
|
3028 |
^ self |
|
3029 |
]. |
|
9714 | 3030 |
typeOrNil = NonGUIApplicationType ifTrue:[ |
9664 | 3031 |
self compile:'isGUIApplication\ ^ false' withCRs |
3032 |
categorized:'description'. |
|
3033 |
^ self |
|
3034 |
]. |
|
3035 |
^ self. |
|
3036 |
||
3037 |
"Created: / 23-08-2006 / 14:26:10 / cg" |
|
9536 | 3038 |
! ! |
3039 |
||
9585 | 3040 |
!ProjectDefinition class methodsFor:'queries'! |
3041 |
||
9627 | 3042 |
definitionClassForPackage: aPackageID |
3043 |
^ self definitionClassForPackage:aPackageID createIfAbsent:false |
|
3044 |
||
3045 |
"Modified: / 17-08-2006 / 14:33:35 / cg" |
|
9585 | 3046 |
! |
3047 |
||
9664 | 3048 |
definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent |
3049 |
^ self definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent projectType:nil |
|
3050 |
||
3051 |
"Modified: / 23-08-2006 / 14:29:15 / cg" |
|
3052 |
! |
|
3053 |
||
3054 |
definitionClassForPackage: aPackageID createIfAbsent: doCreateIfAbsent projectType:typeOrNil |
|
9627 | 3055 |
|packageDefinitionClassName class| |
3056 |
||
3057 |
packageDefinitionClassName := ProjectDefinition initialClassNameForDefinitionOf:aPackageID. |
|
3058 |
class := Smalltalk classNamed:packageDefinitionClassName. |
|
3059 |
class isNil ifTrue:[ |
|
3060 |
doCreateIfAbsent ifTrue:[ |
|
3061 |
class := self newForPackage:aPackageID. |
|
9664 | 3062 |
"setup before prerequisites are defined" |
3063 |
class setupForType:typeOrNil. |
|
9627 | 3064 |
]. |
9664 | 3065 |
] ifFalse:[ |
3066 |
typeOrNil notNil ifTrue:[ |
|
3067 |
class setupForType:typeOrNil. |
|
3068 |
]. |
|
9627 | 3069 |
]. |
3070 |
^ class |
|
3071 |
||
9664 | 3072 |
"Created: / 23-08-2006 / 14:29:21 / cg" |
3073 |
"Modified: / 23-08-2006 / 15:35:26 / cg" |
|
9585 | 3074 |
! |
3075 |
||
9664 | 3076 |
definitionClassForPackage:newProjectID projectType:typeOrNil createIfAbsent:createIfAbsent |
3077 |
^ (self definitionClassForType:typeOrNil) |
|
3078 |
definitionClassForPackage:newProjectID |
|
3079 |
createIfAbsent:createIfAbsent |
|
3080 |
projectType:typeOrNil |
|
9627 | 3081 |
|
9664 | 3082 |
"Created: / 23-08-2006 / 14:28:53 / cg" |
9627 | 3083 |
! |
3084 |
||
3085 |
definitionClassForType: type |
|
9714 | 3086 |
(type = GUIApplicationType) ifTrue:[ ^ ApplicationDefinition ]. |
3087 |
(type = NonGUIApplicationType) ifTrue:[ ^ ApplicationDefinition ]. |
|
3088 |
(type = LibraryType) ifTrue:[ ^ LibraryDefinition ]. |
|
9627 | 3089 |
(type = 'Application') ifTrue:[ ^ ApplicationDefinition ]. |
3090 |
self error. |
|
3091 |
||
3092 |
"Created: / 17-08-2006 / 14:46:28 / cg" |
|
9664 | 3093 |
"Modified: / 23-08-2006 / 13:49:27 / cg" |
9585 | 3094 |
! |
3095 |
||
9627 | 3096 |
hasAllClassesLoaded |
3097 |
|checkLoaded| |
|
3098 |
||
10005 | 3099 |
checkLoaded := [:eachClassName | |
9627 | 3100 |
|cls| |
3101 |
||
10005 | 3102 |
cls := Smalltalk loadedClassNamed:eachClassName. |
9627 | 3103 |
(cls isNil or:[cls isLoaded not]) ifTrue:[^ false ]. |
3104 |
]. |
|
10005 | 3105 |
|
9627 | 3106 |
self allClassNames do:checkLoaded. |
10005 | 3107 |
(self compiled_classNamesForPlatform:OperatingSystem platformName) do:checkLoaded. |
9627 | 3108 |
|
3109 |
^ true. |
|
3110 |
||
3111 |
"Created: / 17-08-2006 / 00:50:01 / cg" |
|
3112 |
"Modified: / 18-08-2006 / 13:44:31 / cg" |
|
9585 | 3113 |
! |
3114 |
||
9627 | 3115 |
hasAllExtensionsLoaded |
3116 |
self extensionMethodNames pairWiseDo:[:className :selector | |
|
3117 |
|cls| |
|
9585 | 3118 |
|
9627 | 3119 |
cls := Smalltalk at:className asSymbol. |
3120 |
(cls isNil or:[cls isLoaded not]) ifTrue:[^ false ]. |
|
3121 |
(cls compiledMethodAt:selector) isNil ifTrue:[^ false ]. |
|
3122 |
]. |
|
3123 |
^ true. |
|
3124 |
||
3125 |
"Created: / 17-08-2006 / 00:50:01 / cg" |
|
9850 | 3126 |
! |
3127 |
||
9906
9efd21c9b1b6
hasExtensions is a bad name (conflicts with the other query)
Claus Gittinger <cg@exept.de>
parents:
9904
diff
changeset
|
3128 |
hasExtensionMethods |
9850 | 3129 |
^ self extensionMethodNames notEmpty |
3130 |
||
3131 |
"Created: / 14-09-2006 / 14:19:35 / cg" |
|
10005 | 3132 |
! |
3133 |
||
3134 |
packageDirectory |
|
3135 |
^ Smalltalk getPackageDirectoryForPackage:self package. |
|
3136 |
||
3137 |
" |
|
3138 |
self packageDirectory |
|
3139 |
stx_libbasic3 packageDirectory |
|
3140 |
" |
|
9585 | 3141 |
! ! |
3142 |
||
9726 | 3143 |
!ProjectDefinition class methodsFor:'sanity checks'! |
3144 |
||
3145 |
validateDescription |
|
9956 | 3146 |
|emptyProjects nonProjects emptyOrNonProjects| |
3147 |
||
3148 |
emptyProjects := Set withAll:self subProjects. |
|
3149 |
Smalltalk allClassesDo:[:cls | |
|
3150 |
emptyProjects remove:(cls package) ifAbsent:[]. |
|
3151 |
]. |
|
3152 |
nonProjects := self subProjects select:[:p | |
|
3153 |
(ProjectDefinition definitionClassForPackage: p) isNil |
|
3154 |
]. |
|
3155 |
||
3156 |
emptyOrNonProjects := Set withAll:emptyProjects. |
|
3157 |
emptyOrNonProjects addAll:nonProjects. |
|
3158 |
||
3159 |
emptyOrNonProjects notEmpty ifTrue:[ |
|
3160 |
(Dialog |
|
3161 |
confirm:('The following projects are non-existent, empty or without description:\\ ' |
|
3162 |
, ((emptyOrNonProjects |
|
3163 |
asSortedCollection |
|
3164 |
collect:[:p | p allBold]) |
|
3165 |
asStringWith:'\ ') |
|
3166 |
, '\\Continue ?') withCRs |
|
3167 |
yesLabel:'OK' noLabel:'Cancel') |
|
3168 |
ifFalse:[ |
|
3169 |
AbortSignal raise |
|
3170 |
]. |
|
3171 |
]. |
|
3172 |
||
3173 |
"Modified: / 19-09-2006 / 20:30:39 / cg" |
|
9726 | 3174 |
! ! |
3175 |
||
9585 | 3176 |
!ProjectDefinition class methodsFor:'testing'! |
3177 |
||
9664 | 3178 |
isApplicationDefinition |
3179 |
^ false |
|
3180 |
||
3181 |
"Created: / 23-08-2006 / 15:17:32 / cg" |
|
9983 | 3182 |
"Modified: / 20-09-2006 / 14:59:56 / cg" |
3183 |
! |
|
3184 |
||
3185 |
isGUIApplication |
|
3186 |
^ false |
|
3187 |
||
3188 |
"Created: / 20-09-2006 / 14:59:49 / cg" |
|
9664 | 3189 |
! |
3190 |
||
3191 |
isLibraryDefinition |
|
3192 |
^ false |
|
3193 |
||
3194 |
"Created: / 23-08-2006 / 15:17:46 / cg" |
|
9983 | 3195 |
"Modified: / 20-09-2006 / 15:00:00 / cg" |
9664 | 3196 |
! |
3197 |
||
9627 | 3198 |
isProjectDefinition |
9664 | 3199 |
"concrete i.e. not abstract" |
3200 |
||
9627 | 3201 |
^ self ~~ ProjectDefinition |
3202 |
||
3203 |
"Created: / 10-08-2006 / 16:24:02 / cg" |
|
9664 | 3204 |
"Modified: / 23-08-2006 / 14:24:38 / cg" |
9585 | 3205 |
! ! |
3206 |
||
9569 | 3207 |
!ProjectDefinition class methodsFor:'documentation'! |
9536 | 3208 |
|
3209 |
version |
|
10013
c6cd8f035693
pretty format of generated methods
Stefan Vogel <sv@exept.de>
parents:
10011
diff
changeset
|
3210 |
^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.84 2006-09-26 12:10:02 stefan Exp $' |
9536 | 3211 |
! ! |
9714 | 3212 |
|
3213 |
ProjectDefinition initialize! |