class: ProjectDefinition
authorStefan Vogel <sv@exept.de>
Wed, 13 Mar 2013 16:42:16 +0100
changeset 14866 dc4ca8598270
parent 14865 8d6cc362aff7
child 14867 e9141cf777a9
class: ProjectDefinition changed: #allPreRequisitesSorted #preRequisitesFor: fix senders of #preRequisitesSorted:
ProjectDefinition.st
--- a/ProjectDefinition.st	Wed Mar 13 15:04:42 2013 +0100
+++ b/ProjectDefinition.st	Wed Mar 13 16:42:16 2013 +0100
@@ -831,7 +831,6 @@
     "Created: / 14-09-2006 / 14:59:53 / cg"
 ! !
 
-
 !ProjectDefinition class methodsFor:'accessing - packaging'!
 
 classNames:aCollectionOfClassNames
@@ -1569,59 +1568,6 @@
     "Modified: / 09-10-2006 / 14:27:20 / cg"
 !
 
-preRequisites_code
-    "generate the code of the #preRequisites method"
-
-    |preRequisites searchedPreRequisites importantReason|
-
-    searchedPreRequisites := self searchForPreRequisites.
-    preRequisites := Set new
-        addAll: searchedPreRequisites keys;
-        removeAllFoundIn:self excludedFromPreRequisites;
-        remove:self package ifAbsent:[];
-        yourself.
-
-    ^ String streamContents:[:s |
-        s nextPutLine:'preRequisites'.
-        s nextPutLine:'    "list all required packages.'.
-        s nextPutLine:'     This list can be maintained manually or (better) generated and'.
-        s nextPutLine:'     updated by scanning the superclass hierarchies and looking for'.
-        s nextPutLine:'     global variable accesses. (the browser has a menu function for that)'.
-        s nextPutLine:'     However, often too much is found, and you may want to explicitely'.
-        s nextPutLine:'     exclude individual packages in the #excludedFromPreRequisites method.'.
-        s nextPutLine:'     If you have explicit preqrequisites, define them in the #includedInPreRequisites method."'.
-        s nextPutLine:''.
-        s nextPutLine:'    ^ #('.
-        preRequisites asSortedCollection do:[:eachPackageID |
-            |reason|
-
-            s spaces:8.
-            eachPackageID asSymbol storeOn:s.
-            reason := searchedPreRequisites at:eachPackageID ifAbsent:nil.
-            reason notEmptyOrNil ifTrue:[
-                "superclasses are really important"
-                importantReason := reason detect:[:eachReasonString|
-                    eachReasonString includesString:' superclass '
-                ] ifNone:[reason anElement].
-                s nextPutAll:'    "'; nextPutAll:importantReason; nextPutAll:' "'.
-            ].
-            s cr.
-        ].
-        s nextPutLine:'    )'
-    ].
-
-    "
-     bosch_dapasx_application preRequisites_code
-     demo_demoApp1 preRequisites_code
-     stx_libbasic3 preRequisites_code
-     stx_libtool2 preRequisites_code
-    "
-
-    "Modified: / 08-08-2006 / 19:24:34 / fm"
-    "Created: / 17-08-2006 / 21:28:09 / cg"
-    "Modified: / 09-10-2006 / 14:27:20 / cg"
-!
-
 productInstallDirBaseName_code
     ^ String streamContents:[:s |
         s nextPutLine:'productInstallDirBaseName'.
@@ -1880,7 +1826,8 @@
         ifTrue:[
             "Still no project definition - maybe it does not exist?"
             Transcript showCR:'Warning: no definition class for package: ', packageId.
-            (ProjectDefinition searchForPreRequisites:packageId) keys
+            ((self searchForPreRequisites:packageId) 
+                fold:[:d1 :d2| d1 addAll:d2; yourself]) keys
         ]
         ifFalse:[ def effectivePreRequisites ]
 
@@ -1948,7 +1895,6 @@
     "Modified: / 17-08-2006 / 19:59:26 / cg"
 ! !
 
-
 !ProjectDefinition class methodsFor:'description - classes'!
 
 additionalClassNamesAndAttributes
@@ -6178,7 +6124,8 @@
         def := self definitionClassForPackage:eachPackageID.
         def isNil ifTrue:[
             Transcript showCR:'Warning: no definition class for package: ', eachPackageID.
-            effective := (self searchForPreRequisites: eachPackageID) keys.
+            ((self searchForPreRequisites: eachPackageID) 
+                fold:[:d1 :d2| d1 addAll:d2; yourself]) keys
         ] ifFalse:[
             "extensionPackages should alread be in the #mandatoryPreRequisites"
             effective := def effectivePreRequisites union:def extensionPackages.
@@ -6189,7 +6136,9 @@
         ].
     ].
 
-    (orderedTuples detect:[:el | el first = el second] ifNone:nil) notNil ifTrue:[self halt].
+    (orderedTuples includes:[:el | el first = el second]) ifTrue:[
+        self halt
+    ].
     sortedPackages := orderedTuples topologicalSort.
 
     "packages which only result from extension methods are used for computing the sort order,
@@ -7036,11 +6985,11 @@
 !ProjectDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.426 2013-03-13 13:22:34 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.427 2013-03-13 15:42:16 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.426 2013-03-13 13:22:34 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.427 2013-03-13 15:42:16 stefan Exp $'
 !
 
 version_SVN