ProjectDefinition.st
branchjv
changeset 18028 e39da2aa21bc
parent 18027 3621469cc5e8
parent 14851 7be11ef3d914
child 18029 589d1088e0ee
--- a/ProjectDefinition.st	Tue Mar 05 18:10:13 2013 +0000
+++ b/ProjectDefinition.st	Wed Mar 13 00:42:41 2013 +0000
@@ -227,149 +227,6 @@
 
 !ProjectDefinition class methodsFor:'accessing'!
 
-allPreRequisites
-    "answer all (recursive) prerequisite project ids of myself - in random order."
-
-    ^ self allPreRequisitesWithParentDo:[:parent :prereq |
-        prereq = self package ifTrue:[ Transcript showCR:('oops: %1 depends on itself' bindWith:prereq) ].
-      ]
-
-    "
-     stx_libbasic allPreRequisites
-     stx_libbasic2 allPreRequisites
-     stx_libview2 allPreRequisites
-     ubs_application allPreRequisites
-     ubs_application allPreRequisitesSorted
-     exept_expecco_application allPreRequisites
-     exept_expeccoNET_application allPreRequisites
-     alspa_batch_application allPreRequisites
-    "
-
-    "Modified: / 13-04-2011 / 15:30:45 / sr"
-    "Modified (comment): / 06-09-2011 / 08:26:06 / cg"
-!
-
-allPreRequisitesSorted
-    "answer all the prerequisites of this projects sorted in
-     the order they are needed.
-     Use this to e.g. compile packages in the dependency order"
-
-    |allPreRequisites orderedTuples effective allPreRequisitesWithExtensions sortedPackages|
-
-    orderedTuples := OrderedCollection new.
-
-    allPreRequisites := self allPreRequisites.
-    allPreRequisitesWithExtensions := allPreRequisites union:self extensionPackages.
-
-    allPreRequisites do:[:eachPackageID |
-        |def|
-
-        self assert:(eachPackageID ~= self package).
-        orderedTuples add:(Array with:eachPackageID with:self package).
-
-        def := self definitionClassForPackage:eachPackageID.
-        def isNil ifTrue:[
-            Transcript showCR:'Warning: no definition class for package: ', eachPackageID.
-            effective := (self searchForPreRequisites: eachPackageID) keys.
-        ] ifFalse:[
-            effective := def effectivePreRequisites union:def extensionPackages.
-            effective notEmptyOrNil ifTrue:[
-                effective do:[:eachPrerequisitePackageID|
-                    self assert:(eachPrerequisitePackageID ~= eachPackageID).
-                    orderedTuples add:(Array with:eachPrerequisitePackageID with:eachPackageID).
-                ].
-            ].
-        ].
-    ].
-
-    (orderedTuples detect:[:el | el first = el second] ifNone:nil) notNil ifTrue:[self halt].
-    sortedPackages := orderedTuples topologicalSort.
-
-    "packages which only result from extension methods are used for computing the sort order,
-     but they are not added, if not present in the first place"
-    ^ sortedPackages select:[:eachProject| allPreRequisites includes:eachProject]
-
-    "
-     stx_libbasic allPreRequisitesSorted
-     stx_libbasic2 allPreRequisitesSorted
-     stx_libwidg2 allPreRequisitesSorted
-     exept_expecco_application allPreRequisitesSorted
-     alspa_batch_application allPreRequisitesSorted
-     ubs_application allPreRequisitesSorted
-    "
-
-    "Modified: / 13-04-2011 / 15:19:13 / sr"
-    "Modified: / 28-06-2011 / 14:04:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-allPreRequisitesWithParentDo:aBlock
-    "answer all (recursive) prerequisite project ids of myself - in random order.
-     If we exclude a project, but one of our prerequisite projects depends on it,
-     then what ????"
-
-    |setOfAllPreRequisites toAdd|
-
-    setOfAllPreRequisites := Set new.
-    toAdd := Set new.
-    toAdd addAll:self effectivePreRequisites.
-
-    "is a subproject really a prerequisite??
-     No, it works the other way: parent projects are prerequisites of sub projects,
-     so the following line has been deleted.
-     Unfortunately the meaning of 'subproject' has never been well defined. SV."
-"/    toAdd addAll:self effectiveSubProjects.
-
-    [toAdd notEmpty] whileTrue:[
-        |aPreRequisiteProjectID def|
-
-        aPreRequisiteProjectID := toAdd removeFirst.
-        (setOfAllPreRequisites includes:aPreRequisiteProjectID) ifFalse:[
-            setOfAllPreRequisites add:aPreRequisiteProjectID.
-
-            def := self definitionClassForPackage:aPreRequisiteProjectID.
-            def isNil ifTrue:[
-                Transcript showCR:'ProjectDefinition ', aPreRequisiteProjectID, ' is missing - cannot find its preRequisites.'.
-            ] ifFalse:[
-                def effectivePreRequisites
-                    select:[:eachSubPreRequisite | (setOfAllPreRequisites includes:eachSubPreRequisite) not]
-                    thenDo:[:eachSubPreRequisite |
-                                Verbose == true ifTrue:[
-                                    Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' requires ', eachSubPreRequisite).
-                                ].
-                                aBlock value:def value:eachSubPreRequisite.
-                                toAdd add:eachSubPreRequisite
-                           ].
-
-                "but subprojects of our prerequisites are also prerequisites"
-                def effectiveSubProjects
-                    select:[:eachSubSubRequisite | eachSubSubRequisite ~= self package and:[ (setOfAllPreRequisites includes:eachSubSubRequisite) not ]]
-                    thenDo:[:eachSubSubRequisite |
-                                Verbose == true ifTrue:[
-                                    Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' hasSub ', eachSubSubRequisite).
-                                ].
-                                aBlock value:def value:eachSubSubRequisite.
-                                toAdd add:eachSubSubRequisite
-                           ].
-            ].
-        ]
-    ].
-    ^ setOfAllPreRequisites.
-
-    "
-     stx_libbasic allPreRequisites
-     stx_libbasic2 allPreRequisites
-     stx_libview2 allPreRequisites
-     ubs_application allPreRequisites
-     ubs_application allPreRequisitesSorted
-     exept_expecco_application allPreRequisites
-     exept_expeccoNET_application allPreRequisites
-     alspa_batch_application allPreRequisites
-    "
-
-    "Created: / 13-04-2011 / 15:23:21 / sr"
-    "Modified: / 20-07-2012 / 18:29:31 / cg"
-!
-
 directory
     "for packageId compatibility"
 
