ProjectDefinition.st
branchjv
changeset 17734 406b1590afe8
parent 17733 a5b3fd5ca84a
child 17735 6a5bc05f696a
--- a/ProjectDefinition.st	Mon Oct 26 21:51:17 2009 +0000
+++ b/ProjectDefinition.st	Thu Nov 05 14:41:30 2009 +0000
@@ -84,6 +84,103 @@
 
 !ProjectDefinition class methodsFor:'instance creation'!
 
+definitionClassForMonticelloPackage:aMonicelloPackagename
+    ^ self definitionClassForMonticelloPackage:aMonicelloPackagename createIfAbsent:false
+
+    "
+     self definitionClassForMonticelloPackage:'foobar'
+    "
+!
+
+definitionClassForMonticelloPackage:aMonicelloPackagename createIfAbsent:createIfAbsent
+    ^ self allSubclasses 
+        detect:[:eachProjectDefinition |
+            eachProjectDefinition monticelloPackageName = aMonicelloPackagename ]
+        ifNone:[
+            |dfn squeakPackageInfo|
+
+            createIfAbsent ifTrue:[
+                dfn := ApplicationDefinition 
+                    definitionClassForPackage:'mc:',aMonicelloPackagename createIfAbsent:true projectType:GUIApplicationType.
+
+                "/ if the squeak-stuff is loaded, use it.
+                squeakPackageInfo := PackageInfo allSubclasses 
+                                            detect:[:pi | pi new packageName = aMonicelloPackagename] ifNone:nil.
+
+                squeakPackageInfo notNil ifTrue:[
+                    dfn classNames:(squeakPackageInfo new classes collect:[:each | each name]).
+                ].
+            ] ifFalse:[
+                nil
+            ]
+        ]
+
+    "
+     self definitionClassForMonticelloPackage:'foobar'
+     self definitionClassForMonticelloPackage:'foobar' createIfAbsent:true
+    "
+!
+
+definitionClassForPackage:aPackageID
+    ^ self definitionClassForPackage:aPackageID createIfAbsent:false
+
+    "Modified: / 17-08-2006 / 14:33:35 / cg"
+!
+
+definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent
+    ^ self definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent projectType:nil
+
+    "Modified: / 23-08-2006 / 14:29:15 / cg"
+!
+
+definitionClassForPackage: aPackageID createIfAbsent: doCreateIfAbsent projectType:typeOrNil
+    |packageDefinitionClassName class|
+
+    packageDefinitionClassName := ProjectDefinition initialClassNameForDefinitionOf:aPackageID.
+    class := Smalltalk classNamed:packageDefinitionClassName.
+    class isNil ifTrue:[
+        doCreateIfAbsent ifTrue:[
+            class := self newForPackage:aPackageID.
+            "setup before prerequisites are defined"
+            class setupForType:typeOrNil.
+            "/ look what is there and include it; is this ok ?
+            class compileDescriptionMethods 
+        ].
+    ] ifFalse:[
+        typeOrNil notNil ifTrue:[
+            class projectType == typeOrNil ifFalse: [
+                class setupForType:typeOrNil.
+            ].
+        ].
+    ].
+    ^ class
+
+    "Created: / 23-08-2006 / 14:29:21 / cg"
+    "Modified: / 23-08-2006 / 15:35:26 / cg"
+!
+
+definitionClassForPackage:newProjectID projectType:typeOrNil createIfAbsent:createIfAbsent
+    ^ (self definitionClassForType:typeOrNil)
+            definitionClassForPackage:newProjectID 
+            createIfAbsent:createIfAbsent
+            projectType:typeOrNil
+
+    "Created: / 23-08-2006 / 14:28:53 / cg"
+!
+
+definitionClassForType: type
+    "answer the class that describes a give project type"
+
+    (type = LibraryType) ifTrue:[ ^ LibraryDefinition ].
+    (type = GUIApplicationType) ifTrue:[ ^ ApplicationDefinition ].
+    (type = NonGUIApplicationType) ifTrue:[ ^ ApplicationDefinition ].
+    (type = 'Application') ifTrue:[ ^ ApplicationDefinition ].     "/ temporary - for backward compat.
+    self error:'unknown project type'.
+
+    "Created: / 17-08-2006 / 14:46:28 / cg"
+    "Modified: / 23-08-2006 / 13:49:27 / cg"
+!
+
 newForPackage:packageID
     ^ self 
         newNamed:(self initialClassNameForDefinitionOf:packageID) 
@@ -116,32 +213,6 @@
 
 !ProjectDefinition class methodsFor:'accessing'!
 
-allDependentProjects
-
-    | allDependentProjects pendingProjects |
-    allDependentProjects := Set new.
-    pendingProjects := OrderedCollection withAll: self dependentProjects.
-    [ pendingProjects isEmpty ] whileFalse: [
-        | currentProject |
-        currentProject := pendingProjects removeFirst.
-        (allDependentProjects includes: currentProject) ifFalse:
-            [|prjDef|
-            allDependentProjects add: currentProject.
-            prjDef := Smalltalk at:(ProjectDefinition initialClassNameForDefinitionOf:self package) asSymbol.
-            pendingProjects addAll:
-                (prjDef dependentProjects)]
-
-        
-    ].
-    ^allDependentProjects
-    "
-        stx_goodies_libtool3 allDependentProjects     
-        stx_goodies_xmlsuite_core allDependentProjects
-    "
-
-    "Created: / 06-06-2008 / 12:50:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
-!
-
 allPreRequisites
     "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, "
@@ -238,20 +309,9 @@
     "
 !
 
-dependentProjects
-
-    ^(ProjectDefinition allSubclasses 
-        select:[:prjDef|prjDef preRequisites includes: self package])
-        collect:[:prjDef|prjDef package]
-
-    "
-        stx_goodies_libtool3 dependentProjects     
-    "
-
-    "Created: / 06-06-2008 / 12:39:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
-!
-
 initialClassNameForDefinitionOf:aPackageId
+    "given a package-ID, return an appropriate class name for this package"
+
     |s|
 
     s := aPackageId asString copy replaceAny:':/' with:$_.
@@ -381,6 +441,12 @@
     "Modified: / 17-08-2006 / 14:13:51 / cg"
 !
 
+monticelloPackageName
+    "hook for packages which have been loaded from monticello"
+
+    ^ nil
+!
+
 msdosPathToPackage:toPackageID from:fromPackageID
     "Returns the path to the package defined by aPackageID relative to my path"
     
@@ -441,7 +507,7 @@
 
 packageDirectory
 
-    ^Smalltalk packageDirectoryForPackageId: self package
+    ^ Smalltalk packageDirectoryForPackageId: self package
 
     "Created: / 15-06-2009 / 12:01:18 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
@@ -768,6 +834,129 @@
     "Created: / 14-09-2006 / 14:59:53 / cg"
 ! !
 
