Tools__ProjectBuilderAssistantApplication.st
changeset 3335 217dad1c84d0
parent 3320 3a3e4ca40b7c
child 3336 108c139b4bbd
--- a/Tools__ProjectBuilderAssistantApplication.st	Thu Oct 06 19:12:47 2016 +0200
+++ b/Tools__ProjectBuilderAssistantApplication.st	Fri Oct 07 00:04:03 2016 +0200
@@ -206,108 +206,6 @@
 "
 ! !
 
-!ProjectBuilderAssistantApplication class methodsFor:'assistant pages spec'!
-
-assistantSpec
-    ^ #(Array
-        ( AssistantPageSpec
-            pageTitle: 'Project Type Selection'
-            windowSpecSelector: page1_projectTypeSelectionSpec
-            enterCallbackSelector: updateListOfMatchingProjects
-            infoText: 'Choose the <B>type</B> of project you are about to build.'
-        )
-
-        (AssistantPageSpec
-            pageTitle: 'ProjectDefinition Selection'
-            windowSpecSelector: page2_projectSelectionSpec
-            enterCallbackSelector: updateListOfMatchingProjectsAndProjectIDs
-            leaveCallbackSelector: fetchAttributesFromProjectDefinition
-            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".'
-        )
-
-        (AssistantPageSpec
-            pageTitle: 'Startup Application Selection'
-            windowSpecSelector: page3_applicationSelectionSpec
-            isEnabledQuerySelector: #projectTypeIsGuiApplication
-            canEnterQuerySelector: #canEnterApplicationSelection
-            enterCallbackSelector: updateListOfApplicationsInProject
-            infoText: 'Choose an existing application or create a new one. These are subclasses of <I>ApplicationModel</I> and define the GUI and control flow inside the application. Can also be left blank if the startup class does it all (stx build).'
-        )
-
-        (AssistantPageSpec
-            pageTitle: 'Startup Class Selection'
-            windowSpecSelector: page4_startupClassSelectionSpec
-            isEnabledQuerySelector: #projectTypeIsNotLibrary
-            canEnterQuerySelector: #canEnterStartupClassSelection
-            enterCallbackSelector: updateListOfStartupClassesInProject
-            infoText: 'Choose an existing startup-class or create a new one. These are subclasses of <I>StandaloneStartup</I> and start the application. Command line arguments can be interpreted there.'
-        )
-
-        (AssistantPageSpec
-            pageTitle: 'Specify Contents'
-            windowSpecSelector: page5_specifyIncludedClasses
-            enterCallbackSelector: enterContentsSpecification
-            canEnterQuerySelector: #canEnterContentsSelection
-            infoText: 'Define which (other) classes are to be included. Do not include classes from other packages here. Press "<I>Scan</I>" to include all classes of the package; "<I>Browse</I>" to edit the contents manually.'
-        )
-
-        (AssistantPageSpec
-            pageTitle: 'Specify Prerequisites'
-            windowSpecSelector: page5b_specifyPrerequisitePackages
-            enterCallbackSelector: enterPrerequisitesSpecification
-            canEnterQuerySelector: #canEnterPrerequisitesSelection
-            infoText: 'Define which packages are needed as prerequisites. These are required class libraries which should be packaged together with the application. Press "<I>Scan</I>" to search for prerequisites; "<I>Browse</I>" to edit the list manually.'
-        )
-
-        (AssistantPageSpec
-            pageTitle: 'Specify Project Attributes'
-            windowSpecSelector: page6a_specifyProjectAttributes
-            infoText: 'Define additional attributes. These will be shown during the installation of the deployed package and affect the name of the deployed self installable file.'
-            enterCallbackSelector: updateProjectAttributes
-            leaveCallbackSelector: #rememberProjectAttributes
-        )
-
-        (AssistantPageSpec
-            pageTitle: 'Specify Build Directory'
-            windowSpecSelector: page6b_specifyBuildDirectorySpec
-            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).'
-            enterCallbackSelector: #checkCompilerAvailability
-            leaveCallbackSelector: #rememberUsedCompiler
-        )
-
-        (AssistantPageSpec
-            pageTitle: 'Check Into Source Repository'
-            windowSpecSelector: page7a_checkinSpec
-            enterCallbackSelector: #checkSourceCodeManagerType
-            infoText: 'Check the package''s source and build-support files into the source code repository.'
-        )
-
-        (AssistantPageSpec
-            pageTitle: 'Build'
-            windowSpecSelector: page7b_buildSpec
-            canEnterQuerySelector: #canEnterBuild
-            enterCallbackSelector: #restoreMakeOutputsContents
-            leaveCallbackSelector: #rememberMakeOutputsContents
-            infoText: 'Start the build-process. This will run "make"+"bcc/vc/gcc" to compile all required classes and "nsis" to generate a self-installable executable (on windows). 
-You must have the compiler (borland-bcc or visual-c) and NullSoft NSIS packages installed for this to work.
-Without NSIS, zip the folder where the exe is generated and unzip on a target machine.
-<P>
-To try the application, open an explorer/finder on the directory and double click on the executable.
-Alternatively, open a command window and type the name of the executable there. Sorry, but double-click in the ST/X file browser does not work.'
-        )
-
-        (AssistantPageSpec
-            pageTitle: 'Deploy'
-            windowSpecSelector: page8_deploySpec
-            canEnterQuerySelector: #canEnterDeploy
-            infoText: 'Find the installer-file to be deployed (or test-run the executable). 
-You can open a Windows-explorer/finder 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.'
-        )
-    ) decodeAsLiteralArray.
-
-    "Modified: / 04-09-2012 / 09:49:50 / cg"
-! !
-
 !ProjectBuilderAssistantApplication class methodsFor:'defaults'!
 
 defaultIcon
