use stand alone aspects
authortz
Sun, 19 Apr 1998 00:59:32 +0200
changeset 1560 308be6511a7c
parent 1559 088d6bc754c9
child 1561 102b90f99e58
use stand alone aspects
LibraryBuilder.st
--- a/LibraryBuilder.st	Sun Apr 19 00:58:38 1998 +0200
+++ b/LibraryBuilder.st	Sun Apr 19 00:59:32 1998 +0200
@@ -1,5 +1,5 @@
 ApplicationBuilder subclass:#LibraryBuilder
-	instanceVariableNames:'allClasses classSelectionBlock'
+	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Interface-Smalltalk'
@@ -58,8 +58,8 @@
 
     ^super helpSpec addPairsFrom:#(
 
-#addRemoveClasses
-'Removes or adds the selected classes to the list of the library classes.'
+#addLibraryClasses
+'Adds the selected classes to the list of library classes.'
 
 #fileOutClasses
 'Files out the source code of the selected library classes.'
@@ -77,7 +77,7 @@
 'Name of the library.'
 
 #linkSources
-'Creates links in the source directory to the source file of the library classes.'
+'Creates links in the source directory to the source files of the library classes.'
 
 #optinline
 'Generate optimized inline code.'
@@ -91,6 +91,9 @@
 #optspace3
 'Optimize even more for space.'
 
+#removeLibraryClasses
+'Removes the selected library classes.'
+
 #stxClasses
 'Classes of the ST/X.'
 
@@ -120,11 +123,11 @@
           #window: 
            #(#WindowSpec
               #name: 'Library Builder (experimental)'
-              #layout: #(#LayoutFrame -48 0 102 0 451 0 561 0)
+              #layout: #(#LayoutFrame 15 0 222 0 514 0 681 0)
               #label: 'Library Builder (experimental)'
               #min: #(#Point 420 220)
               #max: #(#Point 1152 900)
-              #bounds: #(#Rectangle -48 102 452 562)
+              #bounds: #(#Rectangle 15 222 515 682)
               #menu: #menu
               #usePreferredExtent: false
           )
@@ -181,15 +184,6 @@
                                         #useIndex: false
                                         #sequenceList: #libraryClasses
                                     )
-                                     #(#UpDownButtonSpec
-                                        #name: 'addRemoveButton'
-                                        #layout: #(#LayoutOrigin -23 0.6 33 0)
-                                        #activeHelpKey: #addRemoveClasses
-                                        #orientation: #horizontal
-                                        #upAction: #removeLibraryClasses
-                                        #downAction: #addLibraryClasses
-                                        #upArgument: ''
-                                    )
                                      #(#DividerSpec
                                         #name: 'Separator3'
                                         #layout: #(#LayoutFrame 0 0 196 0 0 1 199 0)
@@ -282,6 +276,22 @@
                                         #activeHelpKey: #sourceDirectory
                                         #model: #sourceDirectory
                                     )
+                                     #(#ActionButtonSpec
+                                        #name: 'removeButton'
+                                        #layout: #(#LayoutFrame -32 0.6 34 0 -1 0.6 56 0)
+                                        #activeHelpKey: #removeLibraryClasses
+                                        #hasCharacterOrientedLabel: false
+                                        #label: 'leftIcon'
+                                        #model: #removeLibraryClasses
+                                    )
+                                     #(#ActionButtonSpec
+                                        #name: 'addButton'
+                                        #layout: #(#LayoutFrame 1 0.6 34 0 32 0.6 56 0)
+                                        #activeHelpKey: #addLibraryClasses
+                                        #hasCharacterOrientedLabel: false
+                                        #label: 'rightIcon'
+                                        #model: #addLibraryClasses
+                                    )
                                   )
                               )
                           )
@@ -542,7 +552,8 @@
 
     |libraryClasses selectionOfLibraryClasses|
 
-    self selectionOfClasses value size == 0 ifTrue: [^self warn: 'No class selected!!'].
+    self selectionOfClasses value size == 0 
+        ifTrue: [^self warn: 'No class selected!!'].
 
     libraryClasses := (aspects at: #libraryClasses) value.
 
@@ -849,7 +860,7 @@
     [
         |makeProtoFile makeProtoFileStream conf libraryClasses|
 
-        (makeProtoFileStream := makeProtoFile writeStream) isNil
+        (makeProtoFileStream := (makeProtoFile := dir asFilename construct:'Make.proto') writeStream) isNil
         ifTrue:
         [
             self warn: 'Cannot create Make.proto'
@@ -905,12 +916,7 @@
     [
         |makeFile makeFileStream makeProtoFile catOn|
 
-        (makeFile := dir asFilename construct:'Makefile') exists
-        ifTrue:
-        [
-            makeFile renameTo: (dir asFilename construct:'Makefile.bak')
-        ].
-        (makeFileStream := makeFile writeStream) isNil
+        (makeFileStream := (makeFile := dir asFilename construct:'Makefile') writeStream) isNil
         ifTrue:
         [
             self warn:'Cannot create Makefile'.
@@ -989,12 +995,17 @@
 initialize
     "initializes all aspects"
 
-    |homeDir|
+    |homeDir myAspects|
 
     super initialize.
 
     homeDir := Filename homeDirectory asFilename.
 
+    myAspects := IdentityDictionary new.
+    aspects associationsDo: [:aspect| myAspects at: aspect key put: aspect value copy].
+    aspects   := myAspects.
+
+    (aspects at: #systemLibrary) addDependent: self.
     self aspectsAt: #libraryName     putFirst: 'libnew'.
     self aspectsAt: #libraryClasses  putFirst: OrderedCollection new.
     self getLibraryClasses. "do check classes"
@@ -1016,7 +1027,7 @@
     self aspectsAt: #optinline   putFirst: false.
     self aspectsAt: #inlineNew   putFirst: false.
 
-    self aspectsAt: #linkSources putFirst: true.
+    self aspectsAt: #linkSources putFirst: false.
 
 ! !
 
@@ -1037,8 +1048,21 @@
     ^libraryClasses reverse
 ! !
 
+!LibraryBuilder methodsFor:'startup / release'!
+
+closeRequest
+    "close request; stores the aspects for the next try"
+
+    self class aspects: aspects.
+
+    super closeRequest
+
+
+
+! !
+
 !LibraryBuilder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/LibraryBuilder.st,v 1.3 1998-04-18 14:17:45 tz Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/LibraryBuilder.st,v 1.4 1998-04-18 22:59:32 tz Exp $'
 ! !