author | Jan Vrany <jan.vrany@labware.com> |
Sat, 30 Sep 2023 22:55:25 +0100 | |
branch | jv |
changeset 19648 | 5df52d354504 |
parent 19607 | f9108fde4972 |
permissions | -rw-r--r-- |
2628 | 1 |
" |
2 |
COPYRIGHT (c) 1998 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 |
" |
|
7087 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
15950 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
1518 | 16 |
ToolApplicationModel subclass:#ApplicationBuilder |
1525 | 17 |
instanceVariableNames:'task shellView aspects' |
18 |
classVariableNames:'' |
|
1518 | 19 |
poolDictionaries:'' |
7087 | 20 |
category:'Interface-Tools' |
1518 | 21 |
! |
22 |
||
1525 | 23 |
ApplicationBuilder class instanceVariableNames:'aspects' |
24 |
||
25 |
" |
|
13471
3ee11c3d0306
Support for senders/implementors for Java. Fix for accepting Java classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13289
diff
changeset
|
26 |
The following class instance variables are inherited by this class: |
3ee11c3d0306
Support for senders/implementors for Java. Fix for accepting Java classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13289
diff
changeset
|
27 |
|
3ee11c3d0306
Support for senders/implementors for Java. Fix for accepting Java classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13289
diff
changeset
|
28 |
ToolApplicationModel - history fileHistory clipboard settings showingHelp instances |
19607
f9108fde4972
Move `CodeGenerator` and `CodeGeneratorTests` to namespace `Tools`
Jan Vrany <jan.vrany@labware.com>
parents:
15950
diff
changeset
|
29 |
ApplicationModel - ClassResources defaultKeyboardMap defaultStyleSheet |
13471
3ee11c3d0306
Support for senders/implementors for Java. Fix for accepting Java classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13289
diff
changeset
|
30 |
Model - |
3ee11c3d0306
Support for senders/implementors for Java. Fix for accepting Java classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13289
diff
changeset
|
31 |
Object - |
1525 | 32 |
" |
33 |
! |
|
34 |
||
1518 | 35 |
!ApplicationBuilder class methodsFor:'documentation'! |
36 |
||
2628 | 37 |
copyright |
38 |
" |
|
39 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
40 |
All Rights Reserved |
|
41 |
||
42 |
This software is furnished under a license and may be used |
|
43 |
only in accordance with the terms of that license and with the |
|
44 |
inclusion of the above copyright notice. This software may not |
|
45 |
be provided or otherwise made available to, or used by, any |
|
46 |
other person. No title to or ownership of the software is |
|
47 |
hereby transferred. |
|
48 |
" |
|
49 |
||
50 |
||
51 |
! |
|
52 |
||
1518 | 53 |
documentation |
54 |
" |
|
2628 | 55 |
WARNING: unfinished - do not use. |
56 |
||
1518 | 57 |
The Application Builder of ST/X allows you to build ST/X-applications by following steps: |
58 |
||
59 |
0. Clobber the target directory of the application |
|
1525 | 60 |
1. Generate the h-file with symbols |
61 |
2. Generate the c-file with modules |
|
62 |
3. Compile the modules init file |
|
63 |
4. Compile the startup C-file |
|
64 |
5. Define the symbolic links to the libraries |
|
65 |
6. Link the libraries to the application |
|
66 |
7. Define the symbolic links to the resources |
|
67 |
||
1518 | 68 |
[instance variables:] |
69 |
task <Process> task of the running build |
|
1558 | 70 |
shellView <ShellView> shell view for outputting the build results |
1518 | 71 |
|
1525 | 72 |
[instance class variables:] |
73 |
aspects <IdentityDictionary> aspects of the settings |
|
1518 | 74 |
|
75 |
[start with:] |
|
76 |
ApplicationBuilder open |
|
77 |
||
78 |
[see also:] |
|
79 |
LibraryBuilder |
|
80 |
||
81 |
[author:] |
|
82 |
Thomas Zwick, eXept Software AG |
|
83 |
" |
|
84 |
! ! |
|
85 |
||
1525 | 86 |
!ApplicationBuilder class methodsFor:'accessing'! |
87 |
||
88 |
aspects |
|
89 |
||
90 |
aspects isNil ifTrue: [aspects := IdentityDictionary new]. |
|
91 |
^aspects |
|
92 |
||
93 |
||
94 |
! |
|
95 |
||
96 |
aspects: anIdentityDictionary |
|
97 |
||
98 |
aspects := anIdentityDictionary |
|
1558 | 99 |
! |
100 |
||
101 |
label |
|
102 |
||
103 |
^'Application Builder (experimental)' |
|
1525 | 104 |
! ! |
105 |
||
1518 | 106 |
!ApplicationBuilder class methodsFor:'help specs'! |
107 |
||
108 |
helpSpec |
|
109 |
"This resource specification was automatically generated |
|
110 |
by the UIHelpTool of ST/X." |
|
111 |
||
112 |
"Do not manually edit this!! If it is corrupted, |
|
113 |
the UIHelpTool may not be able to read the specification." |
|
114 |
||
115 |
" |
|
116 |
UIHelpTool openOnClass:ApplicationBuilder |
|
117 |
" |
|
118 |
||
119 |
<resource: #help> |
|
120 |
||
121 |
^super helpSpec addPairsFrom:#( |
|
122 |
||
123 |
#applicationLinkDefines |
|
124 |
'Opens a dialog to define the link defines for the application.' |
|
125 |
||
126 |
#applicationName |
|
127 |
'Name of the application.' |
|
128 |
||
129 |
#build |
|
1525 | 130 |
'Starts the process of building the target.' |
1518 | 131 |
|
132 |
#buildDate |
|
133 |
'Build date of the application.' |
|
134 |
||
135 |
#configuration |
|
136 |
'Configuration information of the application.' |
|
137 |
||
138 |
#libraryDirectory |
|
139 |
'Directory of the ST/X libraries.' |
|
140 |
||
1525 | 141 |
#link |
142 |
'Starts the process of linking the application.' |
|
143 |
||
1558 | 144 |
#selectPath |
145 |
'Opens a dialog for choosing the name of the file/path.' |
|
146 |
||
147 |
#sourceDirectory |
|
148 |
'Source directory of ST/X.' |
|
149 |
||
1518 | 150 |
#start |
151 |
'Start the build application.' |
|
152 |
||
153 |
#startupCFile |
|
154 |
'Startup C-file of ST/X for the application.' |
|
155 |
||
156 |
#startupFile |
|
157 |
'Startup C-file of ST/X for the application.' |
|
158 |
||
159 |
#startupMessage |
|
160 |
'Startup message consisting of the class name and the selector name.' |
|
161 |
||
162 |
#startupModule |
|
163 |
'Startup module of ST/X for the application.' |
|
164 |
||
165 |
#stop |
|
1525 | 166 |
'Stops the process of the building.' |
1518 | 167 |
|
168 |
#stxLibraries |
|
169 |
'List of the ST/X library names.' |
|
170 |
||
171 |
#symlinkBitmaps |
|
172 |
'Create symbolic links to the bitmaps of ST/X.' |
|
173 |
||
174 |
#symlinkRCFiles |
|
175 |
'Create symbolic links to the RC-files of ST/X.' |
|
176 |
||
177 |
#symlinkResources |
|
178 |
'Create symbolic links to the resources of ST/X.' |
|
179 |
||
180 |
#symlinkSources |
|
181 |
'Create symbolic links to the sources of ST/X.' |
|
182 |
||
183 |
#systemLibaries |
|
1525 | 184 |
'Libraries of the operating system needed by the target.' |
1518 | 185 |
|
186 |
#targetDirectory |
|
1525 | 187 |
'Directory where the target will build.' |
1518 | 188 |
|
189 |
#topDirectory |
|
190 |
'Top directory of ST/X.' |
|
191 |
||
192 |
#userLibraries |
|
193 |
'Libraries of the user wanted to add to the application.' |
|
194 |
||
195 |
) |
|
196 |
! ! |
|
197 |
||
198 |
!ApplicationBuilder class methodsFor:'interface specs'! |
|
199 |
||
200 |
windowSpec |
|
201 |
"This resource specification was automatically generated |
|
202 |
by the UIPainter of ST/X." |
|
203 |
||
204 |
"Do not manually edit this!! If it is corrupted, |
|
205 |
the UIPainter may not be able to read the specification." |
|
206 |
||
207 |
" |
|
208 |
UIPainter new openOnClass:ApplicationBuilder andSelector:#windowSpec |
|
209 |
ApplicationBuilder new openInterface:#windowSpec |
|
210 |
ApplicationBuilder open |
|
211 |
" |
|
212 |
||
213 |
<resource: #canvas> |
|
214 |
||
215 |
^ |
|
216 |
||
217 |
#(#FullSpec |
|
218 |
#window: |
|
219 |
#(#WindowSpec |
|
220 |
#name: 'Application Builder' |
|
1558 | 221 |
#layout: #(#LayoutFrame 79 0 285 0 578 0 744 0) |
1518 | 222 |
#label: 'Application Builder' |
223 |
#min: #(#Point 420 220) |
|
224 |
#max: #(#Point 1152 900) |
|
1558 | 225 |
#bounds: #(#Rectangle 79 285 579 745) |
1518 | 226 |
#menu: #menu |
227 |
#usePreferredExtent: false |
|
228 |
) |
|
229 |
#component: |
|
230 |
#(#SpecCollection |
|
231 |
#collection: |
|
232 |
#( |
|
233 |
#(#ViewSpec |
|
234 |
#name: 'Box1' |
|
1525 | 235 |
#layout: #(#LayoutFrame 0 0.0 3 0 0 1.0 292 0) |
1518 | 236 |
#component: |
237 |
#(#SpecCollection |
|
238 |
#collection: |
|
239 |
#( |
|
240 |
#(#ViewSpec |
|
241 |
#name: 'Box2' |
|
242 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 -148 1.0 2 1.0) |
|
243 |
#component: |
|
244 |
#(#SpecCollection |
|
245 |
#collection: |
|
246 |
#( |
|
247 |
#(#LabelSpec |
|
248 |
#name: 'applicationNameLabel' |
|
249 |
#layout: #(#AlignmentOrigin 147 0 15 0 1 0.5) |
|
250 |
#label: 'Application Name:' |
|
251 |
#adjust: #right |
|
252 |
) |
|
253 |
#(#InputFieldSpec |
|
254 |
#name: 'applicationNameField' |
|
255 |
#layout: #(#LayoutFrame 150 0 4 0 0 1 26 0) |
|
256 |
#activeHelpKey: #applicationName |
|
257 |
#model: #applicationName |
|
258 |
) |
|
259 |
#(#LabelSpec |
|
260 |
#name: 'startupMessageLabel' |
|
261 |
#layout: #(#AlignmentOrigin 147 0 39 0 1 0.5) |
|
262 |
#label: 'Startup Message:' |
|
263 |
#adjust: #right |
|
264 |
) |
|
265 |
#(#InputFieldSpec |
|
266 |
#name: 'startupMessageField' |
|
267 |
#layout: #(#LayoutFrame 150 0 28 0 0 1.0 50 0) |
|
268 |
#activeHelpKey: #startupMessage |
|
269 |
#model: #startupMessage |
|
270 |
) |
|
271 |
#(#LabelSpec |
|
272 |
#name: 'buildDateLabel' |
|
273 |
#layout: #(#AlignmentOrigin 147 0 63 0 1 0.5) |
|
274 |
#label: 'Build Date:' |
|
275 |
#adjust: #right |
|
276 |
) |
|
277 |
#(#InputFieldSpec |
|
278 |
#name: 'buildDateField' |
|
279 |
#layout: #(#LayoutFrame 150 0 52 0 0 1.0 74 0) |
|
280 |
#activeHelpKey: #buildDate |
|
281 |
#model: #buildDate |
|
282 |
) |
|
283 |
#(#LabelSpec |
|
284 |
#name: 'configurationLabel' |
|
285 |
#layout: #(#AlignmentOrigin 147 0 87 0 1 0.5) |
|
286 |
#label: 'Configuration:' |
|
287 |
#adjust: #right |
|
288 |
) |
|
289 |
#(#InputFieldSpec |
|
290 |
#name: 'configurationField' |
|
291 |
#layout: #(#LayoutFrame 150 0 76 0 0 1.0 98 0) |
|
292 |
#activeHelpKey: #configuration |
|
293 |
#model: #configuration |
|
294 |
) |
|
295 |
#(#DividerSpec |
|
1525 | 296 |
#name: 'Separator2' |
1518 | 297 |
#layout: #(#LayoutFrame 0 0 102 0 0 1 105 0) |
298 |
) |
|
299 |
#(#ActionButtonSpec |
|
300 |
#name: 'targetDirectoryButton' |
|
301 |
#layout: #(#LayoutFrame 4 0 109 0 147 0 133 0) |
|
1558 | 302 |
#activeHelpKey: #selectPath |
1518 | 303 |
#label: 'Target Directory:' |
304 |
#model: #doSelectDirectory: |
|
305 |
#actionValue: 'Target' |
|
306 |
) |
|
307 |
#(#InputFieldSpec |
|
308 |
#name: 'targetDirectoryField' |
|
309 |
#layout: #(#LayoutFrame 150 0 109 0 0 1.0 131 0) |
|
310 |
#activeHelpKey: #targetDirectory |
|
311 |
#model: #targetDirectory |
|
312 |
) |
|
313 |
#(#ActionButtonSpec |
|
314 |
#name: 'topDirectoryButton' |
|
315 |
#layout: #(#LayoutFrame 4 0 133 0 147 0 157 0) |
|
1558 | 316 |
#activeHelpKey: #selectPath |
1518 | 317 |
#label: 'Top Directory:' |
318 |
#model: #doSelectDirectory: |
|
319 |
#actionValue: 'Top' |
|
320 |
) |
|
321 |
#(#InputFieldSpec |
|
322 |
#name: 'topDirectoryField' |
|
323 |
#layout: #(#LayoutFrame 150 0 133 0 0 1.0 155 0) |
|
324 |
#activeHelpKey: #topDirectory |
|
325 |
#model: #topDirectory |
|
326 |
) |
|
327 |
#(#ActionButtonSpec |
|
328 |
#name: 'libraryDirectoryButton' |
|
329 |
#layout: #(#LayoutFrame 4 0 157 0 147 0 181 0) |
|
1558 | 330 |
#activeHelpKey: #selectPath |
1518 | 331 |
#label: 'Library Directory:' |
332 |
#model: #doSelectDirectory: |
|
333 |
#actionValue: 'Library' |
|
334 |
) |
|
335 |
#(#InputFieldSpec |
|
336 |
#name: 'libraryDirectoryField' |
|
337 |
#layout: #(#LayoutFrame 150 0 157 0 0 1.0 179 0) |
|
338 |
#activeHelpKey: #libraryDirectory |
|
339 |
#model: #libraryDirectory |
|
340 |
) |
|
341 |
#(#ActionButtonSpec |
|
342 |
#name: 'startupCFileButton' |
|
343 |
#layout: #(#LayoutFrame 4 0 181 0 147 0 205 0) |
|
1558 | 344 |
#activeHelpKey: #selectPath |
1518 | 345 |
#label: 'Startup C-File:' |
346 |
#model: #doSelectCFile: |
|
347 |
#actionValue: 'StartupCFile' |
|
348 |
) |
|
349 |
#(#InputFieldSpec |
|
350 |
#name: 'startupCFileField' |
|
351 |
#layout: #(#LayoutFrame 150 0 181 0 0 1.0 203 0) |
|
352 |
#activeHelpKey: #startupModule |
|
353 |
#model: #startupCFile |
|
354 |
) |
|
355 |
#(#DividerSpec |
|
1525 | 356 |
#name: 'Separator3' |
1518 | 357 |
#layout: #(#LayoutFrame 0 0.0 208 0 0 1.0 211 0) |
358 |
) |
|
359 |
#(#LabelSpec |
|
360 |
#name: 'stxLibraryButton' |
|
1525 | 361 |
#layout: #(#AlignmentOrigin 147 0 227 0 1 0.5) |
1518 | 362 |
#label: 'ST/X Libraries:' |
363 |
) |
|
364 |
#(#ComboBoxSpec |
|
365 |
#name: 'stxLibrariesComboBox' |
|
366 |
#layout: #(#LayoutFrame 150 0 216 0 0 1 238 0) |
|
367 |
#activeHelpKey: #stxLibraries |
|
368 |
#model: #stxLibrary |
|
369 |
#immediateAccept: false |
|
370 |
#acceptOnTab: false |
|
371 |
#comboList: #stxLibraries |
|
372 |
) |
|
373 |
#(#ActionButtonSpec |
|
374 |
#name: 'systemLibrariesButton' |
|
375 |
#layout: #(#LayoutFrame 4 0 239 0 147 0 263 0) |
|
1558 | 376 |
#activeHelpKey: #selectPath |
1518 | 377 |
#label: 'System Libraries:' |
378 |
#model: #doSelectLibrary: |
|
379 |
#actionValue: 'SystemLibrary' |
|
380 |
) |
|
381 |
#(#ComboBoxSpec |
|
382 |
#name: 'systemLibrariesComboBox' |
|
383 |
#layout: #(#LayoutFrame 150 0 240 0 0 1 262 0) |
|
384 |
#activeHelpKey: #systemLibaries |
|
385 |
#model: #systemLibrary |
|
386 |
#immediateAccept: false |
|
387 |
#acceptOnTab: false |
|
388 |
#comboList: #systemLibraries |
|
389 |
) |
|
390 |
#(#ActionButtonSpec |
|
391 |
#name: 'userLibrariesButton' |
|
392 |
#layout: #(#LayoutFrame 4 0 263 0 147 0 287 0) |
|
1558 | 393 |
#activeHelpKey: #selectPath |
1518 | 394 |
#label: 'User Libraries:' |
395 |
#model: #doSelectLibrary: |
|
396 |
#actionValue: 'UserLibrary' |
|
397 |
) |
|
398 |
#(#ComboBoxSpec |
|
399 |
#name: 'userLibrariesComboBox' |
|
400 |
#layout: #(#LayoutFrame 150 0 264 0 0 1 286 0) |
|
401 |
#activeHelpKey: #userLibraries |
|
402 |
#model: #userLibrary |
|
403 |
#immediateAccept: false |
|
404 |
#acceptOnTab: false |
|
405 |
#comboList: #userLibraries |
|
406 |
) |
|
407 |
) |
|
408 |
) |
|
409 |
) |
|
1525 | 410 |
#(#DividerSpec |
411 |
#name: 'Separator4' |
|
412 |
#layout: #(#LayoutFrame -144 1 0 0.0 -138 1 0 1.0) |
|
413 |
#orientation: #vertical |
|
414 |
) |
|
1518 | 415 |
#(#ViewSpec |
416 |
#name: 'Box3' |
|
417 |
#layout: #(#LayoutFrame -134 1 0 0.0 0 1.0 0 1.0) |
|
418 |
#component: |
|
419 |
#(#SpecCollection |
|
420 |
#collection: |
|
421 |
#( |
|
422 |
#(#FramedBoxSpec |
|
423 |
#name: 'FramedBox' |
|
1525 | 424 |
#layout: #(#LayoutFrame -4 0.0 4 0.0 0 1.0 -150 1.0) |
1518 | 425 |
#component: |
426 |
#(#SpecCollection |
|
427 |
#collection: |
|
428 |
#( |
|
429 |
#(#CheckBoxSpec |
|
430 |
#name: 'linkRCFilesCheckBox' |
|
431 |
#layout: #(#LayoutFrame 12 0 24 0 12 1 46 0) |
|
432 |
#activeHelpKey: #symlinkRCFiles |
|
433 |
#model: #linkRCFiles |
|
434 |
#label: 'RC-Files' |
|
435 |
) |
|
436 |
#(#CheckBoxSpec |
|
437 |
#name: 'linkResourcesCheckBox' |
|
438 |
#layout: #(#LayoutFrame 12 0 48 0 12 1 70 0) |
|
439 |
#activeHelpKey: #symlinkResources |
|
440 |
#model: #linkResources |
|
441 |
#label: 'Resources' |
|
442 |
) |
|
443 |
#(#CheckBoxSpec |
|
444 |
#name: 'linkSourcesCheckBox' |
|
445 |
#layout: #(#LayoutFrame 12 0 72 0 12 1 94 0) |
|
446 |
#activeHelpKey: #symlinkSources |
|
447 |
#model: #linkSources |
|
448 |
#label: 'Sources' |
|
449 |
) |
|
450 |
#(#CheckBoxSpec |
|
451 |
#name: 'linkBitmapsCheckBox' |
|
452 |
#layout: #(#LayoutFrame 12 0 96 0 12 1 118 0) |
|
453 |
#activeHelpKey: #symlinkBitmaps |
|
454 |
#model: #linkBitmaps |
|
455 |
#label: 'Bitmaps' |
|
456 |
) |
|
457 |
) |
|
458 |
) |
|
459 |
#label: 'Symbolic Links' |
|
460 |
#labelPosition: #topLeft |
|
461 |
) |
|
462 |
#(#VerticalPanelViewSpec |
|
463 |
#name: 'VerticalPanel' |
|
1525 | 464 |
#layout: #(#LayoutFrame 0 0.0 -144 1 -6 1.0 -2 1.0) |
1518 | 465 |
#component: |
466 |
#(#SpecCollection |
|
467 |
#collection: |
|
468 |
#( |
|
469 |
#(#ActionButtonSpec |
|
470 |
#name: 'buildButton' |
|
471 |
#activeHelpKey: #build |
|
472 |
#label: 'Build' |
|
473 |
#model: #doBuild |
|
1525 | 474 |
#extent: #(#Point 128 33) |
475 |
) |
|
476 |
#(#ActionButtonSpec |
|
477 |
#name: 'linkButton' |
|
478 |
#activeHelpKey: #link |
|
479 |
#label: 'Link' |
|
480 |
#model: #doLink |
|
481 |
#extent: #(#Point 128 34) |
|
1518 | 482 |
) |
483 |
#(#ActionButtonSpec |
|
484 |
#name: 'stopButton' |
|
485 |
#activeHelpKey: #stop |
|
486 |
#label: 'Stop' |
|
487 |
#model: #doStop |
|
1525 | 488 |
#extent: #(#Point 128 33) |
1518 | 489 |
) |
490 |
#(#ActionButtonSpec |
|
491 |
#name: 'Button1' |
|
492 |
#activeHelpKey: #start |
|
493 |
#label: 'Start' |
|
494 |
#model: #doStart |
|
1525 | 495 |
#extent: #(#Point 128 33) |
1518 | 496 |
) |
497 |
) |
|
498 |
) |
|
499 |
#horizontalLayout: #fit |
|
500 |
#verticalLayout: #fit |
|
501 |
#horizontalSpace: 3 |
|
502 |
#verticalSpace: 3 |
|
503 |
) |
|
504 |
) |
|
505 |
) |
|
506 |
) |
|
507 |
) |
|
508 |
) |
|
1525 | 509 |
#borderWidth: 1 |
1518 | 510 |
) |
511 |
#(#SubCanvasSpec |
|
1525 | 512 |
#name: 'shellViewSubCanvas' |
513 |
#layout: #(#LayoutFrame 0 0.0 294 0 0 1.0 -26 1) |
|
1518 | 514 |
#hasHorizontalScrollBar: false |
515 |
#hasVerticalScrollBar: false |
|
516 |
#clientHolder: #shellView |
|
517 |
) |
|
518 |
#(#UISubSpecification |
|
519 |
#name: 'windowSpecForInfoBar' |
|
520 |
#layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
521 |
#majorKey: #ToolApplicationModel |
|
522 |
#minorKey: #windowSpecForInfoBar |
|
523 |
) |
|
524 |
) |
|
525 |
) |
|
526 |
) |
|
527 |
! ! |
|
528 |
||
529 |
!ApplicationBuilder class methodsFor:'menu specs'! |
|
530 |
||
531 |
menu |
|
532 |
"This resource specification was automatically generated |
|
533 |
by the MenuEditor of ST/X." |
|
534 |
||
535 |
"Do not manually edit this!! If it is corrupted, |
|
536 |
the MenuEditor may not be able to read the specification." |
|
537 |
||
538 |
" |
|
539 |
MenuEditor new openOnClass:ApplicationBuilder andSelector:#menu |
|
540 |
(Menu new fromLiteralArrayEncoding:(ApplicationBuilder menu)) startUp |
|
541 |
" |
|
542 |
||
543 |
<resource: #menu> |
|
544 |
||
545 |
^ |
|
546 |
||
547 |
#(#Menu |
|
548 |
||
549 |
#( |
|
550 |
#(#MenuItem |
|
1558 | 551 |
#label: 'About' |
552 |
#labelImage: #(#ResourceRetriever nil #menuIcon) |
|
553 |
#submenuChannel: #menuAbout |
|
554 |
) |
|
555 |
#(#MenuItem |
|
1518 | 556 |
#label: 'File' |
557 |
#submenu: |
|
558 |
#(#Menu |
|
559 |
||
560 |
#( |
|
561 |
#(#MenuItem |
|
1558 | 562 |
#label: 'Exit' |
563 |
#value: #closeRequest |
|
564 |
#activeHelpKey: #fileExit |
|
565 |
) |
|
566 |
) nil |
|
567 |
nil |
|
568 |
) |
|
569 |
) |
|
570 |
#(#MenuItem |
|
571 |
#label: 'Application' |
|
572 |
#submenu: |
|
573 |
#(#Menu |
|
574 |
||
575 |
#( |
|
576 |
#(#MenuItem |
|
1518 | 577 |
#label: 'Build' |
578 |
#value: #doBuild |
|
579 |
#activeHelpKey: #build |
|
580 |
) |
|
581 |
#(#MenuItem |
|
1525 | 582 |
#label: 'Link' |
583 |
#value: #doLink |
|
584 |
#activeHelpKey: #link |
|
585 |
) |
|
586 |
#(#MenuItem |
|
1558 | 587 |
#label: '-' |
588 |
) |
|
589 |
#(#MenuItem |
|
1518 | 590 |
#label: 'Stop' |
591 |
#value: #doStop |
|
592 |
#activeHelpKey: #stop |
|
593 |
) |
|
594 |
#(#MenuItem |
|
595 |
#label: 'Start' |
|
596 |
#value: #doStart |
|
597 |
#activeHelpKey: #start |
|
598 |
) |
|
599 |
) nil |
|
600 |
nil |
|
601 |
) |
|
602 |
) |
|
603 |
#(#MenuItem |
|
604 |
#label: 'Settings' |
|
605 |
#submenu: |
|
606 |
#(#Menu |
|
607 |
||
608 |
#( |
|
609 |
#(#MenuItem |
|
610 |
#label: 'Target Directory...' |
|
611 |
#value: #doSelectDirectory: |
|
612 |
#activeHelpKey: #targetDirectory |
|
613 |
#argument: 'Target' |
|
614 |
) |
|
615 |
#(#MenuItem |
|
616 |
#label: 'Top Directory...' |
|
617 |
#value: #doSelectDirectory: |
|
618 |
#activeHelpKey: #topDirectory |
|
619 |
#argument: 'Top' |
|
620 |
) |
|
621 |
#(#MenuItem |
|
622 |
#label: 'Library Directory...' |
|
623 |
#value: #doSelectDirectory: |
|
624 |
#activeHelpKey: #libraryDirectory |
|
625 |
#argument: 'Library' |
|
626 |
) |
|
627 |
#(#MenuItem |
|
628 |
#label: 'Startup C-File...' |
|
629 |
#value: #doSelectCFile: |
|
630 |
#activeHelpKey: #startupCFile |
|
631 |
#argument: 'StartupCFile' |
|
632 |
) |
|
633 |
#(#MenuItem |
|
634 |
#label: '-' |
|
635 |
) |
|
636 |
#(#MenuItem |
|
637 |
#label: 'System Libraries...' |
|
638 |
#value: #doSelectLibrary: |
|
639 |
#activeHelpKey: #systemLibaries |
|
640 |
#argument: 'SystemLibrary' |
|
641 |
) |
|
642 |
#(#MenuItem |
|
643 |
#label: 'User Libraries...' |
|
644 |
#value: #doSelectLibrary: |
|
645 |
#activeHelpKey: #userLibraries |
|
646 |
#argument: 'UserLibrary' |
|
647 |
) |
|
648 |
#(#MenuItem |
|
649 |
#label: '-' |
|
650 |
) |
|
651 |
#(#MenuItem |
|
652 |
#label: 'Application Link Defines...' |
|
653 |
#value: #doDefineApplicationLinkDefines |
|
654 |
#activeHelpKey: #applicationLinkDefines |
|
655 |
) |
|
656 |
#(#MenuItem |
|
657 |
#label: '-' |
|
658 |
) |
|
659 |
#(#MenuItem |
|
660 |
#label: 'Fonts' |
|
661 |
#submenuChannel: #menuFont |
|
662 |
) |
|
663 |
) nil |
|
664 |
nil |
|
665 |
) |
|
666 |
) |
|
667 |
#(#MenuItem |
|
668 |
#label: 'Help' |
|
669 |
#startGroup: #right |
|
670 |
#submenuChannel: #menuHelp |
|
671 |
) |
|
672 |
) nil |
|
673 |
nil |
|
674 |
) |
|
675 |
! ! |
|
676 |
||
677 |
!ApplicationBuilder methodsFor:'actions'! |
|
678 |
||
679 |
doBuild |
|
680 |
"builds the application by doing following tasks: |
|
681 |
0. Clobber the target directory of the application |
|
1525 | 682 |
1. Generate the h-file with symbols |
683 |
2. Generate the c-file with modules |
|
684 |
3. Compile the modules init file |
|
685 |
4. Compile the startup C-file |
|
686 |
5. Define the symbolic links to the libraries |
|
687 |
6. Link the libraries to the application |
|
688 |
7. Define the symbolic links to the resources |
|
1518 | 689 |
" |
690 |
|dir compilerPath compilerFlags block0 block1 block2 block3 block4 block5 block6 block7 priority| |
|
691 |
||
692 |
task notNil ifTrue: [self warn: 'There is already a build running!!']. |
|
693 |
||
694 |
self inform: 'Starting building of application...' asBoldText. |
|
695 |
||
1525 | 696 |
(dir := self getTargetDirectory) isNil |
1518 | 697 |
ifTrue: [^self warn: 'Could not create application directory!!']. |
698 |
||
699 |
shellView directory: dir. |
|
700 |
||
701 |
(compilerPath := ByteCodeCompiler ccPath, ' ') isNil |
|
702 |
ifTrue: [^self warn:'Define first a system compiler!!']. |
|
703 |
compilerFlags := self getCompilerFlags. |
|
704 |
||
1525 | 705 |
block0 := self getBlockForClobberingTargetDirectory: dir. |
706 |
block1 := self getBlockForGeneratingHFileWithSymbolsIn: dir. |
|
707 |
block2 := self getBlockForGeneratingCFileWithModulesIn: dir. |
|
708 |
block3 := self getBlockForCompilingModulListFileWith: compilerPath, compilerFlags inDirectory: dir. |
|
709 |
block4 := self getBlockForCompilingStartupCFileWith: compilerPath, compilerFlags inDirectory: dir. |
|
710 |
block5 := self getBlockForCreatingSymbolicLinksToTheLibrariesIn: dir. |
|
711 |
block6 := self getBlockForLinkingLibrariesToTheApplicationIn: dir. |
|
712 |
block7 := self getBlockForCreatingSymbolicLinksToTheResourcesIn: dir. |
|
1518 | 713 |
|
714 |
priority := Processor userBackgroundPriority. |
|
715 |
task := block0 forkAt: priority. |
|
716 |
task addExitAction: |
|
717 |
[ |
|
718 |
task isNil ifTrue: |
|
719 |
[ |
|
720 |
task := block1 forkAt: priority. |
|
721 |
task addExitAction: |
|
722 |
[ |
|
723 |
task isNil ifTrue: |
|
724 |
[ |
|
725 |
task := block2 forkAt: priority. |
|
726 |
task addExitAction: |
|
727 |
[ |
|
728 |
task isNil ifTrue: |
|
729 |
[ |
|
730 |
task := block3 forkAt: priority. |
|
731 |
task addExitAction: |
|
732 |
[ |
|
733 |
task isNil ifTrue: |
|
734 |
[ |
|
735 |
task := block4 forkAt: priority. |
|
736 |
task addExitAction: |
|
737 |
[ |
|
738 |
task isNil ifTrue: |
|
739 |
[ |
|
740 |
task := block5 forkAt: priority. |
|
741 |
task addExitAction: |
|
742 |
[ |
|
743 |
task isNil ifTrue: |
|
744 |
[ |
|
745 |
task := block6 forkAt: priority. |
|
746 |
task addExitAction: |
|
747 |
[ |
|
748 |
task isNil ifTrue: |
|
749 |
[ |
|
750 |
task := block7 forkAt: priority. |
|
751 |
task addExitAction: |
|
752 |
[ |
|
1525 | 753 |
task isNil |
754 |
ifTrue: [self inform: 'Application build.' asBoldText] |
|
1630 | 755 |
ifFalse: [self informTargetBuildingFailed]. |
1518 | 756 |
Display beep. |
757 |
] |
|
1630 | 758 |
] ifFalse: [self informTargetBuildingFailed] |
1518 | 759 |
] |
1630 | 760 |
] ifFalse: [self informTargetBuildingFailed] |
1518 | 761 |
] |
1630 | 762 |
] ifFalse: [self informTargetBuildingFailed] |
1518 | 763 |
] |
1630 | 764 |
] ifFalse: [self informTargetBuildingFailed] |
1518 | 765 |
] |
1630 | 766 |
] ifFalse: [self informTargetBuildingFailed] |
1518 | 767 |
] |
1630 | 768 |
] ifFalse: [self informTargetBuildingFailed] |
1518 | 769 |
] |
1630 | 770 |
] ifFalse: [self informTargetBuildingFailed] |
1518 | 771 |
] |
772 |
! |
|
773 |
||
774 |
doDefineApplicationLinkDefines |
|
775 |
"opens a dialog for defining the application defines" |
|
776 |
||
777 |
|box| |
|
778 |
box := EnterBox new. |
|
779 |
box label: 'Application Link Defines'. |
|
1525 | 780 |
box initialText: (aspects at: #applicationLinkDefines) value. |
1518 | 781 |
box showAtPointer. |
782 |
box accepted |
|
783 |
ifTrue: |
|
784 |
[ |
|
1525 | 785 |
(aspects at: #applicationLinkDefines) value: box contents |
1518 | 786 |
]. |
787 |
box destroy |
|
788 |
! |
|
789 |
||
1525 | 790 |
doLink |
791 |
"links the application" |
|
792 |
||
793 |
|dir block priority| |
|
794 |
||
795 |
task notNil ifTrue: [self warn: 'There is already a build running!!']. |
|
796 |
||
797 |
self inform: 'Starting building of application...' asBoldText. |
|
798 |
||
799 |
(dir := self getTargetDirectory) isNil |
|
800 |
ifTrue: [^self warn: 'Could not create application directory!!']. |
|
801 |
||
802 |
shellView directory: dir. |
|
803 |
||
804 |
block := self getBlockForLinkingLibrariesToTheApplicationIn: dir. |
|
805 |
||
806 |
priority := Processor userBackgroundPriority. |
|
807 |
task := block forkAt: priority. |
|
808 |
task addExitAction: |
|
809 |
[ |
|
810 |
task isNil |
|
811 |
ifTrue: [self inform: 'Application build.' asBoldText] |
|
1630 | 812 |
ifFalse:[self informTargetBuildingFailed]. |
1525 | 813 |
Display beep. |
814 |
] |
|
815 |
! |
|
816 |
||
1518 | 817 |
doSelectCFile: whichFile |
818 |
"opens a FileSelectionBrowser in order to select C-file" |
|
819 |
||
820 |
|currentFile selectedFile| |
|
821 |
||
1525 | 822 |
currentFile := aspects at: whichFile asLowercaseFirst asSymbol. |
1518 | 823 |
|
824 |
((selectedFile := FileSelectionBrowser |
|
825 |
request: 'Select Your ', whichFile, ' File' |
|
826 |
fileName: currentFile value |
|
827 |
withFileFilters: #('*.c')) notNil and: |
|
828 |
[selectedFile asFilename exists and: [selectedFile asFilename isDirectory not]]) |
|
829 |
ifTrue: [currentFile value: selectedFile] |
|
830 |
||
831 |
||
832 |
! |
|
833 |
||
834 |
doSelectDirectory: whichDir |
|
835 |
"opens a FileSelectionBrowser in order to select directory" |
|
836 |
||
837 |
|currentDir selectedDir| |
|
838 |
||
1525 | 839 |
currentDir := aspects at: (whichDir asLowercaseFirst, 'Directory') asSymbol. |
1518 | 840 |
|
841 |
((selectedDir := FileSelectionBrowser |
|
842 |
request: 'Select Your ', whichDir, ' Directory' |
|
843 |
fileName: nil |
|
844 |
inDirectory: currentDir value |
|
845 |
withFileFilters: #('*.*o')) notNil and: |
|
846 |
[selectedDir asFilename exists and: [selectedDir asFilename isDirectory]]) |
|
847 |
ifTrue: [currentDir value: selectedDir. shellView executeCommand: 'cd ', selectedDir] |
|
848 |
||
849 |
||
850 |
! |
|
851 |
||
852 |
doSelectLibrary: whichFile |
|
853 |
"opens a FileSelectionBrowser in order to select library" |
|
854 |
||
855 |
|currentFile selectedFile| |
|
856 |
||
1525 | 857 |
currentFile := aspects at: whichFile asLowercaseFirst asSymbol. |
1518 | 858 |
|
859 |
((selectedFile := FileSelectionBrowser |
|
860 |
request: 'Select Your ', whichFile, ' File' |
|
861 |
fileName: currentFile value |
|
862 |
withFileFilters: #('*.*o' '*.a')) notNil and: |
|
863 |
[selectedFile asFilename exists and: [selectedFile asFilename isDirectory not]]) |
|
864 |
ifTrue: [currentFile value: selectedFile] |
|
865 |
||
866 |
||
867 |
! |
|
868 |
||
869 |
doStart |
|
870 |
"starts the build application" |
|
871 |
||
872 |
|dir| |
|
873 |
self doStop. |
|
1525 | 874 |
(dir := self getTargetDirectory) isNil |
1518 | 875 |
ifTrue: [^self warn: 'Application directory does not exists!!']. |
876 |
||
877 |
shellView directory: dir. |
|
1525 | 878 |
shellView executeCommand: (aspects at: #applicationName) value. |
1518 | 879 |
|
880 |
! |
|
881 |
||
882 |
doStop |
|
883 |
"terminates the task of the current build" |
|
884 |
||
885 |
task notNil ifTrue: [task removeAllExitActions. task terminate]. |
|
886 |
task := nil. |
|
887 |
shellView executeCommand: 'clear'. |
|
888 |
self inform: '' |
|
889 |
||
1525 | 890 |
! |
891 |
||
892 |
executeCommand: aCommand inDirectory: dir |
|
893 |
"executes aCommand in directory dir; put aCommand and the result into the shell view" |
|
894 |
||
895 |
|outStream| |
|
896 |
||
897 |
shellView directory: dir. |
|
898 |
shellView append: shellView getDirectoryTextString, ' ', aCommand. |
|
899 |
||
900 |
outStream:= PipeStream readingFrom: aCommand errorDisposition:#inline inDirectory: dir. |
|
901 |
[ |
|
902 |
outStream canReadWithoutBlocking |
|
903 |
ifTrue: |
|
904 |
[ |
|
905 |
outStream readWait. |
|
1558 | 906 |
shellView append: (Text string: (outStream upTo: Character cr) color: Color red). |
1525 | 907 |
]. |
908 |
] doWhile:[outStream atEnd not]. |
|
909 |
||
910 |
outStream close |
|
911 |
||
912 |
! |
|
913 |
||
914 |
inform: aString |
|
915 |
"outputs aString via shell view as information" |
|
916 |
||
917 |
shellView commandInputField contents: aString |
|
918 |
||
919 |
||
920 |
||
921 |
||
922 |
! |
|
923 |
||
1630 | 924 |
informTargetBuildingFailed |
1525 | 925 |
"informs that something went wrong" |
926 |
||
1630 | 927 |
self inform: 'Application building failed.' asBoldText. |
1525 | 928 |
task := nil |
1518 | 929 |
! ! |
930 |
||
931 |
!ApplicationBuilder methodsFor:'aspects'! |
|
932 |
||
933 |
aspectFor:aKey |
|
934 |
"returns an aspect at aKey" |
|
935 |
||
1525 | 936 |
^aspects at: aKey ifAbsent: [super aspectFor:aKey] |
1518 | 937 |
! |
938 |
||
939 |
aspectsAt: aKey putFirst: anObject |
|
940 |
"puts firstly anObject as ValueHolder at aKey and returns it" |
|
941 |
||
1525 | 942 |
^aspects at: aKey ifAbsent: [aspects at: aKey put: anObject asValue] |
1518 | 943 |
|
944 |
||
945 |
||
946 |
||
947 |
||
948 |
||
949 |
||
950 |
||
951 |
||
952 |
||
953 |
||
954 |
||
955 |
||
956 |
||
957 |
||
958 |
||
959 |
||
960 |
||
961 |
||
962 |
||
963 |
||
964 |
||
965 |
||
966 |
||
967 |
||
968 |
||
969 |
||
970 |
||
971 |
! |
|
972 |
||
973 |
shellView |
|
974 |
"returns a shell view" |
|
975 |
||
1525 | 976 |
shellView isNil ifTrue: [shellView := ShellView new. shellView directory: (aspects at: #topDirectory) value]. |
1518 | 977 |
^shellView |
978 |
||
979 |
||
980 |
||
981 |
! ! |
|
982 |
||
1525 | 983 |
!ApplicationBuilder methodsFor:'building blocks'! |
1518 | 984 |
|
1525 | 985 |
getBlockForClobberingTargetDirectory: dir |
986 |
"returns the block for clobbering the target directory of the application" |
|
1518 | 987 |
|
1525 | 988 |
^ |
989 |
[ |
|
990 |
self inform: 'Clobbering the target directory...'. |
|
991 |
self executeCommand: 'rm -r *' inDirectory: dir. |
|
992 |
task := nil |
|
993 |
] |
|
1518 | 994 |
|
995 |
! |
|
996 |
||
1525 | 997 |
getBlockForCompilingModulListFileWith: compilerPathAndFlags inDirectory: dir |
998 |
"returns the block for compiling the C-file with the list of the module names" |
|
1518 | 999 |
|
1525 | 1000 |
^ |
1001 |
[ |
|
1002 |
|command| |
|
1003 |
self inform: 'Starting compilation of the modules init file...'. |
|
1004 |
command := compilerPathAndFlags , ' -c -fPIC -O6 -fomit-frame-pointer -m486 -DDEBUG -Di386 modulList.c'. |
|
1005 |
self executeCommand: command inDirectory: dir. |
|
1006 |
(dir asFilename construct: 'modulList.o') exists |
|
1007 |
ifTrue: [task := nil] |
|
1008 |
ifFalse: [self warn:'Could not compile the modules file!!'] |
|
1009 |
] |
|
1518 | 1010 |
! |
1011 |
||
1525 | 1012 |
getBlockForCompilingStartupCFileWith: compilerPathAndFlags inDirectory: dir |
1013 |
"returns the block for compiling the startup file with passing startup class, startup selector, configuration string, and build date" |
|
1518 | 1014 |
|
1525 | 1015 |
^ |
1016 |
[ |
|
1017 |
|startUpClass cls startUpSelector startupFile command| |
|
1018 |
((aspects at: #startupCFile) value asFilename) exists |
|
1019 |
ifFalse: |
|
1020 |
[ |
|
1021 |
self warn: 'Defined startup C-file not found!!' |
|
1022 |
] |
|
1023 |
ifTrue: |
|
1024 |
[ |
|
1025 |
self inform: 'Starting compilation of the startup C-file...'. |
|
1518 | 1026 |
|
1525 | 1027 |
startUpClass := ((aspects at: #startupMessage) value upTo: $ ) asSymbol. |
1559 | 1028 |
(cls := Smalltalk at: startUpClass) isNil |
1029 |
ifTrue: |
|
1030 |
[ |
|
1031 |
self warn: 'Defined class not found in system!!' |
|
1032 |
] |
|
1033 |
ifFalse: |
|
1034 |
[ |
|
1035 |
startUpSelector := ((aspects at: #startupMessage) value copy reverse upTo: $ ) reverse asSymbol. |
|
1036 |
(cls respondsTo: startUpSelector) |
|
1037 |
ifFalse: |
|
1038 |
[ |
|
1039 |
self warn: 'Defined class does not respond to the defined selector!!' |
|
1040 |
] |
|
1041 |
ifTrue: |
|
1042 |
[ |
|
1043 |
startupFile := (aspects at: #startupCFile) value asFilename. |
|
1044 |
startupFile copyTo: (startupFile := dir asFilename construct: (aspects at: #startupCFile) value asFilename baseName). |
|
1045 |
command := compilerPathAndFlags , ' -o main.o -c -O -O6 -fomit-frame-pointer -m486 -DDEBUG -Di386 ', |
|
1046 |
'-DSTARTUP_CLASS="\"', startUpClass, '\"" ', |
|
1047 |
'-DSTARTUP_SELECTOR="\"', startUpSelector, '\"" ', |
|
1048 |
'-DCONFIGURATION_STRING="\"', (aspects at: #configuration) value, '\"" ', |
|
1049 |
'-DBUILD_DATE="\"', (aspects at: #buildDate) value, '\"" ', |
|
1050 |
startupFile name. |
|
1518 | 1051 |
|
1559 | 1052 |
self executeCommand: command inDirectory: dir |
1053 |
] |
|
1054 |
] |
|
1525 | 1055 |
]. |
1056 |
(dir asFilename construct: 'main.o') exists |
|
1057 |
ifTrue: [task := nil] |
|
1058 |
ifFalse: [self warn:'Could not compile the startup C-file!!'] |
|
1059 |
] |
|
1518 | 1060 |
! |
1061 |
||
1525 | 1062 |
getBlockForCreatingSymbolicLinksToTheLibrariesIn: dir |
1063 |
"returns the block for creating the symbolic links to the libraries" |
|
1518 | 1064 |
|
1525 | 1065 |
^ |
1066 |
[ |
|
1067 |
self inform: 'Starting defining of the symbolic links to the libraries...'. |
|
1068 |
self getLibraryFileNames value do: |
|
1069 |
[:libPath| |
|
1070 |
self executeCommand: 'ln -s ', libPath , ' ', libPath asFilename head inDirectory: dir |
|
1071 |
]. |
|
1072 |
task := nil. |
|
1518 | 1073 |
] |
1074 |
||
1075 |
! |
|
1076 |
||
1525 | 1077 |
getBlockForCreatingSymbolicLinksToTheResourcesIn: dir |
1078 |
"returns the block for creating the symbolic links to the resources" |
|
1518 | 1079 |
|
1525 | 1080 |
^ |
1081 |
[ |
|
1082 |
self inform: 'Starting linking of the resources...'. |
|
1083 |
(aspects at: #linkRCFiles) value |
|
1084 |
ifTrue: |
|
1085 |
[ |
|
1086 |
self executeCommand: |
|
1087 |
'ln -s ', |
|
1088 |
((aspects at: #libraryDirectory) value asFilename construct: '*.rc') name, ' ', |
|
1089 |
(aspects at: #targetDirectory) value inDirectory: dir. |
|
1558 | 1090 |
self executeCommand: |
1091 |
'ln -s ', |
|
1092 |
((aspects at: #libraryDirectory) value asFilename construct: 'patches') name, ' ', |
|
1093 |
(aspects at: #targetDirectory) value inDirectory: dir. |
|
1525 | 1094 |
]. |
1095 |
(aspects at: #linkResources) value |
|
1518 | 1096 |
ifTrue: |
1525 | 1097 |
[ |
1098 |
self executeCommand: |
|
1099 |
'cp -r -d ', |
|
1100 |
((aspects at: #libraryDirectory) value asFilename construct: 'resources') name, ' ', |
|
1101 |
(aspects at: #targetDirectory) value inDirectory: dir. |
|
1518 | 1102 |
]. |
1525 | 1103 |
(aspects at: #linkSources) value |
1104 |
ifTrue: |
|
1105 |
[ |
|
1106 |
self executeCommand: |
|
1107 |
'cp -r -d ', |
|
1108 |
((aspects at: #libraryDirectory) value asFilename construct: 'source') name, ' ', |
|
1109 |
(aspects at: #targetDirectory) value inDirectory: dir. |
|
1110 |
]. |
|
1111 |
(aspects at: #linkBitmaps) value |
|
1112 |
ifTrue: |
|
1113 |
[ |
|
1114 |
self executeCommand: |
|
1115 |
'cp -r -d ', |
|
1116 |
((aspects at: #libraryDirectory) value asFilename construct: 'bitmaps') name, ' ', |
|
1117 |
(aspects at: #targetDirectory) value inDirectory: dir. |
|
1118 |
]. |
|
1119 |
task := nil. |
|
1120 |
] |
|
1518 | 1121 |
|
1122 |
! |
|
1123 |
||
1525 | 1124 |
getBlockForGeneratingCFileWithModulesIn: dir |
1125 |
"returns the block for generating a C-file with the modules in directory dir" |
|
1518 | 1126 |
|
1525 | 1127 |
^ |
1128 |
[ |
|
1129 |
|selectionOfLibraries| |
|
1130 |
||
1131 |
self inform: 'Starting generation of the C-file with modules...'. |
|
1518 | 1132 |
|
1525 | 1133 |
selectionOfLibraries := self getModuleNames. |
1134 |
self executeCommand: 'echo "#include <stcIntern.h>" > modulList.c' inDirectory: dir. |
|
1135 |
self executeCommand: 'echo "typedef void (*vf)();" >> modulList.c' inDirectory: dir. |
|
1136 |
selectionOfLibraries do: |
|
1137 |
[:lib| |
|
1138 |
self executeCommand: 'echo "extern void _', lib, '_Init();" >> modulList.c' inDirectory: dir. |
|
1139 |
]. |
|
1140 |
self executeCommand: 'echo "static vf modules[] = {" >> modulList.c' inDirectory: dir. |
|
1141 |
selectionOfLibraries do: |
|
1142 |
[:lib| |
|
1143 |
self executeCommand: 'echo "_', lib, '_Init," >> modulList.c' inDirectory: dir. |
|
1144 |
]. |
|
1145 |
self executeCommand: 'echo "(vf)0};" >> modulList.c' inDirectory: dir. |
|
1146 |
self executeCommand: 'echo "vf *__modules__ = modules;" >> modulList.c' inDirectory: dir. |
|
1518 | 1147 |
|
1525 | 1148 |
(dir asFilename construct: 'modulList.c') exists |
1149 |
ifTrue: [task := nil] |
|
1150 |
ifFalse: [self warn:'Could not generate the C-file with libraries!!'] |
|
1151 |
] |
|
1518 | 1152 |
|
1153 |
! |
|
1154 |
||
1525 | 1155 |
getBlockForGeneratingHFileWithSymbolsIn: dir |
1156 |
"returns the block for generating a H-file with the symbols in directory dir" |
|
1157 |
||
1158 |
^ |
|
1159 |
[ |
|
1160 |
|symbolsFile realInc| |
|
1161 |
||
1162 |
self inform: 'Starting generation of the h-file with symbols...'. |
|
1518 | 1163 |
|
1525 | 1164 |
ByteCodeCompiler stcCompilationIncludes asArrayOfSubstrings do: |
1165 |
[:inc| |
|
1166 |
realInc := inc readStream. |
|
1167 |
realInc upTo: $/. |
|
1168 |
realInc := '/', realInc upToEnd. |
|
1169 |
(symbolsFile := realInc asFilename construct: 'symbols.stc') exists |
|
1170 |
ifTrue: |
|
1171 |
[ |
|
1172 |
self executeCommand: 'echo "char *__symbols[] = {" > symbols.h' inDirectory: dir. |
|
1173 |
self executeCommand: 'sed ''s/^/"/'' < ', symbolsFile name,' | sed ''s/$/",/'' | sed ''s/\\/\\\\/g'' >> symbols.h' inDirectory: dir. |
|
1174 |
self executeCommand: 'echo "0 };" >> symbols.h' inDirectory: dir. |
|
1175 |
] |
|
1176 |
]. |
|
1518 | 1177 |
|
1525 | 1178 |
(dir asFilename construct: 'symbols.h') exists |
1179 |
ifTrue: [task := nil] |
|
1180 |
ifFalse: [self warn:'Could not generate the h-file with symbols!!'] |
|
1181 |
] |
|
1518 | 1182 |
|
1183 |
! |
|
1184 |
||
1525 | 1185 |
getBlockForLinkingLibrariesToTheApplicationIn: dir |
1186 |
"returns the block for linking the libraries to the application" |
|
1518 | 1187 |
|
1525 | 1188 |
^ |
1189 |
[ |
|
1190 |
|appName command| |
|
1518 | 1191 |
|
1525 | 1192 |
self inform: 'Starting linking of the libraries to the application...'. |
1518 | 1193 |
|
1525 | 1194 |
appName := (aspects at: #applicationName) value. |
1518 | 1195 |
|
1525 | 1196 |
command := ByteCodeCompiler ccPath, |
1197 |
' ', (aspects at: #applicationLinkDefines) value, ' ', |
|
1198 |
' -o ' , appName, |
|
1199 |
' modulList.o main.o ', |
|
1200 |
((aspects at: #libraryDirectory) value asFilename construct: 'librun', ObjectFileLoader sharedLibraryExtension) name, ' ', |
|
1201 |
((self getLibraryFileNames, (aspects at: #systemLibraries) value) asStringCollection asStringWith: $ ). |
|
1518 | 1202 |
|
1525 | 1203 |
self executeCommand: command inDirectory: dir. |
1518 | 1204 |
|
1525 | 1205 |
(dir asFilename construct: (aspects at: #applicationName) value) exists |
1206 |
ifTrue: [task := nil] |
|
1207 |
ifFalse: [self warn:'Could not build the application!!'] |
|
1208 |
] |
|
1518 | 1209 |
|
1210 |
! ! |
|
1211 |
||
1212 |
!ApplicationBuilder methodsFor:'change & update'! |
|
1213 |
||
1214 |
update:something with:aParameter from:changedObject |
|
1215 |
"updates the combo boxes with the library names and the module names" |
|
1216 |
||
1217 |
|library libraries| |
|
1218 |
||
1525 | 1219 |
changedObject == (aspects at: #stxLibrary ifAbsent: nil) |
1518 | 1220 |
ifTrue: |
1221 |
[ |
|
1525 | 1222 |
libraries := (aspects at: #stxLibraries) value. |
1223 |
(aspects at: #stxLibrary) value size = 0 ifTrue: [libraries remove: (aspects at: #oldSTXLibrary) value ifAbsent: nil]. |
|
1224 |
(aspects at: #oldSTXLibrary) value: (library := (aspects at: #stxLibrary) value). |
|
1518 | 1225 |
]. |
1525 | 1226 |
changedObject == (aspects at: #systemLibrary) |
1518 | 1227 |
ifTrue: |
1228 |
[ |
|
1525 | 1229 |
libraries := (aspects at: #systemLibraries) value. |
1230 |
(aspects at: #systemLibrary) value size = 0 ifTrue: [libraries remove: (aspects at: #oldSystemLibrary) value ifAbsent: nil]. |
|
1231 |
(aspects at: #oldSystemLibrary) value: (library := (aspects at: #systemLibrary) value). |
|
1518 | 1232 |
]. |
1525 | 1233 |
changedObject == (aspects at: #userLibrary ifAbsent: nil) |
1518 | 1234 |
ifTrue: |
1235 |
[ |
|
1525 | 1236 |
libraries := (aspects at: #userLibraries) value. |
1237 |
(aspects at: #userLibrary) value size = 0 ifTrue: [libraries remove: (aspects at: #oldUserLibrary) value ifAbsent: nil]. |
|
1238 |
(aspects at: #oldUserLibrary) value: (library := (aspects at: #userLibrary) value). |
|
1518 | 1239 |
]. |
1558 | 1240 |
(libraries includes: library) not & library notEmpty |
1525 | 1241 |
ifTrue: |
1242 |
[ |
|
1630 | 1243 |
libraries add: library |
1525 | 1244 |
] |
1518 | 1245 |
|
1246 |
||
1247 |
||
1248 |
||
1249 |
||
1250 |
! ! |
|
1251 |
||
1252 |
!ApplicationBuilder methodsFor:'initialization'! |
|
1253 |
||
1254 |
initialize |
|
1255 |
"initialize all aspects" |
|
1256 |
||
1564 | 1257 |
|topDir| |
1518 | 1258 |
|
1259 |
super initialize. |
|
1260 |
||
1525 | 1261 |
aspects := self class aspects. |
1518 | 1262 |
|
1564 | 1263 |
topDir := (Filename currentDirectory asFilename construct:'..') construct:'..'. |
1518 | 1264 |
|
1564 | 1265 |
self aspectsAt: #topDirectory putFirst: topDir pathName. |
1558 | 1266 |
aspects at: #systemLibraries put: ObjectFileLoader searchedLibraries asValue. |
1525 | 1267 |
(aspects at: #systemLibrary put: ((aspects at: #systemLibraries) value at: 1 ifAbsent: '') asValue) addDependent: self. |
1268 |
self aspectsAt: #oldSystemLibrary putFirst: (aspects at: #systemLibrary) value. |
|
1269 |
self aspectsAt: #configuration putFirst: Smalltalk configuration. |
|
1270 |
||
1558 | 1271 |
self class ~~ ApplicationBuilder ifTrue: [^self]. |
1525 | 1272 |
|
1518 | 1273 |
self aspectsAt: #applicationName putFirst: 'application'. |
1274 |
self aspectsAt: #startupMessage putFirst: 'Smalltalk start'. |
|
1564 | 1275 |
self aspectsAt: #startupCFile putFirst: (topDir construct: 'librun/main.c') pathName. |
1525 | 1276 |
|
1564 | 1277 |
self aspectsAt: #targetDirectory putFirst: ((topDir construct: 'projects') construct:'application') pathName. |
1278 |
self aspectsAt: #libraryDirectory putFirst: ((topDir construct: 'projects') construct:'smalltalk') pathName. |
|
1518 | 1279 |
|
1280 |
self aspectsAt: #stxLibraries putFirst: |
|
1281 |
(ObjectMemory binaryModuleInfo collect: [:binMoInfo| (binMoInfo name copy reverse upTo: $ ) reverse]) asSortedCollection. |
|
1525 | 1282 |
|
1518 | 1283 |
self aspectsAt: #userLibraries putFirst: OrderedCollection new. |
1284 |
||
1564 | 1285 |
aspects at: #buildDate put: (Date today printString, ' ', Time now printString) asValue. |
1518 | 1286 |
|
1287 |
self aspectsAt: #linkRCFiles putFirst: true. |
|
1288 |
self aspectsAt: #linkResources putFirst: true. |
|
1289 |
self aspectsAt: #linkSources putFirst: true. |
|
1290 |
self aspectsAt: #linkBitmaps putFirst: true. |
|
1291 |
||
1525 | 1292 |
(aspects at: #stxLibrary put: ((aspects at: #stxLibraries) value at: 1 ifAbsent: '') asValue) addDependent: self. |
1293 |
(aspects at: #userLibrary put: ((aspects at: #userLibraries) value at: 1 ifAbsent: '') asValue) addDependent: self. |
|
1518 | 1294 |
|
1525 | 1295 |
self aspectsAt: #oldSTXLibrary putFirst: (aspects at: #stxLibrary) value. |
1296 |
self aspectsAt: #oldUserLibrary putFirst: (aspects at: #userLibrary) value. |
|
1518 | 1297 |
|
1298 |
self aspectsAt: #applicationLinkDefines putFirst: '-L/usr/X11/lib -Llib -Lbinary -L. -L/usr/local/lib -L/usr/lib -L/lib -lm -ldl -lXext -lX11'. |
|
1299 |
! ! |
|
1300 |
||
1301 |
!ApplicationBuilder methodsFor:'queries'! |
|
1302 |
||
1303 |
getCompilerFlags |
|
1304 |
"returns the defines of the OS and the compiler flags of the ByteCodeCompiler" |
|
1305 |
||
1306 |
|compilerFlags| |
|
1307 |
||
1308 |
compilerFlags := OperatingSystem getOSDefine ? ''. |
|
1309 |
||
1310 |
ByteCodeCompiler stcCompilationDefines notNil |
|
1311 |
ifTrue:[compilerFlags := compilerFlags , ' ' , ByteCodeCompiler stcCompilationDefines]. |
|
1312 |
ByteCodeCompiler stcCompilationIncludes notNil |
|
1313 |
ifTrue:[compilerFlags := compilerFlags , ' ' , ByteCodeCompiler stcCompilationIncludes]. |
|
1314 |
ByteCodeCompiler ccCompilationOptions notNil |
|
1315 |
ifTrue:[compilerFlags := compilerFlags , ' ' , ByteCodeCompiler ccCompilationOptions]. |
|
1316 |
||
1317 |
^compilerFlags |
|
1318 |
||
1319 |
! |
|
1320 |
||
1321 |
getLibraryFileNames |
|
1322 |
"returns the complete file names of the system and the user libraries" |
|
1323 |
||
1324 |
|libraryFileNames| |
|
1325 |
||
1326 |
libraryFileNames := OrderedCollection new. |
|
1327 |
||
1525 | 1328 |
(aspects at: #stxLibraries) value do: |
1518 | 1329 |
[:lib| |
1330 |
|abbrevLib libPath| |
|
1331 |
abbrevLib := lib. |
|
1332 |
lib = 'GLXWorkstation' ifTrue: [abbrevLib := 'GLXWorkstat']. |
|
1333 |
lib = 'XWorkstation' ifTrue: [abbrevLib := 'XWorkstat' ]. |
|
1334 |
lib = 'ObjectFileLoader' ifTrue: [abbrevLib := 'ObjFLoader' ]. |
|
1525 | 1335 |
(libPath := (aspects at: #libraryDirectory) value asFilename construct: abbrevLib, ObjectFileLoader sharedLibraryExtension) exists |
1518 | 1336 |
ifTrue: [libraryFileNames add: libPath name] |
1337 |
]. |
|
1338 |
||
1525 | 1339 |
^libraryFileNames, (aspects at: #userLibraries) value |
1518 | 1340 |
|
1341 |
! |
|
1342 |
||
1343 |
getModuleNames |
|
1344 |
"returns the module names of the system and the user libraries" |
|
1345 |
||
1346 |
|moduleNames| |
|
1347 |
||
1348 |
moduleNames := OrderedCollection new. |
|
1525 | 1349 |
(aspects at: #userLibraries) value do: |
1518 | 1350 |
[:lib| |
1351 |
lib asFilename exists ifTrue: [moduleNames add: (lib asFilename baseName upTo: $.)] |
|
1352 |
]. |
|
1353 |
||
1525 | 1354 |
^(aspects at: #stxLibraries) value, moduleNames |
1355 |
! |
|
1356 |
||
1357 |
getTargetDirectory |
|
1358 |
"returns the directory of the application; if not present, create it" |
|
1359 |
||
1360 |
|targetDirectory| |
|
1361 |
||
1362 |
(targetDirectory := (aspects at: #targetDirectory) value asFilename) exists ifFalse:[targetDirectory makeDirectory]. |
|
1363 |
(targetDirectory isReadable and:[targetDirectory isWritable]) ifFalse: [^nil]. |
|
1364 |
||
1365 |
^targetDirectory name |
|
1366 |
||
1367 |
||
1518 | 1368 |
! ! |
1369 |
||
13256 | 1370 |
!ApplicationBuilder methodsFor:'startup & release'! |
1518 | 1371 |
|
1372 |
closeRequest |
|
1373 |
"close request; before closing stop the running build, then release the dependents of all aspects" |
|
1374 |
||
1375 |
self doStop. |
|
1525 | 1376 |
aspects do: [:aspect| aspect release]. |
1518 | 1377 |
|
1378 |
super closeRequest |
|
1379 |
||
1558 | 1380 |
! |
1381 |
||
1382 |
postBuildWith:aBuilder |
|
1383 |
"sets target directory for the shell view" |
|
1384 |
||
1385 |
shellView directory: self getTargetDirectory. |
|
1386 |
||
1387 |
^super postBuildWith:aBuilder |
|
1518 | 1388 |
! ! |
1389 |
||
1390 |
!ApplicationBuilder class methodsFor:'documentation'! |
|
1391 |
||
1392 |
version |
|
13256 | 1393 |
^ '$Header: /cvs/stx/stx/libtool/ApplicationBuilder.st,v 1.10 2013-07-30 05:57:02 cg Exp $' |
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
1394 |
! |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
1395 |
|
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
1396 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
1397 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
1398 |
^ '$Changeset: <not expanded> $' |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
1399 |
! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
1400 |
|
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
1401 |
version_SVN |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
1402 |
^ '$Id: ApplicationBuilder.st 7854 2012-01-30 17:49:41Z vranyj1 $' |
1518 | 1403 |
! ! |
13256 | 1404 |