@@ -854,7 +711,10 @@
 !
 
 requiredProjects
-    ^ self effectivePreRequisites , self subProjects
+    ^ Set new
+        addAll:self effectivePreRequisites;
+        addAll:self subProjects;
+        yorself.
 !
 
 topRelativePathTo:aBaseFilename inPackage:aPackageID architecture:arch
@@ -1478,20 +1338,6 @@
     "Modified: / 18-08-2006 / 16:16:24 / cg"
 !
 
-effectivePreRequisites
-    "get the preRequisites, that are not excluded"
-
-    |preRequisites|
-
-    preRequisites := self preRequisites asOrderedSet.    "prerequisite order matters"
-    preRequisites 
-        addAll:self includedInPreRequisites;
-        removeAllFoundIn:self excludedFromPreRequisites;
-        remove:self package ifAbsent:[].
-
-    ^ preRequisites
-!
-
 effectiveSubProjects
     "get the subProjects, that are not excluded"
 
@@ -1603,7 +1449,11 @@
         value: 'description - contents'.
 
     aTwoArgBlock
-        value: self preRequisites_code
+        value: self mandatoryPreRequisites_code
+        value: 'description'.
+
+    aTwoArgBlock
+        value: self referencedPreRequisites_code
         value: 'description'.
 
     ((self class includesSelector:#excludedFromPreRequisites) not or:[ignoreOldDefinition]) ifTrue:[
@@ -1679,6 +1529,51 @@
     "Created: / 18-08-2006 / 16:21:01 / cg"
 !
 
+mandatoryPreRequisites_code
+    "generate the code of the #mandatoryPreRequisites method"
+
+    |preRequisites|
+
+    preRequisites := self searchForPreRequisites first.
+    preRequisites removeAllKeys:self excludedFromPreRequisites ifAbsent:[].
+
+    ^ String streamContents:[:s |
+        s nextPutLine:'mandatoryPreRequisites'.
+        s nextPutLine:'    "list all required mandatory packages.'.
+        s nextPutLine:'     Packages are mandatory, if they contain superclasses of the package''s classes'.
+        s nextPutLine:'     or classes which are extended by this package.'.
+        s nextPutLine:'     This list can be maintained manually or (better) generated and'.
+        s nextPutLine:'     updated by scanning the superclass hierarchies'.
+        s nextPutLine:'     (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:''.
+        s nextPutLine:'    ^ #('.
+        preRequisites keys asSortedCollection do:[:eachPackageID |
+            |reason|
+
+            s spaces:8.
+            eachPackageID asSymbol storeOn:s.
+            reason := preRequisites at:eachPackageID ifAbsent:nil.
+            reason notEmptyOrNil ifTrue:[
+                s nextPutAll:'    "'; nextPutAll:reason anElement; nextPutAll:' "'.
+            ].
+            s cr.
+        ].
+        s nextPutLine:'    )'
+    ].
+
+    "
+     demo_demoApp1 mandatoryPreRequisites_code
+     stx_libbasic3 mandatoryPreRequisites_code
+     stx_libtool2 mandatoryPreRequisites_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"
+!
+
 preRequisites_code
     "generate the code of the #preRequisites method"
 
@@ -1776,6 +1671,52 @@
     "Created: / 18-08-2006 / 16:14:19 / cg"
 !
 
+referencedPreRequisites_code
+    "generate the code of the #referencedPreRequisites method"
+
+    |preRequisitesColl preRequisites|
+
+    preRequisitesColl := self searchForPreRequisites.
+    preRequisites := self searchForPreRequisites second.
+    preRequisites 
+        removeAllKeys:self excludedFromPreRequisites ifAbsent:[];
+        removeAllKeys:preRequisitesColl first keys ifAbsent:[].  "remove the mandatory prerequisites"
+
+    ^ String streamContents:[:s |
+        s nextPutLine:'referencedPreRequisites'.
+        s nextPutLine:'    "list all packages containing classes referenced by the packages''s members.'.
+        s nextPutLine:'     This list can be maintained manually or (better) generated and'.
+        s nextPutLine:'     updated by looking for global variable accesses'.
+        s nextPutLine:'     (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:''.
+        s nextPutLine:'    ^ #('.
+        preRequisites keys asSortedCollection do:[:eachPackageID |
+            |reason|
+
+            s spaces:8.
+            eachPackageID asSymbol storeOn:s.
+            reason := preRequisites at:eachPackageID ifAbsent:nil.
+            reason notEmptyOrNil ifTrue:[
+                s nextPutAll:'    "'; nextPutAll:reason anElement; nextPutAll:' "'.
+            ].
+            s cr.
+        ].
+        s nextPutLine:'    )'
+    ].
+
+    "
+     demo_demoApp1 referencedPreRequisites_code
+     stx_libbasic3 referencedPreRequisites_code
+     stx_libtool2 referencedPreRequisites_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"
+!
+
 svnRevisionNr_code: revisionNrOrNil
     ^ String streamContents:[:s |
         s nextPutLine:'svnRevisionNr'.
@@ -1906,50 +1847,63 @@
     ^ #()
 !
 
-preRequisites
-    "list packages which are required as a prerequisite. This method is generated automatically,
-     by searching along the inheritance chain of all of my classes.
-     However, when generating automatically, packages are only added - never removed, unless listed
-     in excludedFromPreRequisites."
+mandatoryPreRequisites
+    "list packages which are mandatory as a prerequisite.
+     This are packages containing superclasses of my classes and classes which
+     are extended by myself.
+     They are mandatory, beacuse we need these packages as a prerequisite for loading and compiling.
+     This method is generated automatically,
+     by searching along the inheritance chain of all of my classes."
 
     ^ #()
+!
+
+preRequisites
+    "list packages which are required as a prerequisite."
+
+    "use an OrderedSet here, so that mandatory prerequisites come first"
+
+    ^ OrderedSet new
+        addAll:self mandatoryPreRequisites;
+        addAll:self referencedPreRequisites;
+        addAll:self includedInPreRequisites;
+        removeAllFoundIn:self excludedFromPreRequisites;
+        yourself.
 
     "Modified: / 17-08-2006 / 19:54:21 / cg"
 !
 
-preRequisitesFor: packageId
-    | def |
+preRequisitesFor:packageId 
+    |def|
 
     def := self definitionClassForPackage:packageId.
     def isNil ifTrue:[
         "Maybe the package is not loaded? Try to load it..."
-        (Smalltalk loadPackage: packageId) ifTrue:
-            [def := self definitionClassForPackage:packageId]
+        (Smalltalk loadPackage:packageId) ifTrue:[
+            def := self definitionClassForPackage:packageId
+        ]
     ].
     ^ def isNil 
-        ifTrue:
-            ["Still no project definition - maybe does not exists?"
-            (ProjectDefinition searchForPreRequisites: packageId) keys]
-        ifFalse:
-            [def effectivePreRequisites]
+        ifTrue:[
+            "Still no project definition - maybe it does not exist?"
+            Transcript showCR:'Warning: no definition class for package: ', packageId.
+            (ProjectDefinition searchForPreRequisites:packageId) keys
+        ]
+        ifFalse:[ def effectivePreRequisites ]
 
     "Created: / 24-02-2011 / 22:47:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 18-11-2011 / 14:52:43 / cg"
     "Modified (format): / 19-11-2011 / 11:25:36 / cg"
 !
 
-preRequisitesForBuilding
-    "for now, there is only one list of prerequisites present;
-     will be changed in the (near?) future"
-
-    ^ self preRequisites
-!
-
-preRequisitesForLoading
-    "for now, there is only one list of prerequisites present;
-     will be changed in the (near?) future"
-
-    ^ self preRequisites
+referencedPreRequisites
+    "list packages which are a prerequisite, because the contain
+     classes which are referenced by my classes.
+     We do not need these packages as a prerequisite for loading or compiling.
+     This method is generated automatically,
+     by searching along the inheritance chain of all of my classes."
+
+    ^ #()
 !
 
 siblingsAreSubProjects
@@ -2426,7 +2380,6 @@
     "Created: / 18-08-2006 / 12:51:38 / cg"
 ! !
 
-
 !ProjectDefinition class methodsFor:'description - project information'!
 
 applicationAdditionalIconFileNames
@@ -3597,20 +3550,24 @@
 !
 
 package_dot_deps_dot_rake_mappings
-    | dependencies |
-
-    dependencies := String streamContents:
-        [:s|
-        self allPreRequisites do:
-            [:package|
-            (self preRequisitesFor: package) do:
-                [:prereq|
-                s nextPutAll: ('task "%1" => "%2"' bindWith: package with: prereq); cr].
-            s cr].
-        self effectivePreRequisites do:
-                [:prereq|
-                s nextPutAll: ('task "%1" => "%2"' bindWith: self package with: prereq); cr].
-        ].
+    |dependencies|
+
+    dependencies := String 
+            streamContents:[:s | 
+                self allPreRequisites do:[:package | 
+                    (self preRequisitesFor:package) do:[:prereq | 
+                        s
+                            nextPutAll:('task "%1" => "%2"' bindWith:package with:prereq);
+                            cr
+                    ].
+                    s cr
+                ].
+                self effectivePreRequisites do:[:prereq | 
+                    s
+                        nextPutAll:('task "%1" => "%2"' bindWith:self package with:prereq);
+                        cr
+                ].
+            ].
 
     ^ (Dictionary new)
         at:'DEPENDENCIES' put:dependencies;
@@ -4603,7 +4560,9 @@
 @FOR /F "tokens=*" %%%%i in (''hg root'') do SET HGROOT=%%%%i
 @IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
 
-@call %(TOP)\rules\find_mingw.bat
+@pushd %(TOP)\rules
+@call find_mingw.bat
+@popd
 make.exe -N -f bc.mak %%USEMINGW_ARG%% %%*
 
 %(SUBPROJECT_MINGWMAKE_CALLS)
@@ -4713,7 +4672,9 @@
 @REM -------
 
 @if not defined VSINSTALLDIR (
-    call %(TOP)\rules\vcsetup.bat
+    pushd %(TOP)\rules
+    call vcsetup.bat
+    popd
 )
 @SET DEFINES=
 @REM Kludge got Mercurial, cannot be implemented in Borland make
@@ -4791,6 +4752,10 @@
         ^ false
     ].
     thisContext isRecursive ifTrue:[self breakPoint:#cg. ^ false].    "/ avoid endless loops
+    (PackagesBeingLoaded notNil and:[PackagesBeingLoaded includes:self package]) ifTrue:[
+        "/ seems to be a recursive call
+        ^ false
+    ].
 
     newStuffHasBeenLoaded := false.
 
@@ -5365,7 +5330,7 @@
         ].
 
     "/ need them also...
-    self preRequisites do:[:eachPreRequisitePackage |
+    self effectivePreRequisites do:[:eachPreRequisitePackage |
         addPackage value:eachPreRequisitePackage
     ].
 
@@ -5968,7 +5933,7 @@
     |prereq|
 
     prereq := self effectivePreRequisites.
-    prereq notEmptyOrNil ifTrue:[
+    prereq notEmpty ifTrue:[
         Verbose ifTrue:[
             Transcript showCR:('  %1 loading prerequisites...' bindWith:self name).
         ].
@@ -6216,6 +6181,167 @@
     "Modified: / 30-05-2007 / 12:48:30 / cg"
 !
 
+allPreRequisites
+    "answer all (recursive) prerequisite project ids of myself - in random order."
+    
+    ^ self 
+        allPreRequisitesWithParentDo:[:parent :prereq | 
+            prereq = self package ifTrue:[
+                Transcript showCR:('oops: %1 depends on itself' bindWith:prereq)
+            ].
+        ]
+
+    "
+     stx_libbasic allPreRequisites
+     stx_libbasic2 allPreRequisites
+     stx_libview2 allPreRequisites
+     ubs_application allPreRequisites
+     ubs_application allPreRequisitesSorted
+     exept_expecco_application allPreRequisites
+     exept_expeccoNET_application allPreRequisites
+     alspa_batch_application allPreRequisites"
+    "Modified: / 13-04-2011 / 15:30:45 / sr"
+    "Modified (comment): / 06-09-2011 / 08:26:06 / cg"
+!
+
+allPreRequisitesSorted
+    "answer all the prerequisites of this projects sorted in
+     the order they are needed.
+     Use this to e.g. compile packages in the dependency order"
+
+    |allPreRequisites orderedTuples effective sortedPackages|
+
+    orderedTuples := OrderedCollection new.
+    allPreRequisites := self allPreRequisites.
+
+    allPreRequisites do:[:eachPackageID |
+        |def|
+
+        self assert:(eachPackageID ~= self package).
+        orderedTuples add:(Array with:eachPackageID with:self package).
+
+        def := self definitionClassForPackage:eachPackageID.
+        def isNil ifTrue:[
+            Transcript showCR:'Warning: no definition class for package: ', eachPackageID.
+            effective := (self searchForPreRequisites: eachPackageID) keys.
+        ] ifFalse:[
+            "extensionPackages should alread be in the #mandatoryPreRequisites"
+            effective := def effectivePreRequisites union:def extensionPackages.
+            effective do:[:eachPrerequisitePackageID|
+                self assert:(eachPrerequisitePackageID ~= eachPackageID).
+                orderedTuples add:(Array with:eachPrerequisitePackageID with:eachPackageID).
+            ].
+        ].
+    ].
+
+    (orderedTuples detect:[:el | el first = el second] ifNone:nil) notNil ifTrue:[self halt].
+    sortedPackages := orderedTuples topologicalSort.
+
+    "packages which only result from extension methods are used for computing the sort order,
+     but they are not added, if not present in the first place"
+    ^ sortedPackages select:[:eachProject| allPreRequisites includes:eachProject]
+
+    "
+     stx_libbasic allPreRequisitesSorted
+     stx_libbasic2 allPreRequisitesSorted
+     stx_libwidg2 allPreRequisitesSorted
+     exept_expecco_application allPreRequisitesSorted
+     alspa_batch_application allPreRequisitesSorted
+     ubs_application allPreRequisitesSorted
+    "
+
+    "Modified: / 13-04-2011 / 15:19:13 / sr"
+    "Modified: / 28-06-2011 / 14:04:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+allPreRequisitesWithParentDo:aBlock
+    "answer all (recursive) prerequisite project ids of myself - in random order.
+     If we exclude a project, but one of our prerequisite projects depends on it,
+     then what ????"
+
+    |setOfAllPreRequisites toAdd|
+
+    setOfAllPreRequisites := Set new.
+    toAdd := Set withAll:self effectivePreRequisites.
+
+    "is a subproject really a prerequisite??
+     No, it works the other way: parent projects are prerequisites of sub projects,
+     so the following line has been deleted.
+     Unfortunately the meaning of 'subproject' has never been well defined. SV."
+"/    toAdd addAll:self effectiveSubProjects.
+
+    [toAdd notEmpty] whileTrue:[
+        |aPreRequisiteProjectID def|
+
+        aPreRequisiteProjectID := toAdd removeFirst.
+        (setOfAllPreRequisites includes:aPreRequisiteProjectID) ifFalse:[
+            setOfAllPreRequisites add:aPreRequisiteProjectID.
+
+            def := self definitionClassForPackage:aPreRequisiteProjectID.
+            def isNil ifTrue:[
+                Transcript showCR:'ProjectDefinition ', aPreRequisiteProjectID, ' is missing - cannot find its preRequisites.'.
+            ] ifFalse:[
+                def effectivePreRequisites
+                    select:[:eachSubPreRequisite | (setOfAllPreRequisites includes:eachSubPreRequisite) not]
+                    thenDo:[:eachSubPreRequisite |
+                                Verbose == true ifTrue:[
+                                    Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' requires ', eachSubPreRequisite).
+                                ].
+                                aBlock value:def value:eachSubPreRequisite.
+                                toAdd add:eachSubPreRequisite
+                           ].
+
+                "but subprojects of our prerequisites are also prerequisites"
+                def effectiveSubProjects
+                    select:[:eachSubSubRequisite | eachSubSubRequisite ~= self package and:[ (setOfAllPreRequisites includes:eachSubSubRequisite) not ]]
+                    thenDo:[:eachSubSubRequisite |
+                                Verbose == true ifTrue:[
+                                    Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' hasSub ', eachSubSubRequisite).
+                                ].
+                                aBlock value:def value:eachSubSubRequisite.
+                                toAdd add:eachSubSubRequisite
+                           ].
+            ].
+        ]
+    ].
+    ^ setOfAllPreRequisites.
+
+    "
+     stx_libbasic allPreRequisites
+     stx_libbasic2 allPreRequisites
+     stx_libview2 allPreRequisites
+     ubs_application allPreRequisites
+     ubs_application allPreRequisitesSorted
+     exept_expecco_application allPreRequisites
+     exept_expeccoNET_application allPreRequisites
+     alspa_batch_application allPreRequisites
+    "
+
+    "Created: / 13-04-2011 / 15:23:21 / sr"
+    "Modified: / 20-07-2012 / 18:29:31 / cg"
+!
+
+effectivePreRequisites
+    "get the preRequisites, that are not excluded.
+     This method appears to be obsolete, because its functionality
+     is now included in #preRequisites.
+     But is hat to be kept for backward compatibilty with old
+     existant subclasses."
+
+    self mandatoryPreRequisites notEmpty ifTrue:[
+        "this is a new subclass - avoid overhead"
+        ^ self preRequisites.
+    ].
+
+    "I am an old sublclass, where #preRequisites returns a plain array"
+    ^ Set new
+        addAll:self preRequisites;
+        addAll:self includedInPreRequisites;
+        removeAllFoundIn:self excludedFromPreRequisites;
+        remove:self package ifAbsent:[];
+        yourself.
+!
+
 searchForPreRequisites
     "answer a Dictionary where the keys are the prerequisite package for this package
      and the values are a Set of reasons, why each package is required"
@@ -6256,9 +6382,10 @@
     "answer a Dictionary where the keys are the prerequisite package for this package
      and the values are a Set of reasons, why each package is required"
 
-    |requiredClasses requiredPackageReasons usedClassesWithReasons ignoredPackages|
-
-    usedClassesWithReasons := Dictionary new.
+    |requiredClasses mandatoryClassesForLoadingWithReasons referencedClassesWithReasons ignoredPackages packageExtractionBlock|
+
+    mandatoryClassesForLoadingWithReasons := Dictionary new.
+    referencedClassesWithReasons := Dictionary new.
 
     "my classes are required"
     requiredClasses := (self searchForClassesWithProject: packageId) asSet.
@@ -6266,55 +6393,65 @@
     withSubProjectsBoolean ifTrue:[
         "my subproject's classes are required"
         self subProjects do:[:eachProjectName |
-            requiredClasses addAll: (self searchForClassesWithProject:eachProjectName asSymbol)
+            requiredClasses addAll:(self searchForClassesWithProject:eachProjectName asSymbol)
         ].
     ].
 
-    "all superclasses of my classes and my subProject's classes are required"
+    "all superclasses of my classes and my subProject's classes are mandatory"
     requiredClasses do:[:cls |
         cls allSuperclassesDo:[:eachSuperclass |
-            (usedClassesWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new])
+            (mandatoryClassesForLoadingWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new])
                 add: (eachSuperclass name, ' - superclass of ', cls name).
         ]
     ].
+    "all classes for which I define extensions are mandatory"
+    self allExtensionClasses do:[:eachExtendedClass |
+        (mandatoryClassesForLoadingWithReasons at:eachExtendedClass ifAbsentPut:[OrderedSet new])
+            add: (eachExtendedClass name, ' - extended').
+        eachExtendedClass allSuperclassesDo:[:eachSuperclass |
+            (mandatoryClassesForLoadingWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new])
+                add: (eachSuperclass name, ' - superclass of extended ', eachExtendedClass name).
+        ]
+    ].
 
     "all classes referenced by my classes or my subproject's classes
      are required. But:
          only search for locals refered to by my methods (assuming that superclasses'
          prerequisites are specified in their package)."
 