@@ -1815,7 +1713,7 @@
             (SpecCollection
                collection: (
                 (SubCanvasSpec
-                   name: 'SubCanvas1'
+                   name: 'FileBrowserSubCanvas'
                    layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
                    hasHorizontalScrollBar: false
                    hasVerticalScrollBar: false
@@ -2843,7 +2741,7 @@
 !
 
 openOn:aProjectDefinitionClass
-    |type apps startupClass pageToGo|
+    |type "apps" startupClass pageToGo|
 
     self allButOpen.
     aProjectDefinitionClass isLibraryDefinition ifTrue:[
@@ -2862,7 +2760,7 @@
     self hasProjectSelectedHolder value:true.
 
     pageToGo := 2.
-    type == ProjectDefinition guiApplicationType ifTrue:[
+    (type == ProjectDefinition guiApplicationType) ifTrue:[
         pageToGo := 3.
         (startupClass := aProjectDefinitionClass startupClass) notNil ifTrue:[
             self updateListOfStartupClassesInProject.
@@ -2870,9 +2768,9 @@
             self selectedStartupClassIndexHolder value:(self listOfStartupClassesInProject value indexOf:startupClass).
             pageToGo := 5.
         ]. 
-"/    apps := (aProjectDefinitionClass classes select:[:cls | cls isKindOf:ApplicationModel])
+        "/ apps := (aProjectDefinitionClass classes select:[:cls | cls isKindOf:ApplicationModel])
     ].
-    type == ProjectDefinition nonGuiApplicationType ifTrue:[
+    (type == ProjectDefinition nonGuiApplicationType) ifTrue:[
         pageToGo := 4.
         (startupClass := aProjectDefinitionClass startupClass) notNil ifTrue:[
             self updateListOfStartupClassesInProject.
@@ -3164,7 +3062,140 @@
 !ProjectBuilderAssistantApplication methodsFor:'specs'!
 
 assistantSpec
-    ^ self class assistantSpec
+    |specs|
+
+    specs := OrderedCollection new.
+    specs add:
+        #( AssistantPageSpec
+            pageTitle: 'Project Type Selection'
+            windowSpecSelector: page1_projectTypeSelectionSpec
+            enterCallbackSelector: updateListOfMatchingProjects
+            infoText: 'Choose the <B>type</B> of project you are about to build.'
+        ) decodeAsLiteralArray.
+
+    specs add:
+        #(AssistantPageSpec
+            pageTitle: 'ProjectDefinition Selection'
+            windowSpecSelector: page2_projectSelectionSpec
+            enterCallbackSelector: updateListOfMatchingProjectsAndProjectIDs
+            leaveCallbackSelector: fetchAttributesFromProjectDefinition
+            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".'
+        ) decodeAsLiteralArray.
+
+    specs add:
+        #(AssistantPageSpec
+            pageTitle: 'Startup Application Selection'
+            windowSpecSelector: page3_applicationSelectionSpec
+            isEnabledQuerySelector: #projectTypeIsGuiApplication
+            canEnterQuerySelector: #canEnterApplicationSelection
+            enterCallbackSelector: updateListOfApplicationsInProject
+            infoText: 'Choose an existing application or create a new one. These are subclasses of <I>ApplicationModel</I> and define the GUI and control flow inside the application. Can also be left blank if the startup class does it all (stx build).'
+        ) decodeAsLiteralArray.
+
+    specs add:
+        #(AssistantPageSpec
+            pageTitle: 'Startup Class Selection'
+            windowSpecSelector: page4_startupClassSelectionSpec
+            isEnabledQuerySelector: #projectTypeIsNotLibrary
+            canEnterQuerySelector: #canEnterStartupClassSelection
+            enterCallbackSelector: updateListOfStartupClassesInProject
+            infoText: 'Choose an existing startup-class or create a new one. These are subclasses of <I>StandaloneStartup</I> and start the application. Command line arguments can be interpreted there.'
+        ) decodeAsLiteralArray.
+
+    specs add:
+        #(AssistantPageSpec
+            pageTitle: 'Specify Contents'
+            windowSpecSelector: page5_specifyIncludedClasses
+            enterCallbackSelector: enterContentsSpecification
+            canEnterQuerySelector: #canEnterContentsSelection
+            infoText: 'Define which (other) classes are to be included. Do not include classes from other packages here. Press "<I>Scan</I>" to include all classes of the package; "<I>Browse</I>" to edit the contents manually.'
+        ) decodeAsLiteralArray.
+
+    specs add:
+        #(AssistantPageSpec
+            pageTitle: 'Specify Prerequisites'
+            windowSpecSelector: page5b_specifyPrerequisitePackages
+            enterCallbackSelector: enterPrerequisitesSpecification
+            canEnterQuerySelector: #canEnterPrerequisitesSelection
+            infoText: 'Define which packages are needed as prerequisites. These are required class libraries which should be packaged together with the application. Press "<I>Scan</I>" to search for prerequisites; "<I>Browse</I>" to edit the list manually.'
+        ) decodeAsLiteralArray.
+
+    specs add:
+        #(AssistantPageSpec
+            pageTitle: 'Specify Project Attributes'
+            windowSpecSelector: page6a_specifyProjectAttributes
+            infoText: 'Define additional attributes. These will be shown during the installation of the deployed package and affect the name of the deployed self installable file.'
+            enterCallbackSelector: updateProjectAttributes
+            leaveCallbackSelector: #rememberProjectAttributes
+        ) decodeAsLiteralArray.
+
+    specs add:
+        #(AssistantPageSpec
+            pageTitle: 'Specify Build Directory'
+            windowSpecSelector: page6b_specifyBuildDirectorySpec
+            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).'
+            enterCallbackSelector: #checkCompilerAvailability
+            leaveCallbackSelector: #rememberUsedCompiler
+        ) decodeAsLiteralArray.
+
+    specs add:
+        #(AssistantPageSpec
+            pageTitle: 'Check Into Source Repository'
+            windowSpecSelector: page7a_checkinSpec
+            enterCallbackSelector: #checkSourceCodeManagerType
+            infoText: 'Check the package''s source and build-support files into the source code repository.'
+        ) decodeAsLiteralArray.
+
+    specs add:
+        #(AssistantPageSpec
+            pageTitle: 'Build'
+            windowSpecSelector: page7b_buildSpec
+            canEnterQuerySelector: #canEnterBuild
+            enterCallbackSelector: #restoreMakeOutputsContents
+            leaveCallbackSelector: #rememberMakeOutputsContents
+            infoText: 'Start the build-process. This will create an isolated build directory,
+and run "make" there to compile all required classes.
+<P>            
+On Windows, it will use "nsis" to generate a self-installable executable, 
+and you must have the compiler (borland-bcc, visual-c or mingw) and NullSoft NSIS packages installed for this to work.
+Without NSIS, zip the folder where the exe is generated and unzip on a target machine.
+<P>
+On OS X, it will generate a "dmg" for deployment. You should have XCode or the "gcc" tool chain installed.
+<P>
+On Linux, an installable package will be generated. You should have the development support packages installed (gcc, Xlib etc.).
+<P>
+To try the application, open an Explorer/Finder on the directory and double click on the executable.
+Alternatively, open a command window and type the name of the executable there. 
+Sorry, but double-click in the ST/X file browser does not work.'
+        ) decodeAsLiteralArray.
+
+    self projectTypeIsLibrary ifTrue:[
+        specs add:
+            #(AssistantPageSpec
+                pageTitle: 'Deploy'
+                windowSpecSelector: page8_deploySpec
+                canEnterQuerySelector: #canEnterDeploy
+                enterCallbackSelector: enterDeploySpecification
+                infoText: 'Find the generated binary class library file here.
+Because this is a library package (i.e. no application package), 
+there is no deployable installer generated, just the binary (.so / .dll).'
+            ) decodeAsLiteralArray.
+    ] ifFalse:[   
+        specs add:
+            #(AssistantPageSpec
+                pageTitle: 'Deploy'
+                windowSpecSelector: page8_deploySpec
+                canEnterQuerySelector: #canEnterDeploy
+                enterCallbackSelector: enterDeploySpecification
+                infoText: 'Find the installer-file to be deployed (or test-run the executable). 
+You can open an Explorer/Finder 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.'
+            ) decodeAsLiteralArray.
+    ].
+    ^ specs.
+
+    "Modified: / 04-09-2012 / 09:49:50 / cg"
 ! !
 
 !ProjectBuilderAssistantApplication methodsFor:'update'!
@@ -3289,6 +3320,14 @@
     self updateListOfClassesInProject.
 !
 
+enterDeploySpecification
+    |fileBrowserCanvas fileBrowser|
+
+    fileBrowserCanvas := self builder componentAt:'FileBrowserSubCanvas'.
+    fileBrowser := fileBrowserCanvas application. 
+    fileBrowser filterModel value:('*' , ObjectFileLoader sharedLibraryExtension).
+!
+
 enterPrerequisitesSpecification
     |toAdd|