author | Claus Gittinger <cg@exept.de> |
Tue, 04 Sep 2012 00:34:29 +0200 | |
changeset 2911 | e12e4a47cfaa |
parent 2909 | da16870432b5 |
child 2912 | 6e62954c5f35 |
permissions | -rw-r--r-- |
2741 | 1 |
" |
2 |
COPYRIGHT (c) 2009 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 |
" |
|
2596 | 12 |
"{ Package: 'stx:libtool2' }" |
13 |
||
2635 | 14 |
"{ NameSpace: Tools }" |
15 |
||
2596 | 16 |
Object subclass:#ProjectBuilder |
17 |
instanceVariableNames:'package projectDefinitionClass sourceCodeManager buildDirectory |
|
2673 | 18 |
myWorkingDirectory mySTXTopDirectory myTopDirectory outputStream |
2680 | 19 |
makeExeOnly usedCompiler' |
2596 | 20 |
classVariableNames:'PreviousBuildDirectory' |
21 |
poolDictionaries:'' |
|
22 |
category:'System-Support-Projects' |
|
23 |
! |
|
24 |
||
2741 | 25 |
!ProjectBuilder class methodsFor:'documentation'! |
26 |
||
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 2009 by eXept Software AG |
|
30 |
All Rights Reserved |
|
31 |
||
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! ! |
|
2596 | 40 |
|
2633 | 41 |
!ProjectBuilder class methodsFor:'accessing'! |
42 |
||
43 |
previousBuildDirectory |
|
44 |
^ PreviousBuildDirectory |
|
45 |
! |
|
46 |
||
47 |
previousBuildDirectory:something |
|
48 |
PreviousBuildDirectory := something. |
|
49 |
! ! |
|
50 |
||
2596 | 51 |
!ProjectBuilder class methodsFor:'examples'! |
52 |
||
2644 | 53 |
example1 |
54 |
Smalltalk loadPackage:'stx:projects/helloWorldApp' asAutoloaded:true. |
|
55 |
||
56 |
self new |
|
57 |
package:'stx:projects/helloWorldApp'; |
|
58 |
build |
|
2622 | 59 |
! |
60 |
||
2644 | 61 |
example2 |
62 |
|builder| |
|
63 |
||
64 |
Smalltalk loadPackage:'stx:clients/Demos/foxCalcApplication' asAutoloaded:true. |
|
65 |
||
66 |
builder := self new. |
|
2909 | 67 |
builder |
68 |
package:'stx:clients/Demos/foxCalcApplication'; |
|
69 |
build. |
|
2644 | 70 |
|
71 |
UserPreferences fileBrowserClass openOnDirectory:builder packageBuildDirectory. |
|
2909 | 72 |
|
73 |
"Modified: / 03-09-2012 / 19:23:53 / cg" |
|
2596 | 74 |
! ! |
75 |
||
2873 | 76 |
!ProjectBuilder class methodsFor:'queries'! |
77 |
||
78 |
defaultUsedCompiler |
|
79 |
|compiler| |
|
80 |
||
81 |
(compiler := UserPreferences current usedCompilerForBuild) notNil ifTrue:[ |
|
82 |
^ compiler |
|
83 |
]. |
|
84 |
||
85 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
86 |
^ 'bcc' |
|
87 |
]. |
|
88 |
^ 'gcc' |
|
89 |
||
90 |
"Created: / 21-01-2012 / 14:06:51 / cg" |
|
91 |
! |
|
92 |
||
93 |
listOfPossibleCompilers |
|
94 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
2909 | 95 |
^ #('bcc' 'vc' 'tcc' 'lcc' 'gcc' ) |
2873 | 96 |
]. |
97 |
^ #('gcc') |
|
98 |
||
99 |
"Created: / 21-01-2012 / 14:04:15 / cg" |
|
100 |
! ! |
|
101 |
||
2596 | 102 |
!ProjectBuilder methodsFor:'accessing'! |
103 |
||
2644 | 104 |
buildDirectory |
105 |
^ buildDirectory |
|
2622 | 106 |
! |
107 |
||
2634 | 108 |
buildDirectory:something |
109 |
buildDirectory := something. |
|
110 |
! |
|
111 |
||
2673 | 112 |
makeExeOnly:aBoolean |
113 |
makeExeOnly := aBoolean. |
|
114 |
! |
|
115 |
||
2644 | 116 |
package:aPackageIDOrSymbol |
117 |
package := aPackageIDOrSymbol asPackageId. |
|
2596 | 118 |
! |
119 |
||
2644 | 120 |
packageBuildDirectory |
121 |
"the directoray, where the deployable binary is created (xxxSetup.exe)" |
|
2622 | 122 |
|
123 |
^ buildDirectory / (package asPackageId module) / (package asPackageId directory) |
|
2635 | 124 |
! |
125 |
||
2644 | 126 |
projectDefinitionClass:something |
127 |
projectDefinitionClass := something. |
|
2680 | 128 |
! |
129 |
||
2683 | 130 |
suffixForHeaderFiles |
131 |
^ OperatingSystem isUNIXlike ifTrue:['.H'] ifFalse:['.STH'] |
|
132 |
! |
|
133 |
||
2873 | 134 |
usedCompilerForBuild:something |
2680 | 135 |
usedCompiler := something. |
2873 | 136 |
|
137 |
"Created: / 22-01-2012 / 10:50:48 / cg" |
|
2596 | 138 |
! ! |
139 |
||
140 |
!ProjectBuilder methodsFor:'building'! |
|
141 |
||
2644 | 142 |
build |
143 |
"/ intermediate - this will move into a commonly used utility class |
|
2635 | 144 |
"/ (where all the project code support will be collected). |
145 |
||
2647 | 146 |
|makeOutput| |
147 |
||
148 |
makeOutput := TextStream on:(Text new:10000). |
|
149 |
self buildWithColorizedOutputTo:makeOutput. |
|
150 |
||
151 |
TextView openWith:makeOutput contents. |
|
152 |
! |
|
153 |
||
154 |
buildWithColorizedOutputTo:makeOutput |
|
155 |
"/ intermediate - this will move into a commonly used utility class |
|
156 |
"/ (where all the project code support will be collected). |
|
157 |
||
158 |
|stdOut stdErr lock| |
|
2635 | 159 |
|
2644 | 160 |
lock := Semaphore forMutualExclusion. |
2647 | 161 |
|
2644 | 162 |
stdErr := ActorStream new |
163 |
nextPutBlock:[:char | |
|
164 |
lock critical:[ |
|
165 |
makeOutput emphasis:{#backgroundColor->Color red. #color->Color white.}. |
|
166 |
makeOutput nextPut:char. |
|
167 |
makeOutput emphasis:nil. |
|
168 |
] |
|
169 |
]; |
|
2683 | 170 |
nextPutAllBlock:[:string | |
2873 | 171 |
lock critical:[ |
172 |
"/ (string includesString:'das Ziel' )ifTrue:[self halt]. |
|
2644 | 173 |
makeOutput emphasis:{#backgroundColor->Color red. #color->Color white.}. |
2683 | 174 |
makeOutput nextPutAll:string. |
2644 | 175 |
makeOutput emphasis:nil. |
176 |
] |
|
177 |
]. |
|
178 |
stdOut := ActorStream new |
|
179 |
nextPutBlock:[:char | |
|
180 |
lock critical:[ |
|
181 |
makeOutput nextPut:char. |
|
182 |
] |
|
183 |
]; |
|
2683 | 184 |
nextPutAllBlock:[:string | |
2873 | 185 |
lock critical:[ |
186 |
"/ (string includesString:'das Ziel' )ifTrue:[self halt]. |
|
2683 | 187 |
makeOutput nextPutAll:string. |
2644 | 188 |
] |
189 |
]. |
|
2635 | 190 |
|
2644 | 191 |
self buildWithOutputTo:stdOut errorTo:stdErr. |
2873 | 192 |
|
193 |
"Modified: / 21-01-2012 / 13:49:13 / cg" |
|
2611 | 194 |
! |
195 |
||
196 |
buildWithOutputTo:stdOut errorTo:stdErr |
|
197 |
"/ intermediate - this will move into a commonly used utility class |
|
198 |
"/ (where all the project code support will be collected). |
|
199 |
||
2596 | 200 |
|module directory| |
201 |
||
202 |
projectDefinitionClass := ProjectDefinition definitionClassForPackage:package. |
|
203 |
projectDefinitionClass isNil ifTrue:[ |
|
204 |
self error:('Missing ProjectDefinition class for "',package asString,'"') |
|
205 |
]. |
|
206 |
||
207 |
"/ ensure that everything is loaded... |
|
208 |
projectDefinitionClass loadAsAutoloaded:false. |
|
209 |
projectDefinitionClass loadExtensions. |
|
210 |
projectDefinitionClass loadAllClassesAsAutoloaded:false. |
|
211 |
||
212 |
module := package module. |
|
213 |
directory := package directory. |
|
214 |
||
215 |
buildDirectory isNil ifTrue:[ |
|
2634 | 216 |
buildDirectory := PreviousBuildDirectory ifNil:[ UserPreferences current buildDirectory ]. |
217 |
buildDirectory isNil ifTrue:[ |
|
218 |
buildDirectory := Filename tempDirectory construct:'stx_build'. |
|
219 |
]. |
|
2596 | 220 |
]. |
221 |
buildDirectory := buildDirectory asFilename. |
|
222 |
||
223 |
"/ self validateBuildDirectoryIsPresent. |
|
224 |
||
225 |
PreviousBuildDirectory := buildDirectory. |
|
226 |
||
227 |
"/ UserPreferences current localBuild:true |
|
228 |
UserPreferences current localBuild ifFalse:[ |
|
229 |
SourceCodeManager notNil ifTrue:[ |
|
2861
b8c6e02e60a1
Do not call obsolete methods in SourceCodeManager class
Stefan Vogel <sv@exept.de>
parents:
2852
diff
changeset
|
230 |
sourceCodeManager := SourceCodeManagerUtilities default sourceCodeManagerFor:projectDefinitionClass. |
2596 | 231 |
] |
232 |
]. |
|
233 |
sourceCodeManager := nil. |
|
234 |
||
2598 | 235 |
myTopDirectory := |
2596 | 236 |
Smalltalk packagePath |
237 |
detect:[:aPath | |
|
238 |
(aPath asFilename / 'stx' / 'include') exists |
|
239 |
and: [ (aPath asFilename / 'stx' / 'rules') exists ]] |
|
240 |
ifNone:nil. |
|
2598 | 241 |
myTopDirectory isNil ifTrue:[ |
242 |
self error:('Cannot figure out my top directory (where stx/include and stx/rules are)') |
|
2596 | 243 |
]. |
2598 | 244 |
myTopDirectory := myTopDirectory asFilename. |
245 |
mySTXTopDirectory := myTopDirectory / 'stx'. |
|
2613
b8d38caaa884
changed: #buildWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
246 |
|
2596 | 247 |
self setupBuildDirectory. |
2628 | 248 |
self activityNotification:'Generating stc directory...'. |
2599 | 249 |
self copySTCDirectoryForBuild. |
2628 | 250 |
self activityNotification:'Generating source files...'. |
2596 | 251 |
self generateSourceFiles. |
2672
a1cda5d8943d
changed: #buildWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents:
2647
diff
changeset
|
252 |
self activityNotification:'Copying dlls for linkage...'. |
2600 | 253 |
self copyDLLsForLinkage. |
2672
a1cda5d8943d
changed: #buildWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents:
2647
diff
changeset
|
254 |
self activityNotification:'Copying support files for linkage...'. |
2600 | 255 |
self copySupportFilesForLinkage. |
256 |
self copyStartupFilesFromSmalltalk. |
|
2596 | 257 |
|
2628 | 258 |
self activityNotification:'Executing make...'. |
2611 | 259 |
self makeWithOutputTo:stdOut errorTo:stdErr. |
2898 | 260 |
! ! |
261 |
||
262 |
!ProjectBuilder methodsFor:'building/private'! |
|
2596 | 263 |
|
2644 | 264 |
copyDLLsForLinkage |
2911 | 265 |
|targetBuildDir preRequisites dllRelativeSourcePathes dllRelativeDestPathes| |
2723 | 266 |
|
2644 | 267 |
|
268 |
targetBuildDir := buildDirectory / package module / package directory. |
|
269 |
||
2723 | 270 |
preRequisites := projectDefinitionClass allPreRequisites. |
271 |
OperatingSystem isUNIXlike ifTrue:[ |
|
272 |
"For now: unix Makefiles require some libs implicitely..." |
|
273 |
preRequisites := preRequisites union:#( |
|
274 |
'stx:goodies/refactoryBrowser/parser' |
|
275 |
'stx:libtool' |
|
276 |
). |
|
277 |
]. |
|
278 |
||
279 |
preRequisites do:[:eachPackageToFileout | |
|
2644 | 280 |
|packageId packageDef packageModule packageDirectory packageTargetDir |
2911 | 281 |
dllSource dllSourceDir libraryName dllRelativePathSource |
282 |
dllRelativePathDest objDirSource objDirDest| |
|
2644 | 283 |
|
284 |
packageId := eachPackageToFileout asPackageId. |
|
285 |
packageModule := packageId module. |
|
286 |
packageDirectory := packageId directory. |
|
287 |
packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory. |
|
288 |
||
289 |
packageDef := packageId projectDefinitionClass. |
|
290 |
libraryName := packageDef libraryName. |
|
291 |
||
292 |
"/ mhmh - take them from my tree or from the projects/smalltalk execution directory ?? |
|
293 |
dllSourceDir := myTopDirectory / packageModule / packageDirectory. |
|
2909 | 294 |
|
2644 | 295 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
2911 | 296 |
objDirDest := self objDirForUsedCompiler:usedCompiler. |
297 |
"/ use visual-c files for tcc linkage |
|
298 |
usedCompiler = 'tcc' ifTrue:[ |
|
299 |
objDirSource := self objDirForUsedCompiler:'vc'. |
|
300 |
] ifFalse:[ |
|
301 |
objDirSource := objDirDest |
|
302 |
]. |
|
2905 | 303 |
"/ dllRelativePath := objDir,'/',(libraryName,'.dll'). |
2644 | 304 |
"/ (dllSourceDir / dllRelativePath) exists |
2911 | 305 |
dllRelativeSourcePathes := Array with:(objDirSource,'\', libraryName, '.dll'). |
306 |
dllRelativeDestPathes := Array with:(objDirDest,'\', libraryName, '.dll'). |
|
2644 | 307 |
] ifFalse:[ |
2911 | 308 |
dllRelativeSourcePathes := Array with:(libraryName,'.so'). |
2723 | 309 |
(packageModule = 'stx' and:[packageDirectory = 'libview']) ifTrue:[ |
2911 | 310 |
dllRelativeSourcePathes := dllRelativeSourcePathes, #('XWorkstation.so' 'GLXWorkstation.so'). |
2723 | 311 |
]. |
2644 | 312 |
]. |
2911 | 313 |
dllRelativeSourcePathes with:dllRelativeDestPathes do:[:dllRelativeSourcePath :dllRelativeDestPath| |
2896
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
314 |
|source dest| |
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
315 |
|
2911 | 316 |
source := dllSourceDir / dllRelativeSourcePath. |
317 |
dest := packageTargetDir / dllRelativeDestPath. |
|
2896
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
318 |
(dest exists not |
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
319 |
or:[source fileSize ~= dest fileSize |
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
320 |
or:[source modificationTime >= dest modificationTime |
2723 | 321 |
"/ or:[ ((dllSourceDir / dllRelativePath) sameContentsAs:(packageTargetDir / dllRelativePath)) not ] |
322 |
]]) ifTrue:[ |
|
2911 | 323 |
Transcript showCR:'updating ',dllRelativeDestPath. |
2896
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
324 |
dest directory recursiveMakeDirectory. |
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
325 |
source copyTo:dest. |
2723 | 326 |
]. |
327 |
]. |
|
2644 | 328 |
]. |
2896
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
329 |
|
2911 | 330 |
"Modified: / 04-09-2012 / 00:30:21 / cg" |
2644 | 331 |
! |
332 |
||
333 |
copyDirectory:relativepath |
|
334 |
"/ need rules in stx |
|
335 |
((Smalltalk projectDirectoryForPackage:'stx') asFilename construct:relativepath) |
|
336 |
recursiveCopyTo:(buildDirectory construct:'stx'). |
|
337 |
! |
|
338 |
||
339 |
copyDirectoryForBuild:subdir |
|
340 |
|targetDir targetFile| |
|
341 |
||
342 |
targetDir := buildDirectory / 'stx' / subdir. |
|
343 |
targetDir exists ifFalse:[ |
|
344 |
targetDir makeDirectory. |
|
345 |
]. |
|
346 |
(mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile | |
|
347 |
eachFile isDirectory ifFalse:[ |
|
348 |
targetFile := targetDir / eachFile baseName. |
|
349 |
(targetFile exists not |
|
350 |
or:[ targetFile modificationTime < eachFile modificationTime ]) ifTrue:[ |
|
351 |
self activityNotification:'copying ',eachFile pathName,'...'. |
|
352 |
eachFile copyTo:(targetDir construct:eachFile baseName) |
|
353 |
] |
|
354 |
]. |
|
355 |
]. |
|
356 |
self activityNotification:nil |
|
357 |
! |
|
358 |
||
359 |
copyResourcesForPackage:aPackage |
|
360 |
|module directory| |
|
361 |
||
362 |
module := aPackage asPackageId module. |
|
363 |
directory := aPackage asPackageId directory. |
|
364 |
||
365 |
(myTopDirectory / module / directory / 'resources' ) exists ifTrue:[ |
|
366 |
(myTopDirectory / module / directory / 'resources' ) |
|
367 |
recursiveCopyTo:(buildDirectory / module / directory) |
|
368 |
]. |
|
369 |
(myTopDirectory / module / directory / 'styles' ) exists ifTrue:[ |
|
370 |
(myTopDirectory / module / directory / 'styles' ) |
|
371 |
recursiveCopyTo:(buildDirectory / module / directory) |
|
372 |
]. |
|
373 |
! |
|
374 |
||
375 |
copySTCDirectoryForBuild |
|
376 |
|targetDir stc files| |
|
377 |
||
378 |
targetDir := buildDirectory / 'stx' / 'stc'. |
|
379 |
targetDir exists ifFalse:[ targetDir makeDirectory ]. |
|
380 |
||
381 |
stc := OperatingSystem isMSWINDOWSlike |
|
382 |
ifTrue:[ 'stc.exe' ] |
|
383 |
ifFalse:[ 'stc' ]. |
|
384 |
||
385 |
files := #( ) copyWith:stc. |
|
386 |
||
387 |
files do:[:eachFile | |
|
388 |
|sourceFile targetFile| |
|
389 |
||
390 |
sourceFile := mySTXTopDirectory / 'stc' / eachFile. |
|
391 |
targetFile := targetDir / eachFile. |
|
392 |
(targetFile exists not |
|
393 |
or:[ targetFile modificationTime < sourceFile modificationTime ]) ifTrue:[ |
|
394 |
self activityNotification:'copying ',sourceFile pathName,'...'. |
|
395 |
sourceFile copyTo:targetFile |
|
396 |
]. |
|
397 |
]. |
|
2683 | 398 |
|
399 |
OperatingSystem isUNIXlike ifTrue:[ |
|
400 |
(targetDir / 'stc') makeExecutableForAll |
|
401 |
]. |
|
402 |
||
2644 | 403 |
self activityNotification:nil |
404 |
! |
|
405 |
||
406 |
copyStartupFilesFromSmalltalk |
|
407 |
(buildDirectory / 'stx' / 'projects/smalltalk' ) exists ifFalse:[ |
|
408 |
(buildDirectory / 'stx' / 'projects/smalltalk' ) recursiveMakeDirectory. |
|
409 |
]. |
|
410 |
||
2678
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
411 |
#( |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
412 |
'keyboard.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
413 |
'keyboardMacros.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
414 |
'display.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
415 |
'd_win32.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
416 |
'host.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
417 |
'h_win32.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
418 |
'smalltalk.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
419 |
'private.rc' |
2644 | 420 |
) do:[:fn | |
421 |
(myTopDirectory / 'stx' / 'projects/smalltalk' / fn) |
|
422 |
copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / fn) |
|
2678
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
423 |
]. |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
424 |
|
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
425 |
(myTopDirectory / 'stx' / 'doc/online/english/LICENCE_STX.html') |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
426 |
copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / 'LICENCE_STX.html'). |
2644 | 427 |
! |
428 |
||
429 |
copySupportFilesForLinkage |
|
430 |
|files| |
|
431 |
||
432 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
433 |
files := #( |
|
434 |
'librun/genDate.exe' |
|
435 |
'librun/main.c' |
|
2673 | 436 |
'projects/smalltalk/stx_16x16.ico' |
437 |
'projects/smalltalk/stx_32x32.ico' |
|
438 |
'projects/smalltalk/stx_splash.bmp' |
|
2644 | 439 |
). |
2905 | 440 |
|
441 |
usedCompiler = 'bcc' ifTrue:[ |
|
442 |
files := files , #( |
|
443 |
'librun/objbc/librun.dll' |
|
444 |
'support/win32/borland/cs3245.dll' |
|
445 |
'support/win32/X11.dll' |
|
446 |
'support/win32/Xext.dll' |
|
447 |
'libbc/librun.lib' |
|
448 |
'libbc/cs32i.lib' |
|
449 |
). |
|
450 |
]. |
|
451 |
usedCompiler = 'vc' ifTrue:[ |
|
452 |
files := files , #( |
|
453 |
'librun/objvc/librun.dll' |
|
454 |
'libvc/librun.lib' |
|
455 |
). |
|
456 |
]. |
|
2911 | 457 |
usedCompiler = 'tcc' ifTrue:[ |
458 |
files := files , #( |
|
459 |
'librun/objvc/librun.dll' |
|
460 |
'libvc/librun.lib' |
|
461 |
). |
|
462 |
]. |
|
2644 | 463 |
] ifFalse:[ |
464 |
files := #( |
|
465 |
'librun/main.c' |
|
466 |
'librun/librun.so' |
|
467 |
) |
|
468 |
]. |
|
2677
e2c24a1be97f
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2673
diff
changeset
|
469 |
files := files asOrderedCollection. |
e2c24a1be97f
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2673
diff
changeset
|
470 |
|
e2c24a1be97f
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2673
diff
changeset
|
471 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
e2c24a1be97f
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2673
diff
changeset
|
472 |
projectDefinitionClass applicationIconFileName notNil ifTrue:[ |
2678
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
473 |
files add:('projects/smalltalk/',projectDefinitionClass applicationIconFileName,'.ico') |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
474 |
]. |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
475 |
projectDefinitionClass splashFileName notNil ifTrue:[ |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
476 |
files add:('projects/smalltalk/',projectDefinitionClass splashFileName,'.bmp') |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
477 |
]. |
2677
e2c24a1be97f
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2673
diff
changeset
|
478 |
]. |
2644 | 479 |
|
480 |
files do:[:dllRelativePath | |
|
2684 | 481 |
(mySTXTopDirectory / dllRelativePath) exists ifTrue:[ |
482 |
((buildDirectory / 'stx' / dllRelativePath) exists |
|
483 |
and:[ (mySTXTopDirectory / dllRelativePath) fileSize = (buildDirectory / 'stx' / dllRelativePath) fileSize |
|
484 |
and:[ (mySTXTopDirectory / dllRelativePath) modificationTime < (buildDirectory / 'stx' / dllRelativePath) modificationTime |
|
485 |
"/ and:[ (mySTXTopDirectory / dllRelativePath) sameContentsAs:(targetBuildDir / dllRelativePath) ] |
|
486 |
]]) ifFalse:[ |
|
487 |
(buildDirectory / 'stx' / dllRelativePath) directory recursiveMakeDirectory. |
|
488 |
(mySTXTopDirectory / dllRelativePath) copyTo:(buildDirectory / 'stx' / dllRelativePath). |
|
489 |
] |
|
490 |
] ifFalse:[ |
|
491 |
self error:'Missing file: ',dllRelativePath printString mayProceed:true. |
|
492 |
]. |
|
2614 | 493 |
]. |
2873 | 494 |
|
2911 | 495 |
"Modified: / 04-09-2012 / 00:25:26 / cg" |
2600 | 496 |
! |
497 |
||
2644 | 498 |
createHeaderFileFor:aClass in:packageTargetDir |
499 |
|instVarList classInstVarList classVarList bindings superclassFilename |
|
500 |
template file newContents oldContents| |
|
501 |
||
502 |
instVarList := StringCollection new. |
|
503 |
aClass instVarNames do:[:v | |
|
504 |
instVarList add:('OBJ %1;' bindWith:v) |
|
505 |
]. |
|
506 |
classInstVarList := StringCollection new. |
|
507 |
aClass class instVarNames do:[:v | |
|
508 |
(v includes:$_) ifTrue:[self halt]. |
|
509 |
classInstVarList add:('OBJ %1;' bindWith:v) |
|
510 |
]. |
|
511 |
classVarList := StringCollection new. |
|
512 |
aClass classVarNames do:[:v | |
|
513 |
classVarList add:('extern OBJ %1_%2;' bindWith:aClass name with:v) |
|
514 |
]. |
|
2614 | 515 |
|
2644 | 516 |
bindings := Dictionary new. |
517 |
bindings at:'ClassName' put:aClass name. |
|
518 |
aClass superclass isNil ifTrue:[ |
|
519 |
bindings at:'SuperclassName' put:'-'. |
|
2852 | 520 |
bindings at:'SuperclassFileInclude' put:''. |
2644 | 521 |
] ifFalse:[ |
522 |
bindings at:'SuperclassName' put:aClass superclass name. |
|
523 |
bindings at:'SuperclassFileName' put:(superclassFilename := Smalltalk fileNameForClass:aClass superclass). |
|
524 |
bindings at:'SuperclassFileInclude' put:('#include "%1.STH"' bindWith:superclassFilename). |
|
525 |
]. |
|
526 |
bindings at:'InstVarList' put:instVarList asString. |
|
527 |
bindings at:'ClassVarList' put:classVarList asString. |
|
528 |
bindings at:'ClassInstVarList' put:classInstVarList asString. |
|
529 |
||
530 |
template := |
|
531 |
'/* This file was generated by ProjectBuilder. */ |
|
532 |
/* !!!!!!!! Do not change by hand !!!!!!!! */ |
|
533 |
||
534 |
/* Class: %(ClassName) */ |
|
535 |
/* Superclass: %(SuperclassName) */ |
|
536 |
||
537 |
%(SuperclassFileInclude) |
|
538 |
||
539 |
/* INDIRECTGLOBALS */ |
|
540 |
#ifdef _HEADER_INST_ |
|
541 |
%(InstVarList) |
|
542 |
#endif /* _HEADER_INST_ */ |
|
543 |
||
544 |
#ifdef _HEADER_CLASS_ |
|
545 |
%(ClassVarList) |
|
546 |
#endif /* _HEADER_CLASS_ */ |
|
547 |
||
548 |
#ifdef _HEADER_CLASSINST_ |
|
549 |
%(ClassInstVarList) |
|
550 |
#endif /* _HEADER_CLASSINST_ */ |
|
551 |
'. |
|
552 |
newContents := template bindWithArguments:bindings. |
|
2683 | 553 |
file := packageTargetDir asFilename / ((Smalltalk fileNameForClass:aClass),(self suffixForHeaderFiles)). |
2644 | 554 |
(file exists not |
555 |
or:[ (oldContents := file contents) ~= newContents ]) ifTrue:[ |
|
556 |
file contents: newContents. |
|
557 |
]. |
|
2852 | 558 |
|
559 |
"Modified: / 15-08-2011 / 14:58:46 / cg" |
|
2614 | 560 |
! |
561 |
||
2644 | 562 |
generateSourceFiles |
563 |
sourceCodeManager notNil ifTrue:[ |
|
564 |
"/ check out / generate files there |
|
565 |
self generateSourceFilesByCheckingOutUsing:sourceCodeManager |
|
566 |
] ifFalse:[ |
|
567 |
"/ local build |
|
568 |
"/ fileout the project |
|
569 |
self generateSourceFilesByFilingOut |
|
570 |
] |
|
2599 | 571 |
! |
572 |
||
2644 | 573 |
generateSourceFilesByCheckingOutUsing:aSourceCodeManager |
574 |
"/ will no longer be needed/supported |
|
575 |
||
576 |
|repository stxRepository module directory| |
|
577 |
||
2868
8a4d46fd157c
changed: #generateSourceFilesByCheckingOutUsing:
Claus Gittinger <cg@exept.de>
parents:
2861
diff
changeset
|
578 |
self breakPoint:#cg. |
8a4d46fd157c
changed: #generateSourceFilesByCheckingOutUsing:
Claus Gittinger <cg@exept.de>
parents:
2861
diff
changeset
|
579 |
|
2644 | 580 |
"/ check out / generate files there |
581 |
repository := (aSourceCodeManager repositoryNameForModule:module) ifNil:[aSourceCodeManager repositoryName]. |
|
582 |
stxRepository := aSourceCodeManager repositoryName. |
|
2600 | 583 |
|
2644 | 584 |
(buildDirectory construct:'stx') exists ifFalse:[ |
585 |
(module ~= 'stx') ifTrue:[ |
|
586 |
OperatingSystem |
|
587 |
executeCommand:('cvs -d ',stxRepository,' co stx') |
|
588 |
inputFrom:nil |
|
589 |
outputTo:Transcript |
|
590 |
errorTo:Transcript |
|
591 |
inDirectory:buildDirectory |
|
592 |
onError:[:status| self error:'cvs update stx failed']. |
|
593 |
]. |
|
594 |
]. |
|
2635 | 595 |
|
2644 | 596 |
((buildDirectory construct:module) construct:'CVS') exists ifFalse:[ |
597 |
OperatingSystem |
|
598 |
executeCommand:('cvs -d ',repository,' co -l ',directory) |
|
599 |
inputFrom:nil |
|
600 |
outputTo:Transcript |
|
601 |
errorTo:Transcript |
|
602 |
inDirectory:buildDirectory |
|
603 |
onError:[:status| self error:'cvs update failed']. |
|
604 |
]. |
|
605 |
OperatingSystem |
|
606 |
executeCommand:'cvs upd -d' |
|
607 |
inputFrom:nil |
|
608 |
outputTo:Transcript |
|
609 |
errorTo:Transcript |
|
610 |
inDirectory:(buildDirectory construct:module) |
|
611 |
onError:[:status| self error:'cvs update failed']. |
|
612 |
self halt. |
|
2868
8a4d46fd157c
changed: #generateSourceFilesByCheckingOutUsing:
Claus Gittinger <cg@exept.de>
parents:
2861
diff
changeset
|
613 |
|
8a4d46fd157c
changed: #generateSourceFilesByCheckingOutUsing:
Claus Gittinger <cg@exept.de>
parents:
2861
diff
changeset
|
614 |
"Modified: / 29-12-2011 / 14:02:56 / cg" |
2600 | 615 |
! |
616 |
||
2644 | 617 |
generateSourceFilesByFilingOut |
618 |
"/ local build |
|
619 |
"/ fileout the project |
|
620 |
||
2844
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
621 |
|fullPathName| |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
622 |
|
2644 | 623 |
(package module ~= 'stx') ifTrue:[ |
624 |
(buildDirectory / package module) makeDirectory. |
|
625 |
]. |
|
626 |
||
627 |
"/ file out the package(s) which are to be built |
|
628 |
((Array with:package)) |
|
629 |
do:[:eachPackageToFileout | |
|
630 |
|packageId packageModule packageDirectory packageTargetDir packageDef| |
|
631 |
||
632 |
packageId := eachPackageToFileout asPackageId. |
|
633 |
packageModule := packageId module. |
|
634 |
packageDirectory := packageId directory. |
|
635 |
packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory. |
|
636 |
||
637 |
packageDef := packageId projectDefinitionClass. |
|
638 |
(packageDef compiled_classNames_common , |
|
639 |
packageDef compiled_classNamesForPlatform) do:[:eachClassName | |
|
640 |
|cls fileName newSource| |
|
641 |
||
642 |
cls := Smalltalk classNamed:eachClassName. |
|
643 |
self assert:cls isLoaded. |
|
644 |
fileName := (Smalltalk fileNameForClass:cls),'.st'. |
|
645 |
fileName := packageTargetDir asFilename construct:fileName. |
|
646 |
fileName exists ifTrue:[ |
|
647 |
newSource := String streamContents:[:s | cls fileOutOn:s withTimeStamp:false]. |
|
648 |
newSource = fileName contentsAsString ifFalse:[ |
|
649 |
fileName contents:newSource |
|
650 |
]. |
|
651 |
] ifFalse:[ |
|
652 |
cls fileOutIn:packageTargetDir withTimeStamp:false |
|
653 |
]. |
|
654 |
]. |
|
2596 | 655 |
|
2644 | 656 |
"/ (Smalltalk allClassesInPackage:eachPackageToFileout) do:[:cls | |
657 |
"/ cls isPrivate ifFalse:[ |
|
658 |
"/ cls isLoaded ifFalse:[ |
|
659 |
"/ self halt. |
|
660 |
"/ cls autoload. |
|
661 |
"/ ]. |
|
662 |
"/ cls fileOutIn:packageTargetDir |
|
663 |
"/ ] |
|
664 |
"/ ]. |
|
665 |
||
666 |
projectDefinitionClass forEachFileNameAndGeneratedContentsDo:[:fileName :fileContents | |
|
2844
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
667 |
fullPathName := packageTargetDir construct:fileName. |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
668 |
fullPathName directory exists ifFalse:[ |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
669 |
"take care for files like 'autopackage/default.apspec'" |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
670 |
fullPathName directory makeDirectory. |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
671 |
]. |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
672 |
(fullPathName exists |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
673 |
and:[ fullPathName contents = fileContents ]) ifFalse:[ |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
674 |
fullPathName contents:fileContents. |
2644 | 675 |
]. |
676 |
]. |
|
677 |
]. |
|
2596 | 678 |
|
2644 | 679 |
"/ generate header files in prerequisite packages... |
680 |
(projectDefinitionClass allPreRequisites) |
|
681 |
do:[:eachPackageToFileout | |
|
682 |
|packageId packageDef packageModule packageDirectory packageTargetDir| |
|
683 |
||
684 |
packageId := eachPackageToFileout asPackageId. |
|
685 |
packageModule := packageId module. |
|
686 |
packageDirectory := packageId directory. |
|
687 |
packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory. |
|
688 |
||
689 |
packageDef := packageId projectDefinitionClass. |
|
690 |
(packageDef compiled_classNames_common , |
|
691 |
packageDef compiled_classNamesForPlatform) do:[:eachClassName | |
|
692 |
|cls| |
|
693 |
||
694 |
cls := Smalltalk classNamed:eachClassName. |
|
695 |
"/ self assert:cls isLoaded. |
|
696 |
cls isLoaded ifTrue:[ |
|
697 |
self createHeaderFileFor:cls in:packageTargetDir |
|
698 |
]. |
|
699 |
]. |
|
700 |
self copyResourcesForPackage:eachPackageToFileout. |
|
701 |
]. |
|
702 |
||
703 |
"/ stx_libbasic2 preRequisitesForBuilding#(#'stx:libbasic') |
|
2596 | 704 |
! |
705 |
||
2909 | 706 |
makeCommandOfCompiler:usedCompiler |
707 |
usedCompiler = 'bcc' ifTrue:[ |
|
708 |
^ 'bmake'. |
|
709 |
]. |
|
710 |
usedCompiler = 'vc' ifTrue:[ |
|
711 |
^ 'vcmake'. "/ compilerFlag := '-DUSEVC' |
|
712 |
]. |
|
713 |
usedCompiler = 'lcc' ifTrue:[ |
|
714 |
^ 'lccmake'. "/ compilerFlag := '-DUSELCC' |
|
715 |
]. |
|
716 |
usedCompiler = 'tcc' ifTrue:[ |
|
717 |
^ 'tccmake'. "/ compilerFlag := '-DUSELCC' |
|
718 |
]. |
|
719 |
usedCompiler = 'gcc' ifTrue:[ |
|
720 |
^ 'make'. |
|
721 |
]. |
|
722 |
usedCompiler = 'gcc' ifTrue:[ |
|
723 |
^ 'make'. |
|
724 |
]. |
|
725 |
self error:'unknown compiler specified'. |
|
726 |
||
727 |
"Created: / 03-09-2012 / 19:46:07 / cg" |
|
728 |
! |
|
729 |
||
2644 | 730 |
makeWithOutputTo:stdOut errorTo:stdErr |
2909 | 731 |
|module directory makeCommand| |
2644 | 732 |
|
733 |
module := package module. |
|
734 |
directory := package directory. |
|
735 |
||
2680 | 736 |
makeCommand := ParserFlags makeCommand. |
2895
2b939399b83b
changed: #makeWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents:
2873
diff
changeset
|
737 |
usedCompiler isNil ifTrue:[ |
2b939399b83b
changed: #makeWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents:
2873
diff
changeset
|
738 |
usedCompiler := ParserFlags usedCompiler. |
2b939399b83b
changed: #makeWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents:
2873
diff
changeset
|
739 |
]. |
2909 | 740 |
makeCommand := self makeCommandOfCompiler:usedCompiler. |
2873 | 741 |
|
2852 | 742 |
"/ makeCommand := makeCommand, ' TOP=', mySTXTopDirectory pathName. |
2680 | 743 |
|
2683 | 744 |
OperatingSystem isUNIXlike ifTrue:[ |
745 |
OperatingSystem |
|
2845
0d52c66fbc8e
changed: #makeWithOutputTo:errorTo:
Stefan Vogel <sv@exept.de>
parents:
2844
diff
changeset
|
746 |
executeCommand:('sh %1/rules/stmkmf' bindWith:mySTXTopDirectory pathName) |
2683 | 747 |
inputFrom:nil |
748 |
outputTo:stdOut |
|
749 |
errorTo:stdErr |
|
750 |
inDirectory:(buildDirectory / module / directory) |
|
751 |
onError:[:status| self error:'make failed']. |
|
752 |
]. |
|
753 |
||
2644 | 754 |
projectDefinitionClass isLibraryDefinition ifTrue:[ |
755 |
OperatingSystem |
|
2680 | 756 |
executeCommand:(makeCommand,' classLibRule') |
2644 | 757 |
inputFrom:nil |
758 |
outputTo:stdOut |
|
759 |
errorTo:stdErr |
|
760 |
inDirectory:(buildDirectory / module / directory) |
|
761 |
onError:[:status| self error:'make failed']. |
|
762 |
] ifFalse:[ |
|
763 |
OperatingSystem |
|
2680 | 764 |
executeCommand:(makeCommand,' exe') |
2644 | 765 |
inputFrom:nil |
766 |
outputTo:stdOut |
|
767 |
errorTo:stdErr |
|
768 |
inDirectory:(buildDirectory / module / directory) |
|
769 |
onError:[:status| self error:'make failed']. |
|
770 |
||
2673 | 771 |
(makeExeOnly ? false) ifFalse:[ |
772 |
OperatingSystem |
|
2680 | 773 |
executeCommand:(makeCommand,' setup') |
2673 | 774 |
inputFrom:nil |
775 |
outputTo:stdOut |
|
776 |
errorTo:stdErr |
|
777 |
inDirectory:(buildDirectory / module / directory) |
|
778 |
onError:[:status| self error:'make failed']. |
|
779 |
] |
|
2644 | 780 |
] |
2793 | 781 |
|
2909 | 782 |
"Modified: / 03-09-2012 / 19:47:15 / cg" |
2596 | 783 |
! |
784 |
||
2905 | 785 |
objDirForUsedCompiler |
2909 | 786 |
^ self objDirForUsedCompiler:usedCompiler |
787 |
||
788 |
"Created: / 20-08-2012 / 17:01:13 / cg" |
|
789 |
! |
|
790 |
||
791 |
objDirForUsedCompiler:usedCompiler |
|
2905 | 792 |
usedCompiler = 'bcc' ifTrue:[^ 'objbc']. |
793 |
usedCompiler = 'vc' ifTrue:[^ 'objvc']. |
|
2909 | 794 |
usedCompiler = 'tcc' ifTrue:[^ 'objtcc']. |
795 |
usedCompiler = 'lcc' ifTrue:[^ 'objlcc']. |
|
796 |
usedCompiler = 'gcc' ifTrue:[^ 'obj']. |
|
2905 | 797 |
self halt:'please fill in here'. |
798 |
^ 'objbc' |
|
799 |
||
2909 | 800 |
"Created: / 03-09-2012 / 19:55:34 / cg" |
2905 | 801 |
! |
802 |
||
2683 | 803 |
recursiveCopyDirectoryForBuild:subdir |
804 |
|targetDir| |
|
805 |
||
806 |
targetDir := buildDirectory / 'stx' / subdir. |
|
807 |
targetDir exists ifFalse:[ |
|
808 |
targetDir makeDirectory. |
|
809 |
]. |
|
810 |
(mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile | |
|
811 |
eachFile recursiveCopyTo:(targetDir construct:eachFile baseName) |
|
812 |
]. |
|
813 |
self activityNotification:nil |
|
814 |
! |
|
815 |
||
2644 | 816 |
setupBuildDirectory |
817 |
buildDirectory exists ifFalse:[ |
|
818 |
buildDirectory recursiveMakeDirectory. |
|
819 |
]. |
|
820 |
(buildDirectory / 'stx') exists ifFalse:[ |
|
821 |
(buildDirectory / 'stx') makeDirectory. |
|
822 |
]. |
|
823 |
||
824 |
self copyDirectoryForBuild:'include'. |
|
825 |
self copyDirectoryForBuild:'rules'. |
|
2683 | 826 |
OperatingSystem isUNIXlike ifTrue:[ |
827 |
self recursiveCopyDirectoryForBuild:'configurations'. |
|
828 |
] |
|
2611 | 829 |
! |
830 |
||
2644 | 831 |
validateBuildDirectoryIsPresent |
832 |
||
833 |
^ self. |
|
2596 | 834 |
|
2644 | 835 |
"/ [ |
836 |
"/ |default directoryIsOKForMe stc | |
|
837 |
"/ |
|
838 |
"/ default := (buildDirectory ? |
|
839 |
"/ PreviousBuildDirectory) |
|
840 |
"/ ifNil:[ UserPreferences current buildDirectory]. |
|
841 |
"/ |
|
842 |
"/ buildDirectory := Dialog requestDirectoryName:'Temporary Work-ROOT for build:' |
|
843 |
"/ default:default. |
|
844 |
"/ |
|
845 |
"/ buildDirectory isEmptyOrNil ifTrue:[^ self]. |
|
846 |
"/ buildDirectory := buildDirectory asFilename. |
|
847 |
"/ directoryIsOKForMe := true. |
|
848 |
"/ |
|
849 |
"/ buildDirectory exists ifFalse:[ |
|
850 |
"/ Dialog warn:(self classResources string:'Work directory %1 does not exist.' with:buildDirectory). |
|
851 |
"/ directoryIsOKForMe := false. |
|
852 |
"/ ] ifTrue:[ |
|
853 |
"/ (buildDirectory construct:'stx') exists ifFalse:[ |
|
854 |
"/ Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stx subDirectory,\which contains (at least) the stc and include subdirectories.'). |
|
855 |
"/ directoryIsOKForMe := false. |
|
856 |
"/ ] ifTrue:[ |
|
857 |
"/ stc := (OperatingSystem isMSDOSlike) ifTrue:['stc.exe'] ifFalse:['stc']. |
|
858 |
"/ (((buildDirectory construct:'stx')construct:'stc')construct:stc) exists ifFalse:[ |
|
859 |
"/ Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stc compiler in the stx/stc subDirectory.'). |
|
860 |
"/ directoryIsOKForMe := false. |
|
861 |
"/ ]. |
|
862 |
"/ ((buildDirectory construct:'stx')construct:'include') exists ifFalse:[ |
|
863 |
"/ Dialog warn:(self classResources stringWithCRs:'Work directory must have had a make run before (for include files to exists).'). |
|
864 |
"/ directoryIsOKForMe := false. |
|
865 |
"/ ]. |
|
866 |
"/ ] |
|
867 |
"/ ]. |
|
868 |
"/ directoryIsOKForMe |
|
869 |
"/ ] whileFalse |
|
2596 | 870 |
! ! |
871 |
||
872 |
!ProjectBuilder class methodsFor:'documentation'! |
|
873 |
||
2896
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
874 |
version |
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
875 |
^ '$Header$' |
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
876 |
! |
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
877 |
|
2596 | 878 |
version_CVS |
879 |
^ '$Header$' |
|
880 |
! ! |