checkin from browser
authorClaus Gittinger <cg@exept.de>
Tue, 30 Mar 1999 19:44:37 +0200
changeset 4078 ce18e95e0826
parent 4077 cc1f4c165ace
child 4079 84ad7326cc62
checkin from browser
Project.st
--- a/Project.st	Tue Mar 30 00:16:38 1999 +0200
+++ b/Project.st	Tue Mar 30 19:44:37 1999 +0200
@@ -676,14 +676,16 @@
     (pack at:'classes' default:#()) do:[:info |
         |condKey className optionalFileName|
 
+        condKey := #always.
         info isSymbol ifTrue:[
             className := info.
-            condKey := #always.
         ] ifFalse:[
-            condKey := info at:1.
-            className := info at:2.
-            info size > 2 ifTrue:[
-                optionalFileName := info at:3.
+            className := info at:1.
+            info size > 1 ifTrue:[
+                optionalFileName := info at:2.
+                info size > 2 ifTrue:[
+                    condKey := info at:3.
+                ]
             ].
         ].
         self 
@@ -727,11 +729,11 @@
      Actually, the format is the same as used for resources (i.e. key - value pairs)
      and the code below could be much simpler - if there where no humans to read it ..."
 
-    |s coll first|
+    |s coll first maxLen|
 
     s := aStream.
 
-    s nextPutLine:'; $Header: /cvs/stx/stx/libbasic/Project.st,v 1.72 1999-03-29 22:16:38 cg Exp $'; nextPutLine:';'.
+    s nextPutLine:'; $Header: /cvs/stx/stx/libbasic/Project.st,v 1.73 1999-03-30 17:44:37 cg Exp $'; nextPutLine:';'.
     s nextPutLine:'; Project saved ' , Smalltalk timeStamp; nextPutLine:';'.
     s nextPutLine:'; Be careful when editing - do not corrupt the files syntax.'.
     s nextPutLine:'; (Lines starting with a semicolon are comment lines)'.
@@ -803,11 +805,22 @@
     ].
 
     s cr; nextPutLine:';'; nextPutLine:'; classes:'; nextPutLine:';'.
-    s nextPutLine:'; (for each class: condition className fileName)'; nextPutLine:';'.
+    s nextPutLine:'; (for each class, one line of the form: ( #''className'' [fileName [condition]] )'.
+    s nextPutLine:'; (where fileName and condition are optionl)'.
+    s nextPutLine:';'.
 
     coll := self classInfo.
     coll size > 0 ifTrue:[
         s nextPutAll:'classes'; tab; nextPutLine:'#( \'.
+        "/ find the longest className (for layout only)
+        
+        maxLen := coll inject:0 into:[:maxSoFar :aClassInfo |
+                                        |clsName|
+
+                                        clsName := aClassInfo className.
+                                        maxSoFar max:clsName storeString size
+                                     ].
+
         coll do:[:aClassInfo |
             |clsName fileName cond|
 
@@ -818,10 +831,12 @@
             ].
             cond := aClassInfo conditionForInclusion.
             s tab. s nextPutAll:'( '; 
-                     nextPutAll:cond storeString; 
-                     tab; nextPutAll:clsName; 
-                     tab; nextPutAll:fileName storeString;
-                     nextPutLine:') \'.
+                     nextPutAll:(clsName storeString paddedTo:maxLen); 
+                     tab; nextPutAll:fileName storeString.
+            cond == #always ifFalse:[
+                s tab; nextPutAll:cond storeString.
+            ].
+            s nextPutLine:') \'.
         ].
         s nextPutLine:')'.
     ]
@@ -1509,6 +1524,6 @@
 !Project class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Project.st,v 1.72 1999-03-29 22:16:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Project.st,v 1.73 1999-03-30 17:44:37 cg Exp $'
 ! !
 Project initialize!