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