15 listOfStartupClassesInProject selectedStartupClassIndexHolder |
15 listOfStartupClassesInProject selectedStartupClassIndexHolder |
16 selectedStartupClass hasStartupClassSelectedHolder |
16 selectedStartupClass hasStartupClassSelectedHolder |
17 selectedApplicationsComment buildDirectoryHolder makeProcess |
17 selectedApplicationsComment buildDirectoryHolder makeProcess |
18 listOfClassesInProject makeOutputWindow projectBuilder |
18 listOfClassesInProject makeOutputWindow projectBuilder |
19 newStartupClassName usedCompilerHolder listOfNewProjectsName |
19 newStartupClassName usedCompilerHolder listOfNewProjectsName |
20 newProjectsNameListExtendedComboBox' |
20 newProjectsNameListExtendedComboBox productNameHolder |
|
21 companyNameHolder compilerWarnMessageHolder |
|
22 compilerWarnMessageVisibleHolder' |
21 classVariableNames:'' |
23 classVariableNames:'' |
22 poolDictionaries:'' |
24 poolDictionaries:'' |
23 category:'System-Support-Projects' |
25 category:'System-Support-Projects' |
24 ! |
26 ! |
25 |
27 |
153 Press "<I>Scan</I>" to include all classes of the package; |
155 Press "<I>Scan</I>" to include all classes of the package; |
154 browse to edit the contents manually.' |
156 browse to edit the contents manually.' |
155 ) |
157 ) |
156 |
158 |
157 (AssistantPageSpec |
159 (AssistantPageSpec |
|
160 pageTitle: 'Specify Project Attributes' |
|
161 windowSpecSelector: page6a_specifyProjectAttributes |
|
162 infoText: 'Define additional attributes.' |
|
163 enterCallbackSelector: updateProjectAttributes |
|
164 leaveCallbackSelector: #rememberProjectAttributes |
|
165 ) |
|
166 |
|
167 (AssistantPageSpec |
158 pageTitle: 'Specify Build Directory' |
168 pageTitle: 'Specify Build Directory' |
159 windowSpecSelector: page6_specifyBuildDirectorySpec |
169 windowSpecSelector: page6b_specifyBuildDirectorySpec |
160 infoText: 'Define where the build-process is to be performed. |
170 infoText: 'Define where the build-process is to be performed. |
161 All generated files are created below that directory. |
171 All generated files are created below that directory. |
162 After deployment, the build directory is no longer needed |
172 After deployment, the build directory is no longer needed |
163 (but you can keep it for a faster compile the next time).' |
173 (but you can keep it for a faster compile the next time).' |
|
174 |
|
175 enterCallbackSelector: #checkCompilerAvailability |
164 ) |
176 ) |
165 |
177 |
166 (AssistantPageSpec |
178 (AssistantPageSpec |
167 pageTitle: 'Build' |
179 pageTitle: 'Build' |
168 windowSpecSelector: page7_buildSpec |
180 windowSpecSelector: page7_buildSpec |
866 |
878 |
867 ) |
879 ) |
868 ) |
880 ) |
869 ! |
881 ! |
870 |
882 |
871 page6_specifyBuildDirectorySpec |
883 page6a_specifyProjectAttributes |
872 "This resource specification was automatically generated |
884 "This resource specification was automatically generated |
873 by the UIPainter of ST/X." |
885 by the UIPainter of ST/X." |
874 |
886 |
875 "Do not manually edit this!! If it is corrupted, |
887 "Do not manually edit this!! If it is corrupted, |
876 the UIPainter may not be able to read the specification." |
888 the UIPainter may not be able to read the specification." |
877 |
889 |
878 " |
890 " |
879 UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page6_specifyBuildDirectorySpec |
891 UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page6a_specifyProjectAttributes |
880 Tools::ProjectBuilderAssistantApplication new openInterface:#page6_specifyBuildDirectorySpec |
892 Tools::ProjectBuilderAssistantApplication new openInterface:#page6a_specifyProjectAttributes |
881 " |
893 " |
882 |
894 |
883 <resource: #canvas> |
895 <resource: #canvas> |
884 |
896 |
885 ^ |
897 ^ |
886 #(FullSpec |
898 #(FullSpec |
887 name: #'page6_specifyBuildDirectorySpec' |
899 name: #'page6a_specifyProjectAttributes' |
888 window: |
900 window: |
889 (WindowSpec |
901 (WindowSpec |
890 label: 'Project Selection' |
902 label: 'Project Selection' |
891 name: 'Project Selection' |
903 name: 'Project Selection' |
892 min: (Point 0 0) |
904 min: (Point 0 0) |
893 bounds: (Rectangle 0 0 521 239) |
905 bounds: (Rectangle 0 0 521 239) |
|
906 ) |
|
907 component: |
|
908 (SpecCollection |
|
909 collection: ( |
|
910 (FramedBoxSpec |
|
911 label: 'Product Information' |
|
912 name: 'FramedBox3' |
|
913 layout: (LayoutFrame 0 0.0 5 0 4 1.0 101 0) |
|
914 labelPosition: topLeft |
|
915 translateLabel: true |
|
916 component: |
|
917 (SpecCollection |
|
918 collection: ( |
|
919 (LabelSpec |
|
920 label: 'Product Name:' |
|
921 name: 'Label1' |
|
922 layout: (LayoutFrame 0 0 10 0 148 0 32 0) |
|
923 translateLabel: true |
|
924 adjust: right |
|
925 ) |
|
926 (InputFieldSpec |
|
927 name: 'EntryField4' |
|
928 layout: (LayoutFrame 150 0.0 10 0 0 1.0 32 0) |
|
929 model: productNameHolder |
|
930 acceptOnLostFocus: true |
|
931 acceptOnPointerLeave: true |
|
932 viewClassName: '' |
|
933 ) |
|
934 (LabelSpec |
|
935 label: 'Company Name:' |
|
936 name: 'Label2' |
|
937 layout: (LayoutFrame 0 0 39 0 148 0 61 0) |
|
938 translateLabel: true |
|
939 adjust: right |
|
940 ) |
|
941 (InputFieldSpec |
|
942 name: 'EntryField3' |
|
943 layout: (LayoutFrame 150 0.0 39 0 0 1.0 61 0) |
|
944 model: companyNameHolder |
|
945 acceptOnLostFocus: true |
|
946 acceptOnPointerLeave: true |
|
947 viewClassName: '' |
|
948 ) |
|
949 ) |
|
950 |
|
951 ) |
|
952 ) |
|
953 ) |
|
954 |
|
955 ) |
|
956 ) |
|
957 ! |
|
958 |
|
959 page6b_specifyBuildDirectorySpec |
|
960 "This resource specification was automatically generated |
|
961 by the UIPainter of ST/X." |
|
962 |
|
963 "Do not manually edit this!! If it is corrupted, |
|
964 the UIPainter may not be able to read the specification." |
|
965 |
|
966 " |
|
967 UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page6b_specifyBuildDirectorySpec |
|
968 Tools::ProjectBuilderAssistantApplication new openInterface:#page6b_specifyBuildDirectorySpec |
|
969 " |
|
970 |
|
971 <resource: #canvas> |
|
972 |
|
973 ^ |
|
974 #(FullSpec |
|
975 name: #'page6b_specifyBuildDirectorySpec' |
|
976 window: |
|
977 (WindowSpec |
|
978 label: 'Project Selection' |
|
979 name: 'Project Selection' |
|
980 min: (Point 0 0) |
|
981 bounds: (Rectangle 0 0 521 361) |
894 ) |
982 ) |
895 component: |
983 component: |
896 (SpecCollection |
984 (SpecCollection |
897 collection: ( |
985 collection: ( |
898 (FramedBoxSpec |
986 (FramedBoxSpec |
1104 extent: (Point 172 22) |
1203 extent: (Point 172 22) |
1105 ) |
1204 ) |
1106 (ActionButtonSpec |
1205 (ActionButtonSpec |
1107 label: 'Open Console' |
1206 label: 'Open Console' |
1108 name: 'Button2' |
1207 name: 'Button2' |
1109 visibilityChannel: false |
1208 visibilityChannel: isUnixOS |
1110 translateLabel: true |
1209 translateLabel: true |
1111 resizeForLabel: true |
1210 resizeForLabel: true |
1112 model: doOpenConsoleTerminal |
1211 model: doOpenConsoleTerminal |
1113 extent: (Point 172 22) |
1212 extent: (Point 172 22) |
1114 ) |
1213 ) |
1200 classVariableNames:'' |
1299 classVariableNames:'' |
1201 poolDictionaries:'' |
1300 poolDictionaries:'' |
1202 category:'Applications'. |
1301 category:'Applications'. |
1203 CodeGeneratorTool createApplicationCodeFor:newAppClass. |
1302 CodeGeneratorTool createApplicationCodeFor:newAppClass. |
1204 ]. |
1303 ]. |
1205 self updateListOfApplicationsInProject |
1304 self updateListOfApplicationsInProject. |
|
1305 self selectedApplicationIndexHolder value:(listOfApplicationsInProject value indexOf:newAppClass). |
1206 ]. |
1306 ]. |
1207 ! |
1307 ! |
1208 |
1308 |
1209 createNewProject |
1309 createNewProject |
1210 <resource: #uiCallback> |
1310 <resource: #uiCallback> |
1288 category:'Applications'. |
1388 category:'Applications'. |
1289 |
1389 |
1290 self projectTypeIsGuiApplication ifTrue: [startupApplication := selectedApplication]. |
1390 self projectTypeIsGuiApplication ifTrue: [startupApplication := selectedApplication]. |
1291 CodeGeneratorTool createStartupCodeFor:newStartupClass forStartOf:startupApplication. |
1391 CodeGeneratorTool createStartupCodeFor:newStartupClass forStartOf:startupApplication. |
1292 ]. |
1392 ]. |
1293 self updateListOfStartupClassesInProject |
1393 self updateListOfStartupClassesInProject. |
|
1394 self selectedStartupClassIndexHolder value:(listOfStartupClassesInProject value indexOf:newStartupClass). |
1294 ]. |
1395 ]. |
1295 ! |
1396 ! |
1296 |
1397 |
1297 doAddClassToProject |
1398 doAddClassToProject |
1298 <resource: #uiCallback> |
1399 <resource: #uiCallback> |
1360 |
1461 |
1361 doOpenConsoleTerminal |
1462 doOpenConsoleTerminal |
1362 "/ OperatingSystem |
1463 "/ OperatingSystem |
1363 "/ executeCommand:'cmd.exe' |
1464 "/ executeCommand:'cmd.exe' |
1364 "/ inDirectory:(projectBuilder packageBuildDirectory) |
1465 "/ inDirectory:(projectBuilder packageBuildDirectory) |
1365 OperatingSystem |
1466 OperatingSystem isUNIXlike ifTrue:[ |
1366 executeCommand:'c:\windows\System32\cmd.exe' |
1467 VT100TerminalView openShellIn:(projectBuilder packageBuildDirectory) |
1367 inDirectory:(projectBuilder packageBuildDirectory) |
1468 ] ifFalse:[ |
|
1469 OperatingSystem |
|
1470 executeCommand:'c:\windows\System32\cmd.exe' |
|
1471 inDirectory:(projectBuilder packageBuildDirectory) |
|
1472 ] |
1368 ! |
1473 ! |
1369 |
1474 |
1370 doOpenExplorer |
1475 doOpenExplorer |
1371 OperatingSystem |
1476 OperatingSystem |
1372 openApplicationForDocument:(projectBuilder packageBuildDirectory) operation:#explore. |
1477 openApplicationForDocument:(projectBuilder packageBuildDirectory) operation:#explore. |
1387 ] ensure:[ |
1493 ] ensure:[ |
1388 self stopMakeButtonVisible value:false. |
1494 self stopMakeButtonVisible value:false. |
1389 self startMakeButtonEnabled value:true. |
1495 self startMakeButtonEnabled value:true. |
1390 makeProcess := nil. |
1496 makeProcess := nil. |
1391 self updateButtonEnableState. |
1497 self updateButtonEnableState. |
|
1498 self infoHolder value:''. |
1392 ]. |
1499 ]. |
1393 ] newProcess. |
1500 ] newProcess. |
1394 |
1501 |
1395 makeProcess priority:4. |
1502 makeProcess priority:4. |
1396 makeProcess priorityRange:(4 to:8). |
1503 makeProcess priorityRange:(4 to:8). |
1412 ] ensure:[ |
1520 ] ensure:[ |
1413 self stopMakeButtonVisible value:false. |
1521 self stopMakeButtonVisible value:false. |
1414 self startMakeButtonEnabled value:true. |
1522 self startMakeButtonEnabled value:true. |
1415 makeProcess := nil. |
1523 makeProcess := nil. |
1416 self updateButtonEnableState. |
1524 self updateButtonEnableState. |
|
1525 self infoHolder value:''. |
1417 ]. |
1526 ]. |
1418 ] newProcess. |
1527 ] newProcess. |
1419 |
1528 |
1420 makeProcess priority:4. |
1529 makeProcess priority:4. |
1421 makeProcess priorityRange:(4 to:8). |
1530 makeProcess priorityRange:(4 to:8). |
1560 buildDirectoryHolder value: buildDirectory. |
1669 buildDirectoryHolder value: buildDirectory. |
1561 ]. |
1670 ]. |
1562 ^ buildDirectoryHolder. |
1671 ^ buildDirectoryHolder. |
1563 ! |
1672 ! |
1564 |
1673 |
|
1674 companyNameHolder |
|
1675 <resource: #uiAspect> |
|
1676 |
|
1677 companyNameHolder isNil ifTrue:[ |
|
1678 companyNameHolder := 'MyCompany' asValue. |
|
1679 ]. |
|
1680 ^ companyNameHolder. |
|
1681 ! |
|
1682 |
|
1683 compilerWarnMessageHolder |
|
1684 <resource: #uiAspect> |
|
1685 |
|
1686 compilerWarnMessageHolder isNil ifTrue:[ |
|
1687 compilerWarnMessageHolder := '' asValue. |
|
1688 ]. |
|
1689 ^ compilerWarnMessageHolder. |
|
1690 ! |
|
1691 |
|
1692 compilerWarnMessageVisibleHolder |
|
1693 <resource: #uiAspect> |
|
1694 |
|
1695 compilerWarnMessageVisibleHolder isNil ifTrue:[ |
|
1696 compilerWarnMessageVisibleHolder := false asValue. |
|
1697 ]. |
|
1698 ^ compilerWarnMessageVisibleHolder. |
|
1699 ! |
|
1700 |
1565 hasApplicationSelectedHolder |
1701 hasApplicationSelectedHolder |
1566 <resource: #uiAspect> |
1702 <resource: #uiAspect> |
1567 |
1703 |
1568 hasApplicationSelectedHolder isNil ifTrue:[ |
1704 hasApplicationSelectedHolder isNil ifTrue:[ |
1569 hasApplicationSelectedHolder := nil asValue. |
1705 hasApplicationSelectedHolder := nil asValue. |
1744 |
1880 |
1745 newStartupClassName isNil ifTrue:[ |
1881 newStartupClassName isNil ifTrue:[ |
1746 newStartupClassName := ValueHolder new. |
1882 newStartupClassName := ValueHolder new. |
1747 ]. |
1883 ]. |
1748 ^ newStartupClassName. |
1884 ^ newStartupClassName. |
|
1885 ! |
|
1886 |
|
1887 productNameHolder |
|
1888 <resource: #uiAspect> |
|
1889 |
|
1890 productNameHolder isNil ifTrue:[ |
|
1891 productNameHolder := 'MyProduct' asValue. |
|
1892 ]. |
|
1893 ^ productNameHolder. |
1749 ! |
1894 ! |
1750 |
1895 |
1751 projectType |
1896 projectType |
1752 self projectTypeHolder value == #libraryType ifTrue:[ |
1897 self projectTypeHolder value == #libraryType ifTrue:[ |
1753 ^ ProjectDefinition libraryType |
1898 ^ ProjectDefinition libraryType |
1876 usedCompilerHolder |
2021 usedCompilerHolder |
1877 <resource: #uiAspect> |
2022 <resource: #uiAspect> |
1878 |
2023 |
1879 usedCompilerHolder isNil ifTrue:[ |
2024 usedCompilerHolder isNil ifTrue:[ |
1880 usedCompilerHolder := ValueHolder new. |
2025 usedCompilerHolder := ValueHolder new. |
1881 usedCompilerHolder value:(OperatingSystem isMSWINDOWSlike ifTrue:['bcc'] ifFalse:['gcc']) |
2026 usedCompilerHolder value:(OperatingSystem isMSWINDOWSlike ifTrue:['bcc'] ifFalse:['gcc']). |
|
2027 usedCompilerHolder onChangeSend:#checkCompilerAvailability to:self. |
1882 ]. |
2028 ]. |
1883 ^ usedCompilerHolder. |
2029 ^ usedCompilerHolder. |
1884 ! ! |
2030 ! ! |
1885 |
2031 |
1886 !ProjectBuilderAssistantApplication methodsFor:'initialization & release'! |
2032 !ProjectBuilderAssistantApplication methodsFor:'initialization & release'! |
1892 |
2038 |
1893 targetDirectory := projectBuilder packageBuildDirectory. |
2039 targetDirectory := projectBuilder packageBuildDirectory. |
1894 |
2040 |
1895 browser := FileBrowserV2 new. |
2041 browser := FileBrowserV2 new. |
1896 browser onDirectory:targetDirectory. |
2042 browser onDirectory:targetDirectory. |
1897 browser filter:'*.exe'. |
2043 OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
2044 browser filter:'*.exe;*.com'. |
|
2045 ] ifFalse:[ |
|
2046 browser filter:'*'. |
|
2047 ]. |
1898 ^ browser. |
2048 ^ browser. |
1899 ! |
2049 ! |
1900 |
2050 |
1901 postBuildMakeOutputWindow:aView |
2051 postBuildMakeOutputWindow:aView |
1902 makeOutputWindow := aView |
2052 makeOutputWindow := aView |
2047 assistantSpec |
2201 assistantSpec |
2048 ^ self class assistantSpec |
2202 ^ self class assistantSpec |
2049 ! ! |
2203 ! ! |
2050 |
2204 |
2051 !ProjectBuilderAssistantApplication methodsFor:'update'! |
2205 !ProjectBuilderAssistantApplication methodsFor:'update'! |
|
2206 |
|
2207 checkCompilerAvailability |
|
2208 |cmd suite warnMsg1 warnMsg2 sep| |
|
2209 |
|
2210 cmd := 'cc'. |
|
2211 suite := 'C-Compiler'. |
|
2212 warnMsg1 := warnMsg2 := ''. |
|
2213 |
|
2214 self usedCompilerHolder value = 'bcc' ifTrue:[ |
|
2215 cmd := 'bcc32'. |
|
2216 suite := 'Borland C-Compiler'. |
|
2217 ]. |
|
2218 self usedCompilerHolder value = 'vc' ifTrue:[ |
|
2219 cmd := 'cl'. |
|
2220 suite := 'Microsoft Visual C C-Compiler'. |
|
2221 warnMsg2 := 'Due to bugs in this C-compiler, some classes may not be compilable.'. |
|
2222 ]. |
|
2223 self usedCompilerHolder value = 'lcc' ifTrue:[ |
|
2224 cmd := 'lcc'. |
|
2225 suite := 'LCC C-Compiler'. |
|
2226 warnMsg2 := 'The LCC C-compiler suite is not yet supported (linkage).'. |
|
2227 ]. |
|
2228 self usedCompilerHolder value = 'gcc' ifTrue:[ |
|
2229 cmd := 'gcc'. |
|
2230 suite := 'GNU C-Compiler'. |
|
2231 OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
2232 warnMsg2 := 'The GNU C-compiler suite is not yet supported on MSDOS systems.'. |
|
2233 ]. |
|
2234 ]. |
|
2235 |
|
2236 (OperatingSystem canExecuteCommand:cmd) ifFalse:[ |
|
2237 warnMsg1 := |
|
2238 'The "%1"-command seems to be not in your path. |
|
2239 Please ensure that you installed the |
|
2240 "%2" compiler suite correctly.' bindWith:cmd with:suite. |
|
2241 ]. |
|
2242 |
|
2243 (warnMsg1 notEmpty or:[warnMsg2 notEmpty]) ifTrue:[ |
|
2244 sep := ''. |
|
2245 (warnMsg2 notEmpty) ifTrue:[ sep := '\\' withCRs ]. |
|
2246 |
|
2247 self compilerWarnMessageHolder value:('Warning: |
|
2248 |
|
2249 ',warnMsg1,sep,warnMsg2). |
|
2250 self compilerWarnMessageVisibleHolder value:true. |
|
2251 ] ifFalse:[ |
|
2252 self compilerWarnMessageVisibleHolder value:false |
|
2253 ]. |
|
2254 ! |
2052 |
2255 |
2053 enterContentsSpecification |
2256 enterContentsSpecification |
2054 |toAdd| |
2257 |toAdd| |
2055 |
2258 |
2056 self updateListOfClassesInProject. |
2259 self updateListOfClassesInProject. |
2074 self updateListOfClassesInProject. |
2277 self updateListOfClassesInProject. |
2075 ! |
2278 ! |
2076 |
2279 |
2077 rememberMakeOutputsContents |
2280 rememberMakeOutputsContents |
2078 makeOutputHolder value:(makeOutputWindow contents) |
2281 makeOutputHolder value:(makeOutputWindow contents) |
|
2282 ! |
|
2283 |
|
2284 rememberProjectAttributes |
|
2285 self assert:selectedProjectDefinition notNil. |
|
2286 Class withoutUpdatingChangesDo:[ |
|
2287 self productNameHolder value ~= selectedProjectDefinition productName ifTrue:[ |
|
2288 selectedProjectDefinition class compile:(selectedProjectDefinition |
|
2289 productName_codeFor:(self productNameHolder value)). |
|
2290 ]. |
|
2291 self companyNameHolder value ~= selectedProjectDefinition companyName ifTrue:[ |
|
2292 selectedProjectDefinition class compile:(selectedProjectDefinition |
|
2293 companyName_codeFor:(self companyNameHolder value)). |
|
2294 ] |
|
2295 ]. |
2079 ! |
2296 ! |
2080 |
2297 |
2081 restoreMakeOutputsContents |
2298 restoreMakeOutputsContents |
2082 makeOutputWindow contents:makeOutputHolder value |
2299 makeOutputWindow contents:makeOutputHolder value |
2083 ! |
2300 ! |
2258 ]. |
2475 ]. |
2259 ]. |
2476 ]. |
2260 |
2477 |
2261 self listOfStartupClassesInProject value:startupClasses. |
2478 self listOfStartupClassesInProject value:startupClasses. |
2262 self selectedStartupClassIndexHolder value:startupClassIndex. |
2479 self selectedStartupClassIndexHolder value:startupClassIndex. |
|
2480 ! |
|
2481 |
|
2482 updateProjectAttributes |
|
2483 self assert:selectedProjectDefinition notNil. |
|
2484 self productNameHolder value:(selectedProjectDefinition productName). |
|
2485 self companyNameHolder value:(selectedProjectDefinition companyName). |
2263 ! ! |
2486 ! ! |
2264 |
2487 |
2265 !ProjectBuilderAssistantApplication class methodsFor:'documentation'! |
2488 !ProjectBuilderAssistantApplication class methodsFor:'documentation'! |
2266 |
2489 |
2267 version_CVS |
2490 version_CVS |