Tools__ProjectBuilderAssistantApplication.st
changeset 2674 3f61bdc7e0dc
parent 2671 48cb061347ef
child 2675 7bd7413e3cb3
equal deleted inserted replaced
2673:100b4dd5c3c2 2674:3f61bdc7e0dc
   792               verticalSpace: 3
   792               verticalSpace: 3
   793               component: 
   793               component: 
   794              (SpecCollection
   794              (SpecCollection
   795                 collection: (
   795                 collection: (
   796                  (ActionButtonSpec
   796                  (ActionButtonSpec
   797                     label: 'Start Make'
   797                     label: 'Make All'
   798                     name: 'Button3'
   798                     name: 'Button3'
   799                     translateLabel: true
   799                     translateLabel: true
   800                     model: doStartMake
   800                     model: doStartMakeAll
   801                     enableChannel: startMakeButtonEnabled
   801                     enableChannel: startMakeButtonEnabled
   802                     extent: (Point 107 22)
   802                     extent: (Point 107 22)
       
   803                   )
       
   804                  (ActionButtonSpec
       
   805                     label: 'Make EXE only'
       
   806                     name: 'Button5'
       
   807                     translateLabel: true
       
   808                     model: doStartMakeExe
       
   809                     enableChannel: startMakeButtonEnabled
       
   810                     extent: (Point 107 22)
       
   811                   )
       
   812                  (ViewSpec
       
   813                     name: 'Box1'
       
   814                     extent: (Point 20 10)
   803                   )
   815                   )
   804                  (ActionButtonSpec
   816                  (ActionButtonSpec
   805                     label: 'Stop Make'
   817                     label: 'Stop Make'
   806                     name: 'Button4'
   818                     name: 'Button4'
   807                     visibilityChannel: stopMakeButtonVisible
   819                     visibilityChannel: stopMakeButtonVisible
  1068 doOpenExplorer
  1080 doOpenExplorer
  1069     OperatingSystem
  1081     OperatingSystem
  1070         openApplicationForDocument:(projectBuilder packageBuildDirectory) operation:#explore.
  1082         openApplicationForDocument:(projectBuilder packageBuildDirectory) operation:#explore.
  1071 !
  1083 !
  1072 
  1084 
  1073 doStartMake
  1085 doStartMakeAll
  1074     <resource: #uiCallback>
  1086     <resource: #uiCallback>
  1075 
  1087 
  1076     self stopMakeButtonVisible value:true.
  1088     self stopMakeButtonVisible value:true.
  1077     self startMakeButtonEnabled value:false.
  1089     self startMakeButtonEnabled value:false.
  1078 
  1090 
  1079     makeOutputWindow clear.
  1091     makeOutputWindow clear.
  1080 
  1092 
  1081     makeProcess := 
  1093     makeProcess := 
  1082             [
  1094             [
  1083                 [
  1095                 [
  1084                     self runBuildProcess
  1096                     self runBuildProcess:'all'
  1085                 ] ensure:[
  1097                 ] ensure:[
  1086                     self stopMakeButtonVisible value:false.
  1098                     self stopMakeButtonVisible value:false.
  1087                     self startMakeButtonEnabled value:true.
  1099                     self startMakeButtonEnabled value:true.
  1088                     makeProcess := nil.
  1100                     makeProcess := nil.
  1089                     self updateButtonEnableState.
  1101                     self updateButtonEnableState.
  1093     makeProcess priority:4.
  1105     makeProcess priority:4.
  1094     makeProcess priorityRange:(4 to:8).
  1106     makeProcess priorityRange:(4 to:8).
  1095     makeProcess resume.
  1107     makeProcess resume.
  1096 !
  1108 !
  1097 
  1109 
       
  1110 doStartMakeExeOnly
       
  1111     <resource: #uiCallback>
       
  1112 
       
  1113     self stopMakeButtonVisible value:true.
       
  1114     self startMakeButtonEnabled value:false.
       
  1115 
       
  1116     makeOutputWindow clear.
       
  1117 
       
  1118     makeProcess := 
       
  1119             [
       
  1120                 [
       
  1121                     self runBuildProcess:'exe'
       
  1122                 ] ensure:[
       
  1123                     self stopMakeButtonVisible value:false.
       
  1124                     self startMakeButtonEnabled value:true.
       
  1125                     makeProcess := nil.
       
  1126                     self updateButtonEnableState.
       
  1127                 ].
       
  1128             ] newProcess.
       
  1129 
       
  1130     makeProcess priority:4.
       
  1131     makeProcess priorityRange:(4 to:8).
       
  1132     makeProcess resume.
       
  1133 !
       
  1134 
  1098 doStopMake
  1135 doStopMake
  1099     <resource: #uiCallback>
  1136     <resource: #uiCallback>
  1100 
  1137 
  1101     |p|
  1138     |p|
  1102 
  1139 
  1116     <resource: #uiCallback>
  1153     <resource: #uiCallback>
  1117 
  1154 
  1118     self updateListOfMatchingProjects
  1155     self updateListOfMatchingProjects
  1119 !
  1156 !
  1120 
  1157 
  1121 runBuildProcess
  1158 runBuildProcess:what
  1122     <resource: #uiCallback>
  1159     <resource: #uiCallback>
  1123 
  1160 
  1124     self assert:makeOutputWindow notNil.
  1161     self assert:makeOutputWindow notNil.
  1125     self assert:makeOutputWindow model == self makeOutputHolder.
  1162     self assert:makeOutputWindow model == self makeOutputHolder.
  1126 
  1163 
  1133         ].
  1170         ].
  1134         ex proceed.
  1171         ex proceed.
  1135     ] do:[
  1172     ] do:[
  1136         projectBuilder := ProjectBuilder new.
  1173         projectBuilder := ProjectBuilder new.
  1137         projectBuilder package:(selectedProjectDefinition package).
  1174         projectBuilder package:(selectedProjectDefinition package).
  1138         projectBuilder buildWithColorizedOutputTo:makeOutputWindow.
  1175         what = 'exe' ifTrue:[
       
  1176             projectBuilder makeExeOnly:true
       
  1177         ] ifFalse:[
       
  1178             projectBuilder makeExeOnly:false
       
  1179         ].
       
  1180 
       
  1181         Error handle:[:ex |
       
  1182             makeOutputWindow endEntry.
       
  1183             makeOutputWindow cr.
       
  1184             makeOutputWindow nextPutLine:(ex messageText colorizeAllWith:Color white on:Color red).
       
  1185             makeOutputWindow endEntry.
       
  1186         ] do:[
       
  1187             projectBuilder buildWithColorizedOutputTo:makeOutputWindow.
       
  1188         ].
  1139     ].
  1189     ].
  1140 !
  1190 !
  1141 
  1191 
  1142 selectedApplicationChanged
  1192 selectedApplicationChanged
  1143     |idx|
  1193     |idx|
  1590     ^ self hasBuildDirectorySpecified
  1640     ^ self hasBuildDirectorySpecified
  1591 !
  1641 !
  1592 
  1642 
  1593 canEnterContentsSelection
  1643 canEnterContentsSelection
  1594     ^ self hasProjectSelected 
  1644     ^ self hasProjectSelected 
  1595     and:[ self hasApplicationSelected 
  1645     and:[ true "self hasApplicationSelected" 
  1596     and:[ self hasStartupClassSelected ]]
  1646     and:[ self hasStartupClassSelected ]]
  1597 !
  1647 !
  1598 
  1648 
  1599 canEnterDeploy
  1649 canEnterDeploy
  1600     ^ self hasProjectBuilder
  1650     ^ self hasProjectBuilder
  1840         startupClasses := Smalltalk allClasses
  1890         startupClasses := Smalltalk allClasses
  1841                                     select:[:cls |
  1891                                     select:[:cls |
  1842                                         ((cls includesBehavior:StandaloneStartup)
  1892                                         ((cls includesBehavior:StandaloneStartup)
  1843                                         and:[ self hideOtherStartupClasses value not
  1893                                         and:[ self hideOtherStartupClasses value not
  1844                                               or:[ cls package = package ]])
  1894                                               or:[ cls package = package ]])
       
  1895                                         or:[ cls == Smalltalk
       
  1896                                              and:[ self hideOtherStartupClasses value not ] ]
  1845                                     ].
  1897                                     ].
  1846         startupClasses := startupClasses asOrderedCollection.
  1898         startupClasses := startupClasses asOrderedCollection.
  1847         startupClasses sort:[:a :b | a name < b name].
  1899         startupClasses sort:[:a :b | a name < b name].
  1848 
  1900 
  1849         startUpClassName := [ selectedProjectDefinition startupClassName ] ifError:[ nil ].
  1901         startUpClassName := [ selectedProjectDefinition startupClassName ] ifError:[ nil ].
  1853                 startupClassIndex := startupClasses indexOf:startUpClass.
  1905                 startupClassIndex := startupClasses indexOf:startUpClass.
  1854                 startupClassIndex == 0 ifTrue:[ startupClassIndex := nil ].
  1906                 startupClassIndex == 0 ifTrue:[ startupClassIndex := nil ].
  1855             ].
  1907             ].
  1856         ].
  1908         ].
  1857     ].
  1909     ].
       
  1910 
  1858     self listOfStartupClassesInProject value:startupClasses.
  1911     self listOfStartupClassesInProject value:startupClasses.
  1859 
       
  1860     self selectedStartupClassIndexHolder value:startupClassIndex.
  1912     self selectedStartupClassIndexHolder value:startupClassIndex.
  1861 ! !
  1913 ! !
  1862 
  1914 
  1863 !ProjectBuilderAssistantApplication class methodsFor:'documentation'!
  1915 !ProjectBuilderAssistantApplication class methodsFor:'documentation'!
  1864 
  1916