author | Claus Gittinger <cg@exept.de> |
Fri, 15 Sep 2006 16:57:04 +0200 | |
changeset 9904 | 88e186908460 |
parent 9901 | 6ea34c2d6a54 |
child 9906 | 9efd21c9b1b6 |
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 |
9829 | 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 |
||
9569 | 590 |
!ProjectDefinition class methodsFor:'defaults'! |
9536 | 591 |
|
9664 | 592 |
applicationTypes |
9714 | 593 |
GUIApplicationType isNil ifTrue:[self initialize]. |
594 |
^ Array with:GUIApplicationType with:NonGUIApplicationType |
|
9664 | 595 |
|
9714 | 596 |
" |
597 |
self applicationTypes |
|
598 |
" |
|
9664 | 599 |
! |
600 |
||
9536 | 601 |
defaultDescription |
602 |
^ 'description' |
|
9664 | 603 |
! |
604 |
||
9714 | 605 |
defaultProjectType |
9745 | 606 |
^ self libraryTypes first |
607 |
"/ ^ self applicationTypes first |
|
9714 | 608 |
|
609 |
"Created: / 23-08-2006 / 14:27:32 / cg" |
|
610 |
! |
|
611 |
||
612 |
defaultProjectTypeForGUIApplication |
|
613 |
^ GUIApplicationType |
|
614 |
! |
|
615 |
||
616 |
defaultProjectTypeForNonGUIApplication |
|
617 |
^ NonGUIApplicationType |
|
618 |
! |
|
9664 | 619 |
|
9714 | 620 |
guiApplicationType |
621 |
^ GUIApplicationType |
|
622 |
! |
|
623 |
||
624 |
libraryType |
|
625 |
^ LibraryType |
|
626 |
! |
|
627 |
||
628 |
libraryTypes |
|
629 |
LibraryType isNil ifTrue:[self initialize]. |
|
630 |
^ Array with:LibraryType |
|
631 |
||
632 |
" |
|
633 |
self libraryTypes |
|
634 |
" |
|
635 |
! |
|
636 |
||
637 |
nonGuiApplicationType |
|
638 |
^ NonGUIApplicationType |
|
9664 | 639 |
! |
640 |
||
641 |
projectTypes |
|
642 |
^ self libraryTypes , self applicationTypes |
|
643 |
||
644 |
"Created: / 23-08-2006 / 14:27:32 / cg" |
|
9536 | 645 |
! ! |
646 |
||
9569 | 647 |
!ProjectDefinition class methodsFor:'description'! |
9536 | 648 |
|
9575 | 649 |
postLoadAction |
650 |
"invoked after loading a project" |
|
651 |
||
652 |
"/ intentionally left blank |
|
653 |
||
654 |
"Created: / 08-08-2006 / 11:07:40 / fm" |
|
655 |
"Modified: / 17-08-2006 / 19:59:17 / cg" |
|
656 |
! |
|
657 |
||
658 |
preRequisites |
|
659 |
"list packages which are required as a prerequisite. This method is generated automatically, |
|
660 |
by searching along the inheritance chain of all of my classes. |
|
661 |
However, when generating automatically, packages are only added - never removed, unless listed |
|
662 |
in excludedFromPreRequisites." |
|
663 |
||
664 |
^ #() |
|
665 |
||
666 |
"Modified: / 17-08-2006 / 19:54:21 / cg" |
|
667 |
! |
|
668 |
||
669 |
preUnloadAction |
|
670 |
"invoked before unloading a project" |
|
671 |
||
672 |
"/ intentionally left blank |
|
673 |
||
674 |
"Created: / 08-08-2006 / 11:07:40 / fm" |
|
675 |
"Modified: / 17-08-2006 / 19:59:26 / cg" |
|
676 |
! |
|
677 |
||
9685 | 678 |
siblingsAreSubProjects |
679 |
^ false |
|
680 |
! |
|
681 |
||
9575 | 682 |
subProjects |
683 |
"list packages which are known as subprojects. This method is generated automatically. |
|
684 |
However, when generating automatically, packages are only added - never removed, unless listed |
|
685 |
in excludedFromSubProjects." |
|
686 |
||
687 |
^ #() |
|
688 |
||
689 |
"Modified: / 17-08-2006 / 19:57:46 / cg" |
|
690 |
! ! |
|
691 |
||
692 |
!ProjectDefinition class methodsFor:'description - classes'! |
|
693 |
||
9621 | 694 |
additionalClassNamesAndAttributes |
695 |
^ #() |
|
696 |
||
697 |
"Created: / 21-08-2006 / 19:53:04 / cg" |
|
698 |
! |
|
699 |
||
9607 | 700 |
allClassNames |
701 |
^ self classNamesForWhich:[:nm :attr | true ]. |
|
702 |
! |
|
9536 | 703 |
|
9607 | 704 |
classNames |
705 |
"a correponding method with real names is generated in my subclasses" |
|
706 |
||
707 |
self halt. |
|
9595 | 708 |
^ #() |
9536 | 709 |
|
710 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
711 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
9607 | 712 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
9536 | 713 |
! |
714 |
||
9607 | 715 |
classNamesAndAttributes |
9575 | 716 |
"a correponding method with real names is generated in my subclasses" |
717 |
||
9595 | 718 |
^ #() |
9536 | 719 |
|
9575 | 720 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
721 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
722 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
|
723 |
! |
|
724 |
||
9607 | 725 |
classNamesForWhich:aBlock |
726 |
"a correponding method with real names is generated in my subclasses" |
|
727 |
||
728 |
|coll| |
|
729 |
||
730 |
coll := OrderedCollection new. |
|
731 |
self classNamesAndAttributesDo:[:nm :attributes | |
|
732 |
(aBlock value:nm value:attributes) ifTrue:[ |
|
733 |
coll add:nm. |
|
734 |
]. |
|
735 |
]. |
|
736 |
^ coll |
|
737 |
||
738 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
739 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
740 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
|
741 |
! |
|
742 |
||
9615 | 743 |
common_compiled_classNames |
744 |
^ self classNamesForWhich:[:nm :attr | attr isEmptyOrNil]. |
|
745 |
||
746 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
747 |
"Created: / 21-08-2006 / 18:47:12 / cg" |
|
748 |
! |
|
749 |
||
9607 | 750 |
compiled_classNames |
9615 | 751 |
^ self classNamesForWhich:[:nm :attr | attr isEmptyOrNil or:[(attr includes:#autoload) not]]. |
9607 | 752 |
|
753 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
754 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
9615 | 755 |
"Modified: / 21-08-2006 / 18:48:31 / cg" |
9607 | 756 |
! |
757 |
||
758 |
compiled_classNamesForArchitecture:architectureID |
|
759 |
^ self |
|
760 |
classNamesForWhich:[:nm :attr | |
|
761 |
(attr includes:#autoload) not |
|
762 |
and:[(attr includes:architectureID)] |
|
763 |
]. |
|
764 |
||
765 |
"Created: / 07-08-2006 / 19:02:57 / fm" |
|
766 |
"Modified: / 07-08-2006 / 21:25:25 / fm" |
|
767 |
"Modified: / 17-08-2006 / 20:47:20 / cg" |
|
768 |
! |
|
769 |
||
770 |
compiled_classNames_common |
|
771 |
"class, only to be compiled under unix" |
|
772 |
||
773 |
^ self |
|
774 |
classNamesForWhich:[:nm :attr | |
|
775 |
attr isEmptyOrNil |
|
776 |
]. |
|
777 |
||
778 |
"Created: / 18-08-2006 / 13:37:51 / cg" |
|
779 |
! |
|
780 |
||
9584 | 781 |
compiled_classNames_unix |
782 |
"class, only to be compiled under unix" |
|
783 |
||
9607 | 784 |
^ self |
785 |
classNamesForWhich:[:nm :attr | |
|
786 |
attr includes:#unix |
|
787 |
]. |
|
9584 | 788 |
|
789 |
"Created: / 18-08-2006 / 13:37:51 / cg" |
|
790 |
! |
|
791 |
||
792 |
compiled_classNames_windows |
|
793 |
"class, only to be compiled under windows" |
|
794 |
||
9607 | 795 |
^ self |
796 |
classNamesForWhich:[:nm :attr | |
|
797 |
attr includes:#win32 |
|
798 |
]. |
|
9584 | 799 |
|
800 |
"Created: / 18-08-2006 / 13:37:56 / cg" |
|
801 |
! |
|
802 |
||
9575 | 803 |
extensionMethodNames |
804 |
"list class/selector pairs of extensions. |
|
805 |
A correponding method with real names is generated in my subclasses" |
|
806 |
||
9595 | 807 |
^ #() |
9575 | 808 |
|
809 |
"Modified: / 17-08-2006 / 20:49:51 / cg" |
|
810 |
! ! |
|
811 |
||
812 |
!ProjectDefinition class methodsFor:'description - compilation'! |
|
9536 | 813 |
|
9625 | 814 |
additionalDefinitions_make_dot_proto |
815 |
"allows for additional definitions/rules to be added to the make.proto file." |
|
816 |
||
817 |
^ '' |
|
818 |
||
819 |
"Created: / 22-08-2006 / 23:53:08 / cg" |
|
820 |
! |
|
821 |
||
822 |
additionalDefinitions_nt_dot_mak |
|
823 |
"allows for additional definitions/rules to be added to the nt.mak file." |
|
824 |
||
825 |
^ '' |
|
826 |
||
827 |
"Created: / 22-08-2006 / 23:59:32 / cg" |
|
828 |
! |
|
829 |
||
9733 | 830 |
additionalLinkLibraries_make_dot_proto |
831 |
"allows for additional targets to be added to the make.proto file." |
|
832 |
||
833 |
^ '' |
|
834 |
||
835 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
|
836 |
! |
|
837 |
||
9625 | 838 |
additionalRules_make_dot_proto |
839 |
"allows for additional rules to be added to the make.proto file." |
|
840 |
||
841 |
^ '' |
|
842 |
||
843 |
"Created: / 22-08-2006 / 23:59:16 / cg" |
|
844 |
! |
|
845 |
||
846 |
additionalRules_nt_dot_mak |
|
847 |
"allows for additional rules to be added to the nt.mak file." |
|
848 |
||
849 |
^ '' |
|
850 |
||
851 |
"Created: / 22-08-2006 / 23:59:24 / cg" |
|
852 |
! |
|
853 |
||
854 |
additionalTargets_make_dot_proto |
|
855 |
"allows for additional targets to be added to the make.proto file." |
|
856 |
||
857 |
^ '' |
|
858 |
||
859 |
"Created: / 22-08-2006 / 23:53:33 / cg" |
|
860 |
! |
|
861 |
||
862 |
additionalTargets_nt_dot_mak |
|
863 |
"allows for additional targets to be added to the nt.mak file." |
|
864 |
||
865 |
^ '' |
|
866 |
||
867 |
"Created: / 23-08-2006 / 00:00:35 / cg" |
|
868 |
! |
|
869 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
870 |
localIncludes |
9714 | 871 |
"allow for the specification of addition include directories" |
872 |
||
873 |
^ '' |
|
874 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
875 |
"Created: / 06-09-2006 / 18:14:31 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
876 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
877 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
878 |
localIncludes_unix |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
879 |
"allow for the specification of addition include directories" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
880 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
881 |
^ self makeUnixIncludes:(self localIncludes) |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
882 |
|
9714 | 883 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
884 |
"Modified: / 06-09-2006 / 18:15:26 / cg" |
9714 | 885 |
! |
886 |
||
887 |
localIncludes_win32 |
|
888 |
"allow for the specification of addition include directories" |
|
889 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
890 |
^ self makeWin32Includes:(self localIncludes) |
9714 | 891 |
|
892 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
|
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
893 |
"Modified: / 06-09-2006 / 18:15:37 / cg" |
9714 | 894 |
! |
895 |
||
9575 | 896 |
stcOptimizationOptions |
897 |
"see the stc reference / stc usage for options. |
|
898 |
For now, the following variants are useful: |
|
899 |
+optspace3 most compact code |
|
900 |
- use for all gui, application code. |
|
901 |
||
9714 | 902 |
+optinline +optinline2 +inlineNew |
903 |
fastest code |
|
9575 | 904 |
- use only for computation-intensive classes" |
905 |
||
906 |
^ '+optspace3' |
|
907 |
||
908 |
"Created: / 18-08-2006 / 12:50:27 / cg" |
|
9536 | 909 |
! |
910 |
||
9575 | 911 |
stcWarningOptions |
912 |
"see the stc reference / stc usage for options. |
|
913 |
For now, the following variants are useful: |
|
914 |
-warn no warnings |
|
915 |
-warnNonStandard no warnings about non-standard smalltalk features" |
|
916 |
||
9714 | 917 |
^ '-warnNonStandard' |
9575 | 918 |
|
919 |
"Created: / 18-08-2006 / 12:51:38 / cg" |
|
920 |
! ! |
|
9536 | 921 |
|
9575 | 922 |
!ProjectDefinition class methodsFor:'description - project information'! |
923 |
||
924 |
companyName |
|
9584 | 925 |
"Returns a company string which will appear in <lib>.rc. |
926 |
Under win32, this is placed into the dlls file-info" |
|
9575 | 927 |
|
928 |
self module = 'stx' ifTrue:[ |
|
929 |
^ 'eXept Software AG' |
|
930 |
]. |
|
931 |
||
932 |
^ 'My Company' |
|
933 |
||
9584 | 934 |
"Modified: / 18-08-2006 / 16:08:20 / cg" |
9536 | 935 |
! |
936 |
||
937 |
description |
|
9575 | 938 |
"Returns a description string which will appear in nt.def / bc.def" |
9536 | 939 |
|
9803 | 940 |
^self productName,' ',self packageName |
941 |
"/ ^ self name |
|
9536 | 942 |
|
943 |
"Created: / 08-08-2006 / 11:15:01 / fm" |
|
9575 | 944 |
"Modified: / 17-08-2006 / 20:53:34 / cg" |
945 |
! |
|
946 |
||
947 |
fileDescription |
|
948 |
"Returns a description string which will appear in libName.rc" |
|
949 |
||
9803 | 950 |
^self description |
9575 | 951 |
|
952 |
"Modified: / 17-08-2006 / 20:27:07 / cg" |
|
953 |
! |
|
954 |
||
955 |
fileMajorVersionNr |
|
956 |
"Returns a versionNumber which will appear in libName.rc" |
|
957 |
||
958 |
^ Smalltalk majorVersionNr printString |
|
959 |
||
960 |
"Created: / 18-08-2006 / 12:03:32 / cg" |
|
9817 | 961 |
"Modified: / 30-08-2006 / 18:50:51 / cg" |
9575 | 962 |
! |
963 |
||
964 |
fileMinorVersionNr |
|
965 |
"Returns a versionNumber which will appear in libName.rc" |
|
966 |
||
9618 | 967 |
^ Smalltalk minorVersionNr printString |
9575 | 968 |
|
969 |
"Created: / 18-08-2006 / 12:03:13 / cg" |
|
9817 | 970 |
"Modified: / 30-08-2006 / 18:50:46 / cg" |
9575 | 971 |
! |
972 |
||
973 |
fileReleaseNr |
|
974 |
"Returns a releaseNumber which will appear in libName.rc" |
|
975 |
||
9817 | 976 |
"take the default revision from the cvs-version" |
9618 | 977 |
^ self cvsRevision last |
9575 | 978 |
|
979 |
"Created: / 18-08-2006 / 12:02:58 / cg" |
|
9817 | 980 |
"Modified: / 30-08-2006 / 18:54:48 / cg" |
9536 | 981 |
! |
982 |
||
9575 | 983 |
fileRevisionNr |
984 |
"Returns a revisionNumber which will appear in libName.rc" |
|
9536 | 985 |
|
9817 | 986 |
"take the default revision from the cvs-version" |
9618 | 987 |
^ self cvsRevision first |
9575 | 988 |
|
989 |
"Created: / 18-08-2006 / 12:02:39 / cg" |
|
9817 | 990 |
"Modified: / 30-08-2006 / 18:54:39 / cg" |
9536 | 991 |
! |
992 |
||
9575 | 993 |
fileVersion |
994 |
"Returns a fileVersion string which will appear in libName.rc" |
|
995 |
||
996 |
"<major>.<minor>.<rev>.<rel> (such as '1.2.17.1') " |
|
997 |
||
9817 | 998 |
^ self fileMajorVersionNr |
9575 | 999 |
, '.' |
9817 | 1000 |
, self fileMinorVersionNr |
9575 | 1001 |
, '.' |
9817 | 1002 |
, self fileRevisionNr |
9575 | 1003 |
, '.' |
9817 | 1004 |
, self fileReleaseNr |
9575 | 1005 |
|
1006 |
" |
|
1007 |
self fileVersion |
|
1008 |
" |
|
1009 |
||
9817 | 1010 |
"Modified: / 30-08-2006 / 18:51:49 / cg" |
9575 | 1011 |
! |
9536 | 1012 |
|
9575 | 1013 |
fileVersionCommaSeparated |
1014 |
"Returns a fileVersion string which will appear in libName.rc" |
|
1015 |
||
9817 | 1016 |
"<major>,<minor>,<revision>,<release> (such as '2,17,1,2') " |
1017 |
||
1018 |
^ self fileMajorVersionNr |
|
9575 | 1019 |
, ',' |
9817 | 1020 |
, self fileMinorVersionNr |
9575 | 1021 |
, ',' |
9817 | 1022 |
, self fileRevisionNr |
9575 | 1023 |
, ',' |
9579 | 1024 |
, self fileReleaseNr |
9575 | 1025 |
|
1026 |
"Created: / 17-08-2006 / 20:16:17 / cg" |
|
9817 | 1027 |
"Modified: / 30-08-2006 / 18:54:20 / cg" |
1028 |
! |
|
1029 |
||
1030 |
iconFileName |
|
1031 |
"Returns the icon-filename for the application (nil if there is none)" |
|
1032 |
||
1033 |
^ nil |
|
1034 |
||
1035 |
"Created: / 30-08-2006 / 18:44:15 / cg" |
|
9575 | 1036 |
! |
1037 |
||
1038 |
internalName |
|
1039 |
"Returns a name string which will appear in libName.rc" |
|
1040 |
||
1041 |
^self packageName |
|
1042 |
||
1043 |
"Modified: / 17-08-2006 / 20:27:37 / cg" |
|
9536 | 1044 |
! |
1045 |
||
9575 | 1046 |
legalCopyright |
9584 | 1047 |
"Returns a copyright string which will appear in <lib>.rc. |
1048 |
Under win32, this is placed into the dlls file-info" |
|
9575 | 1049 |
|
1050 |
self module = 'stx' ifTrue:[ |
|
9817 | 1051 |
"hardwired-default" |
9625 | 1052 |
^ 'Copyright Claus Gittinger 1988-%1\nCopyright eXept Software AG 1998-%1' |
1053 |
bindWith:(Date today year printString) |
|
9575 | 1054 |
]. |
9817 | 1055 |
self module = 'exept' ifTrue:[ |
1056 |
"hardwired-default" |
|
1057 |
^ 'Copyright eXept Software AG 1998-%1' |
|
1058 |
bindWith:(Date today year printString) |
|
1059 |
]. |
|
9575 | 1060 |
|
1061 |
^ 'My CopyRight or CopyLeft' |
|
1062 |
||
9817 | 1063 |
"Modified: / 30-08-2006 / 18:53:36 / cg" |
9575 | 1064 |
! |
1065 |
||
1066 |
majorVersionNr |
|
1067 |
"Returns a versionNumber which will appear in libName.rc" |
|
1068 |
||
1069 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
|
1070 |
the default here takes smalltalks version number. |
|
1071 |
But thats probably not good for an end-user-app." |
|
1072 |
||
9817 | 1073 |
^ Smalltalk majorVersionNr printString |
9575 | 1074 |
|
1075 |
"Created: / 17-08-2006 / 20:20:18 / cg" |
|
9817 | 1076 |
"Modified: / 30-08-2006 / 18:52:13 / cg" |
9575 | 1077 |
! |
1078 |
||
1079 |
minorVersionNr |
|
1080 |
"Returns a versionNumber which will appear in libName.rc" |
|
9536 | 1081 |
|
9575 | 1082 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
1083 |
the default here takes smalltalks version number. |
|
1084 |
But thats probably not good for an end-user-app." |
|
1085 |
||
9817 | 1086 |
^ Smalltalk minorVersionNr printString |
9575 | 1087 |
|
1088 |
"Created: / 17-08-2006 / 20:20:32 / cg" |
|
9817 | 1089 |
"Modified: / 30-08-2006 / 18:52:16 / cg" |
9575 | 1090 |
! |
1091 |
||
1092 |
productDate |
|
1093 |
"Returns a product-date string which will appear in libName.rc" |
|
1094 |
||
1095 |
"take the current date - by default" |
|
9536 | 1096 |
|
9575 | 1097 |
^ Timestamp now printStringRFC1123Format |
1098 |
||
1099 |
"Created: / 17-08-2006 / 20:17:28 / cg" |
|
1100 |
! |
|
1101 |
||
9898 | 1102 |
productInstallDir |
1103 |
"Returns a product default installDir which will appear in <app>.nsi." |
|
1104 |
||
1105 |
^ '$PROGRAMFILES\',self module |
|
1106 |
||
1107 |
"Created: / 14-09-2006 / 21:23:01 / cg" |
|
1108 |
! |
|
1109 |
||
9575 | 1110 |
productName |
9584 | 1111 |
"Returns a product name which will appear in <lib>.rc. |
1112 |
Under win32, this is placed into the dlls file-info" |
|
9575 | 1113 |
|
1114 |
self module = 'stx' ifTrue:[ |
|
1115 |
^ 'Smalltalk/X' |
|
1116 |
]. |
|
1117 |
||
1118 |
^ 'My Product' |
|
1119 |
||
9584 | 1120 |
"Modified: / 18-08-2006 / 16:08:26 / cg" |
9536 | 1121 |
! |
1122 |
||
9898 | 1123 |
productPublisher |
1124 |
"Returns a product publisher which will appear in <app>.nsi." |
|
1125 |
||
1126 |
( #('exept' 'stx') includes:self module) ifTrue:[ |
|
1127 |
^ 'eXept Software AG' |
|
1128 |
]. |
|
1129 |
||
1130 |
^ 'thePublisher' |
|
1131 |
||
1132 |
"Created: / 14-09-2006 / 21:12:54 / cg" |
|
1133 |
! |
|
1134 |
||
9575 | 1135 |
productVersion |
1136 |
"Returns a product version which will appear in libName.rc" |
|
1137 |
||
1138 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1')" |
|
9536 | 1139 |
|
9817 | 1140 |
^ self majorVersionNr |
9575 | 1141 |
, '.' |
9817 | 1142 |
, self minorVersionNr |
9575 | 1143 |
, '.' |
9817 | 1144 |
, self revisionNr |
9575 | 1145 |
, '.' |
9817 | 1146 |
, self releaseNr |
9536 | 1147 |
|
9575 | 1148 |
" |
1149 |
self productVersion |
|
1150 |
" |
|
1151 |
||
9817 | 1152 |
"Modified: / 30-08-2006 / 18:52:47 / cg" |
9536 | 1153 |
! |
1154 |
||
9575 | 1155 |
productVersionCommaSeparated |
1156 |
"Returns a product version which will appear in libName.rc" |
|
1157 |
||
1158 |
"<major>.<minor>.<revision>.<release> (such as '0,1,1,1') " |
|
9536 | 1159 |
|
9817 | 1160 |
^ self majorVersionNr |
9575 | 1161 |
, ',' |
9817 | 1162 |
, self minorVersionNr |
9575 | 1163 |
, ',' |
9817 | 1164 |
, self revisionNr |
9575 | 1165 |
, ',' |
9817 | 1166 |
, self releaseNr |
9536 | 1167 |
|
9575 | 1168 |
"Created: / 17-08-2006 / 20:13:32 / cg" |
9817 | 1169 |
"Modified: / 30-08-2006 / 18:52:42 / cg" |
9536 | 1170 |
! |
1171 |
||
9898 | 1172 |
productWebSite |
1173 |
"Returns a product webSite which will appear in <app>.nsi." |
|
1174 |
||
1175 |
( #('exept' 'stx') includes:self module) ifTrue:[ |
|
1176 |
^ 'http://www.exept.de' |
|
1177 |
]. |
|
1178 |
||
1179 |
^ 'http://www.yoursite.com' |
|
1180 |
||
1181 |
"Created: / 14-09-2006 / 21:15:05 / cg" |
|
1182 |
! |
|
1183 |
||
9575 | 1184 |
releaseNr |
1185 |
"Returns a releaseNr which will appear in libName.rc" |
|
1186 |
||
1187 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
|
1188 |
the default here takes smalltalks version number. |
|
1189 |
But thats probably not good for an end-user-app." |
|
1190 |
||
9817 | 1191 |
^ Smalltalk releaseNr printString |
9536 | 1192 |
|
9575 | 1193 |
"Created: / 17-08-2006 / 20:20:51 / cg" |
9817 | 1194 |
"Modified: / 30-08-2006 / 18:52:22 / cg" |
9575 | 1195 |
! |
1196 |
||
1197 |
revisionNr |
|
1198 |
"Returns a revisionNr which will appear in libName.rc" |
|
9536 | 1199 |
|
9575 | 1200 |
"<major>.<minor>.<revision>.<release> (such as '5.3.2.1') |
1201 |
the default here takes smalltalks version number. |
|
1202 |
But thats probably not good for an end-user-app." |
|
1203 |
||
9817 | 1204 |
^ Smalltalk revisionNr printString |
9575 | 1205 |
|
1206 |
"Created: / 17-08-2006 / 20:20:40 / cg" |
|
9817 | 1207 |
"Modified: / 30-08-2006 / 18:52:32 / cg" |
9536 | 1208 |
! |
1209 |
||
1210 |
versionNumber |
|
9575 | 1211 |
"Returns a version string which will appear in nt.def " |
9536 | 1212 |
|
9575 | 1213 |
^'' |
9536 | 1214 |
|
1215 |
"Created: / 08-08-2006 / 11:35:52 / fm" |
|
9575 | 1216 |
"Modified: / 17-08-2006 / 19:46:29 / cg" |
9536 | 1217 |
! ! |
1218 |
||
9569 | 1219 |
!ProjectDefinition class methodsFor:'file generation'! |
9536 | 1220 |
|
9852 | 1221 |
basicFileNamesToGenerate |
1222 |
self subclassResponsibility |
|
1223 |
||
1224 |
"Created: / 14-09-2006 / 14:36:31 / cg" |
|
1225 |
! |
|
1226 |
||
9536 | 1227 |
fileNamesToGenerate |
9852 | 1228 |
^ self basicFileNamesToGenerate reject:[:p | self protectedFileNames includes:(p first) ]. |
1229 |
||
1230 |
"Modified: / 14-09-2006 / 14:36:10 / cg" |
|
9536 | 1231 |
! |
1232 |
||
9544 | 1233 |
forEachFileNameAndGeneratedContentsDo:aTwoArgBlock |
1234 |
|pairs| |
|
1235 |
||
1236 |
pairs := OrderedCollection new. |
|
1237 |
self forEachFileNameAndGeneratorMethodDo:[:fileName :generator | |
|
1238 |
|file| |
|
1239 |
||
1240 |
file := self perform:generator. |
|
1241 |
pairs add:(Array with:fileName with:file) |
|
1242 |
]. |
|
1243 |
||
1244 |
pairs pairsDo:aTwoArgBlock |
|
1245 |
||
1246 |
"Created: / 16-08-2006 / 18:37:52 / User" |
|
1247 |
! |
|
1248 |
||
9536 | 1249 |
forEachFileNameAndGeneratorMethodDo:aTwoArgBlock |
1250 |
|fileNamesAndSelectors| |
|
1251 |
||
9898 | 1252 |
fileNamesAndSelectors := self fileNamesToGenerate. |
9536 | 1253 |
fileNamesAndSelectors pairsDo:aTwoArgBlock |
9831 | 1254 |
|
9898 | 1255 |
"Modified: / 14-09-2006 / 21:02:37 / cg" |
9536 | 1256 |
! |
1257 |
||
1258 |
generateFile:filename |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
1259 |
self basicFileNamesToGenerate |
9817 | 1260 |
pairsDo:[:fn :action | |
1261 |
filename = fn ifTrue:[ |
|
1262 |
^ self perform:action |
|
1263 |
]. |
|
1264 |
]. |
|
9898 | 1265 |
(filename = 'app.rc' or:[filename = 'lib.rc' or:[filename = self rcFilename]]) ifTrue:[ |
9817 | 1266 |
^ self generate_packageName_dot_rc |
9607 | 1267 |
]. |
9898 | 1268 |
(filename = 'app.nsi' or:[filename = self nsiFilename]) ifTrue:[ |
1269 |
^ self generate_packageName_dot_nsi |
|
1270 |
]. |
|
1271 |
||
9850 | 1272 |
(filename = 'loadAll') ifTrue:[ |
1273 |
^ self generate_loadAll |
|
1274 |
]. |
|
9621 | 1275 |
self error:('File "%1" not appropriate (not generated) for this type of project.' |
1276 |
bindWith:filename) |
|
9575 | 1277 |
|
9898 | 1278 |
"Modified: / 14-09-2006 / 21:07:49 / cg" |
9536 | 1279 |
! |
1280 |
||
1281 |
generate_abbrev_dot_stc |
|
1282 |
^ String |
|
1283 |
streamContents:[:s | |
|
9621 | 1284 |
|addEntry| |
1285 |
||
1286 |
addEntry := |
|
1287 |
[:eachClassName | |
|
9681 | 1288 |
|cls fn wasLoaded failedToLoad numClassInstvars| |
9621 | 1289 |
|
1290 |
s nextPutAll:eachClassName. |
|
1291 |
s nextPutAll:' '. |
|
9536 | 1292 |
|
9621 | 1293 |
cls := Smalltalk classNamed:eachClassName. |
1294 |
cls isNil ifTrue:[ |
|
9678 | 1295 |
fn := (Smalltalk fileNameForClass:eachClassName) asFilename withoutSuffix. |
1296 |
fn suffix notEmptyOrNil ifTrue:[ |
|
1297 |
fn := fn withoutSuffix |
|
1298 |
]. |
|
1299 |
fn := fn baseName. |
|
1300 |
s nextPutAll:fn. |
|
9621 | 1301 |
s nextPutAll:' '; nextPutAll:'unknownPackage'; nextPutAll:' '. |
1302 |
s nextPutAll:' '; nextPutAll:'unknownCategory' storeString; nextPutAll:' '. |
|
1303 |
s nextPutAll:' '; nextPutAll:'0'. |
|
1304 |
] ifFalse:[ |
|
1305 |
wasLoaded := cls isLoaded. |
|
9714 | 1306 |
wasLoaded ifFalse:[ |
1307 |
failedToLoad := false. |
|
9681 | 1308 |
|
9714 | 1309 |
Error handle:[:ex | |
1310 |
failedToLoad := true. |
|
1311 |
] do:[ |
|
1312 |
ParserFlags |
|
1313 |
withSTCCompilation:#never |
|
1314 |
do:[ |
|
1315 |
cls autoload. |
|
1316 |
] |
|
1317 |
]. |
|
9681 | 1318 |
]. |
9584 | 1319 |
|
9678 | 1320 |
fn := cls classFilename asFilename withoutSuffix. |
1321 |
fn suffix notEmptyOrNil ifTrue:[ |
|
1322 |
fn := fn withoutSuffix |
|
1323 |
]. |
|
1324 |
fn := fn baseName. |
|
9621 | 1325 |
(fn includes:Character space) ifTrue:[ |
1326 |
s nextPutAll:fn storeString. |
|
1327 |
] ifFalse:[ |
|
1328 |
s nextPutAll:fn. |
|
1329 |
]. |
|
1330 |
s nextPutAll:' '; nextPutAll:(cls package); nextPutAll:' '. |
|
1331 |
s nextPutAll: (cls category asString storeString). |
|
9681 | 1332 |
failedToLoad ifTrue:[ |
1333 |
s nextPutAll:' 0'. |
|
1334 |
] ifFalse:[ |
|
1335 |
numClassInstvars := cls theMetaclass instSize - Class instSize. |
|
1336 |
s nextPutAll:' '; nextPutAll:numClassInstvars printString. |
|
1337 |
]. |
|
9714 | 1338 |
|
9621 | 1339 |
wasLoaded ifFalse:[ |
1340 |
cls unload |
|
1341 |
] |
|
1342 |
]. |
|
1343 |
s cr. |
|
9536 | 1344 |
]. |
9615 | 1345 |
|
9621 | 1346 |
self allClassNames do:addEntry. |
1347 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do: [:nm :attr | |
|
1348 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
|
1349 |
addEntry value:nm |
|
1350 |
]. |
|
1351 |
]. |
|
9536 | 1352 |
] |
1353 |
||
1354 |
" |
|
1355 |
DapasXProject generate_abbrev_dot_stc |
|
1356 |
DapasX_Datenbasis generate_abbrev_dot_stc |
|
1357 |
bosch_dapasx_interactiver_editor generate_abbrev_dot_stc |
|
1358 |
" |
|
1359 |
||
1360 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
9672 | 1361 |
"Modified: / 23-08-2006 / 16:49:42 / cg" |
9536 | 1362 |
! |
1363 |
||
1364 |
generate_bc_dot_def |
|
1365 |
||
1366 |
^self replaceMappings: self bc_dot_def_mappings |
|
1367 |
in: self bc_dot_def |
|
1368 |
||
1369 |
" |
|
1370 |
DapasXProject generate_bc_dot_def |
|
1371 |
DapasX_Datenbasis generate_bc_dot_def |
|
1372 |
||
1373 |
" |
|
1374 |
||
1375 |
"Modified: / 09-08-2006 / 11:30:42 / fm" |
|
1376 |
! |
|
1377 |
||
9575 | 1378 |
generate_bmake_dot_mak |
1379 |
||
1380 |
^self replaceMappings: self bmake_dot_mak_mappings |
|
1381 |
in: self bmake_dot_mak |
|
1382 |
||
1383 |
"Created: / 17-08-2006 / 20:03:43 / cg" |
|
1384 |
! |
|
1385 |
||
9850 | 1386 |
generate_loadAll |
1387 |
^ String |
|
1388 |
streamContents:[:s | |
|
1389 |
|classNames classesLoaded classNamesUnloaded classesSorted classNamesSorted| |
|
1390 |
||
1391 |
classNames := self common_compiled_classNames. |
|
1392 |
classesLoaded := classNames |
|
1393 |
collect:[:nm | |cls| cls := Smalltalk classNamed:nm] |
|
1394 |
thenSelect:[:cls | cls notNil and:[cls isLoaded] ]. |
|
1395 |
classNamesUnloaded := classNames |
|
1396 |
select:[:nm | |cls| cls := Smalltalk classNamed:nm. cls isNil or:[cls isLoaded not]]. |
|
1397 |
||
1398 |
classesSorted := Class classesSortedByLoadOrder:classesLoaded. |
|
1399 |
classNamesSorted := classesSorted collect:[:cls |cls name]. |
|
1400 |
||
1401 |
||
1402 |
s nextPutAll:'"/ |
|
1403 |
"/ $' , 'Header' , '$ |
|
1404 |
"/ |
|
1405 |
"/ loadAll-file to fileIn code for: ' , self package , ' |
|
1406 |
"/ |
|
1407 |
"/ Automatically generated from the ProjectDefinition. |
|
1408 |
"/ DO NOT MODIFY THIS fILE; |
|
1409 |
"/ |
|
1410 |
"/ |
|
1411 |
"/ Prerequisites: |
|
1412 |
"/ |
|
1413 |
"/ Smalltalk loadPackage:''module:directory''. |
|
1414 |
"/ Smalltalk loadPackage:''....''. |
|
1415 |
!! |
|
1416 |
||
1417 |
"{ package:''' , self package, ''' }" |
|
1418 |
!! |
|
1419 |
||
1420 |
|files| |
|
1421 |
||
1422 |
''loading package ' , self package ,'...'' infoPrintCR. |
|
1423 |
||
1424 |
files := #( |
|
1425 |
'. |
|
1426 |
||
1427 |
classesSorted do:[:eachClass | |
|
1428 |
s nextPutLine:' ''' , eachClass classFilename asFilename baseName, ''''. |
|
1429 |
]. |
|
1430 |
classNamesUnloaded do:[:nm | |
|
1431 |
s nextPutLine:' ''' , (Smalltalk fileNameForClass: nm) asFilename baseName, ''''. |
|
1432 |
]. |
|
1433 |
||
1434 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do:[:nm :attr | |
|
1435 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
|
1436 |
s nextPutLine:' ''' , (Smalltalk fileNameForClass: nm) asFilename baseName, ''''. |
|
1437 |
]. |
|
1438 |
]. |
|
1439 |
||
1440 |
self hasExtensions ifTrue:[ |
|
1441 |
s nextPutLine:' ''extensions.st'''. |
|
1442 |
]. |
|
1443 |
||
1444 |
s nextPutAll:' |
|
1445 |
) asOrderedCollection. |
|
1446 |
||
1447 |
"/ see if there is a classLibrary |
|
1448 |
(Smalltalk fileInClassLibrary:''' , (self libraryNameFor:self package) , ''') ifTrue:[ |
|
1449 |
|handle loaded| |
|
1450 |
||
1451 |
handle := ObjectFileLoader loadedObjectHandles |
|
1452 |
detect:[:h | h package = ''' , self package , '''] ifNone:nil. |
|
1453 |
handle ifNotNil:[ |
|
1454 |
loaded := Set new:(handle classes size). |
|
1455 |
handle classes do:[:c| c isMeta ifFalse:[loaded add:c classFilename]]. |
|
1456 |
files := files asOrderedCollection select:[:f| (loaded includes:f) not]. |
|
1457 |
]. |
|
1458 |
]. |
|
1459 |
||
1460 |
"/ load files which are not in the classLibrary (all if there is none) |
|
1461 |
files size > 0 ifTrue:[ |
|
1462 |
files do:[:f | |
|
1463 |
''.'' infoPrint. |
|
1464 |
f asFilename exists ifTrue:[ |
|
1465 |
Smalltalk fileIn:f. |
|
1466 |
] ifFalse:[ |
|
1467 |
Smalltalk fileIn:(''source/'' , f) |
|
1468 |
] |
|
1469 |
]. |
|
1470 |
'' '' infoPrintCR. |
|
1471 |
]. |
|
1472 |
'' done (' , self package ,').'' infoPrintCR. |
|
1473 |
'. |
|
1474 |
]. |
|
1475 |
||
1476 |
"Created: / 14-09-2006 / 14:21:31 / cg" |
|
1477 |
! |
|
1478 |
||
9536 | 1479 |
generate_make_dot_proto |
1480 |
||
9733 | 1481 |
^ (self |
1482 |
replaceMappings: self make_dot_proto_mappings |
|
1483 |
in: self make_dot_proto) asStringCollection withTabs asString |
|
9536 | 1484 |
|
9733 | 1485 |
" |
1486 |
stx:libbasic2 generate_make_dot_proto |
|
1487 |
" |
|
9536 | 1488 |
|
1489 |
"Modified: / 09-08-2006 / 11:31:01 / fm" |
|
1490 |
! |
|
1491 |
||
1492 |
generate_make_dot_spec |
|
9733 | 1493 |
^ (self |
1494 |
replaceMappings: self make_dot_spec_mappings |
|
1495 |
in: self make_dot_spec) asStringCollection withTabs asString |
|
9536 | 1496 |
|
9733 | 1497 |
" |
1498 |
DapasXProject generate_make_dot_spec |
|
1499 |
DapasX_Datenbasis generate_make_dot_spec |
|
1500 |
bosch_dapasx_kernel_Definition generate_make_dot_spec |
|
1501 |
" |
|
9536 | 1502 |
|
1503 |
"Modified: / 09-08-2006 / 11:31:09 / fm" |
|
1504 |
! |
|
1505 |
||
1506 |
generate_modules_dot_stx |
|
1507 |
||
1508 |
^self replaceMappings: self modules_dot_stx_mappings |
|
1509 |
in: self modules_dot_stx |
|
1510 |
||
1511 |
" |
|
1512 |
bosch_dapasx_application generate_modules_dot_stx |
|
1513 |
||
1514 |
" |
|
1515 |
||
1516 |
"Modified: / 09-08-2006 / 11:31:09 / fm" |
|
1517 |
"Modified: / 11-08-2006 / 14:01:56 / cg" |
|
1518 |
! |
|
1519 |
||
1520 |
generate_nt_dot_def |
|
1521 |
||
1522 |
^self replaceMappings: self nt_dot_def_mappings |
|
1523 |
in: self nt_dot_def |
|
1524 |
||
1525 |
" |
|
1526 |
DapasXProject generate_nt_dot_def |
|
1527 |
DapasX_Datenbasis generate_nt_dot_def |
|
1528 |
||
1529 |
" |
|
1530 |
||
1531 |
"Modified: / 09-08-2006 / 11:31:21 / fm" |
|
1532 |
! |
|
1533 |
||
1534 |
generate_nt_dot_mak |
|
9733 | 1535 |
^ (self |
1536 |
replaceMappings: self nt_dot_mak_mappings |
|
1537 |
in: self nt_dot_mak) asStringCollection withTabs asString |
|
9536 | 1538 |
|
9733 | 1539 |
" |
1540 |
DapasXProject generate_nt_dot_mak |
|
1541 |
DapasX_Datenbasis generate_nt_dot_mak |
|
1542 |
" |
|
9536 | 1543 |
|
1544 |
"Modified: / 09-08-2006 / 11:46:14 / fm" |
|
1545 |
! |
|
1546 |
||
9898 | 1547 |
generate_packageName_dot_nsi |
1548 |
||
1549 |
^self replaceMappings: self packageName_dot_nsi_mappings |
|
1550 |
in: self packageName_dot_nsi |
|
1551 |
||
1552 |
" |
|
1553 |
bosch_dapasx_application generate_packageName_dot_nsi |
|
1554 |
" |
|
1555 |
||
1556 |
"Modified: / 09-08-2006 / 11:31:09 / fm" |
|
1557 |
"Created: / 14-09-2006 / 21:08:23 / cg" |
|
1558 |
! |
|
1559 |
||
9536 | 1560 |
generate_packageName_dot_rc |
1561 |
||
1562 |
^self replaceMappings: self packageName_dot_rc_mappings |
|
1563 |
in: self packageName_dot_rc |
|
1564 |
||
1565 |
" |
|
1566 |
bosch_dapasx_datenbasis generate_packageName_dot_rc |
|
1567 |
bosch_dapasx_hw_schnittstellen generate_packageName_dot_rc |
|
9575 | 1568 |
stx_libbasic3 generate_packageName_dot_rc |
9618 | 1569 |
stx_libwidg3 generate_packageName_dot_rc |
1570 |
stx_libwidg3 productVersion |
|
9536 | 1571 |
|
1572 |
" |
|
1573 |
||
1574 |
"Modified: / 09-08-2006 / 11:31:09 / fm" |
|
9618 | 1575 |
"Modified: / 21-08-2006 / 19:33:21 / cg" |
9831 | 1576 |
! |
1577 |
||
9898 | 1578 |
nsiFilename |
1579 |
^ self packageName,'.nsi'. |
|
1580 |
||
1581 |
"Created: / 14-09-2006 / 21:03:41 / cg" |
|
1582 |
! |
|
1583 |
||
9852 | 1584 |
protectedFileNames |
1585 |
"names of files which should NOT be generated |
|
1586 |
- redefine this to protect a hand-written Make.proto" |
|
1587 |
||
1588 |
^ #() |
|
1589 |
||
1590 |
"Created: / 14-09-2006 / 14:38:40 / cg" |
|
1591 |
! |
|
1592 |
||
9831 | 1593 |
rcFilename |
1594 |
^ self packageName,'.rc'. |
|
1595 |
||
1596 |
"Created: / 07-09-2006 / 17:07:00 / cg" |
|
9536 | 1597 |
! ! |
1598 |
||
9569 | 1599 |
!ProjectDefinition class methodsFor:'file templates'! |
9536 | 1600 |
|
9575 | 1601 |
bmake_dot_mak |
1602 |
"the template code for the bmake.bat file" |
|
1603 |
||
1604 |
^ |
|
9888 | 1605 |
'%(SUBPROJECT_BMAKE_CALLS) |
1606 |
make.exe -N -f nt.mak %%1 %%2 |
|
9575 | 1607 |
' |
1608 |
||
1609 |
"Created: / 17-08-2006 / 20:04:14 / cg" |
|
9888 | 1610 |
"Modified: / 14-09-2006 / 19:46:40 / cg" |
9575 | 1611 |
! |
1612 |
||
9817 | 1613 |
make_dot_spec |
1614 |
||
1615 |
^ |
|
1616 |
'# $','Header','$ |
|
1617 |
# |
|
1618 |
# DO NOT EDIT |
|
1619 |
# automagically generated from the projectDefinition: ',self name,'. |
|
1620 |
# |
|
1621 |
# Warning: once you modify this file, do not rerun |
|
1622 |
# stmkmp or projectDefinition-build again - otherwise, your changes are lost. |
|
1623 |
# |
|
1624 |
# This file contains specifications which are common to all platforms. |
|
1625 |
# |
|
1626 |
||
1627 |
# Do NOT CHANGE THESE DEFINITIONS |
|
1628 |
# (otherwise, ST/X will have a hard time to find out the packages location from its packageID, |
|
1629 |
# to find the source code of a class and to find the library for a package) |
|
1630 |
MODULE=%(MODULE) |
|
1631 |
MODULE_DIR=%(MODULE_DIRECTORY) |
|
1632 |
PACKAGE=$(MODULE):$(MODULE_DIR) |
|
1633 |
||
1634 |
||
1635 |
# Argument(s) to the stc compiler (stc --usage). |
|
1636 |
# -H. : create header files locally |
|
1637 |
# (if removed, they will be created as common |
|
1638 |
# -Pxxx : defines the package |
|
1639 |
# -Zxxx : a prefix for variables within the classLib |
|
1640 |
# -Dxxx : defines passed to to CC for inline C-code |
|
1641 |
# -Ixxx : include path passed to CC for inline C-code |
|
1642 |
# +optspace : optimized for space |
|
1643 |
# +optspace2 : optimized more for space |
|
1644 |
# +optspace3 : optimized even more for space |
|
1645 |
# +optinline : generate inline code for some ST constructs |
|
1646 |
# +inlineNew : additionally inline new |
|
1647 |
# +inlineMath : additionally inline some floatPnt math stuff |
|
1648 |
# |
|
1649 |
# ********** OPTIONAL: MODIFY the next line(s) *** |
|
1650 |
# STCLOCALOPTIMIZATIONS=+optinline +inlineNew |
|
1651 |
# STCLOCALOPTIMIZATIONS=+optspace3 |
|
1652 |
STCLOCALOPTIMIZATIONS=%(STCOPTIMIZATIONOPTIONS) |
|
1653 |
||
1654 |
||
1655 |
# Argument(s) to the stc compiler (stc --usage). |
|
1656 |
# -warn : no warnings |
|
1657 |
# -warnNonStandard : no warnings about ST/X extensions |
|
1658 |
# -warnEOLComments : no warnings about EOL comment extension |
|
1659 |
# -warnPrivacy : no warnings about privateClass extension |
|
1660 |
# |
|
1661 |
# ********** OPTIONAL: MODIFY the next line(s) *** |
|
1662 |
# STCWARNINGS=-warn |
|
1663 |
# STCWARNINGS=-warnNonStandard |
|
1664 |
# STCWARNINGS=-warnEOLComments |
|
1665 |
STCWARNINGS=%(STCWARNINGOPTIONS) |
|
1666 |
||
1667 |
%(OBJECTS) |
|
1668 |
' |
|
1669 |
||
1670 |
"Created: / 08-08-2006 / 19:31:29 / fm" |
|
1671 |
"Modified: / 09-08-2006 / 15:10:57 / fm" |
|
1672 |
"Modified: / 30-08-2006 / 19:07:26 / cg" |
|
1673 |
! |
|
1674 |
||
1675 |
objectLine_make_dot_spec |
|
1676 |
||
1677 |
^' $(OUTDIR)%(CLASSFILE).$(O) \' |
|
1678 |
||
1679 |
"Created: / 08-08-2006 / 20:16:46 / fm" |
|
1680 |
"Modified: / 23-08-2006 / 11:11:38 / cg" |
|
1681 |
! |
|
1682 |
||
9627 | 1683 |
packageName_dot_rc |
1684 |
"the template code for the <libName>.rc file" |
|
1685 |
||
1686 |
^ |
|
1687 |
'// |
|
1688 |
// DO NOT EDIT |
|
1689 |
// automagically generated from the projectDefinition: ',self name,'. |
|
1690 |
// |
|
1691 |
VS_VERSION_INFO VERSIONINFO |
|
1692 |
FILEVERSION %(FILE_VERSION_COMMASEPARATED) |
|
1693 |
PRODUCTVERSION %(PRODUCT_VERSION_COMMASEPARATED) |
|
1694 |
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE |
|
1695 |
FILEFLAGS VS_FF_PRERELEASE | VS_FF_SPECIALBUILD |
|
1696 |
FILEOS VOS_NT_WINDOWS32 |
|
1697 |
FILETYPE %(FILETYPE) |
|
1698 |
FILESUBTYPE VS_USER_DEFINED |
|
1699 |
||
1700 |
BEGIN |
|
1701 |
BLOCK "StringFileInfo" |
|
1702 |
BEGIN |
|
1703 |
BLOCK "040904E4" |
|
1704 |
BEGIN |
|
1705 |
VALUE "CompanyName", "%(COMPANY_NAME)\0" |
|
1706 |
VALUE "FileDescription", "%(FILE_DESCRIPTION)\0" |
|
1707 |
VALUE "FileVersion", "%(FILE_VERSION)\0" |
|
1708 |
VALUE "InternalName", "%(INTERNAL_NAME)\0" |
|
9630 | 1709 |
%(LEGAL_COPYRIGHT_LINE) |
9627 | 1710 |
VALUE "ProductName", "%(PRODUCT_NAME)\0" |
1711 |
VALUE "ProductVersion", "%(PRODUCT_VERSION)\0" |
|
1712 |
VALUE "ProductDate", "%(PRODUCT_DATE)\0" |
|
1713 |
END |
|
1714 |
||
1715 |
END |
|
1716 |
||
1717 |
BLOCK "VarFileInfo" |
|
1718 |
BEGIN // Language | Translation |
|
1719 |
VALUE "Translation", 0x409, 0x4E4 // U.S. English, Windows Multilingual |
|
1720 |
END |
|
1721 |
END |
|
1722 |
' |
|
1723 |
" |
|
1724 |
stx_libbasic3 packageName_dot_rc |
|
1725 |
stx_libbasic3 generate_packageName_dot_rc |
|
1726 |
" |
|
1727 |
||
1728 |
"Created: / 08-08-2006 / 19:31:29 / fm" |
|
1729 |
"Modified: / 09-08-2006 / 15:10:57 / fm" |
|
9630 | 1730 |
"Modified: / 23-08-2006 / 01:32:23 / cg" |
9536 | 1731 |
! ! |
1732 |
||
9569 | 1733 |
!ProjectDefinition class methodsFor:'loading'! |
9551 | 1734 |
|
9627 | 1735 |
load |
1736 |
self loadExtensions. |
|
1737 |
self loadAllClasses. |
|
9579 | 1738 |
|
9627 | 1739 |
"Created: / 17-08-2006 / 01:01:41 / cg" |
9579 | 1740 |
! |
1741 |
||
9627 | 1742 |
loadAllClasses |
1743 |
|loadedClasses loadClass| |
|
1744 |
||
1745 |
loadedClasses := OrderedCollection new. |
|
1746 |
||
1747 |
loadClass := [:className | |
|
1748 |
|cls| |
|
1749 |
||
1750 |
cls := Smalltalk at:className asSymbol. |
|
1751 |
(cls isNil or:[cls isLoaded not]) ifTrue:[ |
|
1752 |
cls := Smalltalk |
|
1753 |
fileInClass:className |
|
1754 |
package:self package |
|
1755 |
initialize:false |
|
1756 |
lazy:false |
|
1757 |
silent:false. |
|
1758 |
cls notNil ifTrue:[ |
|
1759 |
loadedClasses add:cls |
|
1760 |
]. |
|
1761 |
]. |
|
1762 |
]. |
|
9817 | 1763 |
|
9627 | 1764 |
self allClassNames do:loadClass. |
1765 |
OperatingSystem isUNIXlike ifTrue:[ |
|
1766 |
self compiled_classNames_unix do:loadClass. |
|
1767 |
] ifFalse:[ |
|
1768 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
1769 |
self compiled_classNames_windows do:loadClass. |
|
1770 |
] ifFalse:[ |
|
1771 |
self error:'unknown OS' |
|
1772 |
]. |
|
1773 |
]. |
|
1774 |
||
1775 |
loadedClasses do:[:each | |
|
1776 |
(each theMetaclass implements:#initialize) ifTrue:[ |
|
1777 |
each initialize |
|
1778 |
]. |
|
1779 |
]. |
|
1780 |
||
1781 |
"Created: / 17-08-2006 / 01:01:14 / cg" |
|
9817 | 1782 |
"Modified: / 30-08-2006 / 18:32:56 / cg" |
9551 | 1783 |
! |
1784 |
||
9627 | 1785 |
loadExtensions |
1786 |
Smalltalk loadExtensionsForPackage:self package. |
|
1787 |
||
1788 |
"Created: / 17-08-2006 / 00:21:39 / cg" |
|
1789 |
! |
|
1790 |
||
1791 |
postAutoload |
|
9850 | 1792 |
self hasExtensions ifTrue:[ |
9627 | 1793 |
self loadExtensions |
1794 |
]. |
|
1795 |
||
1796 |
"Created: / 17-08-2006 / 00:21:29 / cg" |
|
9850 | 1797 |
"Modified: / 14-09-2006 / 14:20:33 / cg" |
9551 | 1798 |
! ! |
1799 |
||
9569 | 1800 |
!ProjectDefinition class methodsFor:'mappings'! |
9536 | 1801 |
|
9627 | 1802 |
bc_dot_def_mappings |
1803 |
^ (Dictionary new) |
|
9887 | 1804 |
at:'DESCRIPTION' |
9627 | 1805 |
put:[ |
1806 |
|d| |
|
1807 |
||
1808 |
d := self description. |
|
1809 |
(d isEmptyOrNil ifTrue:[ self defaultDescription ] ifFalse:[ d ]) storeString. |
|
1810 |
]; |
|
1811 |
yourself |
|
1812 |
||
1813 |
"Created: / 09-08-2006 / 11:17:59 / fm" |
|
9887 | 1814 |
"Modified: / 14-09-2006 / 18:51:17 / cg" |
9536 | 1815 |
! |
1816 |
||
9627 | 1817 |
bmake_dot_mak_mappings |
1818 |
^ (Dictionary new) |
|
9887 | 1819 |
at:'SUBPROJECT_BMAKE_CALLS' put:(self subProjectBmakeCalls); |
9627 | 1820 |
yourself |
1821 |
||
1822 |
"Created: / 17-08-2006 / 21:41:56 / cg" |
|
9887 | 1823 |
"Modified: / 14-09-2006 / 18:55:33 / cg" |
9575 | 1824 |
! |
1825 |
||
9627 | 1826 |
make_dot_spec_mappings |
1827 |
^ Dictionary new |
|
9887 | 1828 |
at: 'TAB' put: ( Character tab asString ); |
1829 |
at: 'MODULE' put: ( self module ); |
|
1830 |
at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); |
|
1831 |
at: 'STCWARNINGOPTIONS' put: (self stcWarningOptions); |
|
1832 |
at: 'STCOPTIMIZATIONOPTIONS' put: (self stcOptimizationOptions); |
|
1833 |
at: 'OBJECTS' put: [self generateObjects_make_dot_spec]; |
|
9627 | 1834 |
yourself |
1835 |
||
1836 |
"Created: / 18-08-2006 / 11:44:23 / cg" |
|
9887 | 1837 |
"Modified: / 14-09-2006 / 18:51:24 / cg" |
9575 | 1838 |
! |
1839 |
||
9627 | 1840 |
nt_dot_mak_mappings |
1841 |
|d| |
|
1842 |
||
1843 |
d := Dictionary new. |
|
1844 |
d |
|
9887 | 1845 |
at: 'TAB' put: ( Character tab asString ); |
1846 |
at: 'TOP' put: ( self pathToTop_win32 ); |
|
1847 |
at: 'MODULE' put: ( self module ); |
|
9891 | 1848 |
at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); |
1849 |
at: 'MODULE_PATH' put: ( self moduleDirectory_win32 ). |
|
9627 | 1850 |
^ d |
1851 |
||
1852 |
"Created: / 18-08-2006 / 11:43:39 / cg" |
|
9891 | 1853 |
"Modified: / 14-09-2006 / 20:20:19 / cg" |
9575 | 1854 |
! |
1855 |
||
9817 | 1856 |
objectLine_make_dot_spec_mappings: aClassName |
1857 |
^ Dictionary new |
|
9887 | 1858 |
at: 'CLASSFILE' |
1859 |
put: ( (Smalltalk classNamed:aClassName) classFilename asFilename withoutSuffix baseName ); |
|
9817 | 1860 |
yourself |
1861 |
||
1862 |
"Created: / 08-08-2006 / 20:17:28 / fm" |
|
1863 |
"Modified: / 09-08-2006 / 18:26:52 / fm" |
|
9887 | 1864 |
"Modified: / 14-09-2006 / 18:51:49 / cg" |
9817 | 1865 |
! |
1866 |
||
9898 | 1867 |
packageName_dot_nsi_mappings |
1868 |
|d s| |
|
1869 |
||
1870 |
d := Dictionary new. |
|
1871 |
d |
|
1872 |
at: 'TOP' put: ( self pathToTop_win32 ); |
|
1873 |
||
1874 |
at: 'APPLICATION' put: (self applicationName); |
|
1875 |
at: 'MODULE' put: ( self module ); |
|
1876 |
at: 'MODULE_KEY' put: ( self module asUppercaseFirst ); |
|
1877 |
at: 'PRODUCT_NAME' put: (self productName); |
|
1878 |
at: 'PRODUCT_VERSION' put: (self productVersion); |
|
1879 |
at: 'PRODUCT_DATE' put: (self productDate); |
|
1880 |
at: 'PRODUCT_PUBLISHER' put: (self productPublisher); |
|
1881 |
at: 'PRODUCT_WEBSITE' put: (self productWebSite); |
|
1882 |
at: 'PRODUCT_INSTALLDIR' put: (self productInstallDir); |
|
1883 |
at: 'FILETYPE' put: ( 'VFT_DLL' ); |
|
1884 |
at: 'FILE_VERSION_COMMASEPARATED' put: (self fileVersionCommaSeparated); |
|
1885 |
at: 'PRODUCT_VERSION_COMMASEPARATED' put: (self productVersionCommaSeparated); |
|
1886 |
||
1887 |
at: 'COMPANY_NAME' put: (self companyName); |
|
1888 |
at: 'FILE_DESCRIPTION' put: (self fileDescription); |
|
1889 |
at: 'FILE_VERSION' put: (self fileVersion); |
|
1890 |
at: 'LEGAL_COPYRIGHT' put: (self legalCopyright ? ''); |
|
1891 |
at: 'INTERNAL_NAME' put: (self internalName). |
|
1892 |
s := self legalCopyright. |
|
1893 |
s notNil ifTrue:[ |
|
1894 |
d |
|
1895 |
at: 'LEGAL_COPYRIGHT_LINE' put: ' VALUE "LegalCopyright", "',s,'\0"' |
|
1896 |
]. |
|
1897 |
s := self iconFileName. |
|
1898 |
s notNil ifTrue:[ |
|
1899 |
d |
|
1900 |
at: #'ICONDEFINITION_LINE' put: 'IDR_MAINFRAME ICON DISCARDABLE "',s,'"' |
|
1901 |
]. |
|
1902 |
||
1903 |
^ d |
|
1904 |
||
1905 |
"Created: / 14-09-2006 / 21:08:44 / cg" |
|
1906 |
! |
|
1907 |
||
9627 | 1908 |
packageName_dot_rc_mappings |
9630 | 1909 |
|d s| |
9627 | 1910 |
|
9630 | 1911 |
d := Dictionary new. |
1912 |
d |
|
9887 | 1913 |
at: 'PRODUCT_NAME' put: (self productName); |
1914 |
at: 'PRODUCT_VERSION' put: (self productVersion); |
|
1915 |
at: 'PRODUCT_DATE' put: (self productDate); |
|
1916 |
at: 'FILETYPE' put: ( 'VFT_DLL' ); |
|
1917 |
at: 'FILE_VERSION_COMMASEPARATED' put: (self fileVersionCommaSeparated); |
|
1918 |
at: 'PRODUCT_VERSION_COMMASEPARATED' put: (self productVersionCommaSeparated); |
|
1919 |
||
1920 |
at: 'COMPANY_NAME' put: (self companyName); |
|
1921 |
at: 'FILE_DESCRIPTION' put: (self fileDescription); |
|
1922 |
at: 'FILE_VERSION' put: (self fileVersion); |
|
1923 |
at: 'INTERNAL_NAME' put: (self internalName). |
|
9630 | 1924 |
s := self legalCopyright. |
1925 |
s notNil ifTrue:[ |
|
1926 |
d |
|
9887 | 1927 |
at: 'LEGAL_COPYRIGHT_LINE' put: ' VALUE "LegalCopyright", "',s,'\0"' |
9630 | 1928 |
]. |
9817 | 1929 |
s := self iconFileName. |
1930 |
s notNil ifTrue:[ |
|
1931 |
d |
|
1932 |
at: #'ICONDEFINITION_LINE' put: 'IDR_MAINFRAME ICON DISCARDABLE "',s,'"' |
|
1933 |
]. |
|
1934 |
||
9630 | 1935 |
^ d |
9627 | 1936 |
|
1937 |
"Created: / 09-08-2006 / 11:21:21 / fm" |
|
9887 | 1938 |
"Modified: / 14-09-2006 / 18:52:37 / cg" |
9536 | 1939 |
! |
1940 |
||
9627 | 1941 |
replaceMappings: mappings in: fileTemplate |
9733 | 1942 |
"Replaces the defined variable mappings found in a file template with the corresponding information" |
9627 | 1943 |
|
9733 | 1944 |
^ fileTemplate bindWithArguments:mappings. |
9627 | 1945 |
|
9733 | 1946 |
" |
1947 |
self replaceMappings: (self nt_dot_def_mappingsFor: self) in: self nt_dot_def |
|
1948 |
" |
|
9627 | 1949 |
|
1950 |
"Created: / 08-08-2006 / 11:44:27 / fm" |
|
1951 |
"Modified: / 08-08-2006 / 12:46:13 / fm" |
|
9536 | 1952 |
! ! |
1953 |
||
9817 | 1954 |
!ProjectDefinition class methodsFor:'mappings support'! |
1955 |
||
9887 | 1956 |
generateDependencies:whichArchitecture |
1957 |
^ String streamContents:[:s | |
|
1958 |
|classNames classesLoaded classesSorted classNamesSorted putDependencyForClass |
|
1959 |
archClassNames archClassesLoaded putSingleClassDependencyEntry putDependencyForExtensions| |
|
1960 |
||
1961 |
putSingleClassDependencyEntry := |
|
1962 |
[:cls | |sclsBaseName| |
|
1963 |
s nextPutAll:' $(INCLUDE_TOP)'. |
|
1964 |
s nextPutAll:(self pathSeparator:whichArchitecture) asString. |
|
1965 |
sclsBaseName := cls classFilename asFilename withoutSuffix baseName. |
|
1966 |
s nextPutAll:(self topRelativePathTo:sclsBaseName inPackage:cls package architecture:whichArchitecture). |
|
1967 |
s nextPutAll:'.$(H)'. |
|
1968 |
]. |
|
1969 |
||
1970 |
putDependencyForClass := |
|
1971 |
[:cls | |
|
1972 |
|clsBaseName already| |
|
1973 |
||
1974 |
clsBaseName := cls classFilename asFilename withoutSuffix baseName. |
|
1975 |
s nextPutAll:'$(OUTDIR)'. |
|
1976 |
s nextPutAll:clsBaseName. |
|
1977 |
s nextPutAll:'.$(O)'. |
|
1978 |
||
1979 |
s nextPutAll:' '. |
|
1980 |
s nextPutAll:clsBaseName. |
|
1981 |
s nextPutAll:'.$(H)'. |
|
1982 |
||
1983 |
s nextPutAll:': '. |
|
1984 |
s nextPutAll:clsBaseName. |
|
1985 |
s nextPutAll:'.st'. |
|
1986 |
already := Set new. |
|
1987 |
cls allSuperclassesDo:[:scls | |
|
1988 |
putSingleClassDependencyEntry value:scls. |
|
1989 |
already add:scls. |
|
1990 |
]. |
|
1991 |
cls privateClassesDo:[:eachPrivateClass | |
|
1992 |
eachPrivateClass allSuperclassesDo:[:scls | |sclsBaseName| |
|
1993 |
scls ~~ cls ifTrue:[ |
|
1994 |
scls isPrivate ifFalse:[ |
|
1995 |
(already includes:scls) ifFalse:[ |
|
1996 |
putSingleClassDependencyEntry value:scls. |
|
1997 |
already add:scls. |
|
1998 |
]. |
|
1999 |
]. |
|
2000 |
]. |
|
2001 |
] |
|
2002 |
]. |
|
2003 |
||
2004 |
s nextPutAll:' $(STCHDR)'. |
|
2005 |
s cr. |
|
2006 |
]. |
|
2007 |
||
2008 |
putDependencyForExtensions := |
|
2009 |
[ |
|
2010 |
|already| |
|
2011 |
||
2012 |
s nextPutAll:'$(OUTDIR)extensions.$(O): extensions.st'. |
|
2013 |
||
2014 |
already := Set new. |
|
2015 |
self extensionMethodNames pairWiseDo:[:className :selector | |
|
2016 |
|mthdCls cls| |
|
2017 |
||
2018 |
((mthdCls := Smalltalk classNamed:className) notNil and:[mthdCls isLoaded]) ifTrue:[ |
|
2019 |
cls := mthdCls theNonMetaclass. |
|
2020 |
(already includes:cls) ifFalse:[ |
|
2021 |
cls allSuperclassesDo:[:scls | |
|
2022 |
(already includes:scls) ifFalse:[ |
|
2023 |
putSingleClassDependencyEntry value:scls. |
|
2024 |
already add:scls. |
|
2025 |
]. |
|
2026 |
]. |
|
2027 |
]. |
|
2028 |
]. |
|
2029 |
]. |
|
2030 |
||
2031 |
s nextPutAll:' $(STCHDR)'. |
|
2032 |
s cr. |
|
2033 |
]. |
|
2034 |
||
2035 |
classNames := self common_compiled_classNames. |
|
2036 |
classesLoaded := classNames |
|
2037 |
collect:[:className | |cls| cls := Smalltalk classNamed:className] |
|
2038 |
thenSelect:[:cls | cls notNil and:[cls isLoaded] ]. |
|
2039 |
||
2040 |
classesSorted := Class classesSortedByLoadOrder:classesLoaded. |
|
2041 |
classesSorted do:putDependencyForClass. |
|
2042 |
||
2043 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do:[:className :attr | |
|
2044 |
|cls| |
|
2045 |
||
2046 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
|
2047 |
((cls := Smalltalk classNamed:className) notNil and:[cls isLoaded]) ifTrue:[ |
|
2048 |
putDependencyForClass value:cls. |
|
2049 |
] |
|
2050 |
]. |
|
2051 |
]. |
|
2052 |
||
2053 |
archClassNames := self compiled_classNamesForArchitecture:whichArchitecture. |
|
2054 |
archClassesLoaded := archClassNames |
|
2055 |
collect:[:className | |cls| cls := Smalltalk classNamed:className] |
|
2056 |
thenSelect:[:cls | cls notNil and:[cls isLoaded] ]. |
|
2057 |
||
2058 |
archClassesLoaded notEmpty ifTrue:[ |
|
2059 |
(Class classesSortedByLoadOrder:archClassesLoaded) do:putDependencyForClass. |
|
2060 |
]. |
|
2061 |
||
2062 |
self hasExtensions ifTrue:putDependencyForExtensions. |
|
2063 |
] |
|
2064 |
||
2065 |
" |
|
2066 |
stx_libbasic3 generateDependencies:#unix |
|
2067 |
stx_libbasic3 generateDependencies:#win32 |
|
2068 |
" |
|
2069 |
||
2070 |
"Modified: / 16-08-2006 / 18:52:10 / User" |
|
2071 |
"Created: / 14-09-2006 / 12:38:57 / cg" |
|
2072 |
"Modified: / 14-09-2006 / 17:04:21 / cg" |
|
2073 |
! |
|
2074 |
||
2075 |
generateDependencies_unix |
|
2076 |
^ self generateDependencies:#unix |
|
2077 |
||
2078 |
" |
|
2079 |
stx_libbasic3 generateDependencies:#unix |
|
2080 |
stx_libbasic3 generateDependencies:#win32 |
|
2081 |
" |
|
2082 |
||
2083 |
"Modified: / 14-09-2006 / 13:32:34 / cg" |
|
2084 |
! |
|
2085 |
||
2086 |
generateDependencies_win32 |
|
2087 |
^ self generateDependencies:#win32 |
|
2088 |
||
2089 |
"Created: / 14-09-2006 / 12:39:18 / cg" |
|
2090 |
! |
|
2091 |
||
2092 |
generateLocalIncludes_win32 |
|
2093 |
^ String streamContents:[:s | |
|
2094 |
s nextPutAll:(self localIncludes_win32). |
|
2095 |
self searchForProjectsWhichProvideHeaderFiles |
|
2096 |
do:[:includeProject | |
|
2097 |
s nextPutAll:' -I$(INCLUDE_TOP)\',(self topRelativePathToPackage_win32: includeProject) |
|
2098 |
] |
|
2099 |
] |
|
2100 |
||
2101 |
" |
|
2102 |
bosch_dapasx_application generateLocalIncludes_win32 |
|
2103 |
bosch_dapasx_datenbasis generateLocalIncludes_win32 |
|
2104 |
stx_libbasic generateLocalIncludes_win32 |
|
2105 |
stx_libview generateLocalIncludes_win32 |
|
2106 |
stx_libtool2 generateLocalIncludes_win32 |
|
2107 |
" |
|
2108 |
||
2109 |
"Created: / 09-08-2006 / 16:46:49 / fm" |
|
2110 |
"Modified: / 14-09-2006 / 15:37:35 / cg" |
|
2111 |
! |
|
2112 |
||
9817 | 2113 |
generateObjects_make_dot_spec |
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2114 |
|pivateClassesOf sorter classes| |
9817 | 2115 |
|
2116 |
classes := self compiled_classes_common. |
|
2117 |
pivateClassesOf := IdentityDictionary new. |
|
2118 |
classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)]. |
|
2119 |
||
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2120 |
sorter := [:a :b | |
9817 | 2121 |
"/ a must come before b iff: |
2122 |
"/ b is a subclass of a |
|
2123 |
"/ b has a private class which is a subclass of a |
|
2124 |
"/ a is a sharedPool, used by b |
|
2125 |
||
2126 |
|mustComeBefore pivateClassesOfB| |
|
2127 |
||
2128 |
mustComeBefore := false. |
|
2129 |
mustComeBefore := (a isSharedPool and:[(b sharedPools includes: a name)]). |
|
2130 |
mustComeBefore := mustComeBefore or:[b isSubclassOf:a]. |
|
2131 |
mustComeBefore ifFalse:[ |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2132 |
pivateClassesOfB := pivateClassesOf at:b ifAbsent:[ #() ]. |
9817 | 2133 |
pivateClassesOfB do:[:eachClassInB | |
2134 |
mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a] |
|
2135 |
]. |
|
2136 |
]. |
|
2137 |
mustComeBefore |
|
2138 |
]. |
|
2139 |
||
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2140 |
classes topologicalSort:sorter. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2141 |
|
9817 | 2142 |
^ String streamContents:[:s | |
2143 |
|putLineForClass sysDepOrNil| |
|
2144 |
||
2145 |
putLineForClass := |
|
2146 |
[:eachClass | |
|
2147 |
|mappings newObjectLine| |
|
2148 |
mappings := self objectLine_make_dot_spec_mappings: eachClass name. |
|
2149 |
newObjectLine := self replaceMappings: mappings in: self objectLine_make_dot_spec. |
|
2150 |
s nextPutLine:newObjectLine. |
|
2151 |
]. |
|
2152 |
||
2153 |
sysDepOrNil := nil. |
|
2154 |
OperatingSystem knownPlatformNames do:[:platformID | |
|
2155 |
|define prefix depClasses| |
|
2156 |
||
2157 |
define := OperatingSystem platformDefineForPlatformName:platformID. |
|
2158 |
prefix := define copyFrom:('-D' size + 1). |
|
2159 |
depClasses := self compiled_classesForArchitecture:platformID. |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2160 |
depClasses topologicalSort:sorter. |
9817 | 2161 |
depClasses notEmpty ifTrue:[ |
2162 |
sysDepOrNil := prefix,'_OBJS'. |
|
2163 |
s nextPutLine:sysDepOrNil,'= \'. |
|
2164 |
depClasses do:putLineForClass. |
|
2165 |
s cr. |
|
2166 |
s cr. |
|
2167 |
] |
|
2168 |
]. |
|
2169 |
||
2170 |
s nextPutLine:'COMMON_OBJS= \'. |
|
2171 |
||
2172 |
classes do:putLineForClass. |
|
2173 |
||
2174 |
self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do: [:nm :attr | |
|
2175 |
(attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[ |
|
2176 |
s nextPutLine:(' $(OUTDIR)',(Smalltalk fileNameForClass:nm),'.$(O) \'). |
|
2177 |
]. |
|
2178 |
]. |
|
2179 |
||
9850 | 2180 |
self hasExtensions ifTrue:[ |
2181 |
s nextPutLine:' $(OUTDIR)extensions.$(O) \'. |
|
2182 |
]. |
|
9817 | 2183 |
s cr. |
2184 |
] |
|
2185 |
||
2186 |
" |
|
2187 |
bosch_dapasx_hw_schnittstellen_Definition generateObjects_make_dot_spec |
|
2188 |
DapasXProject generateObjects_make_dot_spec |
|
2189 |
stx_libbasic3 generateObjects_make_dot_spec |
|
2190 |
" |
|
2191 |
||
2192 |
"Created: / 09-08-2006 / 11:24:39 / fm" |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2193 |
"Modified: / 14-09-2006 / 16:21:46 / cg" |
9887 | 2194 |
! |
2195 |
||
2196 |
subProjectBmakeCalls |
|
2197 |
^ String streamContents:[:s | |
|
2198 |
self subProjects do:[:packageID | |
|
2199 |
s nextPutLine:'cd ', (self msdosPathToPackage:packageID from:(self package)). |
|
2200 |
s nextPutLine:'call bmake %1 %2'. |
|
2201 |
s nextPutLine:'cd ', (self msdosPathToPackage:(self package) from:packageID). |
|
9888 | 2202 |
s cr. |
9887 | 2203 |
] |
2204 |
] |
|
2205 |
||
2206 |
"Created: / 14-09-2006 / 18:40:09 / cg" |
|
9888 | 2207 |
"Modified: / 14-09-2006 / 19:46:57 / cg" |
9817 | 2208 |
! ! |
2209 |
||
9575 | 2210 |
!ProjectDefinition class methodsFor:'private'! |
9536 | 2211 |
|
9627 | 2212 |
classNamesAndAttributesDo: aBlock |
2213 |
self namesAndAttributesIn:(self classNamesAndAttributes) do: aBlock |
|
2214 |
||
2215 |
"Modified: / 22-08-2006 / 18:20:21 / cg" |
|
9607 | 2216 |
! |
2217 |
||
9664 | 2218 |
compile:someCode categorized:category |
2219 |
Class packageQuerySignal |
|
2220 |
answer:self package |
|
2221 |
do:[ |
|
2222 |
self theMetaclass compilerClass |
|
2223 |
compile:someCode |
|
2224 |
forClass:self theMetaclass |
|
2225 |
inCategory:category |
|
2226 |
notifying:nil |
|
2227 |
install:true |
|
2228 |
skipIfSame:true |
|
2229 |
silent:true. |
|
2230 |
] |
|
2231 |
||
2232 |
"Created: / 23-08-2006 / 14:36:53 / cg" |
|
2233 |
! |
|
2234 |
||
9627 | 2235 |
compiled_classes |
2236 |
^ self compiled_classNames collect:[:eachName| (Smalltalk at:eachName asSymbol)] |
|
2237 |
||
2238 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
2239 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
9536 | 2240 |
! |
2241 |
||
9627 | 2242 |
compiled_classesDo:aBlock |
2243 |
self compiled_classes do:aBlock. |
|
2244 |
||
2245 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
2246 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
2247 |
! |
|
2248 |
||
2249 |
compiled_classesForArchitecture:arch |
|
2250 |
^ (self compiled_classNamesForArchitecture:arch) collect:[:eachName| (Smalltalk at:eachName asSymbol)] |
|
2251 |
||
2252 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
2253 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
2254 |
! |
|
2255 |
||
2256 |
compiled_classes_common |
|
2257 |
^ self compiled_classNames_common collect:[:eachName| (Smalltalk at:eachName asSymbol)] |
|
2258 |
||
2259 |
"Created: / 09-08-2006 / 16:28:15 / fm" |
|
2260 |
"Modified: / 09-08-2006 / 18:02:28 / fm" |
|
9607 | 2261 |
! |
2262 |
||
9627 | 2263 |
cvsRevision |
2264 |
|rev| |
|
2265 |
||
2266 |
rev := self revision. |
|
2267 |
rev isNil ifTrue:[ |
|
2268 |
"not yet pubplished" |
|
2269 |
^ #( '0' '1' ) |
|
2270 |
]. |
|
2271 |
^ rev asCollectionOfSubstringsSeparatedBy:$. . |
|
2272 |
||
2273 |
" |
|
2274 |
self cvsRevision |
|
2275 |
stx_libbasic3 cvsRevision |
|
2276 |
" |
|
2277 |
||
2278 |
"Created: / 17-08-2006 / 20:19:03 / cg" |
|
9575 | 2279 |
! |
2280 |
||
9627 | 2281 |
inconsistency:message |
2282 |
Dialog warn:message |
|
9536 | 2283 |
|
9627 | 2284 |
" |
2285 |
self searchForNeverCompiledSuperclasses |
|
2286 |
DapasX_Datenbasis searchForNeverCompiledSuperclasses |
|
2287 |
" |
|
2288 |
||
2289 |
"Created: / 09-08-2006 / 16:32:31 / fm" |
|
9536 | 2290 |
! |
2291 |
||
9826
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2292 |
makeOSIncludesWith:fileSeparator from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2293 |
^ aString copy replaceAny:'/\' with:fileSeparator |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2294 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2295 |
" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2296 |
self makeOSIncludesWith:$/ from:'-I$(TOP)/foo/bar' |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2297 |
self makeOSIncludesWith:$\ from:'-I$(TOP)/foo/bar' |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2298 |
" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2299 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2300 |
"Created: / 06-09-2006 / 18:17:03 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2301 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2302 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2303 |
makeUnixIncludes:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2304 |
^ self makeOSIncludesWith:$/ from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2305 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2306 |
"Created: / 06-09-2006 / 18:16:19 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2307 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2308 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2309 |
makeWin32Includes:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2310 |
^ self makeOSIncludesWith:$\ from:aString |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2311 |
|
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2312 |
"Created: / 06-09-2006 / 18:16:13 / cg" |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2313 |
! |
8d5fe8462720
common localIncludes for all oses
Claus Gittinger <cg@exept.de>
parents:
9825
diff
changeset
|
2314 |
|
9627 | 2315 |
namesAndAttributesIn:aCollection do: aBlock |
2316 |
aCollection do:[:entry | |
|
2317 |
|className attributes| |
|
2318 |
||
2319 |
entry isArray ifFalse:[ |
|
2320 |
className := entry. |
|
2321 |
attributes := #(). |
|
2322 |
] ifTrue:[ |
|
2323 |
className := entry first. |
|
2324 |
attributes := entry copyFrom:2. |
|
2325 |
]. |
|
2326 |
aBlock value: className value: attributes |
|
2327 |
]. |
|
2328 |
||
2329 |
"Created: / 22-08-2006 / 18:20:09 / cg" |
|
9621 | 2330 |
! |
2331 |
||
9627 | 2332 |
searchForClasses |
2333 |
||
2334 |
^ (self searchForClassesWithProject: self package) |
|
2335 |
asOrderedCollection sort:[:a :b | a name < b name] |
|
2336 |
||
2337 |
" |
|
2338 |
self searchForClasses |
|
2339 |
" |
|
2340 |
||
2341 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
2342 |
"Created: / 17-08-2006 / 21:18:30 / cg" |
|
9536 | 2343 |
! |
2344 |
||
9627 | 2345 |
searchForClassesWithProject: aProjectID |
2346 |
||
2347 |
^ Smalltalk allClasses |
|
9829 | 2348 |
select:[:cls | (cls package = aProjectID) ]. |
9627 | 2349 |
|
2350 |
" |
|
2351 |
self searchForClassesWithProject: #'bosch:dapasx' |
|
2352 |
self searchForClassesWithProject: #'bosch:dapasx/datenbasis' |
|
2353 |
self searchForClassesWithProject: #'bosch:dapasx/kernel' |
|
2354 |
" |
|
2355 |
||
2356 |
"Created: / 07-08-2006 / 20:42:39 / fm" |
|
2357 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
2358 |
"Modified: / 16-08-2006 / 18:50:48 / User" |
|
9536 | 2359 |
! |
2360 |
||
9627 | 2361 |
searchForExtensions |
2362 |
^ self searchForExtensionsWithProject:self package |
|
2363 |
||
2364 |
" |
|
2365 |
self searchForExtensions |
|
2366 |
DapasXProject searchForExtensions |
|
2367 |
DapasX_Datenbasis searchForExtensions |
|
2368 |
" |
|
2369 |
||
2370 |
"Modified: / 09-08-2006 / 13:01:26 / fm" |
|
2371 |
"Created: / 17-08-2006 / 21:17:46 / cg" |
|
9575 | 2372 |
! |
2373 |
||
9627 | 2374 |
searchForExtensionsWithProject:aProjectID |
2375 |
"search for any class which has extensions from aProjectID. |
|
2376 |
Return the extension-methods" |
|
2377 |
||
2378 |
|methods| |
|
2379 |
||
9904 | 2380 |
methods := OrderedCollection new. |
9627 | 2381 |
Smalltalk allClassesDo:[:eachClass | |
2382 |
|classPackage| |
|
2383 |
||
2384 |
classPackage := eachClass package. |
|
2385 |
eachClass instAndClassMethodsDo:[:mthd | |
|
2386 |
mthd package ~= classPackage ifTrue:[ |
|
2387 |
mthd package = aProjectID ifTrue:[ |
|
2388 |
methods add:mthd |
|
2389 |
] |
|
2390 |
]. |
|
2391 |
]. |
|
2392 |
]. |
|
9904 | 2393 |
methods sort:[:m1 :m2 | m1 mclass name < m2 mclass name]. |
2394 |
methods sort:[:m1 :m2 | m2 mclass theNonMetaclass isSubclassOf:m1 mclass theNonMetaclass]. |
|
9627 | 2395 |
^ methods |
2396 |
||
2397 |
" |
|
2398 |
self searchForExtensionsWithProject:#'bosch:dapasx' |
|
2399 |
self searchForExtensionsWithProject:#'cg:oyster' |
|
2400 |
" |
|
2401 |
||
2402 |
"Created: / 17-08-2006 / 21:19:04 / cg" |
|
9904 | 2403 |
"Modified: / 15-09-2006 / 16:56:57 / cg" |
9536 | 2404 |
! |
2405 |
||
9627 | 2406 |
searchForProjectsWhichProvideHeaderFiles |
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2407 |
|addPackage myPackageID requiredPackages| |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2408 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2409 |
myPackageID := self package. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2410 |
requiredPackages := Set new. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2411 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2412 |
addPackage := |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2413 |
[:package | |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2414 |
(package ~= myPackageID) ifTrue:[ |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2415 |
true "(package startsWith:'stx:') not" ifTrue:[ |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2416 |
package ~= Project noProjectID ifTrue:[ |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2417 |
requiredPackages add:package. |
9627 | 2418 |
] |
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2419 |
] |
9627 | 2420 |
] |
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2421 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2422 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2423 |
self compiled_classesDo:[:cls | |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2424 |
cls allSuperclassesDo:[:eachSuperClass | |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2425 |
addPackage value:(eachSuperClass package) |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2426 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2427 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2428 |
cls privateClassesDo:[:eachPrivateClass | |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2429 |
eachPrivateClass allSuperclassesDo:[:eachSuperClass | |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2430 |
eachSuperClass isPrivate ifFalse:[ |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2431 |
addPackage value:(eachSuperClass package) |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2432 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2433 |
] |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2434 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2435 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2436 |
|
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2437 |
self extensionMethodNames pairWiseDo:[:className :selector | |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2438 |
|cls| |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2439 |
((cls := Smalltalk classNamed:className) notNil and:[cls isLoaded]) ifTrue:[ |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2440 |
addPackage value:(cls package) |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2441 |
] |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2442 |
]. |
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2443 |
^ requiredPackages |
9627 | 2444 |
|
9880 | 2445 |
" |
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2446 |
stx_libtool searchForProjectsWhichProvideHeaderFiles |
9880 | 2447 |
" |
9627 | 2448 |
|
2449 |
"Created: / 09-08-2006 / 16:26:37 / fm" |
|
9883
c641767d1483
include and dependency generation fixed
Claus Gittinger <cg@exept.de>
parents:
9880
diff
changeset
|
2450 |
"Modified: / 14-09-2006 / 17:06:34 / cg" |
9664 | 2451 |
! |
2452 |
||
9667 | 2453 |
searchForSiblingProjects |
2454 |
|myPackage myParentPackage| |
|
2455 |
||
2456 |
myPackage := self package asPackageId. |
|
2457 |
myParentPackage := myPackage parentPackage. |
|
2458 |
myParentPackage isNil ifTrue:[^ #() ]. |
|
2459 |
||
2460 |
^ Smalltalk allProjectIDs |
|
2461 |
select:[:projectID | |
|
2462 |
|thisPackage| |
|
2463 |
thisPackage := projectID asPackageId. |
|
2464 |
(thisPackage parentPackage = myParentPackage) |
|
2465 |
and:[ thisPackage ~= myPackage ]. |
|
2466 |
] |
|
2467 |
||
2468 |
" |
|
2469 |
self searchForSiblingProjects |
|
2470 |
bosch_dapasx_Application searchForSiblingProjects |
|
2471 |
stx_goodies_refactoryBrowser_changes searchForSiblingProjects |
|
2472 |
" |
|
2473 |
||
2474 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
2475 |
"Created: / 23-08-2006 / 15:06:12 / cg" |
|
2476 |
! |
|
2477 |
||
9664 | 2478 |
searchForSubProjects |
2479 |
|myPackage| |
|
2480 |
||
2481 |
myPackage := self package. |
|
2482 |
^ Smalltalk allProjectIDs select:[:projectID | |
|
2483 |
(projectID asPackageId parentPackage) = myPackage]. |
|
2484 |
||
2485 |
" |
|
2486 |
self searchForSubProjects |
|
2487 |
bosch_dapasx_Application searchForSubProjects |
|
2488 |
stx_goodies_refactoryBrowser_changes searchForSubProjects |
|
2489 |
" |
|
2490 |
||
2491 |
"Created: / 07-08-2006 / 20:42:39 / fm" |
|
2492 |
"Modified: / 07-08-2006 / 21:56:25 / fm" |
|
2493 |
"Modified: / 23-08-2006 / 15:11:50 / cg" |
|
2494 |
! |
|
2495 |
||
2496 |
setupForType:typeOrNil |
|
9714 | 2497 |
typeOrNil = GUIApplicationType ifTrue:[ |
9664 | 2498 |
self compile:'isGUIApplication\ ^ true' withCRs |
2499 |
categorized:'description'. |
|
2500 |
^ self |
|
2501 |
]. |
|
9714 | 2502 |
typeOrNil = NonGUIApplicationType ifTrue:[ |
9664 | 2503 |
self compile:'isGUIApplication\ ^ false' withCRs |
2504 |
categorized:'description'. |
|
2505 |
^ self |
|
2506 |
]. |
|
2507 |
^ self. |
|
2508 |
||
2509 |
"Created: / 23-08-2006 / 14:26:10 / cg" |
|
9536 | 2510 |
! ! |
2511 |
||
9585 | 2512 |
!ProjectDefinition class methodsFor:'queries'! |
2513 |
||
9627 | 2514 |
definitionClassForPackage: aPackageID |
2515 |
^ self definitionClassForPackage:aPackageID createIfAbsent:false |
|
2516 |
||
2517 |
"Modified: / 17-08-2006 / 14:33:35 / cg" |
|
9585 | 2518 |
! |
2519 |
||
9664 | 2520 |
definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent |
2521 |
^ self definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent projectType:nil |
|
2522 |
||
2523 |
"Modified: / 23-08-2006 / 14:29:15 / cg" |
|
2524 |
! |
|
2525 |
||
2526 |
definitionClassForPackage: aPackageID createIfAbsent: doCreateIfAbsent projectType:typeOrNil |
|
9627 | 2527 |
|packageDefinitionClassName class| |
2528 |
||
2529 |
packageDefinitionClassName := ProjectDefinition initialClassNameForDefinitionOf:aPackageID. |
|
2530 |
class := Smalltalk classNamed:packageDefinitionClassName. |
|
2531 |
class isNil ifTrue:[ |
|
2532 |
doCreateIfAbsent ifTrue:[ |
|
2533 |
class := self newForPackage:aPackageID. |
|
9664 | 2534 |
"setup before prerequisites are defined" |
2535 |
class setupForType:typeOrNil. |
|
9627 | 2536 |
]. |
9664 | 2537 |
] ifFalse:[ |
2538 |
typeOrNil notNil ifTrue:[ |
|
2539 |
class setupForType:typeOrNil. |
|
2540 |
]. |
|
9627 | 2541 |
]. |
2542 |
^ class |
|
2543 |
||
9664 | 2544 |
"Created: / 23-08-2006 / 14:29:21 / cg" |
2545 |
"Modified: / 23-08-2006 / 15:35:26 / cg" |
|
9585 | 2546 |
! |
2547 |
||
9664 | 2548 |
definitionClassForPackage:newProjectID projectType:typeOrNil createIfAbsent:createIfAbsent |
2549 |
^ (self definitionClassForType:typeOrNil) |
|
2550 |
definitionClassForPackage:newProjectID |
|
2551 |
createIfAbsent:createIfAbsent |
|
2552 |
projectType:typeOrNil |
|
9627 | 2553 |
|
9664 | 2554 |
"Created: / 23-08-2006 / 14:28:53 / cg" |
9627 | 2555 |
! |
2556 |
||
2557 |
definitionClassForType: type |
|
9714 | 2558 |
(type = GUIApplicationType) ifTrue:[ ^ ApplicationDefinition ]. |
2559 |
(type = NonGUIApplicationType) ifTrue:[ ^ ApplicationDefinition ]. |
|
2560 |
(type = LibraryType) ifTrue:[ ^ LibraryDefinition ]. |
|
9627 | 2561 |
(type = 'Application') ifTrue:[ ^ ApplicationDefinition ]. |
2562 |
self error. |
|
2563 |
||
2564 |
"Created: / 17-08-2006 / 14:46:28 / cg" |
|
9664 | 2565 |
"Modified: / 23-08-2006 / 13:49:27 / cg" |
9585 | 2566 |
! |
2567 |
||
9627 | 2568 |
hasAllClassesLoaded |
2569 |
|checkLoaded| |
|
2570 |
||
2571 |
checkLoaded := [:nm | |
|
2572 |
|cls| |
|
2573 |
||
2574 |
cls := Smalltalk classNamed:nm. |
|
2575 |
(cls isNil or:[cls isLoaded not]) ifTrue:[^ false ]. |
|
2576 |
]. |
|
2577 |
self allClassNames do:checkLoaded. |
|
2578 |
OperatingSystem isUNIXlike ifTrue:[ |
|
2579 |
self compiled_classNames_unix do:checkLoaded. |
|
2580 |
] ifFalse:[ |
|
2581 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
2582 |
self compiled_classNames_windows do:checkLoaded. |
|
2583 |
] ifFalse:[ |
|
2584 |
self error:'unknown OS' |
|
2585 |
]. |
|
2586 |
]. |
|
2587 |
||
2588 |
^ true. |
|
2589 |
||
2590 |
"Created: / 17-08-2006 / 00:50:01 / cg" |
|
2591 |
"Modified: / 18-08-2006 / 13:44:31 / cg" |
|
9585 | 2592 |
! |
2593 |
||
9627 | 2594 |
hasAllExtensionsLoaded |
2595 |
self extensionMethodNames pairWiseDo:[:className :selector | |
|
2596 |
|cls| |
|
9585 | 2597 |
|
9627 | 2598 |
cls := Smalltalk at:className asSymbol. |
2599 |
(cls isNil or:[cls isLoaded not]) ifTrue:[^ false ]. |
|
2600 |
(cls compiledMethodAt:selector) isNil ifTrue:[^ false ]. |
|
2601 |
]. |
|
2602 |
^ true. |
|
2603 |
||
2604 |
"Created: / 17-08-2006 / 00:50:01 / cg" |
|
9850 | 2605 |
! |
2606 |
||
2607 |
hasExtensions |
|
2608 |
^ self extensionMethodNames notEmpty |
|
2609 |
||
2610 |
"Created: / 14-09-2006 / 14:19:35 / cg" |
|
9585 | 2611 |
! ! |
2612 |
||
9726 | 2613 |
!ProjectDefinition class methodsFor:'sanity checks'! |
2614 |
||
2615 |
validateDescription |
|
2616 |
! ! |
|
2617 |
||
9585 | 2618 |
!ProjectDefinition class methodsFor:'testing'! |
2619 |
||
9664 | 2620 |
isApplicationDefinition |
2621 |
"concrete i.e. not abstract" |
|
2622 |
||
2623 |
^ false |
|
2624 |
||
2625 |
"Created: / 23-08-2006 / 15:17:32 / cg" |
|
2626 |
! |
|
2627 |
||
2628 |
isLibraryDefinition |
|
2629 |
"concrete i.e. not abstract" |
|
2630 |
||
2631 |
^ false |
|
2632 |
||
2633 |
"Created: / 23-08-2006 / 15:17:46 / cg" |
|
2634 |
! |
|
2635 |
||
9627 | 2636 |
isProjectDefinition |
9664 | 2637 |
"concrete i.e. not abstract" |
2638 |
||
9627 | 2639 |
^ self ~~ ProjectDefinition |
2640 |
||
2641 |
"Created: / 10-08-2006 / 16:24:02 / cg" |
|
9664 | 2642 |
"Modified: / 23-08-2006 / 14:24:38 / cg" |
9585 | 2643 |
! ! |
2644 |
||
2645 |
!ProjectDefinition class methodsFor:'update description'! |
|
2646 |
||
9799 | 2647 |
classNamesAndAttributes_code_ignoreOldDefinition:ignoreOldDefinition |
9745 | 2648 |
^ String streamContents:[:s | |
2649 |
s nextPutLine:'classNamesAndAttributes'. |
|
2650 |
s nextPutLine:' ^ #('. |
|
2651 |
s tab; nextPutLine:'"/ <className> or (<className> attributes...)'. |
|
2652 |
self searchForClasses do:[:eachClass | |
|
9799 | 2653 |
|attributes oldSpecEntry| |
9745 | 2654 |
|
2655 |
(eachClass isLoaded not or:[eachClass isPrivate not]) ifTrue:[ |
|
9799 | 2656 |
ignoreOldDefinition ifFalse:[ |
2657 |
oldSpecEntry := self classNamesAndAttributes detect:[:entry | entry first = eachClass name] ifNone:nil. |
|
2658 |
]. |
|
2659 |
oldSpecEntry isNil ifTrue:[ |
|
9745 | 2660 |
eachClass isLoaded ifFalse:[ |
2661 |
attributes := #( autoload ). |
|
2662 |
]. |
|
2663 |
] ifFalse:[ |
|
9799 | 2664 |
attributes := oldSpecEntry copyFrom:2. |
9745 | 2665 |
]. |
9799 | 2666 |
|
9745 | 2667 |
s tab. |
2668 |
attributes isEmptyOrNil ifTrue:[ |
|
2669 |
s nextPutAll:eachClass name asString storeString. |
|
2670 |
] ifFalse:[ |
|
2671 |
s nextPutAll:'('; nextPutAll:eachClass name asString storeString. |
|
2672 |
attributes do:[:eachAttribute | s nextPutAll:' '. s nextPutAll:eachAttribute storeString.]. |
|
2673 |
s nextPutAll:')'. |
|
2674 |
]. |
|
2675 |
s cr. |
|
2676 |
] |
|
2677 |
]. |
|
2678 |
s nextPutLine:' )' |
|
2679 |
]. |
|
2680 |
||
2681 |
" |
|
2682 |
stx_libbasic3 classNamesAndAttributes_code |
|
2683 |
" |
|
2684 |
||
2685 |
"Modified: / 08-08-2006 / 19:24:34 / fm" |
|
2686 |
"Created: / 17-08-2006 / 21:03:07 / cg" |
|
9848 | 2687 |
"Modified: / 14-09-2006 / 10:52:40 / cg" |
9745 | 2688 |
! |
2689 |
||
9627 | 2690 |
companyName_code |
2691 |
^ String streamContents:[:s | |
|
2692 |
s nextPutLine:'companyName'. |
|
2693 |
s nextPutLine:' "Return a companyname which will appear in <lib>.rc"'. |
|
2694 |
s cr; nextPutLine:' ^ ',self companyName storeString. |
|
2695 |
]. |
|
2696 |
||
2697 |
" |
|
2698 |
self companyName_code |
|
2699 |
stx_libbasic3 companyName_code |
|
2700 |
" |
|
2701 |
||
2702 |
"Created: / 18-08-2006 / 16:20:42 / cg" |
|
9585 | 2703 |
! |
2704 |
||
9685 | 2705 |
compileDescriptionMethods |
2706 |
(self isLibraryDefinition |
|
2707 |
or:[ self isApplicationDefinition ] ) ifFalse:[ |
|
2708 |
self error:'I am abstract - must be a subclass of Libray- or ApplicationDefinition.' |
|
2709 |
]. |
|
2710 |
||
9824 | 2711 |
self |
2712 |
forEachMethodsCodeToCompileDo:[:code :category | |
|
2713 |
self compile:code categorized:category |
|
9685 | 2714 |
]. |
2715 |
||
9824 | 2716 |
"/ self instAndClassMethodsDo:[:m | m package:self package]. |
2717 |
||
9685 | 2718 |
" |
2719 |
DapasXProject compileDescriptionMethods |
|
2720 |
DapasX_Datenbasis compileDescriptionMethods |
|
2721 |
bosch_dapasx_interactiver_editor compileDescriptionMethods |
|
2722 |
stx_libbasic compileDescriptionMethods |
|
2723 |
" |
|
2724 |
||
2725 |
"Created: / 09-08-2006 / 18:00:31 / fm" |
|
9824 | 2726 |
"Modified: / 05-09-2006 / 13:46:29 / cg" |
9685 | 2727 |
! |
2728 |
||
9627 | 2729 |
description_code |
2730 |
^ String streamContents:[:s | |
|
2731 |
s nextPutLine:'description'. |
|
2732 |
s nextPutLine:' "Return a description string which will appear in nt.def / bc.def"'. |
|
9682 | 2733 |
s cr; nextPutLine:' ^ ',self description asString storeString. |
9627 | 2734 |
]. |
2735 |
||
2736 |
" |
|
2737 |
self description_code |
|
2738 |
stx_libbasic3 description_code |
|
2739 |
" |
|
2740 |
||
2741 |
"Created: / 17-08-2006 / 21:24:01 / cg" |
|
2742 |
"Modified: / 18-08-2006 / 16:16:24 / cg" |
|
9585 | 2743 |
! |
2744 |
||
9745 | 2745 |
extensionMethodNames_code |
2746 |
^ String streamContents:[:s | |
|
2747 |
s nextPutLine:'extensionMethodNames'. |
|
2748 |
s nextPutLine:' ^ #('. |
|
2749 |
self searchForExtensions do:[:eachMethod | |
|
2750 |
s nextPutAll:eachMethod mclass name storeString. |
|
2751 |
s nextPutAll:' '. |
|
2752 |
s nextPutLine: eachMethod selector storeString. |
|
2753 |
]. |
|
2754 |
s nextPutLine:' )' |
|
2755 |
]. |
|
2756 |
||
2757 |
" |
|
2758 |
self extensionMethodNames_code |
|
2759 |
" |
|
2760 |
||
2761 |
"Created: / 17-08-2006 / 21:21:48 / cg" |
|
2762 |
! |
|
2763 |
||
9904 | 2764 |
forEachContentsMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition |
2765 |
aTwoArgBlock |
|
2766 |
value:(self classNamesAndAttributes_code_ignoreOldDefinition:ignoreOldDefinition) |
|
2767 |
value:'description - contents'. |
|
2768 |
||
2769 |
aTwoArgBlock |
|
2770 |
value: self extensionMethodNames_code |
|
2771 |
value: 'description - contents'. |
|
2772 |
||
2773 |
"Created: / 15-09-2006 / 16:47:54 / cg" |
|
2774 |
! |
|
2775 |
||
9627 | 2776 |
forEachMethodsCodeToCompileDo:aTwoArgBlock |
9799 | 2777 |
self forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:false |
2778 |
! |
|
2779 |
||
2780 |
forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition |
|
9745 | 2781 |
aTwoArgBlock |
9799 | 2782 |
value:(self classNamesAndAttributes_code_ignoreOldDefinition:ignoreOldDefinition) |
9745 | 2783 |
value:'description - contents'. |
2784 |
||
2785 |
aTwoArgBlock |
|
2786 |
value: self extensionMethodNames_code |
|
2787 |
value: 'description - contents'. |
|
2788 |
||
9817 | 2789 |
(self class implements:#description) ifFalse:[ |
9627 | 2790 |
aTwoArgBlock |
2791 |
value: self description_code |
|
2792 |
value: 'description - project information'. |
|
2793 |
]. |
|
9817 | 2794 |
(self class implements:#productName) ifFalse:[ |
9627 | 2795 |
aTwoArgBlock |
2796 |
value: self productName_code |
|
2797 |
value: 'description - project information'. |
|
2798 |
]. |
|
9817 | 2799 |
(self class implements:#companyName) ifFalse:[ |
9627 | 2800 |
aTwoArgBlock |
2801 |
value: self companyName_code |
|
2802 |
value: 'description - project information'. |
|
2803 |
]. |
|
9817 | 2804 |
(self class implements:#legalCopyright) ifFalse:[ |
9627 | 2805 |
aTwoArgBlock |
2806 |
value: self legalCopyright_code |
|
2807 |
value: 'description - project information'. |
|
2808 |
]. |
|
2809 |
||
2810 |
"Created: / 18-08-2006 / 16:22:37 / cg" |
|
9817 | 2811 |
"Modified: / 30-08-2006 / 19:04:11 / cg" |
9585 | 2812 |
! |
2813 |
||
9627 | 2814 |
legalCopyright_code |
2815 |
^ String streamContents:[:s | |
|
2816 |
s nextPutLine:'legalCopyright'. |
|
9683 | 2817 |
s nextPutLine:' "Return a copyright string which will appear in <lib>.rc"'. |
9627 | 2818 |
s cr; nextPutLine:' ^ ',self legalCopyright storeString. |
2819 |
]. |
|
2820 |
||
2821 |
" |
|
2822 |
self legalCopyright_code |
|
2823 |
stx_libbasic3 legalCopyright_code |
|
2824 |
" |
|
2825 |
||
2826 |
"Created: / 18-08-2006 / 16:21:01 / cg" |
|
9585 | 2827 |
! |
2828 |
||
9627 | 2829 |
productName_code |
2830 |
^ String streamContents:[:s | |
|
2831 |
s nextPutLine:'productName'. |
|
2832 |
s nextPutLine:' "Return a product name which will appear in <lib>.rc"'. |
|
2833 |
s cr; nextPutLine:' ^ ',self productName storeString. |
|
2834 |
]. |
|
2835 |
||
2836 |
" |
|
2837 |
self productName_code |
|
2838 |
stx_libbasic3 productName_code |
|
2839 |
" |
|
2840 |
||
2841 |
"Created: / 18-08-2006 / 16:14:19 / cg" |
|
9585 | 2842 |
! ! |
2843 |
||
9569 | 2844 |
!ProjectDefinition class methodsFor:'documentation'! |
9536 | 2845 |
|
2846 |
version |
|
9904 | 2847 |
^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.64 2006-09-15 14:57:04 cg Exp $' |
9536 | 2848 |
! ! |
9714 | 2849 |
|
2850 |
ProjectDefinition initialize! |