checkin from browser
authorClaus Gittinger <cg@exept.de>
Sat, 17 Apr 1999 01:56:15 +0200
changeset 4099 f6984fc5cb6c
parent 4098 16838eeb90b9
child 4100 a605c54bf9a9
checkin from browser
Project.st
Smalltalk.st
--- a/Project.st	Fri Apr 16 21:53:38 1999 +0200
+++ b/Project.st	Sat Apr 17 01:56:15 1999 +0200
@@ -514,6 +514,18 @@
     "Modified: 27.1.1997 / 12:10:09 / cg"
 !
 
+prerequisiteClasses
+    "return the prerequisiteClasses of the project"
+
+    ^ (self propertyAt:#prerequisiteClasses) ? #()
+!
+
+prerequisiteClasses:aCollectionOfClassesPrClassNames
+    "set the prerequisiteClasses of the project"
+
+    ^ self propertyAt:#prerequisiteClasses put:aCollectionOfClassesPrClassNames
+!
+
 prerequisites
     "return the prerequisites of the project"
 
@@ -736,6 +748,9 @@
     repositoryModule := pack at:'repository.module' ifAbsent:repositoryModule.
     repositoryDirectory := pack at:'repository.directory' ifAbsent:repositoryDirectory.
 
+    prerequisites := pack at:'prerequisites' ifAbsent:#().
+    self prerequisiteClasses:(pack at:'prerequisiteClasses' ifAbsent:#()).
+
     s := pack at:'nameSpace' ifAbsent:nil.
     s notNil ifTrue:[
         defaultNameSpace := Namespace name:s.
@@ -787,6 +802,13 @@
 
     self wasLoadedFromFile:true.
 
+    "/ all remaining properties
+    pack keysAndValuesDo:[:key :val |
+        (key startsWith:'property.') ifTrue:[
+            self propertyAt:(key copyFrom:'property.' size+1) asSymbol put:val.
+        ]
+    ].
+
     "
      Project current saveAsProjectFile.
 
@@ -827,7 +849,7 @@
 
     s := aStream.
 
-    s nextPutLine:'; $Header: /cvs/stx/stx/libbasic/Project.st,v 1.77 1999-04-16 19:00:27 cg Exp $'; nextPutLine:';'.
+    s nextPutLine:'; $Header' , '$'; 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)'.
@@ -854,9 +876,9 @@
 
     s cr; nextPutLine:';'; nextPutLine:'; repository:'; nextPutLine:';'.
     s nextPutAll:'repository.module'. 
-    s tab. s nextPutLine:repositoryModule ? 'private'.
+    s tab. s nextPutLine:(repositoryModule ? 'private') storeString.
     s nextPutAll:'repository.directory'. 
-    s tab. s nextPutLine:repositoryDirectory ? self packageName.
+    s tab. s nextPutLine:(repositoryDirectory ? self packageName) storeString.
     s cr.
 
     first := true.
@@ -867,6 +889,7 @@
             targetconditions
             classes
             classInfo
+            prerequisiteClasses
         ) includes:key) ifFalse:[
             first ifTrue:[
                 first := false.
@@ -897,6 +920,22 @@
         ].
         s nextPutLine:')'.
     ].
+    s cr; nextPutLine:';'; nextPutLine:'; required classes:'; nextPutLine:';'.
+    s nextPutAll:'prerequisiteClasses'; tab.
+    coll := self prerequisiteClasses.
+    coll size = 0 ifTrue:[
+        s nextPutLine:'#()'. 
+    ] ifFalse:[    
+        s nextPutLine:'#( \'. 
+        coll do:[:aClassOrSymbol | |className|
+
+            (className := aClassOrSymbol) isSymbol ifFalse:[
+                className := aClassOrSymbol name
+            ].
+            s tab. s nextPutAll:(className storeString); nextPutLine:' \'.
+        ].
+        s nextPutLine:')'.
+    ].
 
     s cr; nextPutLine:';'; nextPutLine:'; classes:'; nextPutLine:';'.
     s nextPutLine:'; (for each class, one line of the form: ( #''className'' [fileName [condition]] )'.
@@ -1730,6 +1769,6 @@
 !Project class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Project.st,v 1.77 1999-04-16 19:00:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Project.st,v 1.78 1999-04-16 23:56:01 cg Exp $'
 ! !
 Project initialize!