-    self addReferencesToClassesFromGlobalsIn:requiredClasses to:usedClassesWithReasons.
-    self addReferencesToClassesFromGlobalsInMethods:(self searchForExtensionsWithProject:self package) to:usedClassesWithReasons.
-
-    "all classes for which I define extensions are required"
-    self allExtensionClasses do:[:eachExtendedClass |
-        (usedClassesWithReasons at:eachExtendedClass ifAbsentPut:[OrderedSet new])
-            add: (eachExtendedClass name, ' - extended').
-        eachExtendedClass allSuperclassesDo:[:eachSuperclass |
-            (usedClassesWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new])
-                add: (eachSuperclass name, ' - superclass of extended ', eachExtendedClass name).
-        ]
-    ].
+    self addReferencesToClassesFromGlobalsIn:requiredClasses to:referencedClassesWithReasons.
+    self addReferencesToClassesFromGlobalsInMethods:(self searchForExtensionsWithProject:self package) to:referencedClassesWithReasons.
+
 
     "don't put classes from subProjects into the required list"
     ignoredPackages := (self siblingsAreSubProjects
                                 ifTrue:[ self searchForSiblingProjects ]
                                 ifFalse:[ self searchForSubProjects ]) asSet.
 
-    ignoredPackages add:self package.
-    ignoredPackages add:PackageId noProjectID.
+    ignoredPackages 
+        add:packageId;
+        add:PackageId noProjectID.
 
     "now map classes to packages and collect the reasons"