+!ProjectDefinition class methodsFor:'accessing - packaging'!
+
+classNames:aCollectionOfClassNames
+    "set the set of classes"
+
+    self classNamesAndAttributes:aCollectionOfClassNames usingCompiler:nil
+!
+
+classNamesAndAttributes:newSpec usingCompiler:compilerOrNil
+    "set the set of classes. and attributes 
+     Because this requires compilation of my classList-method, a compiler can be passed in, 
+     which has to do the job.
+     (this is used by the systembrowser to pass in a CodeGeneratorTool with undo support)"
+
+    |oldSpec newCode|
+
+    oldSpec := self classNamesAndAttributes.
+    newSpec = oldSpec ifTrue: [^ self].
+
+    newCode := self classNamesAndAttributes_codeFor:newSpec.
+
+    (compilerOrNil ? self compilerClass)
+        compile:newCode
+        forClass:self theMetaclass
+        inCategory:'description - contents'.
+!
+
+excludeClasses:toExclude usingCompiler:compilerOrNil
+    "exclude (remove from classList) a number of classes. 
+     Because this requires compilation of my classList-method, a compiler can be passed in, 
+     which has to do the job.
+     (this is used by the systembrowser to pass in a CodeGeneratorTool with undo support)"
+
+    |newSpec|
+
+    newSpec := self classNamesAndAttributes copy.
+
+    toExclude do:[:eachClassToExclude |
+        |className|
+        className := eachClassToExclude theNonMetaclass name.
+        (self allClassNames includes:className) ifTrue:[
+            |idx|
+
+            idx := newSpec findFirst:[:entry | entry = className or:[entry first = className]].
+            idx ~~ 0 ifTrue:[
+                newSpec := newSpec copyWithoutIndex:idx.
+            ].
+        ].
+    ].
+    self classNamesAndAttributes:newSpec usingCompiler:compilerOrNil
+
+    "Created: / 30-08-2007 / 18:28:28 / cg"
+!
+
+includeClasses:toInclude usingCompiler:compilerOrNil
+    "include (add to classList) a number of classes. 
+     Because this requires compilation of my classList-method, a compiler can be passed in, 
+     which has to do the job.
+     (this is used by the systembrowser to pass in a CodeGeneratorTool with undo support)"
+
+    |oldSpec newSpec|
+
+    oldSpec := self classNamesAndAttributes.
+    newSpec := oldSpec copy.
+
+    toInclude do:[:eachClassToInclude |
+        |className|
+
+        className := eachClassToInclude theNonMetaclass name.
+        (self compiled_classNames includes:className) ifFalse:[
+            | idx entry|
+
+            idx := oldSpec findFirst:[:entry | entry = className or:[entry first = className]].
+            idx == 0 ifTrue:[
+                newSpec := newSpec copyWith:(Array with:className)
+            ] ifFalse:[
+                entry := newSpec at:idx.
+                entry isArray ifTrue:[
+                    entry := entry copyWithout:#autoload
+                ].
+                newSpec at:idx put:entry
+            ].
+        ].
+    ].
+
+    self classNamesAndAttributes:newSpec usingCompiler:compilerOrNil
+!
+
+makeClassesAutoloaded:toMakeAutoloaded usingCompiler:compilerOrNil
+    "include as autoloaded (add to classList) a number of classes. 
+     Because this requires compilation of my classList-method, a compiler can be passed in, 
+     which has to do the job.
+     (this is used by the systembrowser to pass in a CodeGeneratorTool with undo support)"
+
+    |newSpec|
+
+    newSpec := self classNamesAndAttributes copy.
+
+    toMakeAutoloaded do:[:eachClassToMakeAutoloaded |
+        |className|
+
+        className := eachClassToMakeAutoloaded theNonMetaclass name.
+        (self autoloaded_classNames includes:className) ifFalse:[
+            |idx entry|
+
+            idx := newSpec findFirst:[:entry | entry = className or:[entry first = className]].
+            idx == 0 ifTrue:[
+                newSpec := newSpec copyWith:(Array with:className with:#autoload)
+            ] ifFalse:[
+                entry := newSpec at:idx.
+                entry isArray ifTrue:[
+                    entry := (entry copyWithout:#autoload) copyWith:#autoload.
+                ] ifFalse:[
+                    entry := Array with:entry with:#autoload
+                ].
+                newSpec at:idx put:entry.
+            ].
+        ].
+    ].
+
+    self classNamesAndAttributes:newSpec usingCompiler:compilerOrNil
+! !
+
 !ProjectDefinition class methodsFor:'accessing - svn'!
 
 svnRevision
@@ -855,6 +1044,8 @@
 !
 
 installAutoloadedClasses
+    "install all of my autoloaded classes (if any)"
+
     (self classNamesForWhich:[:nm :attr | (attr includes:#autoload)]) 
         do:[:className |
             "/ 'install as autoloaded: ' errorPrint. className errorPrintCR.
@@ -994,14 +1185,13 @@
                                 attributes := eachClass isLoaded ifTrue:[ #() ] ifFalse:[ #(autoload) ].
                             ].
                         ].
-
                         "JV @ 2009-10-26
-                         Give a project definition to specify additional attributes
-                         for given class."
-                        (self additionalClassAttributesFor: eachClass) do:
-                            [:attr|
-                            (attributes includes: attr) 
-                                ifFalse:[attributes := attributes copyWith: attr]].
+                         Give a project definition to specify additional attributes for given class."
+                        (self additionalClassAttributesFor: eachClass) do:[:attr|
+                            (attributes includes: attr) ifFalse:[
+                                attributes := attributes copyWith: attr
+                            ]
+                        ].
                         newEntry := Array with:className.
                         attributes notEmptyOrNil ifTrue:[
                             newEntry := newEntry , attributes.
@@ -1196,27 +1386,27 @@
         forEachContentsMethodsCodeToCompileDo:aTwoArgBlock 
         ignoreOldDefinition:ignoreOldDefinition.
 
-    (self class implements:#description) ifFalse:[
+    (self class includesSelector:#description) ifFalse:[
         aTwoArgBlock 
             value: self description_code
             value: 'description - project information'.
     ].
-    (self class implements:#productName) ifFalse:[
+    (self class includesSelector:#productName) ifFalse:[
         aTwoArgBlock 
             value: self productName_code
             value: 'description - project information'.
     ].
-    (self class implements:#companyName) ifFalse:[
+    (self class includesSelector:#companyName) ifFalse:[
         aTwoArgBlock 
             value: self companyName_code
             value: 'description - project information'.
     ].
-    (self class implements:#legalCopyright) ifFalse:[
+    (self class includesSelector:#legalCopyright) ifFalse:[
         aTwoArgBlock 
             value: self legalCopyright_code
             value: 'description - project information'.
     ].
-    (self class implements:#applicationIconFileName) ifFalse:[
+    (self class includesSelector:#applicationIconFileName) ifFalse:[
         aTwoArgBlock 
             value: self applicationIconFileName_code
             value: 'description - project information'.
@@ -1388,9 +1578,29 @@
     ^ NonGUIApplicationType
 !
 
+projectTypeSelectors
+    "a list of possible project type selectors"
+
+    ^ #( libraryType guiApplicationType nonGuiApplicationType )
+
+    "
+     self libraryType
+     self guiApplicationType
+     self nonGuiApplicationType
+    "
+
+    "Created: / 23-08-2006 / 14:27:32 / cg"
+!
+
 projectTypes
+    "a list of possible project types"
+
     ^ self libraryTypes , self applicationTypes
 
+    "
+     self projectTypes
+    "
+
     "Created: / 23-08-2006 / 14:27:32 / cg"
 ! !
 
@@ -1415,20 +1625,6 @@
     "Modified: / 17-08-2006 / 19:49:40 / cg"
 !
 
-postLoadAction
-    "invoked after loading a project"
-
-    "/ intentionally left blank, to be redefined by subclasses (i.e. real projects)
-
-    "Modified: / 17-08-2006 / 19:59:17 / cg"
-!
-
-preLoadAction
-    "invoked before loading a project"
-
-    "/ intentionally left blank, to be redefined by subclasses (i.e. real projects)
-!
-
 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.
@@ -1454,14 +1650,6 @@
     ^ self preRequisites
 !
 
-preUnloadAction
-    "invoked before unloading a project"
-
-    "/ intentionally left blank, to be redefined by subclasses (i.e. real projects)
-
-    "Modified: / 17-08-2006 / 19:59:26 / cg"
-!
-
 siblingsAreSubProjects
     ^ false
 !
@@ -1484,68 +1672,40 @@
     "Modified: / 17-08-2006 / 19:57:46 / cg"
 ! !
 
+!ProjectDefinition class methodsFor:'description - actions'!
+
+postLoadAction
+    "invoked after loading a project"
+
+    "/ intentionally left blank, to be redefined by subclasses (i.e. real projects)
+
+    "Modified: / 17-08-2006 / 19:59:17 / cg"
+!
+
+preLoadAction
+    "invoked before loading a project"
+
+    "/ intentionally left blank, to be redefined by subclasses (i.e. real projects)
+!
+
+preUnloadAction
+    "invoked before unloading a project"
+
+    "/ intentionally left blank, to be redefined by subclasses (i.e. real projects)
+
+    "Modified: / 17-08-2006 / 19:59:26 / cg"
+! !
+
 !ProjectDefinition class methodsFor:'description - classes'!
 
-additionalClassAttributesFor: aClass
-    "Answers additional set of class attributes for given class
-     Individual project definitions may override this method, but
-     overriding method should always merge its attributes with result
-     of 'super additionalClassAttributesFor: aClass'.
-
-     Here, we add #autoload attributes to all test cases and
-     test resources, as they are not neccessary for the package
-     and should not be compiled (because of unwanted dependency
-     on stx:goodies/sunit package)
-    "
-
-    (aClass inheritsFrom: TestCase) ifTrue:[^#(autoload)].
-    (aClass inheritsFrom: TestResource) ifTrue:[^#(autoload)].
-
-    ^#()"No additional attributes"
-
-    "
-        stx_libbasic additionalClassAttributesFor: Object 
-        stx_libtool additionalClassAttributesFor: Tools::NavigationHistoryTests
-        stx_goodies_sunit additionalClassAttributesFor: TestCase 
-
-
-        stx_libtool classNamesAndAttributes_code_ignoreOldEntries:true ignoreOldDefinition: true
-
-    "
-
-    "Created: / 26-10-2009 / 12:54:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 additionalClassNamesAndAttributes
     ^ #()
 
     "Created: / 21-08-2006 / 19:53:04 / cg"
 !
 
-allClassNames          
-    ^ self classNamesForWhich:[:nm :attr | true ].
-!
-
-autoloaded_classNames          
-    ^ self classNamesForWhich:[:nm :attr | attr notEmptyOrNil and:[attr includes:#autoload]].
-
-    "Modified: / 07-08-2006 / 21:25:25 / fm"
-    "Created: / 30-08-2007 / 18:48:09 / cg"
-!
-
-classNames          
-    "answer an array containing all the class names of the project's classes"
-
-    ^ self classNamesAndAttributesAsSpecArray collect:[:entry | entry first].
-
-    "
-     stx_libhtml classNames
-     stx_libhtml classNamesAndAttributesAsSpecArray
-    "
-!
-
 classNamesAndAttributes
-    "a correponding method with real names is generated in my subclasses"
+    "a correponding method with real names must be present in my concrete subclasses"
 
     "/ should this be a subclassResponsibility here ?
     ^ #()
@@ -1555,119 +1715,11 @@
     "Modified: / 17-08-2006 / 20:47:20 / cg"
 !
 
-classNamesAndAttributesAsSpecArray
-    "given a classNamesAndAttributes array, make this a spec array (array of arrays).  
-     This decompresses class-name entries into a one-element array for easier processing"
-
-    ^ self classNamesAndAttributes
-        collect:[:entry |
-            entry isArray ifTrue:[
-                entry first isSymbol ifTrue:[
-                    entry
-                ] ifFalse:[
-                    (Array with:entry first asSymbol) , (entry copyFrom:2)
-                ].
-            ] ifFalse:[
-                Array with:entry asSymbol.
-            ]].
-
-    "Created: / 19-02-2007 / 16:11:53 / cg"
-!
-
-classNamesAndAttributesFromSpecArray:aSpecArray
-    "given a spec array (array of arrays), make this a classNamesAndAttributes array
-     as stored literally in the method.
-     This compresses single element array-elements into plain names
-     (to save code in the compiled binaries)"
-
-    ^ aSpecArray
-        collect:[:entry |
-            (entry isArray and:[entry size == 1]) ifTrue:[
-                entry first
-            ] ifFalse:[
-                entry
-            ]].
-
-    "Created: / 19-02-2007 / 16:12:32 / cg"
-!
-
-classNamesForWhich:aBlock          
-    "a correponding method with real names is generated in my subclasses"
-
-    |coll|
-
-    coll := OrderedCollection new.
-    self classNamesAndAttributesDo:[:nm :attributes |
-        (aBlock value:nm value:attributes) ifTrue:[
-            coll add:nm.
-        ].
-    ].
-    ^ coll
-
-    "Created: / 07-08-2006 / 19:02:57 / fm"
-    "Modified: / 07-08-2006 / 21:25:25 / fm"
-    "Modified: / 17-08-2006 / 20:47:20 / cg"
-!
-
-compiled_classNames          
-    ^ 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"
-!
-
-compiled_classNamesForPlatform
-    "answer the classes to be compiled only for the current platformName"
-
-    ^ self compiled_classNamesForPlatform:OperatingSystem platformName
-!
-
-compiled_classNamesForPlatform:platformName
-    "answer the classes to be compiled only for platformName
-     platformName is one of #unix, #win32 (OperatingSystem platformName)"
-
-    ^ self 
-        classNamesForWhich:[:nm :attr | 
-            (attr includes:#autoload) not and:[attr includes:platformName]
-        ].
-
-    "Created: / 07-08-2006 / 19:02:57 / fm"
-    "Modified: / 07-08-2006 / 21:25:25 / fm"
-    "Modified: / 09-10-2006 / 13:30:08 / cg"
-!
-
-compiled_classNames_common
-    "classes to be compiled for any platform"
-
-    ^ self 
-        classNamesForWhich:[:nm :attr |
-            attr isEmptyOrNil
-        ].
-
-    "Created: / 18-08-2006 / 13:37:51 / cg"
-!
-
-compiled_classNames_unix
-    "class, only to be compiled under unix"
-    
-    ^ self compiled_classNamesForPlatform:#unix.
-
-    "Created: / 18-08-2006 / 13:37:51 / cg"
-!
-
-compiled_classNames_windows
-    "class, only to be compiled under windows"
-    
-    ^ self compiled_classNamesForPlatform:#win32.
-
-    "Created: / 18-08-2006 / 13:37:56 / cg"
-!
-
 extensionMethodNames
     "list class/selector pairs of extensions.
-     A correponding method with real names is generated in my subclasses"
-
+     A correponding method with real names must be present in my concrete subclasses"
+
+    "/ should this be a subclassResponsibility here ?
     ^ #()
 
     "Modified: / 17-08-2006 / 20:49:51 / cg"
@@ -2668,304 +2720,7 @@
     "Created: / 07-09-2006 / 17:07:00 / cg"
 ! !
 
-!ProjectDefinition class methodsFor:'file templates'!
-
-bc_dot_mak
-    "answer a template for the bc.mak makefile.
-     Any variable definition %(Variable) will be later replaced by the mapping.
-     $% characters have to be duplicated.
-     Only needed for WIN"
-
-    ^ self subclassResponsibility
-!
-
-bmake_dot_mak
-    "the template code for the bmake.bat file"
-
-    ^ 
-'@REM -------
-@REM make using borland bcc
-@REM type bmake, and wait...
-@REM do not edit - automatically generated from ProjectDefinition
-@REM -------
-make.exe -N -f bc.mak %%1 %%2
-
-%(SUBPROJECT_BMAKE_CALLS)
-'
-
-    "Created: / 17-08-2006 / 20:04:14 / cg"
-    "Modified: / 14-09-2006 / 19:46:40 / cg"
-!
-
-classLine_libInit_dot_cc
-
-^'_%(CLASS)_Init(pass,__pRT__,snd);'
-
-    "Created: / 08-08-2006 / 12:51:44 / fm"
-    "Modified: / 08-08-2006 / 15:46:05 / fm"
-!
-
-lcmake_dot_mak
-    "the template code for the lcmake.bat file"
-
-    ^ 
-'@REM -------
-@REM make using lcc compiler
-@REM type lcmake, and wait...
-@REM do not edit - automatically generated from ProjectDefinition
-@REM -------
-make.exe -N -f bc.mak USELCC=1 %%1 %%2
-
-%(SUBPROJECT_LCCMAKE_CALLS)
-'
-!
-
-make_dot_proto
-    "the template code for the make.proto file"
-
-    ^ self subclassResponsibility
-!
-
-make_dot_spec
-
-^ 
-'# $','Header','$
-#
-# DO NOT EDIT 
-# automagically generated from the projectDefinition: ',self name,'.
-#
-# Warning: once you modify this file, do not rerun
-# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
-#
-# This file contains specifications which are common to all platforms.
-#
-
-# Do NOT CHANGE THESE DEFINITIONS
-# (otherwise, ST/X will have a hard time to find out the packages location from its packageID,
-#  to find the source code of a class and to find the library for a package)
-MODULE=%(MODULE)
-MODULE_DIR=%(MODULE_DIRECTORY)
-PACKAGE=$(MODULE):$(MODULE_DIR)
-
-
-# Argument(s) to the stc compiler (stc --usage).
-#  -H.         : create header files locally
-#                (if removed, they will be created as common
-#  -Pxxx       : defines the package
-#  -Zxxx       : a prefix for variables within the classLib
-#  -Dxxx       : defines passed to to CC for inline C-code
-#  -Ixxx       : include path passed to CC for inline C-code
-#  +optspace   : optimized for space
-#  +optspace2  : optimized more for space
-#  +optspace3  : optimized even more for space
-#  +optinline  : generate inline code for some ST constructs
-#  +inlineNew  : additionally inline new
-#  +inlineMath : additionally inline some floatPnt math stuff
-#
-# ********** OPTIONAL: MODIFY the next line(s) ***
-# STCLOCALOPTIMIZATIONS=+optinline +inlineNew
-# STCLOCALOPTIMIZATIONS=+optspace3
-STCLOCALOPTIMIZATIONS=%(STCOPTIMIZATIONOPTIONS)
-
-
-# Argument(s) to the stc compiler (stc --usage).
-#  -warn            : no warnings
-#  -warnNonStandard : no warnings about ST/X extensions
-#  -warnEOLComments : no warnings about EOL comment extension
-#  -warnPrivacy     : no warnings about privateClass extension
-#
-# ********** OPTIONAL: MODIFY the next line(s) ***
-# STCWARNINGS=-warn
-# STCWARNINGS=-warnNonStandard
-# STCWARNINGS=-warnEOLComments
-STCWARNINGS=%(STCWARNINGOPTIONS)
-
-%(OBJECTS)
-'
-
-    "Created: / 08-08-2006 / 19:31:29 / fm"
-    "Modified: / 09-08-2006 / 15:10:57 / fm"
-    "Modified: / 30-08-2006 / 19:07:26 / cg"
-!
-
-objectLine_make_dot_spec
-
-    ^'    $(OUTDIR)%(CLASSFILE).$(O) \'
-
-    "Created: / 08-08-2006 / 20:16:46 / fm"
-    "Modified: / 23-08-2006 / 11:11:38 / cg"
-!
-
-packageName_dot_rc
-    "the template code for the <libName>.rc file.
-     Only used for WIN"
-
-^ 
-'//
-// DO NOT EDIT 
-// automagically generated from the projectDefinition: ',self name,'.
-//
-VS_VERSION_INFO VERSIONINFO
-  FILEVERSION     %(FILE_VERSION_COMMASEPARATED)
-  PRODUCTVERSION  %(PRODUCT_VERSION_COMMASEPARATED)
-  FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
-  FILEFLAGS       VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
-  FILEOS          VOS_NT_WINDOWS32
-  FILETYPE        %(FILETYPE)
-  FILESUBTYPE     VS_USER_DEFINED
-
-BEGIN
-  BLOCK "StringFileInfo"
-  BEGIN
-    BLOCK "040904E4"
-    BEGIN
-      VALUE "CompanyName", "%(COMPANY_NAME)\0"
-      VALUE "FileDescription", "%(FILE_DESCRIPTION)\0"
-      VALUE "FileVersion", "%(FILE_VERSION)\0"
-      VALUE "InternalName", "%(INTERNAL_NAME)\0"
-%(LEGAL_COPYRIGHT_LINE)
-      VALUE "ProductName", "%(PRODUCT_NAME)\0"
-      VALUE "ProductVersion", "%(PRODUCT_VERSION)\0"
-      VALUE "ProductDate", "%(PRODUCT_DATE)\0"
-    END
-
-  END
-
-  BLOCK "VarFileInfo"
-  BEGIN                               //  Language   |    Translation
-    VALUE "Translation", 0x409, 0x4E4 // U.S. English, Windows Multilingual
-  END
-END
-'
-    "
-     stx_libbasic3 packageName_dot_rc
-     stx_libbasic3 generate_packageName_dot_rc
-    "
-
-    "Created: / 08-08-2006 / 19:31:29 / fm"
-    "Modified: / 09-08-2006 / 15:10:57 / fm"
-    "Modified: / 23-08-2006 / 01:32:23 / cg"
-!
-
-vcmake_dot_mak
-    "the template code for the vcmake.bat file"
-
-    ^ 
-'@REM -------
-@REM make using microsoft visual c
-@REM type vcmake, and wait...
-@REM do not edit - automatically generated from ProjectDefinition
-@REM -------
-make.exe -N -f bc.mak USEVC=1 %%1 %%2
-
-%(SUBPROJECT_VCMAKE_CALLS)
-'
-! !
-
-!ProjectDefinition class methodsFor:'loading'!
-
-load
-    "load the project
-     Answer true, if new classes have been installed for this package, 
-     false if the package's classes have been already present."
-
-    ^ self loadAsAutoloaded:false.
-!
-
-loadAsAutoloaded:asAutoloaded
-    "load the project.
-     If asAutoloaded == true, install all new classes as autoloaded.
-     Answer true, if new classes have been installed for this package,
-     false if the package's classes have been already present."
-
-    |newStuffHasBeenLoaded meOrMySecondIncarnation|
-
-    self projectIsLoaded ifTrue:[^ false].
-    thisContext isRecursive ifTrue:[^ false].    "/ avoid endless loops
-
-    self checkPrerequisitesForLoading.
-
-    newStuffHasBeenLoaded := false.
-
-    (self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[
-        "/ thisContext fullPrintAll.
-        Transcript show:'loading '.
-        asAutoloaded ifTrue:[
-            Transcript show:'as autoloaded '.
-        ].
-        Transcript showCR:self name.
-    ].
-
-    self rememberOverwrittenExtensionMethods.
-
-    self activityNotification:'Executing pre-load action'.
-    self preLoadAction.
-
-    meOrMySecondIncarnation := self.
-
-    Class withoutUpdatingChangesDo:[
-        self activityNotification:'Loading prerequisities'.
-        self loadPreRequisitesAsAutoloaded:asAutoloaded.
-        asAutoloaded ifFalse:[
-            self loadClassLibrary.
-            "/ could have overloaded my first incarnation
-            meOrMySecondIncarnation := (Smalltalk at:(self name)) ? self.
-            meOrMySecondIncarnation ~~ self ifTrue:[
-                meOrMySecondIncarnation fetchSlotsFrom:self.
-            ].
-        ].
-
-        self activityNotification:'Loading extensions'.
-        newStuffHasBeenLoaded := newStuffHasBeenLoaded | meOrMySecondIncarnation loadExtensions.
-        self activityNotification:'Loading classes'.
-        newStuffHasBeenLoaded := newStuffHasBeenLoaded | (meOrMySecondIncarnation loadAllClassesAsAutoloaded:asAutoloaded).
-        self activityNotification:'Loading sub projects'.
-        meOrMySecondIncarnation loadSubProjectsAsAutoloaded:asAutoloaded.
-    ].
-    self activityNotification:'Executing post-load action'.
-    meOrMySecondIncarnation postLoadAction.
-
-    meOrMySecondIncarnation projectIsLoaded:true.
-
-    ^ newStuffHasBeenLoaded
-
-    "Created: / 17-08-2006 / 01:01:41 / cg"
-    "Modified: / 21-11-2006 / 15:07:09 / cg"
-    "Modified: / 30-10-2008 / 08:16:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 22-08-2009 / 12:02:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-unloadPackage
-    "unload the project.
-     Fails if there are still instances of any of my classes in the system"
-
-    self projectIsLoaded ifFalse:[^ false].
-    thisContext isRecursive ifTrue:[^ false].
-
-    (self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[
-        "/ thisContext fullPrintAll.
-        Transcript show:'unloading '; showCR:self name.
-    ].
-
-    self activityNotification:'Executing pre-unload action'.
-    self preUnloadAction.
-
-    self activityNotification:'Restoring original methods'.
-    self restoreOverwrittenExtensionMethods.
-
-    Class withoutUpdatingChangesDo:[
-        self activityNotification:'Unloading sunprojects'.
-        self unloadSubProjects.
-
-        self activityNotification:'Unloading classes'.
-        self unloadClassLibrary.
-        self unloadAllClasses.
-    ].
-    self projectIsLoaded:false.
-    ^ true
-! !
-
-!ProjectDefinition class methodsFor:'mappings'!
+!ProjectDefinition class methodsFor:'file mappings'!
 
 bc_dot_mak_mappings
     |d|
@@ -3130,7 +2885,7 @@
                 replaceAny:':' with:$_
 ! !
 
-!ProjectDefinition class methodsFor:'mappings support'!
+!ProjectDefinition class methodsFor:'file mappings support'!
 
 commonSymbolsFlag
     "only for libraries"
@@ -3678,6 +3433,327 @@
     ]
 ! !
 
+!ProjectDefinition class methodsFor:'file templates'!
+
+bc_dot_mak
+    "answer a template for the bc.mak makefile.
+     Any variable definition %(Variable) will be later replaced by the mapping.
+     $% characters have to be duplicated.
+     Only needed for WIN"
+
+    ^ self subclassResponsibility
+!
+
+bmake_dot_mak
+    "the template code for the bmake.bat file"
+
+    ^ 
+'@REM -------
+@REM make using borland bcc
+@REM type bmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak %%1 %%2
+
+%(SUBPROJECT_BMAKE_CALLS)
+'
+
+    "Created: / 17-08-2006 / 20:04:14 / cg"
+    "Modified: / 14-09-2006 / 19:46:40 / cg"
+!
+
+classLine_libInit_dot_cc
+
+^'_%(CLASS)_Init(pass,__pRT__,snd);'
+
+    "Created: / 08-08-2006 / 12:51:44 / fm"
+    "Modified: / 08-08-2006 / 15:46:05 / fm"
+!
+
+lcmake_dot_mak
+    "the template code for the lcmake.bat file"
+
+    ^ 
+'@REM -------
+@REM make using lcc compiler
+@REM type lcmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak USELCC=1 %%1 %%2
+
+%(SUBPROJECT_LCCMAKE_CALLS)
+'
+!
+
+make_dot_proto
+    "the template code for the make.proto file"
+
+    ^ self subclassResponsibility
+!
+
+make_dot_spec
+
+^ 
+'# $','Header','$
+#
+# DO NOT EDIT 
+# automagically generated from the projectDefinition: ',self name,'.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# This file contains specifications which are common to all platforms.
+#
+
+# Do NOT CHANGE THESE DEFINITIONS
+# (otherwise, ST/X will have a hard time to find out the packages location from its packageID,
+#  to find the source code of a class and to find the library for a package)
+MODULE=%(MODULE)
+MODULE_DIR=%(MODULE_DIRECTORY)
+PACKAGE=$(MODULE):$(MODULE_DIR)
+
+
+# Argument(s) to the stc compiler (stc --usage).
+#  -H.         : create header files locally
+#                (if removed, they will be created as common
+#  -Pxxx       : defines the package
+#  -Zxxx       : a prefix for variables within the classLib
+#  -Dxxx       : defines passed to to CC for inline C-code
+#  -Ixxx       : include path passed to CC for inline C-code
+#  +optspace   : optimized for space
+#  +optspace2  : optimized more for space
+#  +optspace3  : optimized even more for space
+#  +optinline  : generate inline code for some ST constructs
+#  +inlineNew  : additionally inline new
+#  +inlineMath : additionally inline some floatPnt math stuff
+#
+# ********** OPTIONAL: MODIFY the next line(s) ***
+# STCLOCALOPTIMIZATIONS=+optinline +inlineNew
+# STCLOCALOPTIMIZATIONS=+optspace3
+STCLOCALOPTIMIZATIONS=%(STCOPTIMIZATIONOPTIONS)
+
+
+# Argument(s) to the stc compiler (stc --usage).
+#  -warn            : no warnings
+#  -warnNonStandard : no warnings about ST/X extensions
+#  -warnEOLComments : no warnings about EOL comment extension
+#  -warnPrivacy     : no warnings about privateClass extension
+#
+# ********** OPTIONAL: MODIFY the next line(s) ***
+# STCWARNINGS=-warn
+# STCWARNINGS=-warnNonStandard
+# STCWARNINGS=-warnEOLComments
+STCWARNINGS=%(STCWARNINGOPTIONS)
+
+%(OBJECTS)
+'
+
+    "Created: / 08-08-2006 / 19:31:29 / fm"
+    "Modified: / 09-08-2006 / 15:10:57 / fm"
+    "Modified: / 30-08-2006 / 19:07:26 / cg"
+!
+
+objectLine_make_dot_spec
+
+    ^'    $(OUTDIR)%(CLASSFILE).$(O) \'
+
+    "Created: / 08-08-2006 / 20:16:46 / fm"
+    "Modified: / 23-08-2006 / 11:11:38 / cg"
+!
+
+packageName_dot_rc
+    "the template code for the <libName>.rc file.
+     Only used for WIN"
+
+^ 
+'//
+// DO NOT EDIT 
+// automagically generated from the projectDefinition: ',self name,'.
+//
+VS_VERSION_INFO VERSIONINFO
+  FILEVERSION     %(FILE_VERSION_COMMASEPARATED)
+  PRODUCTVERSION  %(PRODUCT_VERSION_COMMASEPARATED)
+  FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
+  FILEFLAGS       VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
+  FILEOS          VOS_NT_WINDOWS32
+  FILETYPE        %(FILETYPE)
+  FILESUBTYPE     VS_USER_DEFINED
+
+BEGIN
+  BLOCK "StringFileInfo"
+  BEGIN
+    BLOCK "040904E4"
+    BEGIN
+      VALUE "CompanyName", "%(COMPANY_NAME)\0"
+      VALUE "FileDescription", "%(FILE_DESCRIPTION)\0"
+      VALUE "FileVersion", "%(FILE_VERSION)\0"
+      VALUE "InternalName", "%(INTERNAL_NAME)\0"
+%(LEGAL_COPYRIGHT_LINE)
+      VALUE "ProductName", "%(PRODUCT_NAME)\0"
+      VALUE "ProductVersion", "%(PRODUCT_VERSION)\0"
+      VALUE "ProductDate", "%(PRODUCT_DATE)\0"
+    END
+
+  END
+
+  BLOCK "VarFileInfo"
+  BEGIN                               //  Language   |    Translation
+    VALUE "Translation", 0x409, 0x4E4 // U.S. English, Windows Multilingual
+  END
+END
+'
+    "
+     stx_libbasic3 packageName_dot_rc
+     stx_libbasic3 generate_packageName_dot_rc
+    "
+
+    "Created: / 08-08-2006 / 19:31:29 / fm"
+    "Modified: / 09-08-2006 / 15:10:57 / fm"
+    "Modified: / 23-08-2006 / 01:32:23 / cg"
+!
+
+vcmake_dot_mak
+    "the template code for the vcmake.bat file"
+
+    ^ 
+'@REM -------
+@REM make using microsoft visual c
+@REM type vcmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak USEVC=1 %%1 %%2
+
+%(SUBPROJECT_VCMAKE_CALLS)
+'
+! !
+
+!ProjectDefinition class methodsFor:'loading'!
+
+ensureFullyLoaded
+    "ensure that all classes and extensions are loaded properly.
+     This is normally no problem for compiled classLibs - however, if a package
+     has only be installedAsAutoloaded, some classes might want to ensure that
+     when being loaded themself."
+
+    self hasAllExtensionsLoaded ifFalse:[
+        self halt.
+    ].
+    self hasAllClassesFullyLoaded ifFalse:[
+        self hasAllClassesLoaded ifFalse:[
+            self halt
+        ].
+        self classes do:[:cls | cls load ].
+    ].
+
+    "
+     stx_libbasic ensureFullyLoaded
+    "
+!
+
+load
+    "load the project
+     Answer true, if new classes have been installed for this package, 
+     false if the package's classes have been already present."
+
+    ^ self loadAsAutoloaded:false.
+!
+
+loadAsAutoloaded:asAutoloaded
+    "load the project.
+     If asAutoloaded == true, install all new classes as autoloaded.
+     Answer true, if new classes have been installed for this package,
+     false if the package's classes have been already present."
+
+    |newStuffHasBeenLoaded meOrMySecondIncarnation|
+
+    self projectIsLoaded ifTrue:[^ false].
+    thisContext isRecursive ifTrue:[^ false].    "/ avoid endless loops
+
+    self checkPrerequisitesForLoading.
+
+    newStuffHasBeenLoaded := false.
+
+    (self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[
+        "/ thisContext fullPrintAll.
+        Transcript show:'loading '.
+        asAutoloaded ifTrue:[
+            Transcript show:'as autoloaded '.
+        ].
+        Transcript showCR:self name.
+    ].
+
+    self rememberOverwrittenExtensionMethods.
+
+    self activityNotification:'Executing pre-load action'.
+    self preLoadAction.
+
+    meOrMySecondIncarnation := self.
+
+    Class withoutUpdatingChangesDo:[
+        self activityNotification:'Loading prerequisities'.
+        self loadPreRequisitesAsAutoloaded:asAutoloaded.
+        asAutoloaded ifFalse:[
+            self loadClassLibrary.
+            "/ could have overloaded my first incarnation
+            meOrMySecondIncarnation := (Smalltalk at:(self name)) ? self.
+            meOrMySecondIncarnation ~~ self ifTrue:[
+                meOrMySecondIncarnation fetchSlotsFrom:self.
+            ].
+        ].
+
+        self activityNotification:'Loading extensions'.
+        newStuffHasBeenLoaded := newStuffHasBeenLoaded | meOrMySecondIncarnation loadExtensions.
+        self activityNotification:'Loading classes'.
+        newStuffHasBeenLoaded := newStuffHasBeenLoaded | (meOrMySecondIncarnation loadAllClassesAsAutoloaded:asAutoloaded).
+        self activityNotification:'Loading sub projects'.
+        meOrMySecondIncarnation loadSubProjectsAsAutoloaded:asAutoloaded.
+    ].
+    self activityNotification:'Executing post-load action'.
+
+    "/ mhmh - already done for dll-loaded packages
+    "/ meOrMySecondIncarnation initializeAllClasses.
+    meOrMySecondIncarnation postLoadAction.
+
+    meOrMySecondIncarnation projectIsLoaded:true.
+
+    ^ newStuffHasBeenLoaded
+
+    "Created: / 17-08-2006 / 01:01:41 / cg"
+    "Modified: / 21-11-2006 / 15:07:09 / cg"
+    "Modified: / 30-10-2008 / 08:16:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 22-08-2009 / 12:02:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+unloadPackage
+    "unload the project.
+     Fails if there are still instances of any of my classes in the system"
+
+    self projectIsLoaded ifFalse:[^ false].
+    thisContext isRecursive ifTrue:[^ false].
+
+    (self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[
+        "/ thisContext fullPrintAll.
+        Transcript show:'unloading '; showCR:self name.
+    ].
+
+    self activityNotification:'Executing pre-unload action'.
+    self preUnloadAction.
+
+    self activityNotification:'Restoring original methods'.
+    self restoreOverwrittenExtensionMethods.
+
+    Class withoutUpdatingChangesDo:[
+        self activityNotification:'Unloading sunprojects'.
+        self unloadSubProjects.
+
+        self activityNotification:'Unloading classes'.
+        self unloadClassLibrary.
+        self unloadAllClasses.
+    ].
+    self projectIsLoaded:false.
+    ^ true
+! !
+
 !ProjectDefinition class methodsFor:'misc ui support'!
 
 iconInBrowserSymbol
@@ -3694,6 +3770,37 @@
 
 !ProjectDefinition class methodsFor:'private'!
 
+additionalClassAttributesFor: aClass
+    "Answers additional set of class attributes for given class
+     Individual project definitions may override this method, but
+     overriding method should always merge its attributes with result
+     of 'super additionalClassAttributesFor: aClass'.
+
+     Here, we add #autoload attributes to all test cases and
+     test resources, as they are not neccessary for the package
+     and should not be compiled (because of unwanted dependency
+     on stx:goodies/sunit package)
+    "
+
+    (aClass inheritsFrom: TestCase) ifTrue:[^#(autoload)].
+    (aClass inheritsFrom: TestResource) ifTrue:[^#(autoload)].
+
+    "No additional attributes"
+    ^#()
+
+    "
+        stx_libbasic additionalClassAttributesFor: Object 
+        stx_libtool additionalClassAttributesFor: Tools::NavigationHistoryTests
+        stx_goodies_sunit additionalClassAttributesFor: TestCase 
+
+
+        stx_libtool classNamesAndAttributes_code_ignoreOldEntries:true ignoreOldDefinition: true
+
+    "
+
+    "Created: / 26-10-2009 / 12:54:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 checkIfClassesArePresent
     "check if all classes defined by this project are present and
      offer a dialog to abort the current operation if not"
@@ -3733,12 +3840,48 @@
     ^ true
 !
 
+classNamesAndAttributesAsSpecArray
+    "given a classNamesAndAttributes array, make this a spec array (array of arrays).  
+     This decompresses class-name entries into a one-element array for easier processing"
+
+    ^ self classNamesAndAttributes
+        collect:[:entry |
+            entry isArray ifTrue:[
+                entry first isSymbol ifTrue:[
+                    entry
+                ] ifFalse:[
+                    (Array with:entry first asSymbol) , (entry copyFrom:2)
+                ].
+            ] ifFalse:[
+                Array with:entry asSymbol.
+            ]].
+
+    "Created: / 19-02-2007 / 16:11:53 / cg"
+!
+
 classNamesAndAttributesDo: aBlock
     self namesAndAttributesIn:(self classNamesAndAttributes) do: aBlock
 
     "Modified: / 22-08-2006 / 18:20:21 / cg"
 !
 
+classNamesAndAttributesFromSpecArray:aSpecArray
+    "given a spec array (array of arrays), make this a classNamesAndAttributes array
+     as stored literally in the method.
+     This compresses single element array-elements into plain names
+     (to save code in the compiled binaries)"
+
+    ^ aSpecArray
+        collect:[:entry |
+            (entry isArray and:[entry size == 1]) ifTrue:[
+                entry first
+            ] ifFalse:[
+                entry
+            ]].
+
+    "Created: / 19-02-2007 / 16:12:32 / cg"
+!
+
 compile:someCode categorized:category
     Class packageQuerySignal 
         answer:self package
@@ -4091,13 +4234,17 @@
     typeOrNil = GUIApplicationType ifTrue:[
         self compile:'isGUIApplication\    ^ true' withCRs
              categorized:'description'.
+        self superclass: ApplicationDefinition.
         ^ self
     ].
     typeOrNil = NonGUIApplicationType ifTrue:[
         self compile:'isGUIApplication\    ^ false' withCRs
              categorized:'description'.
+        self superclass: ApplicationDefinition.
         ^ self
-    ].
+    ].                
+    self theMetaclass removeSelector: #isGUIApplication.
+    self superclass: LibraryDefinition.
     ^ self.
 
     "Created: / 23-08-2006 / 14:26:10 / cg"
@@ -4245,6 +4392,7 @@
     classNamesToLoad := OrderedCollection new.
     classNamesToAutoload := OrderedCollection new.
 
+    hasClassesToLoad := false.
     self classNamesAndAttributesDo:[:eachClassname :eachAttributes | |eachClassnameSym isAutoload cls|
         eachClassnameSym := eachClassname asSymbol.
         isAutoload := asAutoloaded or:[eachAttributes includes:#autoload].
@@ -4334,7 +4482,7 @@
 
         loadedClasses do:[:eachLoadedClass |
             "do not initialize, if initialize method is inherited"
-            (eachLoadedClass theMetaclass implements:#initialize) ifTrue:[
+            (eachLoadedClass theMetaclass includesSelector:#initialize) ifTrue:[
                 eachLoadedClass initialize
             ].
         ].
@@ -4423,6 +4571,8 @@
 !ProjectDefinition class methodsFor:'private-prerequisites'!
 
 addReferencesToClassesFromGlobalsIn:aSetOfClasses to:usedClassReasons
+    "helper for searchForPreRequisites"
+
     aSetOfClasses
         do:[:aClass |
             self
@@ -4442,6 +4592,8 @@
 !
 
 addReferencesToClassesFromGlobalsInMethods:someMethods to:usedClassReasons
+    "helper for searchForPreRequisites"
+
     someMethods do:[:method |
         |resources|
 
@@ -4536,60 +4688,128 @@
 
 !ProjectDefinition class methodsFor:'queries'!
 
-definitionClassForPackage:aPackageID
-    ^ self definitionClassForPackage:aPackageID createIfAbsent:false
-
-    "Modified: / 17-08-2006 / 14:33:35 / cg"
-!
-
-definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent
-    ^ self definitionClassForPackage:aPackageID createIfAbsent:doCreateIfAbsent projectType:nil
-
-    "Modified: / 23-08-2006 / 14:29:15 / cg"
-!
-
-definitionClassForPackage: aPackageID createIfAbsent: doCreateIfAbsent projectType:typeOrNil
-    |packageDefinitionClassName class|
-
-    packageDefinitionClassName := ProjectDefinition initialClassNameForDefinitionOf:aPackageID.
-    class := Smalltalk classNamed:packageDefinitionClassName.
-    class isNil ifTrue:[
-        doCreateIfAbsent ifTrue:[
-            class := self newForPackage:aPackageID.
-            "setup before prerequisites are defined"
-            class setupForType:typeOrNil.
-        ].
-    ] ifFalse:[
-        typeOrNil notNil ifTrue:[
-            class setupForType:typeOrNil.
+allClassNames          
+    ^ self classNamesForWhich:[:nm :attr | true ].
+!
+
+autoloaded_classNames          
+    ^ self classNamesForWhich:[:nm :attr | attr notEmptyOrNil and:[attr includes:#autoload]].
+
+    "Modified: / 07-08-2006 / 21:25:25 / fm"
+    "Created: / 30-08-2007 / 18:48:09 / cg"
+!
+
+classNames          
+    "answer an array containing all the class names of the project's classes"
+
+    ^ self classNamesAndAttributesAsSpecArray collect:[:entry | entry first].
+
+    "
+     stx_libhtml classNames
+     stx_libhtml classNamesAndAttributesAsSpecArray
+    "
+!
+
+classNamesForWhich:aBlock          
+    "a correponding method with real names is generated in my subclasses"
+
+    |coll|
+
+    coll := OrderedCollection new.
+    self classNamesAndAttributesDo:[:nm :attributes |
+        (aBlock value:nm value:attributes) ifTrue:[
+            coll add:nm.
         ].
     ].
-    ^ class
-
-    "Created: / 23-08-2006 / 14:29:21 / cg"
-    "Modified: / 23-08-2006 / 15:35:26 / cg"
-!
-
-definitionClassForPackage:newProjectID projectType:typeOrNil createIfAbsent:createIfAbsent
-    ^ (self definitionClassForType:typeOrNil)
-        definitionClassForPackage:newProjectID 
-        createIfAbsent:createIfAbsent
-        projectType:typeOrNil
-
-    "Created: / 23-08-2006 / 14:28:53 / cg"
-!
-
-definitionClassForType: type
-    "answer the class that describes a give project type"
-
-    (type = LibraryType) ifTrue:[ ^ LibraryDefinition ].
-    (type = GUIApplicationType) ifTrue:[ ^ ApplicationDefinition ].
-    (type = NonGUIApplicationType) ifTrue:[ ^ ApplicationDefinition ].
-    (type = 'Application') ifTrue:[ ^ ApplicationDefinition ].
-    self error:'unknown project type'.
-
-    "Created: / 17-08-2006 / 14:46:28 / cg"
-    "Modified: / 23-08-2006 / 13:49:27 / cg"
+    ^ coll
+
+    "Created: / 07-08-2006 / 19:02:57 / fm"
+    "Modified: / 07-08-2006 / 21:25:25 / fm"
+    "Modified: / 17-08-2006 / 20:47:20 / cg"
+!
+
+classes
+    "list my classes.
+     Project must be loaded - otherwise an error is reported here.
+     Use #classNames if you are only interested in the names"
+
+    ^ self classNames collect:[:nm | Smalltalk at:nm ifAbsent:[self error:'Missing class']]
+
+    "
+     stx_libbasic3 classNames
+     stx_libbasic3 classes
+    "
+!
+
+compiled_classNames          
+    ^ 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"
+!
+
+compiled_classNamesForPlatform
+    "answer the classes to be compiled only for the current platformName"
+
+    ^ self compiled_classNamesForPlatform:OperatingSystem platformName
+!
+
+compiled_classNamesForPlatform:platformName
+    "answer the classes to be compiled only for platformName
+     platformName is one of #unix, #win32 (OperatingSystem platformName)"
+
+    ^ self 
+        classNamesForWhich:[:nm :attr | 
+            (attr includes:#autoload) not and:[attr includes:platformName]
+        ].
+
+    "Created: / 07-08-2006 / 19:02:57 / fm"
+    "Modified: / 07-08-2006 / 21:25:25 / fm"
+    "Modified: / 09-10-2006 / 13:30:08 / cg"
+!
+
+compiled_classNames_common
+    "classes to be compiled for any platform"
+
+    ^ self 
+        classNamesForWhich:[:nm :attr |
+            attr isEmptyOrNil
+        ].
+
+    "Created: / 18-08-2006 / 13:37:51 / cg"
+!
+
+compiled_classNames_unix
+    "class, only to be compiled under unix"
+    
+    ^ self compiled_classNamesForPlatform:#unix.
+
+    "Created: / 18-08-2006 / 13:37:51 / cg"
+!
+
+compiled_classNames_windows
+    "class, only to be compiled under windows"
+    
+    ^ self compiled_classNamesForPlatform:#win32.
+
+    "Created: / 18-08-2006 / 13:37:56 / cg"
+!
+
+extensionMethods
+    "list my extension methods.
+     Project must be loaded - otherwise an error is reported here.
+     Use #extensionMethodsNames if you are only interested in the names"
+
+    ^ self extensionMethodNames 
+        pairWiseCollect:[:className :selector |
+            (Smalltalk classNamed:className) compiledMethodAt:selector.
+        ].
+
+    "
+     stx_libbasic2 extensionMethodNames
+     stx_libbasic2 extensionMethods
+    "
 !
 
 hasAllClassesFullyLoaded
@@ -4697,10 +4917,34 @@
     "Created: / 14-09-2006 / 14:19:35 / cg"
 !
 
+hasPostLoadAction
+    "/ true if postLoadAction has been redefined
+    ^ (self class whichClassIncludesSelector:#postLoadAction) theNonMetaclass isAbstract not
+!
+
+hasPostUnloadAction
+    "/ true if postUnloadAction has been redefined
+    ^ (self class whichClassIncludesSelector:#postUnloadAction) theNonMetaclass isAbstract not
+!
+
+hasPreLoadAction
+    "/ true if preLoadAction has been redefined
+    ^ (self class whichClassIncludesSelector:#preLoadAction) theNonMetaclass isAbstract not
+!
+
+hasPreUnloadAction
+    "/ true if preUnloadAction has been redefined
+    ^ (self class whichClassIncludesSelector:#preUnloadAction) theNonMetaclass isAbstract not
+!
+
 isFullyLoaded
     ^ self hasAllCompiledClassesFullyLoaded and:[self hasAllClassesLoaded and:[self hasAllExtensionsLoaded]]
 
     "Created: / 24-10-2006 / 23:52:23 / cg"
+!
+
+projectType
+    ^ self subclassResponsibility
 ! !
 
 !ProjectDefinition class methodsFor:'queries-privacy'!
@@ -4751,6 +4995,10 @@
 
 !ProjectDefinition class methodsFor:'testing'!
 
+isAbstract
+    ^ self == ProjectDefinition
+!
+
 isApplicationDefinition
     ^ false
 
@@ -4758,6 +5006,12 @@
     "Modified: / 20-09-2006 / 14:59:56 / cg"
 !
 
+isConsoleApplication
+    ^ false
+
+    "Created: / 20-09-2006 / 14:59:49 / cg"
+!
+
 isGUIApplication
     ^ false
 
@@ -4783,15 +5037,12 @@
 !ProjectDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ProjectDefinition.st 10474 2009-10-26 21:51:17Z vranyj1 $'
+    ^ '$Id: ProjectDefinition.st 10477 2009-11-05 14:41:30Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.258 2009/10/19 20:12:52 cg Exp §'
-!
-
-version_SVN
-    ^ '$Id: ProjectDefinition.st 10474 2009-10-26 21:51:17Z vranyj1 $'
+    ^ '$Id: ProjectDefinition.st 10477 2009-11-05 14:41:30Z vranyj1 $'
 ! !
 
 ProjectDefinition initialize!
+