cg@2741
|
1 |
"
|
cg@2741
|
2 |
COPYRIGHT (c) 2009 by eXept Software AG
|
cg@2741
|
3 |
All Rights Reserved
|
cg@2741
|
4 |
|
cg@2741
|
5 |
This software is furnished under a license and may be used
|
cg@2741
|
6 |
only in accordance with the terms of that license and with the
|
cg@2741
|
7 |
inclusion of the above copyright notice. This software may not
|
cg@2741
|
8 |
be provided or otherwise made available to, or used by, any
|
cg@2741
|
9 |
other person. No title to or ownership of the software is
|
cg@2741
|
10 |
hereby transferred.
|
cg@2741
|
11 |
"
|
cg@2596
|
12 |
"{ Package: 'stx:libtool2' }"
|
cg@2596
|
13 |
|
cg@2635
|
14 |
"{ NameSpace: Tools }"
|
cg@2635
|
15 |
|
cg@2596
|
16 |
Object subclass:#ProjectBuilder
|
cg@2596
|
17 |
instanceVariableNames:'package projectDefinitionClass sourceCodeManager buildDirectory
|
cg@2673
|
18 |
myWorkingDirectory mySTXTopDirectory myTopDirectory outputStream
|
cg@3127
|
19 |
makeExeOnly makeAppOnly makeQuick usedCompiler stdOut stdErr
|
cg@3127
|
20 |
isQuickBuild isLocalBuild'
|
cg@2596
|
21 |
classVariableNames:'PreviousBuildDirectory'
|
cg@2596
|
22 |
poolDictionaries:''
|
cg@2596
|
23 |
category:'System-Support-Projects'
|
cg@2596
|
24 |
!
|
cg@2596
|
25 |
|
cg@2741
|
26 |
!ProjectBuilder class methodsFor:'documentation'!
|
cg@2741
|
27 |
|
cg@2741
|
28 |
copyright
|
cg@2741
|
29 |
"
|
cg@2741
|
30 |
COPYRIGHT (c) 2009 by eXept Software AG
|
cg@2741
|
31 |
All Rights Reserved
|
cg@2741
|
32 |
|
cg@2741
|
33 |
This software is furnished under a license and may be used
|
cg@2741
|
34 |
only in accordance with the terms of that license and with the
|
cg@2741
|
35 |
inclusion of the above copyright notice. This software may not
|
cg@2741
|
36 |
be provided or otherwise made available to, or used by, any
|
cg@2741
|
37 |
other person. No title to or ownership of the software is
|
cg@2741
|
38 |
hereby transferred.
|
cg@2741
|
39 |
"
|
cg@2741
|
40 |
! !
|
cg@2596
|
41 |
|
cg@2633
|
42 |
!ProjectBuilder class methodsFor:'accessing'!
|
cg@2633
|
43 |
|
cg@2633
|
44 |
previousBuildDirectory
|
cg@2633
|
45 |
^ PreviousBuildDirectory
|
cg@2633
|
46 |
!
|
cg@2633
|
47 |
|
cg@2633
|
48 |
previousBuildDirectory:something
|
cg@2633
|
49 |
PreviousBuildDirectory := something.
|
cg@2633
|
50 |
! !
|
cg@2633
|
51 |
|
cg@2596
|
52 |
!ProjectBuilder class methodsFor:'examples'!
|
cg@2596
|
53 |
|
cg@2644
|
54 |
example1
|
cg@2644
|
55 |
Smalltalk loadPackage:'stx:projects/helloWorldApp' asAutoloaded:true.
|
cg@2644
|
56 |
|
cg@2644
|
57 |
self new
|
cg@2644
|
58 |
package:'stx:projects/helloWorldApp';
|
cg@2644
|
59 |
build
|
cg@2622
|
60 |
!
|
cg@2622
|
61 |
|
cg@2644
|
62 |
example2
|
cg@2644
|
63 |
|builder|
|
cg@2644
|
64 |
|
cg@2644
|
65 |
Smalltalk loadPackage:'stx:clients/Demos/foxCalcApplication' asAutoloaded:true.
|
cg@2644
|
66 |
|
cg@2644
|
67 |
builder := self new.
|
cg@2909
|
68 |
builder
|
cg@2909
|
69 |
package:'stx:clients/Demos/foxCalcApplication';
|
cg@2909
|
70 |
build.
|
cg@2644
|
71 |
|
cg@2644
|
72 |
UserPreferences fileBrowserClass openOnDirectory:builder packageBuildDirectory.
|
cg@2909
|
73 |
|
cg@2909
|
74 |
"Modified: / 03-09-2012 / 19:23:53 / cg"
|
cg@2596
|
75 |
! !
|
cg@2596
|
76 |
|
cg@2873
|
77 |
!ProjectBuilder class methodsFor:'queries'!
|
cg@2873
|
78 |
|
cg@2873
|
79 |
defaultUsedCompiler
|
cg@2873
|
80 |
|compiler|
|
cg@2873
|
81 |
|
cg@2873
|
82 |
(compiler := UserPreferences current usedCompilerForBuild) notNil ifTrue:[
|
cg@2873
|
83 |
^ compiler
|
cg@2873
|
84 |
].
|
cg@2873
|
85 |
|
cg@3006
|
86 |
^ ParserFlags usedCompiler
|
cg@2873
|
87 |
!
|
cg@2873
|
88 |
|
cg@2873
|
89 |
listOfPossibleCompilers
|
cg@2873
|
90 |
OperatingSystem isMSWINDOWSlike ifTrue:[
|
cg@2918
|
91 |
OperatingSystem getLoginName = 'cg' ifTrue:[
|
cg@2921
|
92 |
^ #(
|
cg@2921
|
93 |
'bcc' "/ OK
|
cg@2921
|
94 |
'vc' "/ almost OK
|
cg@2921
|
95 |
'lcc' "/ experimental, but only free for non-commercial work
|
cg@2921
|
96 |
'tcc' "/ experimental; limited but free
|
cg@2921
|
97 |
'mingw' "/ experimental; free
|
cg@2921
|
98 |
)
|
cg@2918
|
99 |
].
|
cg@2972
|
100 |
^ #('bcc' 'vc' 'mingw' )
|
cg@2873
|
101 |
].
|
cg@2873
|
102 |
^ #('gcc')
|
cg@2873
|
103 |
|
cg@2873
|
104 |
"Created: / 21-01-2012 / 14:04:15 / cg"
|
cg@2921
|
105 |
!
|
cg@2921
|
106 |
|
cg@2921
|
107 |
suiteNameOfCompiler:usedCompiler
|
cg@2921
|
108 |
usedCompiler = 'bcc' ifTrue:[
|
cg@2921
|
109 |
^ 'Borland C-Compiler'.
|
cg@2921
|
110 |
].
|
cg@2921
|
111 |
usedCompiler = 'vc' ifTrue:[
|
cg@2974
|
112 |
^ 'Microsoft Visual C Compiler'.
|
cg@2921
|
113 |
].
|
cg@2921
|
114 |
usedCompiler = 'lcc' ifTrue:[
|
cg@2921
|
115 |
^ 'LCC C-Compiler'.
|
cg@2921
|
116 |
].
|
cg@2921
|
117 |
usedCompiler = 'tcc' ifTrue:[
|
cg@2921
|
118 |
^ 'Tiny C-Compiler'.
|
cg@2921
|
119 |
].
|
cg@2921
|
120 |
usedCompiler = 'gcc' ifTrue:[
|
cg@2921
|
121 |
^ 'GNU C-Compiler'.
|
cg@2921
|
122 |
].
|
cg@2921
|
123 |
usedCompiler = 'mingw' ifTrue:[
|
cg@2921
|
124 |
^ 'MINGW GNU C-Compiler'.
|
cg@2921
|
125 |
].
|
cg@2921
|
126 |
self halt:'unknown compiler'.
|
cg@2921
|
127 |
|
cg@2921
|
128 |
^ 'C-Compiler'.
|
cg@2921
|
129 |
|
cg@2921
|
130 |
"Created: / 06-09-2012 / 15:58:33 / cg"
|
cg@2873
|
131 |
! !
|
cg@2873
|
132 |
|
cg@2596
|
133 |
!ProjectBuilder methodsFor:'accessing'!
|
cg@2596
|
134 |
|
cg@2644
|
135 |
buildDirectory
|
cg@3332
|
136 |
buildDirectory isNil ifTrue:[
|
cg@3332
|
137 |
self determineBuildDirectory
|
cg@3332
|
138 |
].
|
cg@2644
|
139 |
^ buildDirectory
|
cg@2622
|
140 |
!
|
cg@2622
|
141 |
|
cg@2634
|
142 |
buildDirectory:something
|
cg@2634
|
143 |
buildDirectory := something.
|
cg@2634
|
144 |
!
|
cg@2634
|
145 |
|
cg@2964
|
146 |
isLocalBuild
|
cg@2964
|
147 |
^ isLocalBuild ? false
|
cg@2964
|
148 |
!
|
cg@2964
|
149 |
|
cg@2964
|
150 |
isLocalBuild:aBoolean
|
cg@2964
|
151 |
"create a files without going through the source code manager"
|
cg@2964
|
152 |
|
cg@2964
|
153 |
isLocalBuild := aBoolean.
|
cg@2964
|
154 |
!
|
cg@2964
|
155 |
|
cg@2964
|
156 |
isQuickBuild
|
cg@2964
|
157 |
^ isQuickBuild ? false
|
cg@2964
|
158 |
!
|
cg@2964
|
159 |
|
cg@2964
|
160 |
isQuickBuild:aBoolean
|
cg@2964
|
161 |
"skips creation of header files, and copying of support files, if possible
|
cg@2964
|
162 |
to speedup a build. Use with care."
|
cg@2964
|
163 |
|
cg@2964
|
164 |
isQuickBuild := aBoolean.
|
cg@2964
|
165 |
!
|
cg@2964
|
166 |
|
cg@3127
|
167 |
makeAppOnly
|
cg@3127
|
168 |
^ (makeAppOnly ? false)
|
cg@3127
|
169 |
!
|
cg@3127
|
170 |
|
cg@3127
|
171 |
makeAppOnly:aBoolean
|
cg@3127
|
172 |
makeAppOnly := aBoolean.
|
cg@3127
|
173 |
!
|
cg@3127
|
174 |
|
cg@2972
|
175 |
makeExeOnly
|
cg@2972
|
176 |
^ (makeExeOnly ? false)
|
cg@2972
|
177 |
!
|
cg@2972
|
178 |
|
cg@2673
|
179 |
makeExeOnly:aBoolean
|
cg@2673
|
180 |
makeExeOnly := aBoolean.
|
cg@2673
|
181 |
!
|
cg@2673
|
182 |
|
cg@2972
|
183 |
makeQuick
|
cg@2972
|
184 |
^ (makeQuick ? false)
|
cg@2972
|
185 |
!
|
cg@2972
|
186 |
|
cg@2972
|
187 |
makeQuick:aBoolean
|
cg@2972
|
188 |
makeQuick := aBoolean.
|
cg@2972
|
189 |
!
|
cg@2972
|
190 |
|
cg@2644
|
191 |
package:aPackageIDOrSymbol
|
cg@2644
|
192 |
package := aPackageIDOrSymbol asPackageId.
|
cg@2596
|
193 |
!
|
cg@2596
|
194 |
|
cg@2644
|
195 |
packageBuildDirectory
|
cg@2644
|
196 |
"the directoray, where the deployable binary is created (xxxSetup.exe)"
|
cg@2622
|
197 |
|
cg@2622
|
198 |
^ buildDirectory / (package asPackageId module) / (package asPackageId directory)
|
cg@2635
|
199 |
!
|
cg@2635
|
200 |
|
cg@2644
|
201 |
projectDefinitionClass:something
|
cg@2644
|
202 |
projectDefinitionClass := something.
|
cg@2680
|
203 |
!
|
cg@2680
|
204 |
|
sr@2683
|
205 |
suffixForHeaderFiles
|
sr@2683
|
206 |
^ OperatingSystem isUNIXlike ifTrue:['.H'] ifFalse:['.STH']
|
sr@2683
|
207 |
!
|
sr@2683
|
208 |
|
cg@2873
|
209 |
usedCompilerForBuild:something
|
cg@2680
|
210 |
usedCompiler := something.
|
cg@2873
|
211 |
|
cg@2873
|
212 |
"Created: / 22-01-2012 / 10:50:48 / cg"
|
cg@2596
|
213 |
! !
|
cg@2596
|
214 |
|
cg@2596
|
215 |
!ProjectBuilder methodsFor:'building'!
|
cg@2596
|
216 |
|
cg@2644
|
217 |
build
|
cg@2644
|
218 |
"/ intermediate - this will move into a commonly used utility class
|
cg@2635
|
219 |
"/ (where all the project code support will be collected).
|
cg@2635
|
220 |
|
cg@2647
|
221 |
|makeOutput|
|
cg@2647
|
222 |
|
cg@2647
|
223 |
makeOutput := TextStream on:(Text new:10000).
|
cg@2647
|
224 |
self buildWithColorizedOutputTo:makeOutput.
|
cg@2647
|
225 |
|
cg@2647
|
226 |
TextView openWith:makeOutput contents.
|
cg@2647
|
227 |
!
|
cg@2647
|
228 |
|
cg@2647
|
229 |
buildWithColorizedOutputTo:makeOutput
|
cg@2647
|
230 |
"/ intermediate - this will move into a commonly used utility class
|
cg@2647
|
231 |
"/ (where all the project code support will be collected).
|
cg@2647
|
232 |
|
cg@2921
|
233 |
|lock|
|
cg@2635
|
234 |
|
cg@2644
|
235 |
lock := Semaphore forMutualExclusion.
|
cg@2647
|
236 |
|
cg@2644
|
237 |
stdErr := ActorStream new
|
cg@2644
|
238 |
nextPutBlock:[:char |
|
cg@2644
|
239 |
lock critical:[
|
cg@2921
|
240 |
makeOutput
|
cg@2921
|
241 |
withEmphasis:{#backgroundColor->Color red. #color->Color white.}
|
cg@2921
|
242 |
do:[makeOutput nextPut:char].
|
cg@2644
|
243 |
]
|
cg@2644
|
244 |
];
|
sr@2683
|
245 |
nextPutAllBlock:[:string |
|
cg@2873
|
246 |
lock critical:[
|
cg@2921
|
247 |
makeOutput
|
cg@2921
|
248 |
withEmphasis:{#backgroundColor->Color red. #color->Color white.}
|
cg@2921
|
249 |
do:[makeOutput nextPutAll:string].
|
cg@2644
|
250 |
]
|
cg@2644
|
251 |
].
|
cg@2644
|
252 |
stdOut := ActorStream new
|
cg@2644
|
253 |
nextPutBlock:[:char |
|
cg@2644
|
254 |
lock critical:[
|
cg@2644
|
255 |
makeOutput nextPut:char.
|
cg@2644
|
256 |
]
|
cg@2644
|
257 |
];
|
sr@2683
|
258 |
nextPutAllBlock:[:string |
|
cg@2873
|
259 |
lock critical:[
|
sr@2683
|
260 |
makeOutput nextPutAll:string.
|
cg@2644
|
261 |
]
|
cg@2644
|
262 |
].
|
cg@2635
|
263 |
|
cg@2644
|
264 |
self buildWithOutputTo:stdOut errorTo:stdErr.
|
cg@2873
|
265 |
|
cg@2921
|
266 |
"Modified: / 06-09-2012 / 16:15:50 / cg"
|
cg@2611
|
267 |
!
|
cg@2611
|
268 |
|
cg@2969
|
269 |
buildWithOutputTo:stdOutArg errorTo:stdErrArg
|
cg@2611
|
270 |
"/ intermediate - this will move into a commonly used utility class
|
cg@2611
|
271 |
"/ (where all the project code support will be collected).
|
cg@2611
|
272 |
|
cg@2596
|
273 |
|module directory|
|
cg@2596
|
274 |
|
cg@3307
|
275 |
usedCompiler isNil ifTrue:[
|
cg@3307
|
276 |
usedCompiler := ParserFlags usedCompiler.
|
cg@3308
|
277 |
usedCompiler isNil ifTrue:[ self error:'no compiler defined (settings)'. ].
|
cg@3307
|
278 |
].
|
cg@3307
|
279 |
|
cg@2596
|
280 |
projectDefinitionClass := ProjectDefinition definitionClassForPackage:package.
|
cg@2596
|
281 |
projectDefinitionClass isNil ifTrue:[
|
cg@2596
|
282 |
self error:('Missing ProjectDefinition class for "',package asString,'"')
|
cg@2596
|
283 |
].
|
cg@2596
|
284 |
|
cg@2596
|
285 |
"/ ensure that everything is loaded...
|
cg@2596
|
286 |
projectDefinitionClass loadAsAutoloaded:false.
|
cg@2596
|
287 |
projectDefinitionClass loadExtensions.
|
cg@2596
|
288 |
projectDefinitionClass loadAllClassesAsAutoloaded:false.
|
cg@2596
|
289 |
|
cg@2596
|
290 |
module := package module.
|
cg@2596
|
291 |
directory := package directory.
|
cg@2596
|
292 |
|
cg@2596
|
293 |
buildDirectory isNil ifTrue:[
|
cg@3332
|
294 |
self determineBuildDirectory.
|
cg@2596
|
295 |
].
|
cg@2596
|
296 |
|
cg@2596
|
297 |
"/ self validateBuildDirectoryIsPresent.
|
cg@2596
|
298 |
|
cg@2596
|
299 |
PreviousBuildDirectory := buildDirectory.
|
cg@2596
|
300 |
|
cg@2596
|
301 |
"/ UserPreferences current localBuild:true
|
cg@2964
|
302 |
(self isLocalBuild or:[UserPreferences current localBuild]) ifFalse:[
|
cg@2596
|
303 |
SourceCodeManager notNil ifTrue:[
|
sv@3043
|
304 |
sourceCodeManager := SourceCodeManagerUtilities sourceCodeManagerFor:projectDefinitionClass.
|
cg@2596
|
305 |
]
|
cg@2596
|
306 |
].
|
cg@2596
|
307 |
sourceCodeManager := nil.
|
cg@2596
|
308 |
|
cg@2598
|
309 |
myTopDirectory :=
|
cg@2596
|
310 |
Smalltalk packagePath
|
cg@2596
|
311 |
detect:[:aPath |
|
cg@2596
|
312 |
(aPath asFilename / 'stx' / 'include') exists
|
cg@2596
|
313 |
and: [ (aPath asFilename / 'stx' / 'rules') exists ]]
|
cg@2596
|
314 |
ifNone:nil.
|
cg@2598
|
315 |
myTopDirectory isNil ifTrue:[
|
cg@2598
|
316 |
self error:('Cannot figure out my top directory (where stx/include and stx/rules are)')
|
cg@2596
|
317 |
].
|
cg@2598
|
318 |
myTopDirectory := myTopDirectory asFilename.
|
cg@2598
|
319 |
mySTXTopDirectory := myTopDirectory / 'stx'.
|
cg@2613
|
320 |
|
cg@2972
|
321 |
self makeQuick ifFalse:[
|
cg@2972
|
322 |
self setupBuildDirectory.
|
cg@2972
|
323 |
self activityNotification:'Generating stc directory...'.
|
cg@2972
|
324 |
self copySTCDirectoryForBuild.
|
cg@2972
|
325 |
].
|
cg@2628
|
326 |
self activityNotification:'Generating source files...'.
|
cg@2596
|
327 |
self generateSourceFiles.
|
cg@3308
|
328 |
false "self makeQuick" ifFalse:[
|
cg@2972
|
329 |
self activityNotification:'Copying dlls for linkage...'.
|
cg@2972
|
330 |
self copyDLLsForLinkage.
|
cg@2972
|
331 |
self activityNotification:'Copying support files for compilation and linkage...'.
|
cg@2972
|
332 |
self copySupportFilesForCompilation.
|
cg@2972
|
333 |
self copySupportFilesForLinkage.
|
cg@2972
|
334 |
self copyStartupFilesFromSmalltalk.
|
cg@2972
|
335 |
].
|
cg@2611
|
336 |
self makeWithOutputTo:stdOut errorTo:stdErr.
|
cg@2912
|
337 |
|
cg@3308
|
338 |
"Modified: / 06-06-2016 / 15:16:28 / cg"
|
cg@2898
|
339 |
! !
|
cg@2898
|
340 |
|
cg@2898
|
341 |
!ProjectBuilder methodsFor:'building/private'!
|
cg@2596
|
342 |
|
cg@2644
|
343 |
copyDLLsForLinkage
|
mawalch@3321
|
344 |
|targetBuildDir preRequisites dllRelativeSourcePaths dllRelativeDestPaths|
|
sv@2723
|
345 |
|
cg@2644
|
346 |
targetBuildDir := buildDirectory / package module / package directory.
|
cg@2644
|
347 |
|
sv@2723
|
348 |
preRequisites := projectDefinitionClass allPreRequisites.
|
sv@2723
|
349 |
OperatingSystem isUNIXlike ifTrue:[
|
sv@2723
|
350 |
"For now: unix Makefiles require some libs implicitely..."
|
sv@2723
|
351 |
preRequisites := preRequisites union:#(
|
sv@2979
|
352 |
#'stx:goodies/refactoryBrowser/parser'
|
sv@2979
|
353 |
#'stx:libtool'
|
sv@2723
|
354 |
).
|
sv@2723
|
355 |
].
|
sv@2723
|
356 |
|
sv@2723
|
357 |
preRequisites do:[:eachPackageToFileout |
|
cg@2644
|
358 |
|packageId packageDef packageModule packageDirectory packageTargetDir
|
mawalch@3321
|
359 |
dllSource dllSourceDir libraryName dllRelativePathSource
|
cg@2916
|
360 |
dllRelativePathDest objDirSource objDirDest alternativeObjDirSource|
|
cg@2644
|
361 |
|
cg@2644
|
362 |
packageId := eachPackageToFileout asPackageId.
|
cg@2644
|
363 |
packageModule := packageId module.
|
cg@2644
|
364 |
packageDirectory := packageId directory.
|
cg@2644
|
365 |
packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
|
cg@2644
|
366 |
|
cg@2644
|
367 |
packageDef := packageId projectDefinitionClass.
|
cg@2644
|
368 |
libraryName := packageDef libraryName.
|
cg@2644
|
369 |
|
cg@2644
|
370 |
"/ mhmh - take them from my tree or from the projects/smalltalk execution directory ??
|
cg@2644
|
371 |
dllSourceDir := myTopDirectory / packageModule / packageDirectory.
|
cg@2909
|
372 |
|
cg@2644
|
373 |
OperatingSystem isMSWINDOWSlike ifTrue:[
|
cg@2911
|
374 |
objDirDest := self objDirForUsedCompiler:usedCompiler.
|
cg@2916
|
375 |
objDirSource := objDirDest.
|
cg@2916
|
376 |
"/ "/ use visual-c files for tcc linkage
|
cg@2916
|
377 |
"/ usedCompiler = 'tcc' ifTrue:[
|
cg@2916
|
378 |
"/ objDirSource := self objDirForUsedCompiler:'vc'.
|
cg@2916
|
379 |
"/ ] ifFalse:[
|
cg@2916
|
380 |
"/ objDirSource := objDirDest
|
cg@2916
|
381 |
"/ ].
|
cg@2916
|
382 |
(dllSourceDir / objDirSource / (libraryName, '.dll')) exists ifFalse:[
|
cg@2916
|
383 |
alternativeObjDirSource := self objDirForUsedCompiler:'vc'.
|
cg@2916
|
384 |
(dllSourceDir / alternativeObjDirSource / (libraryName, '.dll')) exists ifTrue:[
|
cg@2921
|
385 |
objDirSource := alternativeObjDirSource.
|
mawalch@3321
|
386 |
stdErr nextPutLine:(('Warning: using alternative %1 from %2 (%3 version)...'
|
mawalch@3321
|
387 |
bindWith:libraryName
|
mawalch@3321
|
388 |
with:alternativeObjDirSource
|
cg@2921
|
389 |
with:(self class suiteNameOfCompiler:'vc'))
|
cg@2921
|
390 |
emphasizeAllWith:(#color -> Color red darkened)).
|
cg@2921
|
391 |
] ifFalse:[
|
cg@2921
|
392 |
alternativeObjDirSource := self objDirForUsedCompiler:'bcc'.
|
cg@2921
|
393 |
(dllSourceDir / alternativeObjDirSource / (libraryName, '.dll')) exists ifTrue:[
|
cg@2921
|
394 |
objDirSource := alternativeObjDirSource.
|
mawalch@3321
|
395 |
stdErr nextPutLine:('Warning: using alternative %1 from %2 (%3 version)...'
|
mawalch@3321
|
396 |
bindWith:libraryName
|
mawalch@3321
|
397 |
with:alternativeObjDirSource
|
cg@2921
|
398 |
with:(self class suiteNameOfCompiler:'bcc')).
|
cg@2921
|
399 |
]
|
cg@2921
|
400 |
].
|
cg@2911
|
401 |
].
|
cg@2916
|
402 |
|
cg@2905
|
403 |
"/ dllRelativePath := objDir,'/',(libraryName,'.dll').
|
mawalch@3321
|
404 |
"/ (dllSourceDir / dllRelativePath) exists
|
mawalch@3321
|
405 |
dllRelativeSourcePaths := Array with:(objDirSource,'\', libraryName, '.dll').
|
mawalch@3321
|
406 |
dllRelativeDestPaths := Array with:(objDirDest,'\', libraryName, '.dll').
|
cg@2644
|
407 |
] ifFalse:[
|
mawalch@3321
|
408 |
dllRelativeSourcePaths := Array with:(libraryName,'.so').
|
mawalch@3321
|
409 |
dllRelativeDestPaths := Array with:(libraryName, '.so').
|
sv@2723
|
410 |
(packageModule = 'stx' and:[packageDirectory = 'libview']) ifTrue:[
|
mawalch@3321
|
411 |
dllRelativeSourcePaths := dllRelativeSourcePaths copyWith:('XWorkstation.so').
|
mawalch@3321
|
412 |
dllRelativeDestPaths := dllRelativeDestPaths copyWith:'XWorkstation.so'.
|
mawalch@3321
|
413 |
dllRelativeSourcePaths := dllRelativeSourcePaths copyWith:('GLXWorkstation.so').
|
mawalch@3321
|
414 |
dllRelativeDestPaths := dllRelativeDestPaths copyWith:'GLXWorkstation.so'.
|
sv@2723
|
415 |
].
|
cg@2644
|
416 |
].
|
mawalch@3321
|
417 |
dllRelativeSourcePaths with:dllRelativeDestPaths do:[:dllRelativeSourcePath :dllRelativeDestPath|
|
cg@2896
|
418 |
|source dest|
|
cg@2896
|
419 |
|
cg@2911
|
420 |
source := dllSourceDir / dllRelativeSourcePath.
|
cg@2958
|
421 |
source exists ifFalse:[
|
cg@2958
|
422 |
self activityNotification:' skip missing file: ',source pathName.
|
cg@2958
|
423 |
] ifTrue:[
|
cg@2958
|
424 |
dest := packageTargetDir / dllRelativeDestPath.
|
cg@2958
|
425 |
(dest exists not
|
cg@2958
|
426 |
or:[source fileSize ~= dest fileSize
|
cg@3338
|
427 |
or:[source modificationTime > dest modificationTime
|
cg@2958
|
428 |
"/ or:[ ((dllSourceDir / dllRelativePath) sameContentsAs:(packageTargetDir / dllRelativePath)) not ]
|
cg@2958
|
429 |
]]) ifTrue:[
|
cg@2958
|
430 |
Transcript showCR:'updating ',dllRelativeDestPath.
|
cg@2958
|
431 |
dest directory recursiveMakeDirectory.
|
mawalch@3321
|
432 |
source copyTo:dest.
|
cg@2986
|
433 |
self activityNotification:' ',dest pathName
|
cg@3041
|
434 |
] ifFalse:[
|
cg@3041
|
435 |
Transcript showCR:'already up-to-date: ',dllRelativeDestPath.
|
cg@3041
|
436 |
]
|
cg@2958
|
437 |
]
|
sv@2723
|
438 |
].
|
cg@2614
|
439 |
].
|
cg@2896
|
440 |
|
cg@2921
|
441 |
"Modified: / 06-09-2012 / 16:19:29 / cg"
|
cg@2600
|
442 |
!
|
cg@2600
|
443 |
|
cg@2644
|
444 |
copyDirectory:relativepath
|
cg@2644
|
445 |
"/ need rules in stx
|
cg@2644
|
446 |
((Smalltalk projectDirectoryForPackage:'stx') asFilename construct:relativepath)
|
cg@2644
|
447 |
recursiveCopyTo:(buildDirectory construct:'stx').
|
cg@2596
|
448 |
!
|
cg@2596
|
449 |
|
cg@2644
|
450 |
copyDirectoryForBuild:subdir
|
cg@2644
|
451 |
|targetDir targetFile|
|
cg@2644
|
452 |
|
cg@2644
|
453 |
targetDir := buildDirectory / 'stx' / subdir.
|
cg@2644
|
454 |
targetDir exists ifFalse:[
|
cg@2644
|
455 |
targetDir makeDirectory.
|
cg@2964
|
456 |
] ifTrue:[
|
cg@2964
|
457 |
self isQuickBuild ifTrue:[^ self]
|
cg@2644
|
458 |
].
|
cg@2644
|
459 |
(mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile |
|
cg@2644
|
460 |
eachFile isDirectory ifFalse:[
|
cg@2644
|
461 |
targetFile := targetDir / eachFile baseName.
|
cg@2644
|
462 |
(targetFile exists not
|
cg@2644
|
463 |
or:[ targetFile modificationTime < eachFile modificationTime ]) ifTrue:[
|
cg@2644
|
464 |
self activityNotification:'copying ',eachFile pathName,'...'.
|
cg@2644
|
465 |
eachFile copyTo:(targetDir construct:eachFile baseName)
|
cg@2644
|
466 |
]
|
cg@2644
|
467 |
].
|
cg@2644
|
468 |
].
|
cg@2644
|
469 |
self activityNotification:nil
|
cg@2598
|
470 |
!
|
cg@2598
|
471 |
|
cg@2644
|
472 |
copyResourcesForPackage:aPackage
|
cg@2981
|
473 |
|module directory myPackageDirectory rsrcDir stylesDir|
|
cg@2644
|
474 |
|
cg@2644
|
475 |
module := aPackage asPackageId module.
|
cg@2644
|
476 |
directory := aPackage asPackageId directory.
|
cg@2644
|
477 |
|
cg@2981
|
478 |
myPackageDirectory := myTopDirectory / module / directory.
|
cg@2981
|
479 |
|
cg@2981
|
480 |
(rsrcDir := myPackageDirectory / 'resources' ) exists ifTrue:[
|
cg@2981
|
481 |
rsrcDir recursiveCopyTo:(buildDirectory / module / directory)
|
cg@2644
|
482 |
].
|
cg@2981
|
483 |
(stylesDir := myPackageDirectory / 'styles' ) exists ifTrue:[
|
cg@2981
|
484 |
stylesDir recursiveCopyTo:(buildDirectory / module / directory)
|
cg@2644
|
485 |
].
|
cg@2600
|
486 |
!
|
cg@2600
|
487 |
|
cg@2644
|
488 |
copySTCDirectoryForBuild
|
cg@2912
|
489 |
"copy stc files to the build directory"
|
cg@2912
|
490 |
|
cg@2644
|
491 |
|targetDir stc files|
|
cg@2644
|
492 |
|
cg@2644
|
493 |
targetDir := buildDirectory / 'stx' / 'stc'.
|
cg@2644
|
494 |
targetDir exists ifFalse:[ targetDir makeDirectory ].
|
cg@2644
|
495 |
|
cg@2644
|
496 |
stc := OperatingSystem isMSWINDOWSlike
|
cg@2644
|
497 |
ifTrue:[ 'stc.exe' ]
|
cg@2644
|
498 |
ifFalse:[ 'stc' ].
|
cg@2644
|
499 |
|
cg@2644
|
500 |
files := #( ) copyWith:stc.
|
cg@2644
|
501 |
|
cg@2644
|
502 |
files do:[:eachFile |
|
cg@2644
|
503 |
|sourceFile targetFile|
|
cg@2644
|
504 |
|
cg@2644
|
505 |
sourceFile := mySTXTopDirectory / 'stc' / eachFile.
|
cg@2644
|
506 |
targetFile := targetDir / eachFile.
|
cg@2644
|
507 |
(targetFile exists not
|
cg@2644
|
508 |
or:[ targetFile modificationTime < sourceFile modificationTime ]) ifTrue:[
|
cg@2644
|
509 |
self activityNotification:'copying ',sourceFile pathName,'...'.
|
cg@2644
|
510 |
sourceFile copyTo:targetFile
|
cg@2644
|
511 |
].
|
cg@2644
|
512 |
].
|
sr@2683
|
513 |
|
sr@2683
|
514 |
OperatingSystem isUNIXlike ifTrue:[
|
sr@2683
|
515 |
(targetDir / 'stc') makeExecutableForAll
|
sr@2683
|
516 |
].
|
sr@2683
|
517 |
|
cg@2644
|
518 |
self activityNotification:nil
|
cg@2912
|
519 |
|
cg@2912
|
520 |
"Modified (comment): / 04-09-2012 / 00:49:19 / cg"
|
cg@2599
|
521 |
!
|
cg@2599
|
522 |
|
cg@2644
|
523 |
copyStartupFilesFromSmalltalk
|
cg@2912
|
524 |
"copy additional smalltalk startup files to the build directory"
|
cg@2912
|
525 |
|
cg@2644
|
526 |
(buildDirectory / 'stx' / 'projects/smalltalk' ) exists ifFalse:[
|
cg@2644
|
527 |
(buildDirectory / 'stx' / 'projects/smalltalk' ) recursiveMakeDirectory.
|
cg@2644
|
528 |
].
|
cg@2644
|
529 |
|
cg@2678
|
530 |
#(
|
cg@2678
|
531 |
'keyboard.rc'
|
cg@2678
|
532 |
'keyboardMacros.rc'
|
cg@2678
|
533 |
'display.rc'
|
cg@2678
|
534 |
'd_win32.rc'
|
cg@2678
|
535 |
'host.rc'
|
cg@2678
|
536 |
'h_win32.rc'
|
cg@2678
|
537 |
'smalltalk.rc'
|
cg@2678
|
538 |
'private.rc'
|
cg@2644
|
539 |
) do:[:fn |
|
cg@2644
|
540 |
(myTopDirectory / 'stx' / 'projects/smalltalk' / fn)
|
cg@2644
|
541 |
copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / fn)
|
cg@2678
|
542 |
].
|
cg@2678
|
543 |
|
cg@2678
|
544 |
(myTopDirectory / 'stx' / 'doc/online/english/LICENCE_STX.html')
|
cg@2678
|
545 |
copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / 'LICENCE_STX.html').
|
cg@2912
|
546 |
|
cg@2912
|
547 |
"Modified (comment): / 04-09-2012 / 00:48:47 / cg"
|
cg@2912
|
548 |
!
|
cg@2912
|
549 |
|
cg@2912
|
550 |
copySupportFilesForCompilation
|
cg@2912
|
551 |
"copy the tcc compiler to the build directory"
|
cg@2912
|
552 |
|
cg@2912
|
553 |
|files|
|
cg@2912
|
554 |
|
cg@2912
|
555 |
files := #().
|
cg@2912
|
556 |
|
cg@2912
|
557 |
OperatingSystem isMSWINDOWSlike ifTrue:[
|
cg@2984
|
558 |
files := files , #(
|
cg@2984
|
559 |
'librun/genDate.com'
|
cg@2984
|
560 |
).
|
cg@2912
|
561 |
usedCompiler = 'tcc' ifTrue:[
|
cg@2912
|
562 |
files := files , #(
|
cg@2912
|
563 |
'support/tcc'
|
cg@2912
|
564 |
).
|
cg@2912
|
565 |
].
|
cg@2912
|
566 |
] ifFalse:[
|
cg@2984
|
567 |
files := files , #(
|
cg@2984
|
568 |
"/ 'librun/genDate' -- not needed on unix (done via script)
|
cg@2984
|
569 |
'configurations/myConf'
|
cg@2984
|
570 |
'configurations/vendorConf'
|
cg@2984
|
571 |
'configurations/conf.inc'
|
cg@2984
|
572 |
'configurations/COMMON'
|
cg@2984
|
573 |
).
|
cg@2912
|
574 |
].
|
cg@2912
|
575 |
|
cg@2912
|
576 |
files do:[:relativePath |
|
cg@2912
|
577 |
(mySTXTopDirectory / relativePath) exists ifTrue:[
|
cg@2912
|
578 |
((buildDirectory / 'stx' / relativePath) exists
|
cg@2912
|
579 |
and:[ (mySTXTopDirectory / relativePath) fileSize = (buildDirectory / 'stx' / relativePath) fileSize
|
cg@2912
|
580 |
and:[ (mySTXTopDirectory / relativePath) modificationTime < (buildDirectory / 'stx' / relativePath) modificationTime
|
cg@2912
|
581 |
"/ and:[ (mySTXTopDirectory / dllRelativePath) sameContentsAs:(targetBuildDir / dllRelativePath) ]
|
cg@2912
|
582 |
]]) ifFalse:[
|
cg@2984
|
583 |
(buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory.
|
cg@2984
|
584 |
(mySTXTopDirectory / relativePath) isDirectory ifTrue:[
|
cg@2984
|
585 |
(mySTXTopDirectory / relativePath) recursiveCopyTo:(buildDirectory / 'stx' / relativePath) directory.
|
cg@2984
|
586 |
] ifFalse:[
|
cg@2984
|
587 |
(mySTXTopDirectory / relativePath) copyTo:(buildDirectory / 'stx' / relativePath) directory.
|
cg@2984
|
588 |
]
|
cg@2912
|
589 |
]
|
cg@2912
|
590 |
] ifFalse:[
|
cg@2984
|
591 |
self error:'Missing file or directory: ',relativePath printString mayProceed:true.
|
cg@2912
|
592 |
].
|
cg@2912
|
593 |
].
|
cg@2912
|
594 |
|
cg@2912
|
595 |
"Created: / 04-09-2012 / 00:47:49 / cg"
|
cg@2600
|
596 |
!
|
cg@2600
|
597 |
|
cg@2644
|
598 |
copySupportFilesForLinkage
|
cg@2912
|
599 |
"copy additional files which are req'd for linkage to the build directory"
|
cg@2912
|
600 |
|
cg@3338
|
601 |
|files fn|
|
cg@2644
|
602 |
|
cg@2644
|
603 |
OperatingSystem isMSWINDOWSlike ifTrue:[
|
cg@2644
|
604 |
files := #(
|
cg@2969
|
605 |
'librun/genDate.com'
|
cg@2644
|
606 |
'librun/main.c'
|
cg@2673
|
607 |
'projects/smalltalk/stx_16x16.ico'
|
cg@2673
|
608 |
'projects/smalltalk/stx_32x32.ico'
|
cg@2673
|
609 |
'projects/smalltalk/stx_splash.bmp'
|
cg@2644
|
610 |
).
|
cg@2905
|
611 |
|
cg@2905
|
612 |
usedCompiler = 'bcc' ifTrue:[
|
cg@2905
|
613 |
files := files , #(
|
cg@2905
|
614 |
'librun/objbc/librun.dll'
|
cg@2905
|
615 |
'support/win32/borland/cs3245.dll'
|
cg@2905
|
616 |
'support/win32/X11.dll'
|
cg@2905
|
617 |
'support/win32/Xext.dll'
|
cg@2916
|
618 |
'lib/bc/librun.lib'
|
cg@2916
|
619 |
'lib/bc/cs32i.lib'
|
cg@2905
|
620 |
).
|
cg@2905
|
621 |
].
|
cg@2905
|
622 |
usedCompiler = 'vc' ifTrue:[
|
cg@2905
|
623 |
files := files , #(
|
cg@2905
|
624 |
'librun/objvc/librun.dll'
|
cg@2916
|
625 |
'lib/vc/librun.lib'
|
cg@2905
|
626 |
).
|
cg@2905
|
627 |
].
|
cg@2911
|
628 |
usedCompiler = 'tcc' ifTrue:[
|
cg@2911
|
629 |
files := files , #(
|
cg@2916
|
630 |
'librun/objvc/librun.dll' "/ linkage is against vc version!!
|
cg@2916
|
631 |
'lib/vc/librun.lib'
|
cg@2916
|
632 |
).
|
cg@2916
|
633 |
].
|
cg@2916
|
634 |
usedCompiler = 'lcc' ifTrue:[
|
cg@2916
|
635 |
files := files , #(
|
cg@2916
|
636 |
'librun/objvc/librun.dll' "/ linkage is against vc version!!
|
cg@2916
|
637 |
'lib/vc/librun.lib'
|
cg@2911
|
638 |
).
|
cg@2911
|
639 |
].
|
cg@2918
|
640 |
usedCompiler = 'mingw' ifTrue:[
|
cg@2918
|
641 |
files := files , #(
|
cg@2972
|
642 |
'librun/objmingw/librun.dll' "/ linkage is against vc version!!
|
cg@2972
|
643 |
'lib/mingw/librun.lib'
|
cg@2918
|
644 |
).
|
cg@2918
|
645 |
].
|
cg@2644
|
646 |
] ifFalse:[
|
cg@2644
|
647 |
files := #(
|
cg@2644
|
648 |
'librun/main.c'
|
cg@2644
|
649 |
'librun/librun.so'
|
cg@2644
|
650 |
)
|
cg@2644
|
651 |
].
|
cg@2677
|
652 |
files := files asOrderedCollection.
|
cg@3343
|
653 |
files add:'RELEASE'.
|
cg@3343
|
654 |
|
cg@2677
|
655 |
OperatingSystem isMSWINDOWSlike ifTrue:[
|
cg@3338
|
656 |
(fn := projectDefinitionClass applicationIconFileNameWindows) notNil ifTrue:[
|
cg@3338
|
657 |
fn asFilename suffix isEmptyOrNil ifTrue:[
|
cg@3338
|
658 |
fn := fn,'.ico'
|
cg@3338
|
659 |
].
|
cg@3338
|
660 |
files add:('projects/smalltalk/',fn)
|
cg@2678
|
661 |
].
|
cg@3338
|
662 |
(fn := projectDefinitionClass splashFileName) notNil ifTrue:[
|
cg@3338
|
663 |
files add:('projects/smalltalk/',fn,'.bmp')
|
cg@3338
|
664 |
].
|
cg@3338
|
665 |
].
|
cg@3338
|
666 |
OperatingSystem isOSXlike ifTrue:[
|
cg@3338
|
667 |
(fn := projectDefinitionClass applicationIconFileNameOSX) notNil ifTrue:[
|
cg@3338
|
668 |
fn asFilename suffix isEmptyOrNil ifTrue:[
|
cg@3338
|
669 |
fn := fn,'.icns'
|
cg@3338
|
670 |
].
|
cg@3338
|
671 |
files add:('projects/smalltalk/',fn)
|
cg@2678
|
672 |
].
|
cg@2677
|
673 |
].
|
cg@2644
|
674 |
|
cg@2914
|
675 |
files do:[:relativePath |
|
cg@2914
|
676 |
(mySTXTopDirectory / relativePath) exists ifTrue:[
|
cg@2914
|
677 |
((buildDirectory / 'stx' / relativePath) exists
|
cg@2914
|
678 |
and:[ (mySTXTopDirectory / relativePath) fileSize = (buildDirectory / 'stx' / relativePath) fileSize
|
cg@2914
|
679 |
and:[ (mySTXTopDirectory / relativePath) modificationTime < (buildDirectory / 'stx' / relativePath) modificationTime
|
sr@2684
|
680 |
"/ and:[ (mySTXTopDirectory / dllRelativePath) sameContentsAs:(targetBuildDir / dllRelativePath) ]
|
sr@2684
|
681 |
]]) ifFalse:[
|
cg@2914
|
682 |
(buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory.
|
cg@2914
|
683 |
(mySTXTopDirectory / relativePath) copyTo:(buildDirectory / 'stx' / relativePath).
|
sr@2684
|
684 |
]
|
sr@2684
|
685 |
] ifFalse:[
|
cg@2971
|
686 |
"/ does not really help: objbc/librun.lib does not work with MSVC and vice versa...
|
cg@2971
|
687 |
"/ ((relativePath = 'librun/objvc/librun.dll')
|
cg@2971
|
688 |
"/ and:[ (mySTXTopDirectory / 'librun/objbc/librun.dll') exists ])ifTrue:[
|
cg@2971
|
689 |
"/ stdErr nextPutLine:('Warning: using alternative librun from objbc (Borland version)...').
|
cg@2971
|
690 |
"/ (buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory.
|
cg@2971
|
691 |
"/ (mySTXTopDirectory / 'librun/objbc/librun.dll') copyTo:(buildDirectory / 'stx' / relativePath).
|
cg@2971
|
692 |
"/ ] ifFalse:[
|
cg@2971
|
693 |
"/ ((relativePath = 'librun/objbc/librun.dll')
|
cg@2971
|
694 |
"/ and:[ (mySTXTopDirectory / 'librun/objvc/librun.dll') exists ])ifTrue:[
|
cg@2971
|
695 |
"/ stdErr nextPutLine:('Warning: using alternative librun from objvc (MSVC version)...').
|
cg@2971
|
696 |
"/ (buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory.
|
cg@2971
|
697 |
"/ (mySTXTopDirectory / 'librun/objvc/librun.dll') copyTo:(buildDirectory / 'stx' / relativePath).
|
cg@2971
|
698 |
"/ ] ifFalse:[
|
cg@2971
|
699 |
self error:'Missing file: ',relativePath printString mayProceed:true.
|
cg@2971
|
700 |
"/ ]
|
cg@2971
|
701 |
"/ ]
|
sr@2684
|
702 |
].
|
cg@2644
|
703 |
].
|
cg@2873
|
704 |
|
cg@2918
|
705 |
"Modified: / 05-09-2012 / 16:26:25 / cg"
|
cg@2600
|
706 |
!
|
cg@2600
|
707 |
|
cg@2644
|
708 |
createHeaderFileFor:aClass in:packageTargetDir
|
cg@2644
|
709 |
|instVarList classInstVarList classVarList bindings superclassFilename
|
cg@2644
|
710 |
template file newContents oldContents|
|
cg@2644
|
711 |
|
cg@2644
|
712 |
instVarList := StringCollection new.
|
cg@2644
|
713 |
aClass instVarNames do:[:v |
|
cg@2644
|
714 |
instVarList add:('OBJ %1;' bindWith:v)
|
cg@2644
|
715 |
].
|
cg@2644
|
716 |
classInstVarList := StringCollection new.
|
cg@2644
|
717 |
aClass class instVarNames do:[:v |
|
cg@2961
|
718 |
"/ (v includes:$_) ifTrue:[self halt].
|
cg@2644
|
719 |
classInstVarList add:('OBJ %1;' bindWith:v)
|
cg@2644
|
720 |
].
|
cg@2644
|
721 |
classVarList := StringCollection new.
|
cg@2644
|
722 |
aClass classVarNames do:[:v |
|
cg@2644
|
723 |
classVarList add:('extern OBJ %1_%2;' bindWith:aClass name with:v)
|
cg@2644
|
724 |
].
|
cg@2644
|
725 |
|
cg@2644
|
726 |
bindings := Dictionary new.
|
cg@2644
|
727 |
bindings at:'ClassName' put:aClass name.
|
cg@2644
|
728 |
aClass superclass isNil ifTrue:[
|
cg@2644
|
729 |
bindings at:'SuperclassName' put:'-'.
|
cg@2852
|
730 |
bindings at:'SuperclassFileInclude' put:''.
|
cg@2644
|
731 |
] ifFalse:[
|
cg@2644
|
732 |
bindings at:'SuperclassName' put:aClass superclass name.
|
cg@2644
|
733 |
bindings at:'SuperclassFileName' put:(superclassFilename := Smalltalk fileNameForClass:aClass superclass).
|
cg@2644
|
734 |
bindings at:'SuperclassFileInclude' put:('#include "%1.STH"' bindWith:superclassFilename).
|
cg@2644
|
735 |
].
|
cg@2644
|
736 |
bindings at:'InstVarList' put:instVarList asString.
|
cg@2644
|
737 |
bindings at:'ClassVarList' put:classVarList asString.
|
cg@2644
|
738 |
bindings at:'ClassInstVarList' put:classInstVarList asString.
|
cg@2644
|
739 |
|
cg@2644
|
740 |
template :=
|
cg@2644
|
741 |
'/* This file was generated by ProjectBuilder. */
|
cg@2644
|
742 |
/* !!!!!!!! Do not change by hand !!!!!!!! */
|
cg@2644
|
743 |
|
cg@2644
|
744 |
/* Class: %(ClassName) */
|
cg@2644
|
745 |
/* Superclass: %(SuperclassName) */
|
cg@2644
|
746 |
|
cg@2644
|
747 |
%(SuperclassFileInclude)
|
cg@2644
|
748 |
|
cg@2644
|
749 |
/* INDIRECTGLOBALS */
|
cg@2644
|
750 |
#ifdef _HEADER_INST_
|
cg@2644
|
751 |
%(InstVarList)
|
cg@2644
|
752 |
#endif /* _HEADER_INST_ */
|
cg@2644
|
753 |
|
cg@2644
|
754 |
#ifdef _HEADER_CLASS_
|
cg@2644
|
755 |
%(ClassVarList)
|
cg@2644
|
756 |
#endif /* _HEADER_CLASS_ */
|
cg@2644
|
757 |
|
cg@2644
|
758 |
#ifdef _HEADER_CLASSINST_
|
cg@2644
|
759 |
%(ClassInstVarList)
|
cg@2644
|
760 |
#endif /* _HEADER_CLASSINST_ */
|
cg@2644
|
761 |
'.
|
cg@2644
|
762 |
newContents := template bindWithArguments:bindings.
|
sr@2683
|
763 |
file := packageTargetDir asFilename / ((Smalltalk fileNameForClass:aClass),(self suffixForHeaderFiles)).
|
cg@2644
|
764 |
(file exists not
|
cg@2644
|
765 |
or:[ (oldContents := file contents) ~= newContents ]) ifTrue:[
|
cg@2644
|
766 |
file contents: newContents.
|
cg@2644
|
767 |
].
|
cg@2852
|
768 |
|
cg@2852
|
769 |
"Modified: / 15-08-2011 / 14:58:46 / cg"
|
cg@2596
|
770 |
!
|
cg@2596
|
771 |
|
cg@3332
|
772 |
determineBuildDirectory
|
cg@3332
|
773 |
buildDirectory isNil ifTrue:[
|
cg@3332
|
774 |
buildDirectory := PreviousBuildDirectory ifNil:[ UserPreferences current buildDirectory ].
|
cg@3332
|
775 |
buildDirectory isNil ifTrue:[
|
cg@3332
|
776 |
buildDirectory := Filename tempDirectory construct:'stx_build'.
|
cg@3332
|
777 |
].
|
cg@3332
|
778 |
].
|
cg@3332
|
779 |
buildDirectory := buildDirectory asFilename.
|
cg@3332
|
780 |
!
|
cg@3332
|
781 |
|
cg@3042
|
782 |
generateBuildSupportFilesByFilingOutIn:packageTargetDir forDefinitionClass:projectDefinitionClass
|
cg@3042
|
783 |
|fullPathName|
|
cg@3042
|
784 |
|
cg@3042
|
785 |
projectDefinitionClass forEachFileNameAndGeneratedContentsDo:[:fileName :fileContents |
|
cg@3042
|
786 |
fullPathName := packageTargetDir construct:fileName.
|
cg@3042
|
787 |
fullPathName directory exists ifFalse:[
|
cg@3042
|
788 |
"take care for files like 'autopackage/default.apspec'"
|
cg@3042
|
789 |
fullPathName directory makeDirectory.
|
cg@3042
|
790 |
].
|
cg@3042
|
791 |
(fullPathName exists
|
cg@3042
|
792 |
and:[ fullPathName contents = fileContents ]) ifFalse:[
|
cg@3042
|
793 |
fullPathName contents:fileContents.
|
cg@3042
|
794 |
].
|
cg@3042
|
795 |
].
|
cg@3042
|
796 |
!
|
cg@3042
|
797 |
|
cg@2644
|
798 |
generateSourceFiles
|
cg@2964
|
799 |
(self isLocalBuild not and:[ sourceCodeManager notNil ]) ifTrue:[
|
cg@2644
|
800 |
"/ check out / generate files there
|
cg@2644
|
801 |
self generateSourceFilesByCheckingOutUsing:sourceCodeManager
|
cg@2644
|
802 |
] ifFalse:[
|
cg@2644
|
803 |
"/ local build
|
cg@2644
|
804 |
"/ fileout the project
|
cg@2644
|
805 |
self generateSourceFilesByFilingOut
|
cg@2644
|
806 |
]
|
cg@2596
|
807 |
!
|
cg@2596
|
808 |
|
cg@2644
|
809 |
generateSourceFilesByCheckingOutUsing:aSourceCodeManager
|
cg@2644
|
810 |
"/ will no longer be needed/supported
|
cg@2644
|
811 |
|
cg@2644
|
812 |
|repository stxRepository module directory|
|
cg@2644
|
813 |
|
cg@2868
|
814 |
self breakPoint:#cg.
|
cg@2868
|
815 |
|
cg@2644
|
816 |
"/ check out / generate files there
|
cg@2644
|
817 |
repository := (aSourceCodeManager repositoryNameForModule:module) ifNil:[aSourceCodeManager repositoryName].
|
cg@2644
|
818 |
stxRepository := aSourceCodeManager repositoryName.
|
cg@2644
|
819 |
|
cg@2644
|
820 |
(buildDirectory construct:'stx') exists ifFalse:[
|
cg@2644
|
821 |
(module ~= 'stx') ifTrue:[
|
cg@2644
|
822 |
OperatingSystem
|
cg@2644
|
823 |
executeCommand:('cvs -d ',stxRepository,' co stx')
|
cg@2644
|
824 |
inputFrom:nil
|
cg@2644
|
825 |
outputTo:Transcript
|
cg@2644
|
826 |
errorTo:Transcript
|
cg@2644
|
827 |
inDirectory:buildDirectory
|
cg@2644
|
828 |
onError:[:status| self error:'cvs update stx failed'].
|
cg@2644
|
829 |
].
|
cg@2644
|
830 |
].
|
cg@2644
|
831 |
|
cg@2644
|
832 |
((buildDirectory construct:module) construct:'CVS') exists ifFalse:[
|
cg@2644
|
833 |
OperatingSystem
|
cg@2644
|
834 |
executeCommand:('cvs -d ',repository,' co -l ',directory)
|
cg@2644
|
835 |
inputFrom:nil
|
cg@2644
|
836 |
outputTo:Transcript
|
cg@2644
|
837 |
errorTo:Transcript
|
cg@2644
|
838 |
inDirectory:buildDirectory
|
cg@2644
|
839 |
onError:[:status| self error:'cvs update failed'].
|
cg@2644
|
840 |
].
|
cg@2644
|
841 |
OperatingSystem
|
cg@2644
|
842 |
executeCommand:'cvs upd -d'
|
cg@2644
|
843 |
inputFrom:nil
|
cg@2644
|
844 |
outputTo:Transcript
|
cg@2644
|
845 |
errorTo:Transcript
|
cg@2644
|
846 |
inDirectory:(buildDirectory construct:module)
|
cg@2644
|
847 |
onError:[:status| self error:'cvs update failed'].
|
cg@2644
|
848 |
self halt.
|
cg@2868
|
849 |
|
cg@2868
|
850 |
"Modified: / 29-12-2011 / 14:02:56 / cg"
|
cg@2596
|
851 |
!
|
cg@2596
|
852 |
|
cg@2644
|
853 |
generateSourceFilesByFilingOut
|
cg@2644
|
854 |
"/ local build
|
cg@2644
|
855 |
"/ fileout the project
|
cg@2644
|
856 |
|
cg@2644
|
857 |
(package module ~= 'stx') ifTrue:[
|
cg@2644
|
858 |
(buildDirectory / package module) makeDirectory.
|
cg@2644
|
859 |
].
|
cg@2644
|
860 |
|
cg@2644
|
861 |
"/ file out the package(s) which are to be built
|
cg@2644
|
862 |
((Array with:package))
|
cg@2644
|
863 |
do:[:eachPackageToFileout |
|
cg@2981
|
864 |
|packageId packageModule packageDirectory packageTargetDir packageDef extSource|
|
cg@2644
|
865 |
|
cg@2644
|
866 |
packageId := eachPackageToFileout asPackageId.
|
cg@2644
|
867 |
packageModule := packageId module.
|
cg@2644
|
868 |
packageDirectory := packageId directory.
|
cg@2644
|
869 |
packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
|
cg@2644
|
870 |
|
cg@2644
|
871 |
packageDef := packageId projectDefinitionClass.
|
cg@2644
|
872 |
(packageDef compiled_classNames_common ,
|
cg@2644
|
873 |
packageDef compiled_classNamesForPlatform) do:[:eachClassName |
|
cg@2644
|
874 |
|cls fileName newSource|
|
cg@2644
|
875 |
|
cg@2644
|
876 |
cls := Smalltalk classNamed:eachClassName.
|
cg@3182
|
877 |
(cls notNil and:[cls isLoaded]) ifFalse:[
|
cg@3182
|
878 |
self error:'missing class: ',eachClassName mayProceed:true
|
cg@3182
|
879 |
].
|
cg@2644
|
880 |
fileName := (Smalltalk fileNameForClass:cls),'.st'.
|
cg@2644
|
881 |
fileName := packageTargetDir asFilename construct:fileName.
|
cg@2644
|
882 |
fileName exists ifTrue:[
|
cg@2644
|
883 |
newSource := String streamContents:[:s | cls fileOutOn:s withTimeStamp:false].
|
cg@2644
|
884 |
newSource = fileName contentsAsString ifFalse:[
|
cg@2644
|
885 |
fileName contents:newSource
|
cg@2644
|
886 |
].
|
cg@2644
|
887 |
] ifFalse:[
|
cg@2644
|
888 |
cls fileOutIn:packageTargetDir withTimeStamp:false
|
cg@2644
|
889 |
].
|
cg@2644
|
890 |
].
|
cg@2644
|
891 |
|
cg@2981
|
892 |
packageDef hasExtensionMethods ifTrue:[
|
cg@2981
|
893 |
extSource :=
|
cg@2981
|
894 |
String streamContents:[:s |
|
cg@2985
|
895 |
s nextPutAll:('"{ Package: ''%1'' }" !!\\' bindWith:packageDef package) withCRs.
|
cg@2985
|
896 |
|
cg@2981
|
897 |
packageDef extensionMethods do:[:eachMethod |
|
cg@2981
|
898 |
eachMethod mclass fileOutMethod:eachMethod on:s
|
cg@2981
|
899 |
].
|
cg@2981
|
900 |
].
|
cg@2987
|
901 |
extSource isWideString ifTrue:[
|
cg@2987
|
902 |
extSource := ( '"{ Encoding: utf8 }"' , Character cr asString, Character cr asString, extSource).
|
cg@2987
|
903 |
extSource := extSource utf8Encoded.
|
cg@2987
|
904 |
].
|
cg@2985
|
905 |
(packageTargetDir asFilename construct:'extensions.st') contents:extSource
|
cg@2981
|
906 |
].
|
cg@2981
|
907 |
|
cg@2644
|
908 |
"/ (Smalltalk allClassesInPackage:eachPackageToFileout) do:[:cls |
|
cg@2644
|
909 |
"/ cls isPrivate ifFalse:[
|
cg@2644
|
910 |
"/ cls isLoaded ifFalse:[
|
cg@2644
|
911 |
"/ self halt.
|
cg@2644
|
912 |
"/ cls autoload.
|
cg@2644
|
913 |
"/ ].
|
cg@2644
|
914 |
"/ cls fileOutIn:packageTargetDir
|
cg@2644
|
915 |
"/ ]
|
cg@2644
|
916 |
"/ ].
|
cg@3042
|
917 |
self generateBuildSupportFilesByFilingOutIn:packageTargetDir forDefinitionClass:projectDefinitionClass.
|
cg@2644
|
918 |
].
|
cg@2972
|
919 |
self makeQuick ifFalse:[
|
cg@3042
|
920 |
"/ generate header files and build support files
|
cg@3042
|
921 |
"/ in prerequisite packages...
|
cg@2972
|
922 |
(projectDefinitionClass allPreRequisites)
|
cg@2972
|
923 |
do:[:eachPackageToFileout |
|
cg@2972
|
924 |
|packageId packageDef packageModule packageDirectory packageTargetDir|
|
cg@2644
|
925 |
|
cg@2972
|
926 |
packageId := eachPackageToFileout asPackageId.
|
cg@2972
|
927 |
packageModule := packageId module.
|
cg@2972
|
928 |
packageDirectory := packageId directory.
|
cg@2972
|
929 |
packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
|
cg@2644
|
930 |
|
cg@2972
|
931 |
packageDef := packageId projectDefinitionClass.
|
cg@2972
|
932 |
(packageDef compiled_classNames_common ,
|
cg@2972
|
933 |
packageDef compiled_classNamesForPlatform) do:[:eachClassName |
|
cg@2972
|
934 |
|cls|
|
cg@2644
|
935 |
|
cg@2972
|
936 |
cls := Smalltalk classNamed:eachClassName.
|
cg@2972
|
937 |
"/ self assert:cls isLoaded.
|
cg@2972
|
938 |
cls isNil ifTrue:[
|
cg@2972
|
939 |
stdErr nextPutLine:('Missing class: ',eachClassName, ' (not present in system. Warning only:subclasses of it will not be compiled)').
|
cg@2972
|
940 |
] ifFalse:[
|
cg@2972
|
941 |
cls isLoaded ifTrue:[
|
cg@2972
|
942 |
self createHeaderFileFor:cls in:packageTargetDir
|
cg@2972
|
943 |
]
|
cg@2972
|
944 |
].
|
cg@2644
|
945 |
].
|
cg@2972
|
946 |
self copyResourcesForPackage:eachPackageToFileout.
|
cg@3042
|
947 |
self generateBuildSupportFilesByFilingOutIn:packageTargetDir forDefinitionClass:packageDef.
|
cg@3042
|
948 |
(packageTargetDir / '.NOSOURCE') contents:'existence of this file suppresses compilation of st files'.
|
cg@2644
|
949 |
].
|
cg@2644
|
950 |
].
|
cg@2644
|
951 |
|
cg@2644
|
952 |
"/ stx_libbasic2 preRequisitesForBuilding#(#'stx:libbasic')
|
cg@2596
|
953 |
!
|
cg@2596
|
954 |
|
cg@2909
|
955 |
makeCommandOfCompiler:usedCompiler
|
cg@3308
|
956 |
usedCompiler notNil ifTrue:[
|
cg@3308
|
957 |
usedCompiler = 'bcc' ifTrue:[
|
cg@3308
|
958 |
^ 'bmake'.
|
cg@3308
|
959 |
].
|
cg@3308
|
960 |
usedCompiler = 'vc' ifTrue:[
|
cg@3308
|
961 |
^ 'vcmake'. "/ compilerFlag := '-DUSEVC'
|
cg@3308
|
962 |
].
|
cg@3308
|
963 |
usedCompiler = 'lcc' ifTrue:[
|
cg@3308
|
964 |
^ 'lccmake'. "/ compilerFlag := '-DUSELCC'
|
cg@3308
|
965 |
].
|
cg@3308
|
966 |
usedCompiler = 'tcc' ifTrue:[
|
cg@3308
|
967 |
^ 'tccmake'. "/ compilerFlag := '-DUSELCC'
|
cg@3308
|
968 |
].
|
cg@3308
|
969 |
usedCompiler = 'mingw' ifTrue:[
|
cg@3308
|
970 |
^ 'mingwmake'. "/ compilerFlag := '-DUSEMINGW'
|
cg@3308
|
971 |
].
|
cg@3308
|
972 |
true "usedCompiler = 'gcc'" ifTrue:[
|
cg@3308
|
973 |
^ 'make'. "/ compilerFlag := '-DUSEGCC'
|
cg@3308
|
974 |
].
|
cg@2989
|
975 |
].
|
cg@2909
|
976 |
self error:'unknown compiler specified'.
|
cg@2909
|
977 |
|
cg@2909
|
978 |
"Created: / 03-09-2012 / 19:46:07 / cg"
|
cg@3308
|
979 |
"Modified: / 06-06-2016 / 15:11:54 / cg"
|
cg@2909
|
980 |
!
|
cg@2909
|
981 |
|
cg@2644
|
982 |
makeWithOutputTo:stdOut errorTo:stdErr
|
cg@3127
|
983 |
|module directory makeCommand forceArg makeTarget|
|
cg@2644
|
984 |
|
cg@2644
|
985 |
module := package module.
|
cg@2644
|
986 |
directory := package directory.
|
cg@2644
|
987 |
|
cg@3308
|
988 |
"/ makeCommand := ParserFlags makeCommand.
|
cg@2895
|
989 |
usedCompiler isNil ifTrue:[
|
cg@2895
|
990 |
usedCompiler := ParserFlags usedCompiler.
|
cg@3308
|
991 |
usedCompiler isNil ifTrue:[ self error:'no compiler defined (settings)'. ].
|
cg@2895
|
992 |
].
|
cg@2909
|
993 |
makeCommand := self makeCommandOfCompiler:usedCompiler.
|
cg@3308
|
994 |
self activityNotification:'Executing make... (',makeCommand,')'.
|
cg@3072
|
995 |
forceArg := ''.
|
cg@3072
|
996 |
|
cg@2852
|
997 |
"/ makeCommand := makeCommand, ' TOP=', mySTXTopDirectory pathName.
|
cg@2680
|
998 |
|
sr@2683
|
999 |
OperatingSystem isUNIXlike ifTrue:[
|
cg@3072
|
1000 |
forceArg := ' FORCE='.
|
cg@3072
|
1001 |
|
cg@2921
|
1002 |
"/ generate the makefile first
|
cg@2984
|
1003 |
self activityNotification:('sh %1/rules/stmkmf (in %2)'
|
cg@2984
|
1004 |
bindWith:mySTXTopDirectory pathName
|
cg@2984
|
1005 |
with:(buildDirectory / module / directory)).
|
sr@2683
|
1006 |
OperatingSystem
|
sv@2845
|
1007 |
executeCommand:('sh %1/rules/stmkmf' bindWith:mySTXTopDirectory pathName)
|
sr@2683
|
1008 |
inputFrom:nil
|
sr@2683
|
1009 |
outputTo:stdOut
|
sr@2683
|
1010 |
errorTo:stdErr
|
sr@2683
|
1011 |
inDirectory:(buildDirectory / module / directory)
|
cg@2921
|
1012 |
onError:[:status | self error:'make failed'].
|
sr@2683
|
1013 |
].
|
sr@2683
|
1014 |
|
cg@2644
|
1015 |
projectDefinitionClass isLibraryDefinition ifTrue:[
|
cg@2921
|
1016 |
"/ generate the library
|
cg@2969
|
1017 |
self activityNotification:(makeCommand,' classLibRule').
|
cg@2644
|
1018 |
OperatingSystem
|
cg@3072
|
1019 |
executeCommand:(makeCommand,' classLibRule',forceArg)
|
cg@2644
|
1020 |
inputFrom:nil
|
cg@2644
|
1021 |
outputTo:stdOut
|
cg@2644
|
1022 |
errorTo:stdErr
|
cg@2644
|
1023 |
inDirectory:(buildDirectory / module / directory)
|
cg@2921
|
1024 |
onError:[:status | self error:'make failed'].
|
cg@2644
|
1025 |
] ifFalse:[
|
cg@2972
|
1026 |
(self makeExeOnly) ifTrue:[
|
cg@3127
|
1027 |
makeTarget := 'exe'
|
cg@3127
|
1028 |
] ifFalse:[
|
cg@3127
|
1029 |
(self makeAppOnly) ifTrue:[
|
cg@3127
|
1030 |
makeTarget := 'app'
|
cg@3127
|
1031 |
] ifFalse:[
|
cg@3127
|
1032 |
makeTarget := 'ALL_NP'
|
cg@3127
|
1033 |
].
|
cg@3127
|
1034 |
self activityNotification:(makeCommand,' ',makeTarget).
|
cg@2969
|
1035 |
OperatingSystem
|
cg@2969
|
1036 |
"/ generate the executable
|
cg@3127
|
1037 |
executeCommand:(makeCommand,' ',makeTarget,forceArg)
|
cg@2673
|
1038 |
inputFrom:nil
|
cg@2673
|
1039 |
outputTo:stdOut
|
cg@2673
|
1040 |
errorTo:stdErr
|
cg@2673
|
1041 |
inDirectory:(buildDirectory / module / directory)
|
cg@2921
|
1042 |
onError:[:status | self error:'make failed'].
|
cg@2673
|
1043 |
]
|
cg@2644
|
1044 |
]
|
cg@2793
|
1045 |
|
cg@3308
|
1046 |
"Modified: / 06-06-2016 / 15:17:00 / cg"
|
cg@2611
|
1047 |
!
|
cg@2611
|
1048 |
|
cg@2905
|
1049 |
objDirForUsedCompiler
|
cg@2909
|
1050 |
^ self objDirForUsedCompiler:usedCompiler
|
cg@2909
|
1051 |
|
cg@2909
|
1052 |
"Created: / 20-08-2012 / 17:01:13 / cg"
|
cg@2909
|
1053 |
!
|
cg@2909
|
1054 |
|
cg@2909
|
1055 |
objDirForUsedCompiler:usedCompiler
|
cg@2918
|
1056 |
usedCompiler = 'gcc' ifTrue:[^ 'obj']. "/ unix case
|
cg@2918
|
1057 |
|
cg@2905
|
1058 |
usedCompiler = 'bcc' ifTrue:[^ 'objbc'].
|
cg@2905
|
1059 |
usedCompiler = 'vc' ifTrue:[^ 'objvc'].
|
cg@2909
|
1060 |
usedCompiler = 'tcc' ifTrue:[^ 'objtcc'].
|
cg@2909
|
1061 |
usedCompiler = 'lcc' ifTrue:[^ 'objlcc'].
|
cg@2918
|
1062 |
usedCompiler = 'mingw' ifTrue:[^ 'objmingw'].
|
cg@2961
|
1063 |
self halt:'please add compiler here'.
|
cg@2905
|
1064 |
^ 'objbc'
|
cg@2905
|
1065 |
|
cg@2909
|
1066 |
"Created: / 03-09-2012 / 19:55:34 / cg"
|
cg@2905
|
1067 |
!
|
cg@2905
|
1068 |
|
sr@2683
|
1069 |
recursiveCopyDirectoryForBuild:subdir
|
sr@2683
|
1070 |
|targetDir|
|
sr@2683
|
1071 |
|
sr@2683
|
1072 |
targetDir := buildDirectory / 'stx' / subdir.
|
sr@2683
|
1073 |
targetDir exists ifFalse:[
|
sr@2683
|
1074 |
targetDir makeDirectory.
|
sr@2683
|
1075 |
].
|
sr@2683
|
1076 |
(mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile |
|
sr@2683
|
1077 |
eachFile recursiveCopyTo:(targetDir construct:eachFile baseName)
|
sr@2683
|
1078 |
].
|
sr@2683
|
1079 |
self activityNotification:nil
|
sr@2683
|
1080 |
!
|
sr@2683
|
1081 |
|
cg@2644
|
1082 |
setupBuildDirectory
|
cg@3333
|
1083 |
self activityNotification:('Setting up build directory %1' bindWith:buildDirectory pathName).
|
cg@2984
|
1084 |
|
cg@2644
|
1085 |
buildDirectory exists ifFalse:[
|
cg@2644
|
1086 |
buildDirectory recursiveMakeDirectory.
|
cg@2644
|
1087 |
].
|
cg@2644
|
1088 |
(buildDirectory / 'stx') exists ifFalse:[
|
cg@2644
|
1089 |
(buildDirectory / 'stx') makeDirectory.
|
cg@2644
|
1090 |
].
|
cg@2644
|
1091 |
|
cg@2644
|
1092 |
self copyDirectoryForBuild:'include'.
|
cg@2644
|
1093 |
self copyDirectoryForBuild:'rules'.
|
cg@2984
|
1094 |
|
sr@2683
|
1095 |
OperatingSystem isUNIXlike ifTrue:[
|
sr@2683
|
1096 |
self recursiveCopyDirectoryForBuild:'configurations'.
|
sr@2683
|
1097 |
]
|
cg@2635
|
1098 |
!
|
cg@2596
|
1099 |
|
cg@2644
|
1100 |
validateBuildDirectoryIsPresent
|
cg@2644
|
1101 |
|
cg@2644
|
1102 |
^ self.
|
cg@2644
|
1103 |
|
cg@2644
|
1104 |
"/ [
|
cg@2644
|
1105 |
"/ |default directoryIsOKForMe stc |
|
cg@2644
|
1106 |
"/
|
cg@2644
|
1107 |
"/ default := (buildDirectory ?
|
cg@2644
|
1108 |
"/ PreviousBuildDirectory)
|
cg@2644
|
1109 |
"/ ifNil:[ UserPreferences current buildDirectory].
|
cg@2644
|
1110 |
"/
|
cg@2644
|
1111 |
"/ buildDirectory := Dialog requestDirectoryName:'Temporary Work-ROOT for build:'
|
cg@2644
|
1112 |
"/ default:default.
|
cg@2644
|
1113 |
"/
|
cg@2644
|
1114 |
"/ buildDirectory isEmptyOrNil ifTrue:[^ self].
|
cg@2644
|
1115 |
"/ buildDirectory := buildDirectory asFilename.
|
cg@2644
|
1116 |
"/ directoryIsOKForMe := true.
|
cg@2644
|
1117 |
"/
|
cg@2644
|
1118 |
"/ buildDirectory exists ifFalse:[
|
cg@2644
|
1119 |
"/ Dialog warn:(self classResources string:'Work directory %1 does not exist.' with:buildDirectory).
|
cg@2644
|
1120 |
"/ directoryIsOKForMe := false.
|
cg@2644
|
1121 |
"/ ] ifTrue:[
|
cg@2644
|
1122 |
"/ (buildDirectory construct:'stx') exists ifFalse:[
|
cg@2644
|
1123 |
"/ Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stx subDirectory,\which contains (at least) the stc and include subdirectories.').
|
cg@2644
|
1124 |
"/ directoryIsOKForMe := false.
|
cg@2644
|
1125 |
"/ ] ifTrue:[
|
cg@2644
|
1126 |
"/ stc := (OperatingSystem isMSDOSlike) ifTrue:['stc.exe'] ifFalse:['stc'].
|
cg@2644
|
1127 |
"/ (((buildDirectory construct:'stx')construct:'stc')construct:stc) exists ifFalse:[
|
cg@2644
|
1128 |
"/ Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stc compiler in the stx/stc subDirectory.').
|
cg@2644
|
1129 |
"/ directoryIsOKForMe := false.
|
cg@2644
|
1130 |
"/ ].
|
cg@2644
|
1131 |
"/ ((buildDirectory construct:'stx')construct:'include') exists ifFalse:[
|
cg@2644
|
1132 |
"/ Dialog warn:(self classResources stringWithCRs:'Work directory must have had a make run before (for include files to exists).').
|
cg@2644
|
1133 |
"/ directoryIsOKForMe := false.
|
cg@2644
|
1134 |
"/ ].
|
cg@2644
|
1135 |
"/ ]
|
cg@2644
|
1136 |
"/ ].
|
cg@2644
|
1137 |
"/ directoryIsOKForMe
|
cg@2644
|
1138 |
"/ ] whileFalse
|
cg@2596
|
1139 |
! !
|
cg@2596
|
1140 |
|
cg@2596
|
1141 |
!ProjectBuilder class methodsFor:'documentation'!
|
cg@2596
|
1142 |
|
cg@2896
|
1143 |
version
|
cg@2896
|
1144 |
^ '$Header$'
|
cg@2896
|
1145 |
!
|
cg@2896
|
1146 |
|
cg@2596
|
1147 |
version_CVS
|
cg@2596
|
1148 |
^ '$Header$'
|
cg@2596
|
1149 |
! !
|
cg@2958
|
1150 |
|