Tools__ProjectBuilderAssistantApplication.st
changeset 2913 94e5ae8e15b2
parent 2910 8024f7e8f9f4
child 2915 e0da59b7e3c9
equal deleted inserted replaced
2912:6e62954c5f35 2913:94e5ae8e15b2
    30 		newStartupClassName usedCompilerHolder listOfNewProjectsName
    30 		newStartupClassName usedCompilerHolder listOfNewProjectsName
    31 		newProjectsNameListExtendedComboBox productNameHolder
    31 		newProjectsNameListExtendedComboBox productNameHolder
    32 		companyNameHolder compilerWarnMessageHolder
    32 		companyNameHolder compilerWarnMessageHolder
    33 		compilerWarnMessageVisibleHolder listOfPrerequisitesInProject
    33 		compilerWarnMessageVisibleHolder listOfPrerequisitesInProject
    34 		nameOfUsedCompilerSuiteHolder'
    34 		nameOfUsedCompilerSuiteHolder'
    35 	classVariableNames:''
    35 	classVariableNames:'LastUsedCompiler'
    36 	poolDictionaries:''
    36 	poolDictionaries:''
    37 	category:'System-Support-Projects'
    37 	category:'System-Support-Projects'
    38 !
    38 !
    39 
    39 
    40 !ProjectBuilderAssistantApplication class methodsFor:'documentation'!
    40 !ProjectBuilderAssistantApplication class methodsFor:'documentation'!
   219 
   219 
   220         (AssistantPageSpec
   220         (AssistantPageSpec
   221             pageTitle: 'ProjectDefinition Selection'
   221             pageTitle: 'ProjectDefinition Selection'
   222             windowSpecSelector: page2_projectSelectionSpec
   222             windowSpecSelector: page2_projectSelectionSpec
   223             enterCallbackSelector: updateListOfMatchingProjectsAndProjectIDs
   223             enterCallbackSelector: updateListOfMatchingProjectsAndProjectIDs
       
   224             leaveCallbackSelector: fetchAttributesFromProjectDefinition
   224             infoText: 'Choose an existing project definition or create a new one. These are subclasses of <I>ProjectDefinition</I> and define the type and contents of a project. Notice that the ID directly reflects the project''s location within the source code repository (module:directory/subdirectory...). If in doubt, use "&lt;yourname&gt;:demos/xxx_n".'
   225             infoText: 'Choose an existing project definition or create a new one. These are subclasses of <I>ProjectDefinition</I> and define the type and contents of a project. Notice that the ID directly reflects the project''s location within the source code repository (module:directory/subdirectory...). If in doubt, use "&lt;yourname&gt;:demos/xxx_n".'
   225         )
   226         )
   226 
   227 
   227         (AssistantPageSpec
   228         (AssistantPageSpec
   228             pageTitle: 'Startup Application Selection'
   229             pageTitle: 'Startup Application Selection'
   267         )
   268         )
   268 
   269 
   269         (AssistantPageSpec
   270         (AssistantPageSpec
   270             pageTitle: 'Specify Build Directory'
   271             pageTitle: 'Specify Build Directory'
   271             windowSpecSelector: page6b_specifyBuildDirectorySpec
   272             windowSpecSelector: page6b_specifyBuildDirectorySpec
   272             infoText: 'Define where the build-process is to be performed. All generated files are created below that directory. After deployment, the build directory is no longer needed (but you can keep it for a faster compile the next time).'
   273             infoText: 'Define where the build-process is to be performed and which compiler to use. All generated files are created below that directory. After deployment, the build directory is no longer needed (but you can keep it for a faster compile the next time).'
   273             enterCallbackSelector: #checkCompilerAvailability
   274             enterCallbackSelector: #checkCompilerAvailability
       
   275             leaveCallbackSelector: #rememberUsedCompiler
   274         )
   276         )
   275 
   277 
   276         (AssistantPageSpec
   278         (AssistantPageSpec
   277             pageTitle: 'Build'
   279             pageTitle: 'Build'
   278             windowSpecSelector: page7_buildSpec
   280             windowSpecSelector: page7_buildSpec
   288             canEnterQuerySelector: #canEnterDeploy
   290             canEnterQuerySelector: #canEnterDeploy
   289             infoText: 'Find the installer to be deployed (or test-run the binary). You can open a Windows-Explorer there to copy the files for deployment. After that, the build directory is no longer needed. However, you can keep it for a faster compile the next time.'
   291             infoText: 'Find the installer to be deployed (or test-run the binary). You can open a Windows-Explorer there to copy the files for deployment. After that, the build directory is no longer needed. However, you can keep it for a faster compile the next time.'
   290         )
   292         )
   291     ) decodeAsLiteralArray.
   293     ) decodeAsLiteralArray.
   292 
   294 
   293     "Modified: / 20-08-2012 / 19:44:04 / cg"
   295     "Modified: / 04-09-2012 / 09:49:50 / cg"
   294 ! !
   296 ! !
   295 
   297 
   296 !ProjectBuilderAssistantApplication class methodsFor:'defaults'!
   298 !ProjectBuilderAssistantApplication class methodsFor:'defaults'!
   297 
   299 
   298 defaultIcon
   300 defaultIcon
  1784         makeOutputWindow nextPutLine:('Make Cancelled' colorizeAllWith:Color white on:Color red).
  1786         makeOutputWindow nextPutLine:('Make Cancelled' colorizeAllWith:Color white on:Color red).
  1785         makeOutputWindow endEntry.
  1787         makeOutputWindow endEntry.
  1786     ].
  1788     ].
  1787 !
  1789 !
  1788 
  1790 
       
  1791 fetchSelectedProject
       
  1792     |selectedProjectIndex|
       
  1793 
       
  1794     selectedProjectIndex := self selectedProjectIndexHolder value.
       
  1795     (selectedProjectIndex ? 0) == 0 ifTrue:[
       
  1796         selectedProjectDefinition := nil.
       
  1797     ] ifFalse:[
       
  1798         selectedProjectDefinition := self listOfMatchingProjects value at:(selectedProjectIndex).
       
  1799     ].
       
  1800     self hasProjectSelectedHolder value:(selectedProjectDefinition notNil).
       
  1801 
       
  1802     "Created: / 04-09-2012 / 09:52:32 / cg"
       
  1803 !
       
  1804 
  1789 projectTypeChanged
  1805 projectTypeChanged
  1790     <resource: #uiCallback>
  1806     <resource: #uiCallback>
  1791 
  1807 
  1792     self updateListOfMatchingProjects
  1808     self updateListOfMatchingProjects
  1793 !
  1809 !
  1851     self updateApplicationComment.
  1867     self updateApplicationComment.
  1852     self updateButtonEnableState.
  1868     self updateButtonEnableState.
  1853 !
  1869 !
  1854 
  1870 
  1855 selectedProjectChanged
  1871 selectedProjectChanged
  1856 
  1872     self fetchSelectedProject.
  1857     |selectedProjectIndex|
       
  1858 
       
  1859     selectedProjectIndex := self selectedProjectIndexHolder value.
       
  1860     (selectedProjectIndex ? 0) == 0 ifTrue:[
       
  1861         selectedProjectDefinition := nil.
       
  1862     ] ifFalse:[
       
  1863         selectedProjectDefinition := self listOfMatchingProjects value at:(selectedProjectIndex).
       
  1864     ].
       
  1865     self hasProjectSelectedHolder value:(selectedProjectDefinition notNil).
       
  1866 
  1873 
  1867     self updateComment.
  1874     self updateComment.
  1868     self updateListOfApplicationsInProject.
  1875     self updateListOfApplicationsInProject.
  1869     self updateButtonEnableState.
  1876     self updateButtonEnableState.
       
  1877 
       
  1878     "Modified: / 04-09-2012 / 09:52:43 / cg"
  1870 !
  1879 !
  1871 
  1880 
  1872 selectedStartupClassChanged
  1881 selectedStartupClassChanged
  1873     self selectedStartupClassIndexHolder value isNil ifTrue:[
  1882     self selectedStartupClassIndexHolder value isNil ifTrue:[
  1874         selectedStartupClass := nil.
  1883         selectedStartupClass := nil.
  2266 usedCompilerHolder
  2275 usedCompilerHolder
  2267     <resource: #uiAspect>
  2276     <resource: #uiAspect>
  2268 
  2277 
  2269     usedCompilerHolder isNil ifTrue:[
  2278     usedCompilerHolder isNil ifTrue:[
  2270         usedCompilerHolder := ValueHolder new.
  2279         usedCompilerHolder := ValueHolder new.
  2271         usedCompilerHolder value:(ProjectBuilder defaultUsedCompiler).
  2280         usedCompilerHolder value:(LastUsedCompiler ? ProjectBuilder defaultUsedCompiler).
  2272         usedCompilerHolder onChangeSend:#checkCompilerAvailability to:self.
  2281         usedCompilerHolder onChangeSend:#checkCompilerAvailability to:self.
  2273     ].
  2282     ].
  2274     ^ usedCompilerHolder.
  2283     ^ usedCompilerHolder.
  2275 
  2284 
  2276     "Modified: / 21-01-2012 / 14:07:16 / cg"
  2285     "Modified: / 04-09-2012 / 09:43:20 / cg"
  2277 ! !
  2286 ! !
  2278 
  2287 
  2279 !ProjectBuilderAssistantApplication methodsFor:'initialization & release'!
  2288 !ProjectBuilderAssistantApplication methodsFor:'initialization & release'!
  2280 
  2289 
  2281 fileBrowserInstance
  2290 fileBrowserInstance
  2612     self usedCompilerHolder value = 'bcc' ifTrue:[
  2621     self usedCompilerHolder value = 'bcc' ifTrue:[
  2613         cmd := 'bcc32'.
  2622         cmd := 'bcc32'.
  2614     ].
  2623     ].
  2615     self usedCompilerHolder value = 'vc' ifTrue:[
  2624     self usedCompilerHolder value = 'vc' ifTrue:[
  2616         cmd := 'cl'.
  2625         cmd := 'cl'.
  2617         warnMsg2 := 'Due to bugs in this C-compiler, some classes may not be compilable.'.
  2626         warnMsg1 := 'Due to bugs in this C-compiler, some classes may not be compilable.'.
  2618     ].
  2627     ].
  2619     self usedCompilerHolder value = 'lcc' ifTrue:[
  2628     self usedCompilerHolder value = 'lcc' ifTrue:[
  2620         cmd := 'lcc'.
  2629         cmd := 'lcc'.
  2621         warnMsg2 := 'The LCC C-compiler suite is not yet supported (linkage).'.
  2630         warnMsg1 := 'The LCC C-compiler suite is not yet supported (linkage).'.
  2622     ].
  2631     ].
  2623     self usedCompilerHolder value = 'tcc' ifTrue:[
  2632     self usedCompilerHolder value = 'tcc' ifTrue:[
  2624         cmd := 'tcc'.
  2633         cmd := 'tcc'.
  2625         OperatingSystem isMSWINDOWSlike ifTrue:[
  2634         OperatingSystem isMSWINDOWSlike ifTrue:[
  2626             warnMsg2 := 'The Tiny C-compiler suite is not yet supported on MSDOS systems.'.
  2635             warnMsg1 := 'The Tiny C-compiler suite is not yet supported on MSDOS systems.'.
  2627         ].
  2636         ].
  2628     ].
  2637     ].
  2629     self usedCompilerHolder value = 'gcc' ifTrue:[
  2638     self usedCompilerHolder value = 'gcc' ifTrue:[
  2630         cmd := 'gcc'.
  2639         cmd := 'gcc'.
  2631         OperatingSystem isMSWINDOWSlike ifTrue:[
  2640         OperatingSystem isMSWINDOWSlike ifTrue:[
  2632             warnMsg2 := 'The GNU C-compiler suite is not yet supported on MSDOS systems.'.
  2641             warnMsg1 := 'The GNU C-compiler suite is not yet supported on MSDOS systems.'.
  2633         ].
  2642         ].
  2634     ].
  2643     ].
  2635     suite := self suiteNameOfCompiler:(self usedCompilerHolder value).
  2644     suite := self suiteNameOfCompiler:(self usedCompilerHolder value).
  2636     self nameOfUsedCompilerSuiteHolder value:suite.
  2645     self nameOfUsedCompilerSuiteHolder value:suite.
  2637 
  2646 
  2638     (OperatingSystem canExecuteCommand:cmd) ifFalse:[
  2647     (OperatingSystem canExecuteCommand:cmd) ifFalse:[
  2639         warnMsg1 :=
  2648         warnMsg2 :=
  2640 'The "%1"-command seems to be not in your path.
  2649 'The "%1"-command seems to be not in your path.
  2641 Please ensure that you installed the 
  2650 Please ensure that you installed the 
  2642 "%2" compiler suite correctly.
  2651 "%2" compiler suite correctly.
  2643 (However, the makefiles might know where to find the compiler)' bindWith:cmd with:suite.
  2652 (However, the makefiles might know where to find the compiler)' bindWith:cmd with:suite.
  2644     ].
  2653     ].
  2653         self compilerWarnMessageVisibleHolder value:true.
  2662         self compilerWarnMessageVisibleHolder value:true.
  2654     ] ifFalse:[
  2663     ] ifFalse:[
  2655         self compilerWarnMessageVisibleHolder value:false
  2664         self compilerWarnMessageVisibleHolder value:false
  2656     ].
  2665     ].
  2657 
  2666 
  2658     "Modified: / 03-09-2012 / 19:32:09 / cg"
  2667     "Modified: / 04-09-2012 / 09:57:37 / cg"
  2659 !
  2668 !
  2660 
  2669 
  2661 enterContentsSpecification
  2670 enterContentsSpecification
  2662     |toAdd|
  2671     |toAdd|
  2663 
  2672 
  2706 "/    self updateListOfClassesInProject.
  2715 "/    self updateListOfClassesInProject.
  2707 
  2716 
  2708     "Created: / 19-01-2012 / 15:36:47 / cg"
  2717     "Created: / 19-01-2012 / 15:36:47 / cg"
  2709 !
  2718 !
  2710 
  2719 
       
  2720 fetchAttributesFromProjectDefinition
       
  2721     self fetchSelectedProject.
       
  2722     selectedProjectDefinition notNil ifTrue:[
       
  2723         self productNameHolder value: selectedProjectDefinition productName.
       
  2724         self companyNameHolder value: selectedProjectDefinition companyName.
       
  2725     ].
       
  2726 
       
  2727     "Created: / 04-09-2012 / 09:50:46 / cg"
       
  2728 !
       
  2729 
  2711 rememberMakeOutputsContents
  2730 rememberMakeOutputsContents
  2712     makeOutputHolder value:(makeOutputWindow contents)
  2731     makeOutputHolder value:(makeOutputWindow contents)
  2713 !
  2732 !
  2714 
  2733 
  2715 rememberProjectAttributes
  2734 rememberProjectAttributes
  2722         self companyNameHolder value ~= selectedProjectDefinition companyName ifTrue:[
  2741         self companyNameHolder value ~= selectedProjectDefinition companyName ifTrue:[
  2723             selectedProjectDefinition class compile:(selectedProjectDefinition 
  2742             selectedProjectDefinition class compile:(selectedProjectDefinition 
  2724                         companyName_codeFor:(self companyNameHolder value)).
  2743                         companyName_codeFor:(self companyNameHolder value)).
  2725         ]
  2744         ]
  2726     ].
  2745     ].
       
  2746 !
       
  2747 
       
  2748 rememberUsedCompiler
       
  2749     LastUsedCompiler := self usedCompilerHolder value.
       
  2750 
       
  2751     "Created: / 04-09-2012 / 09:45:42 / cg"
  2727 !
  2752 !
  2728 
  2753 
  2729 restoreMakeOutputsContents
  2754 restoreMakeOutputsContents
  2730     makeOutputWindow contents:makeOutputHolder value
  2755     makeOutputWindow contents:makeOutputHolder value
  2731 !
  2756 !