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