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