-    requiredPackageReasons := Dictionary new.
-    usedClassesWithReasons keysAndValuesDo:[:usedClass :reasonsPerClass | |usedClassPackage|
-        usedClassPackage := usedClass package.
-        (ignoredPackages includes:usedClassPackage) ifFalse:[
-            (requiredPackageReasons at:usedClassPackage ifAbsentPut:[OrderedSet new])
-                            addAll:reasonsPerClass.
+    packageExtractionBlock := [:classesWithReasons|
+            |requiredPackageReasons|
+            requiredPackageReasons := Dictionary new.
+            classesWithReasons keysAndValuesDo:[:usedClass :reasonsPerClass| 
+                |usedClassPackage|
+
+                usedClassPackage := usedClass package.
+                (ignoredPackages includes:usedClassPackage) ifFalse:[
+                    (requiredPackageReasons at:usedClassPackage ifAbsentPut:[OrderedSet new])
+                                    addAll:reasonsPerClass.
+                ].
+            ].
+            requiredPackageReasons
         ].
-    ].
-
-    ^ requiredPackageReasons
+
+
+    ^ Array 
+        with:(packageExtractionBlock value:mandatoryClassesForLoadingWithReasons)
+        with:(packageExtractionBlock value:referencedClassesWithReasons)
 
     "
      self searchForPreRequisites
@@ -6759,9 +6896,14 @@
 
         cls := Smalltalk at:nm asSymbol.
         cls isNil ifTrue:[
-            self error:'oops: missing class: ',nm.
-        ].
-        classesInDescription add:cls.
+            (self autoloaded_classNames includes:nm) ifTrue:[
+                Transcript showCR:'missing autoloaded class: ',nm.
+            ] ifFalse:[
+                self error:('missing class: ',nm) mayProceed:true.
+            ]
+        ] ifFalse:[
+            classesInDescription add:cls.
+        ]
     ].
 
     missingPools := Set new.
@@ -6938,11 +7080,11 @@
 !ProjectDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.420 2013-03-01 21:35:18 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.424 2013-03-11 12:47:59 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.420 2013-03-01 21:35:18 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.424 2013-03-11 12:47:59 cg Exp $'
 !
 
 version_SVN