--- a/Smalltalk.st	Fri Apr 16 21:53:38 1999 +0200
+++ b/Smalltalk.st	Sat Apr 17 01:56:15 1999 +0200
@@ -720,29 +720,30 @@
 
     |sym cSym names oldName actualName wrongName|
 
+    aClass isNil ifTrue:[^ self].
     oldName := aClass name.
     sym := oldName asSymbol.
     ((self at:sym) == aClass) ifFalse:[
-	"check other name ..."
-	(self includes:aClass) ifFalse:[
-	    'Smalltalk [warning]: no such class: ' errorPrint. oldName errorPrintCR.
-	    ^ self
-	].
-	"
-	 the class has changed its name - without telling me ...
-	 what should be done in this case ?
-	"
-	'Smalltalk [warning]: class ' errorPrint. oldName errorPrint.
-	' has changed its name' errorPrintCR.
-
-	"/
-	"/ might be an alias (i.e. removing a compatibility name)
-	"/
-	actualName := self keyAtValue:aClass.
-	('Smalltalk [info]: ' , oldName , ' is actually stored as ' , actualName , '.') infoPrintCR.
-	sym := actualName asSymbol.
-	oldName := actualName asString.
-	wrongName := true.
+        "check other name ..."
+        (self includes:aClass) ifFalse:[
+            'Smalltalk [warning]: no such class: ' errorPrint. oldName errorPrintCR.
+            ^ self
+        ].
+        "
+         the class has changed its name - without telling me ...
+         what should be done in this case ?
+        "
+        'Smalltalk [warning]: class ' errorPrint. oldName errorPrint.
+        ' has changed its name' errorPrintCR.
+
+        "/
+        "/ might be an alias (i.e. removing a compatibility name)
+        "/
+        actualName := self keyAtValue:aClass.
+        ('Smalltalk [info]: ' , oldName , ' is actually stored as ' , actualName , '.') infoPrintCR.
+        sym := actualName asSymbol.
+        oldName := actualName asString.
+        wrongName := true.
     ].
 
     self at:sym put:nil.    "nil it out for compiled accesses"
@@ -751,25 +752,25 @@
     "/ see comment in removeKey: on why we dont remove it here
     "/
     "/ self removeKey:sym.     "/ remove key - this actually fails, if there are
-			       "/ still compiled code references."
+                               "/ still compiled code references."
 
     "remove private classes"
 
     aClass privateClassesSorted do:[:somePrivateClass |
-	aClass privateClassesAt:(somePrivateClass nameWithoutPrefix) asSymbol put:nil.
+        aClass privateClassesAt:(somePrivateClass nameWithoutPrefix) asSymbol put:nil.
     ].
 
     "remove class variables"
 
     names := aClass classVariableString asCollectionOfWords.
     names do:[:name |
-	cSym := (sym , ':' , name) asSymbol.
-	self at:cSym asSymbol put:nil.
-
-	"/
-	"/ see comment in removeKey: on why we dont remove it here
-	"/
-	"/ self removeKey:cSym
+        cSym := (sym , ':' , name) asSymbol.
+        self at:cSym asSymbol put:nil.
+
+        "/
+        "/ see comment in removeKey: on why we dont remove it here
+        "/
+        "/ self removeKey:cSym
     ].
 
 
@@ -795,17 +796,17 @@
     aClass category:#'* removed *'.
 
     wrongName == true ifTrue:[
-	"/
-	"/ an alias (i.e. removing a compatibility name
-	"/
-	self flushCachedClasses.
-	"/ check if there are more refs to it ...
-	[self includes:aClass] whileTrue:[
-	    actualName := self keyAtValue:aClass.
-	    ('Smalltalk [info]: ' , aClass name , ' is also registered under the name ' , actualName
-			  , ' - remove that binding too.') infoPrintCR.
-	    self at:actualName put:nil.
-	].
+        "/
+        "/ an alias (i.e. removing a compatibility name
+        "/
+        self flushCachedClasses.
+        "/ check if there are more refs to it ...
+        [self includes:aClass] whileTrue:[
+            actualName := self keyAtValue:aClass.
+            ('Smalltalk [info]: ' , aClass name , ' is also registered under the name ' , actualName
+                          , ' - remove that binding too.') infoPrintCR.
+            self at:actualName put:nil.
+        ].
     ].
 
     "Modified: / 20.6.1998 / 13:26:10 / cg"
@@ -4214,5 +4215,5 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.311 1999-04-16 12:09:19 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.312 1999-04-16 23:56:15 cg Exp $'
 ! !