added:
authorClaus Gittinger <cg@exept.de>
Sun, 11 Oct 2009 01:09:42 +0200
changeset 2611 706991dee298
parent 2610 2fbaaa0e8e33
child 2612 2e735008a4d8
added: #buildWithOutputTo:errorTo: #makeWithOutputTo:errorTo: changed: #build
ProjectBuilder.st
--- a/ProjectBuilder.st	Sat Oct 10 17:59:32 2009 +0200
+++ b/ProjectBuilder.st	Sun Oct 11 01:09:42 2009 +0200
@@ -35,6 +35,46 @@
     "/ intermediate - this will move into a commonly used utility class
     "/ (where all the project code support will be collected).
 
+    |makeOutput stdOut stdErr lock|
+
+    lock := Semaphore forMutualExclusion.
+    makeOutput := TextStream on:(Text new:10000).
+    stdErr := ActorStream new
+                    nextPutBlock:[:char |
+                        lock critical:[
+                            makeOutput emphasis:{#backgroundColor->Color red. #color->Color white.}.
+                            makeOutput nextPut:char.
+                            makeOutput emphasis:nil.
+                        ]
+                    ];
+                    nextPutAllBlock:[:char |
+                        lock critical:[
+                            makeOutput emphasis:{#backgroundColor->Color red. #color->Color white.}.
+                            makeOutput nextPutAll:char.
+                            makeOutput emphasis:nil.
+                        ]
+                    ].
+    stdOut := ActorStream new
+                    nextPutBlock:[:char |
+                        lock critical:[
+                            makeOutput nextPut:char.
+                        ]
+                    ];
+                    nextPutAllBlock:[:char |
+                        lock critical:[
+                            makeOutput nextPutAll:char.
+                        ]
+                    ].
+
+    self buildWithOutputTo:stdOut errorTo:stdErr.
+
+    TextView openWith:makeOutput contents.
+!
+
+buildWithOutputTo:stdOut errorTo:stdErr
+    "/ intermediate - this will move into a commonly used utility class
+    "/ (where all the project code support will be collected).
+
     |module directory|
 
     projectDefinitionClass := ProjectDefinition definitionClassForPackage:package.
@@ -87,17 +127,7 @@
     self copySupportFilesForLinkage.
     self copyStartupFilesFromSmalltalk.
 
-    OperatingSystem
-        executeCommand:(ParserFlags makeCommand,' exe')
-        inputFrom:nil
-        outputTo:Transcript
-        errorTo:Transcript
-        inDirectory:(buildDirectory / module / directory)
-        onError:[:status| self error:'make failed'].
-
-    "Created: / 09-08-2006 / 18:37:19 / fm"
-    "Modified: / 09-08-2006 / 19:55:50 / fm"
-    "Modified: / 22-09-2006 / 17:37:11 / cg"
+    self makeWithOutputTo:stdOut errorTo:stdErr.
 !
 
 copyDLLsForLinkage
@@ -442,6 +472,29 @@
 "/    stx_libbasic2 preRequisitesForBuilding#(#'stx:libbasic')
 !
 
+makeWithOutputTo:stdOut errorTo:stdErr
+    |module directory|
+
+    module := package module.
+    directory := package directory.
+
+    OperatingSystem
+        executeCommand:(ParserFlags makeCommand,' exe')
+        inputFrom:nil
+        outputTo:stdOut
+        errorTo:stdErr
+        inDirectory:(buildDirectory / module / directory)
+        onError:[:status| self error:'make failed'].
+
+    OperatingSystem
+        executeCommand:(ParserFlags makeCommand,' setup')
+        inputFrom:nil
+        outputTo:stdOut
+        errorTo:stdErr
+        inDirectory:(buildDirectory / module / directory)
+        onError:[:status| self error:'make failed'].
+!
+
 setupBuildDirectory
     buildDirectory exists ifFalse:[
         buildDirectory recursiveMakeDirectory.