added: #validateOrderOfClasses
authorClaus Gittinger <cg@exept.de>
Mon, 05 Mar 2012 13:00:02 +0100
changeset 14042 05b7b61d7e59
parent 14041 76b07843f85f
child 14043 045fd447ab4d
added: #validateOrderOfClasses comment/format in: #autoloaded_classNames #compiled_classNames changed: #validateDescription
ProjectDefinition.st
--- a/ProjectDefinition.st	Thu Mar 01 17:04:03 2012 +0100
+++ b/ProjectDefinition.st	Mon Mar 05 13:00:02 2012 +0100
@@ -6153,6 +6153,8 @@
 !
 
 autoloaded_classNames
+    "the opposite of compiled class names"
+
     ^ self classNamesForWhich:[:nm :attr | attr notEmptyOrNil and:[attr includes:#autoload]].
 
     "Modified: / 07-08-2006 / 21:25:25 / fm"
@@ -6204,11 +6206,14 @@
 !
 
 compiled_classNames
+    "the opposite of autoloaded class names"
+
     ^ self classNamesForWhich:[:nm :attr | attr isEmptyOrNil or:[(attr includes:#autoload) not]].
 
     "Created: / 07-08-2006 / 19:02:57 / fm"
     "Modified: / 07-08-2006 / 21:25:25 / fm"
     "Modified: / 21-08-2006 / 18:48:31 / cg"
+    "Modified (comment): / 05-03-2012 / 12:21:23 / cg"
 !
 
 compiled_classNamesForPlatform
@@ -6593,12 +6598,52 @@
             AbortSignal raiseRequest
         ]
     ].
+    self validateOrderOfClasses
 
     "
      squeak_vmMaker validateDescription
     "
 
-    "Modified: / 09-01-2012 / 11:02:59 / cg"
+    "Modified: / 05-03-2012 / 12:16:08 / cg"
+!
+
+validateOrderOfClasses
+    "check if the project's classes are listed in the correct dependency order in the classList.
+     This is required, because the generated makefile will compile files in that order,
+     and superclasses must be compiled before subclasses (for the header files)"
+
+    |classesInDescriptionInOrder classesInProject already|
+
+    classesInDescriptionInOrder := OrderedCollection new.
+    classesInDescriptionInOrder := 
+        self compiled_classNames 
+            collect:[:eachName |
+                |cls|
+
+                cls := Smalltalk at:eachName.
+                self assert:cls notNil message:'missing class: ',eachName.
+                cls
+            ].
+
+    classesInProject := classesInDescriptionInOrder asSet.
+
+    already := Set new.
+    classesInDescriptionInOrder do:[:eachClass |
+        eachClass allSuperclassesDo:[:superclass |
+            (classesInProject includes:superclass) ifTrue:[
+                "/ if in the set, it must have been already listed
+                self assert:(already includes:superclass) message:'superclass not compiled before'
+            ].
+        ].
+        already add:eachClass.
+    ].
+
+    "
+     stx_goodies_refactoryBrowser_lint validateOrderOfClasses
+     squeak_vmMaker validateOrderOfClasses
+    "
+
+    "Created: / 05-03-2012 / 12:18:45 / cg"
 ! !
 
 !ProjectDefinition class methodsFor:'testing'!
@@ -6670,11 +6715,11 @@
 !ProjectDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.381 2012-02-23 11:50:27 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.382 2012-03-05 12:00:02 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.381 2012-02-23 11:50:27 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.382 2012-03-05 12:00:02 cg Exp $'
 !
 
 version_SVN