*** empty log message ***
authorfm
Wed, 09 Aug 2006 22:42:33 +0200
changeset 9504 b89c84c60e86
parent 9503 fd9bf4b0b073
child 9505 468b2b966bbe
*** empty log message ***
LibraryDefinition.st
--- a/LibraryDefinition.st	Wed Aug 09 22:15:42 2006 +0200
+++ b/LibraryDefinition.st	Wed Aug 09 22:42:33 2006 +0200
@@ -318,7 +318,8 @@
 SEGMENTS
     INITCODE    PRELOAD DISCARDABLE
 EXPORTS
-    __%(LIBRARY_NAME)_Init     @1'
+    __%(LIBRARY_NAME)_Init     @1
+'
 
     "Created: / 08-08-2006 / 12:26:58 / fm"
     "Modified: / 08-08-2006 / 19:32:27 / fm"
@@ -639,11 +640,16 @@
 !ProjectDefinition class methodsFor:'mappings'!
 
 bc_dot_def_mappings
+    ^ (Dictionary new)
+        at:#'LIBRARY_NAME' put:[ self libraryName ];
+        at:#'DESCRIPTION'
+            put:[
+                    |d|
 
-^Dictionary new
-    at: #'LIBRARY_NAME' put: [self libraryName];
-    at: #'DESCRIPTION' put: [self description];  
-    yourself
+                    d := self description.
+                    (d isEmptyOrNil ifTrue:[ 'test' ] ifFalse:[ d ]) storeString.
+                ];
+        yourself
 
     "Created: / 09-08-2006 / 11:17:59 / fm"
 !
@@ -709,7 +715,7 @@
 
 ^Dictionary new
     at: #'LIBRARY_NAME' put: [self libraryName];
-    at: #'DESCRIPTION' put: [self description];
+    at: #'DESCRIPTION' put: [self description storeString];
     at: #'VERSION_NUMBER' put: [self versionNumber];
     yourself
 
@@ -808,16 +814,35 @@
 !
 
 generateObjects_make_dot_spec 
+    |pivateClassesOf classes|
 
-^self compiled_classNames 
-    inject: ''
-    into:[:objectLines :className | 
-        |newObjectLine mappings|
-        mappings := self objectLine_make_dot_spec_mappings: className.
-        newObjectLine := self replaceMappings: mappings  
-                            in: self objectLine_make_dot_spec.
-        objectLines concatenate: newObjectLine 
-                    and: String lf 
+    classes := self compiled_classes.
+    pivateClassesOf := IdentityDictionary new.
+    classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)].
+
+    classes topologicalSort:[:a :b |
+        "/ a must come before b iff:
+        "/    b is a subclass of a
+        "/    b has a private class which is a subclass of a
+
+        |mustComeBefore pivateClassesOfB|
+        mustComeBefore := b isSubclassOf:a.
+        pivateClassesOfB := pivateClassesOf at:b.
+        pivateClassesOfB do:[:eachClassInB |
+            mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a]
+        ].
+        mustComeBefore
+    ].
+
+    ^ String streamContents:[:s |
+        classes do:[:eachClass |
+            |mappings newObjectLine|
+
+            mappings := self objectLine_make_dot_spec_mappings: eachClass name.
+            newObjectLine := self replaceMappings: mappings in: self objectLine_make_dot_spec.
+            s nextPutAll:newObjectLine. 
+            s cr. 
+        ]
     ]
 "
     DapasXProject generateObjects_make_dot_spec
@@ -929,10 +954,15 @@
     "Modified: / 07-08-2006 / 21:25:25 / fm"
 !
 
+compiled_classes
+    ^ self compiled_classNames collect:[:eachName| (Smalltalk at:eachName asSymbol)]
+
+    "Created: / 09-08-2006 / 16:28:15 / fm"
+    "Modified: / 09-08-2006 / 18:02:28 / fm"
+!
+
 compiled_classesDo:aBlock
-    self compiled_classNames do:[:eachName|
-        aBlock value:(Smalltalk at:eachName asSymbol)
-    ].
+    self compiled_classes do:aBlock.
 
     "Created: / 09-08-2006 / 16:28:15 / fm"
     "Modified: / 09-08-2006 / 18:02:28 / fm"
@@ -1357,5 +1387,5 @@
 !ProjectDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/LibraryDefinition.st,v 1.6 2006-08-09 20:15:42 fm Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LibraryDefinition.st,v 1.7 2006-08-09 20:42:33 fm Exp $'
 ! !