--- a/Tools__ProjectBuilderAssistantApplication.st Tue Oct 20 22:55:11 2009 +0200
+++ b/Tools__ProjectBuilderAssistantApplication.st Tue Oct 20 23:52:57 2009 +0200
@@ -10,7 +10,7 @@
newApplicationsName selectedApplicationIndexHolder
selectedApplication listOfApplicationsInProject
selectedApplicationsComment buildDirectoryHolder makeProcess
- listOfClassesInProject'
+ listOfClassesInProject makeOutputWindow projectBuilder'
classVariableNames:''
poolDictionaries:''
category:'System-Support-Projects'
@@ -448,7 +448,7 @@
name: 'Button4'
layout: (LayoutFrame 293 0 363 0 473 0 385 0)
translateLabel: true
- model: doUpdateProjectContents
+ model: doGenerateProjectContentsDefinition
)
)
@@ -517,8 +517,8 @@
the UIPainter may not be able to read the specification."
"
- UIPainter new openOnClass:ProjectBuilderAssistantApplication andSelector:#page6_buildSpec
- ProjectBuilderAssistantApplication new openInterface:#page6_buildSpec
+ UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page6_buildSpec
+ Tools::ProjectBuilderAssistantApplication new openInterface:#page6_buildSpec
"
<resource: #canvas>
@@ -546,13 +546,14 @@
(SpecCollection
collection: (
(TextEditorSpec
- name: 'TextEditor3'
+ name: 'MakeOutputWindow'
layout: (LayoutFrame 0 0 0 0 0 1 0 1)
model: makeOutputHolder
hasHorizontalScrollBar: true
hasVerticalScrollBar: true
hasKeyboardFocusInitially: false
viewClassName: 'TextCollector'
+ postBuildCallback: postBuildMakeOutputWindow:
)
)
@@ -588,8 +589,8 @@
the UIPainter may not be able to read the specification."
"
- UIPainter new openOnClass:ProjectBuilderAssistantApplication andSelector:#page7_deploySpec
- ProjectBuilderAssistantApplication new openInterface:#page7_deploySpec
+ UIPainter new openOnClass:Tools::ProjectBuilderAssistantApplication andSelector:#page7_deploySpec
+ Tools::ProjectBuilderAssistantApplication new openInterface:#page7_deploySpec
"
<resource: #canvas>
@@ -608,88 +609,27 @@
(SpecCollection
collection: (
(FramedBoxSpec
- label: 'New Project'
+ label: 'Deploy Installation File'
name: 'FramedBox3'
- layout: (LayoutFrame 0 0.0 5 0 4 1.0 105 0)
- labelPosition: topLeft
- translateLabel: true
- component:
- (SpecCollection
- collection: (
- (InputFieldSpec
- name: 'EntryField1'
- layout: (LayoutFrame 1 0 6 0 210 0 28 0)
- model: newProjectsName
- acceptOnReturn: true
- acceptOnTab: true
- acceptOnPointerLeave: true
- emptyFieldReplacementText: 'module:directory'
- )
- (ActionButtonSpec
- label: 'Create'
- name: 'Button1'
- layout: (LayoutFrame 216 0 6 0 341 0 28 0)
- translateLabel: true
- model: createNewProject
- )
- )
-
- )
- )
- (FramedBoxSpec
- label: 'Existing Projects'
- name: 'FramedBox4'
- layout: (LayoutFrame 0 0.0 105 0 4 1.0 397 0)
+ layout: (LayoutFrame 0 0.0 5 0 4 1.0 0 1)
labelPosition: topLeft
translateLabel: true
component:
(SpecCollection
collection: (
- (VariableHorizontalPanelSpec
- name: 'VariableHorizontalPanel2'
- layout: (LayoutFrame 0 0 4 0 0 1 -26 1)
- component:
- (SpecCollection
- collection: (
- (SequenceViewSpec
- name: 'List2'
- model: selectedProjectIndexHolder
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- useIndex: true
- sequenceList: listOfMatchingProjects
- )
- (TextEditorSpec
- name: 'TextEditor2'
- model: selectedProjectsComment
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- isReadOnly: true
- hasKeyboardFocusInitially: false
- )
- )
-
- )
- handles: (Any 0.34560327198364 1.0)
- )
- (CheckBoxSpec
- label: 'Hide ST/X Base Packages'
- name: 'CheckBox1'
- layout: (LayoutFrame -1 0 241 0 275 0 263 0)
- model: hideSTXProjects
- translateLabel: true
+ (SubCanvasSpec
+ name: 'SubCanvas1'
+ layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+ hasHorizontalScrollBar: false
+ hasVerticalScrollBar: false
+ clientHolder: fileBrowserInstance
+ createNewApplication: true
+ createNewBuilder: true
)
)
)
)
- (ActionButtonSpec
- label: 'Browse Selected Project'
- name: 'Button3'
- layout: (LayoutFrame 9 0 410 0 189 0 432 0)
- translateLabel: true
- model: doBrowseProject
- )
)
)
@@ -791,12 +731,18 @@
UserPreferences systemBrowserClass openOnPackage:selectedProjectDefinition package.
!
+doGenerateProjectContentsDefinition
+ self generatePackageContentsMethods
+!
+
doStartMake
<resource: #uiCallback>
self stopMakeButtonVisible value:true.
self startMakeButtonEnabled value:false.
+ makeOutputWindow clear.
+
makeProcess :=
[
[
@@ -804,6 +750,7 @@
] ensure:[
self stopMakeButtonVisible value:false.
self startMakeButtonEnabled value:true.
+ makeProcess := nil.
].
] newProcess.
@@ -812,8 +759,38 @@
makeProcess resume.
!
-doUpdateProjectContents
- self updatePackageContentsMethods
+doStopMake
+ <resource: #uiCallback>
+
+ |p|
+
+ (p := makeProcess) notNil ifTrue:[
+ makeProcess := nil.
+ p terminate.
+ p waitUntilTerminated.
+
+ makeOutputWindow endEntry.
+ makeOutputWindow cr.
+ makeOutputWindow nextPutLine:('Make Cancelled' emphasizeAllWith:{#backgroundColor->Color red. #color->Color white.}).
+ makeOutputWindow endEntry.
+ ].
+!
+
+generatePackageContentsMethods
+ <resource: #uiCallback>
+
+ Class packageQuerySignal answer:(selectedProjectDefinition package)
+ do:[
+ selectedProjectDefinition
+ forEachContentsMethodsCodeToCompileDo:[:code :category |
+ CodeGeneratorTool
+ compile:code
+ forClass:selectedProjectDefinition theMetaclass
+ inCategory:category.
+ ]
+ ignoreOldDefinition:true
+ ].
+ self updateListOfClassesInProject
!
projectTypeChanged
@@ -825,7 +802,22 @@
runBuildProcess
<resource: #uiCallback>
- Delay waitForSeconds:10
+ self assert:makeOutputWindow notNil.
+ self assert:makeOutputWindow model == self makeOutputHolder.
+
+ ActivityNotification handle:[:ex |
+ ex messageText notNil ifTrue:[
+ makeOutputWindow endEntry.
+ makeOutputWindow cr.
+ makeOutputWindow nextPutLine:(ex messageText emphasizeAllWith:{#backgroundColor->Color blue. #color->Color white.}).
+ makeOutputWindow endEntry.
+ ].
+ ex proceed.
+ ] do:[
+ projectBuilder := ProjectBuilder new.
+ projectBuilder package:(selectedProjectDefinition package).
+ projectBuilder buildWithColorizedOutputTo:makeOutputWindow.
+ ].
!
selectedApplicationChanged
@@ -847,22 +839,6 @@
self updateComment.
self updateListOfApplicationsInProject.
self updateButtonEnableState.
-!
-
-updatePackageContentsMethods
- <resource: #uiCallback>
-
- Class packageQuerySignal answer:(selectedProjectDefinition package)
- do:[
- selectedProjectDefinition
- forEachContentsMethodsCodeToCompileDo:[:code :category |
- CodeGeneratorTool
- compile:code
- forClass:selectedProjectDefinition theMetaclass
- inCategory:category.
- ]
- ignoreOldDefinition:true
- ].
! !
!ProjectBuilderAssistantApplication methodsFor:'aspects'!
@@ -889,6 +865,17 @@
^ buildDirectoryHolder.
!
+fileBrowserInstance
+ |targetDirectory browser|
+
+ targetDirectory := projectBuilder packageBuildDirectory.
+
+ browser := FileBrowserV2 new.
+ browser onDirectory:targetDirectory.
+ browser filter:'*setup*'.
+ ^ browser.
+!
+
hasBuildDirectorySpecified
^ self buildDirectoryHolder value notEmptyOrNil
!
@@ -937,18 +924,8 @@
makeOutputHolder
<resource: #uiAspect>
- "automatically generated by UIPainter ..."
-
- "*** the code below creates a default model when invoked."
- "*** (which may not be the one you wanted)"
- "*** Please change as required and accept it in the browser."
- "*** (and replace this comment by something more useful ;-)"
-
makeOutputHolder isNil ifTrue:[
- makeOutputHolder := '' asValue.
-"/ if your app needs to be notified of changes, uncomment one of the lines below:
-"/ makeOutputHolder addDependent:self.
-"/ makeOutputHolder onChangeSend:#makeOutputHolderChanged to:self.
+ makeOutputHolder := ValueHolder new.
].
^ makeOutputHolder.
!
@@ -1079,6 +1056,10 @@
!ProjectBuilderAssistantApplication methodsFor:'initialization & release'!
+postBuildMakeOutputWindow:aView
+ makeOutputWindow := aView
+!
+
postBuildWith:aBuilder
super postBuildWith:aBuilder.
self updateListOfMatchingProjects.
@@ -1122,11 +1103,13 @@
( AssistantPageSpec
pageTitle: 'Project Type Selection'
windowSpecSelector: page1_projectTypeSelectionSpec
+ enterCallbackSelector: updateListOfMatchingProjects
)
(AssistantPageSpec
pageTitle: 'Project Selection'
windowSpecSelector: page2_projectSelectionSpec
+ enterCallbackSelector: updateListOfMatchingProjects
)
(AssistantPageSpec
@@ -1134,6 +1117,7 @@
windowSpecSelector: page3_applicationSelectionSpec
isEnabledQuerySelector: #projectTypeIsNotLibrary
canEnterQuerySelector: #hasProjectSelected
+ enterCallbackSelector: updateListOfApplicationsInProject
)
(AssistantPageSpec
@@ -1151,6 +1135,8 @@
pageTitle: 'Build'
windowSpecSelector: page6_buildSpec
canEnterQuerySelector: #hasBuildDirectorySpecified
+ enterCallbackSelector: #restoreMakeOutputsContents
+ leaveCallbackSelector: #rememberMakeOutputsContents
)
(AssistantPageSpec
@@ -1162,6 +1148,14 @@
!ProjectBuilderAssistantApplication methodsFor:'update'!
+rememberMakeOutputsContents
+ makeOutputHolder value:(makeOutputWindow contents)
+!
+
+restoreMakeOutputsContents
+ makeOutputWindow contents:makeOutputHolder value
+!
+
update:something with:anArgument from:changedObject
changedObject == Smalltalk ifTrue:[
(something == #newClass