ApplicationDefinition.st
author Claus Gittinger <cg@exept.de>
Wed, 23 Aug 2006 16:43:05 +0200
changeset 9671 cb20763db715
parent 9669 f0b5ad4fb4a8
child 9684 23bc62e80fca
permissions -rw-r--r--
*** empty log message ***

"
 COPYRIGHT (c) 2006 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

"{ Package: 'stx:libbasic' }"

ProjectDefinition subclass:#ApplicationDefinition
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'System-Support-Projects'
!

!ApplicationDefinition class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2006 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
! !

!ApplicationDefinition class methodsFor:'accessing'!

applicationName

^(self moduleDirectory subStrings:$/) first

"
    bosch_dapasx_application applicationName     
"

    "Created: / 08-08-2006 / 20:25:39 / fm"
! !

!ApplicationDefinition class methodsFor:'defaults'!

defaultDescription
    ^ 'an application'
!

guiClassFileNames
    ^ self guiClasses 
        collect:[:cls | (cls classFilename asFilename 
                            withSuffix:(ObjectFileLoader sharedLibrarySuffix))
                                baseName].
!

guiClasses
    ^ DeviceWorkstation allSubclasses 
        select:[:cls | cls isLoaded and:[cls ~~ WinPrinter]]
!

needResources
    ^ self isGUIApplication
! !

!ApplicationDefinition class methodsFor:'description'!

excludedFromPreRequisites  
    "list packages which are to be explicitely excluded from the automatic constructed
     prerequisites list. If empty, everything that is found along the inheritance of any of
     my classes is considered to be a prerequisite package."

    ^ #()

    "Modified: / 17-08-2006 / 19:48:59 / cg"
!

excludedFromSubProjects
    "list packages which are to be explicitely excluded from the automatic constructed
     subProjects list. If empty, every sub-package is included as a prerequisite."

    ^ #()

    "Modified: / 17-08-2006 / 19:49:40 / cg"
!

isGUIApplication
    "Return true, if this is a GUI app. 
     Redefine to return false for non-GUI applications (affects inclusion of Display classes)."

    ^true

    "Created: / 08-08-2006 / 11:15:01 / fm"
    "Modified: / 17-08-2006 / 19:47:36 / cg"
!

startUpClass
    "The name of the class which provides the entry point for the application."

    self subclassResponsibility

    "Modified: / 17-08-2006 / 20:00:22 / cg"
!

startUpSelector
    "The name of the entry point method (in startUpClass) used to start the application."

    ^ #'start'

    "Modified: / 17-08-2006 / 20:01:00 / cg"
! !

!ApplicationDefinition class methodsFor:'description - project information'!

description
    "Returns a description string which will appear in nt.def / bc.def"

    self module = 'stx' ifTrue:[
        ^ 'Smalltalk/X Application'
    ].

    ^ 'Application'

    "Created: / 17-08-2006 / 20:52:48 / cg"
    "Modified: / 18-08-2006 / 16:16:01 / cg"
! !

!ApplicationDefinition class methodsFor:'file generation'!

fileNamesToGenerate
    ^ #( 
"
          #('Make.proto'        #'generate_make_dot_proto')
          #('Make.spec'         #'generate_make_dot_spec')
          #('libInit.cc'        #'generate_libInit_dot_cc')
"
          #('bc.def'            #'generate_bc_dot_def')
          #('nt.mak'            #'generate_nt_dot_mak')
          #('modules.stx'       #'generate_modules_dot_stx')
"
          #('nt.def'            #'generate_nt_dot_def')
          #('abbrev.stc'        #'generate_abbrev_dot_stc') 
"
          #('bmake.bat'         #'generate_bmake_dot_mak') 
     )

    "Modified: / 17-08-2006 / 20:03:17 / cg"
!

generateFile:filename
    filename = 'modules.stx' ifTrue:[
        ^ self generate_modules_dot_stx
    ].
    ^ super generateFile:filename

    "Created: / 22-08-2006 / 18:35:40 / cg"
! !

!ApplicationDefinition class methodsFor:'file templates'!

bc_dot_def
    "the template code for the bc.def file"

^ 
'DESCRIPTION     %(DESCRIPTION)
CODE            PRELOAD MOVEABLE DISCARDABLE
SEGMENTS
    INITCODE    PRELOAD DISCARDABLE
'

    "Created: / 08-08-2006 / 12:26:58 / fm"
    "Modified: / 08-08-2006 / 19:32:27 / fm"
    "Modified: / 17-08-2006 / 20:05:17 / cg"
!

modules_dot_stx

^ 
'# $','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 is (currently) only used with win-95 / win-NT versions of STX.
# It lists the dll''s which are to be loaded at startup time.
#
# All classes loaded at startup time will be present as precompiled classes.
# Others will be autoloaded.
#
%(PREREQUISITE_LIBS)
%(SUBPROJECT_LIBS)
'

    "Created: / 08-08-2006 / 12:26:58 / fm"
    "Modified: / 08-08-2006 / 19:32:27 / fm"
    "Modified: / 16-08-2006 / 17:56:58 / User"
    "Modified: / 17-08-2006 / 20:35:38 / cg"
!

nt_dot_mak
    |def needResources|

    needResources := false "self isGUIApplication".

    def :=
'#
# 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.
#

CFLAGS1= -WD -w-pro -w-ccc -w-rch -w-aus -w-par -x- -r- -k -y -v -vi- -c -tWDR
CFLAGS1= -w-pro -w-ccc -w-rch -w-aus -w-par -x- -r- -k -y -v -vi- -c

CFLAGS_CONSOLE=
CFLAGS_NOCONSOLE=-tWR -D_NO_VCL;WIN32GUI;WIN32 -DWIN_LOGFILE="\"%(APPLICATION)_%%d.log\""
LFLAGS_CONSOLE=-ap
LFLAGS_NOCONSOLE=-aa
CRT_STARTUP_CONSOLE=c0x32.obj
CRT_STARTUP_NOCONSOLE=c0w32.obj

CFLAGS_APPTYPE=$(CFLAGS_NOCONSOLE)
LFLAGS_APPTYPE=$(LFLAGS_NOCONSOLE)
CRT_STARTUP=$(CRT_STARTUP_NOCONSOLE)

CFLAGS_LOCAL=$(CFLAGS_APPTYPE) \
 -DSTARTUP_CLASS="\"%(STARTUP_CLASS)\"" \
 -DSTARTUP_SELECTOR="\"%(STARTUP_SELECTOR)\"" \
 -DUSE_MODULE_TABLE

TOP=%(TOP)       

#
OBJS=%(OBJECTS)

!!INCLUDE $(TOP)\rules\stdHeader_nt
#
MODULE=%(MODULE)
MODULE_DIR=%(MODULE_DIRECTORY)
PACKAGE=$(MODULE):$(MODULE_DIR)
LIBNAME=dummy
STCOPT="+optinline"
STCLOCALOPT=''-package=$(PACKAGE)'' $(COMMONSYMBOLS) $(SEPINITCODE) $(RELOCINSTVARS) -varPrefix=$(LIBNAME)
#STCLOCALOPT=""

LINKER = ilink32

# LFLAGS = -L$(TOP)\libbc;$(BCB)\lib;$(DEBUGLIBPATH) -H:0x400000 -Hc:0x100000 -S:0x40000 -Sc:0x10000 -ap -Tpe -x -Gn -v -Ao:0x10000
LFLAGS = -L$(TOP)\libbc;$(BCB)\lib -S:0x40000 -Sc:0x10000 $(LFLAGS_APPTYPE) -Tpe -x -Gn -v -Ao:0x10000

PROJECT = %(APPLICATION).exe
#ALLOBJFILES = stx.obj main.obj
ALLOBJFILES = main.obj
RESFILES = %(APPLICATION)WinRC.res
ALLOBJ = $(CRT_STARTUP) $(ALLOBJFILES) $(OBJS)
DEFFILE=bc.def

LIBFILES=$(TOP)\libbc\librun.lib
ALLLIB=$(LIBFILES) import32.lib $(RT_LIB)

REQUIRED_LIBS=librun.dll %(REQUIRED_LIBS)
REQUIRED_FILES=cs3245.dll symbols.stc $(REQUIRED_LIBS)

REQUIRED_SUPPORT_DIRS=%(REQUIRED_SUPPORT_DIRS)

ALL:: $(OBJS) $(REQUIRED_FILES) show $(PROJECT) $(REQUIRED_SUPPORT_DIRS)

setup: install_%(APPLICATION).exe

# This uses the Nullsoft Installer Package and works in Windows only

install_%(APPLICATION).exe: $(PROJECT) %(APPLICATION).nsi
    makensis %(APPLICATION).nsi

new:
    bmake clean
    bmake

%(RESOURCE_RULES)

%(PREREQUISITES_LIBS)      
%(SUBPROJECTS_LIBS)

show:
    @echo LFLAGS= $(LFLAGS)
    @echo ALLOBJ= $(ALLOBJ)
    @echo PROJECT= $(PROJECT)
    @echo ALLLIB= $(ALLLIB)
    @echo DEFFILE= $(DEFFILE)
    @echo ALLRES= $(ALLRES)

$(PROJECT): $(ALLOBJFILES) $(OBJS) $(RESFILES) $(DEFFILE)
    $(BCB)\BIN\$(LINKER) $(LFLAGS) $(ALLOBJ), $(PROJECT),,  $(ALLLIB),  $(DEFFILE),  $(RESFILES)

#$(PROJECT): $(ALLOBJFILES) $(RESFILES) $(DEFFILE)
#    $(BCB)\BIN\$(LINKER) @&&!!
#    $(LFLAGS) +
#    $(ALLOBJ), +
#    $(PROJECT),, +
#    $(ALLLIB), +
#    $(DEFFILE), +
#    $(RESFILES)
#!!


!!INCLUDE $(TOP)\rules\stdRules_nt

#
# additional rules
#

stx.obj: $(TOP)\librun\objbc\stx.obj
        copy $(TOP)\librun\objbc\stx.obj stx.obj

%(APPLICATION)WinRC.res: %(APPLICATION)WinRC.rc %(APPLICATION).ico

main.obj: buildDate.h main.c nt.mak

main.c:        $(TOP)\librun\main.c
        copy $(TOP)\librun\main.c main.c

buildDate.h: genDate.exe
        genDate.exe

genDate.exe:        $(TOP)\librun\genDate.exe
        copy $(TOP)\librun\genDate.exe genDate.exe

librun.dll: $(TOP)\librun\librun.dll
        copy $(TOP)\librun\librun.dll librun.dll

cs3245.dll: $(TOP)\support\win32\borland\cs3245.dll
        copy $(TOP)\support\win32\borland\cs3245.dll cs3245.dll

symbols.stc: $(TOP)\include\symbols.stc
        copy $(TOP)\include\symbols.stc symbols.stc

clean::
        -del genDate.exe
        -del c0x32.dll
        -del c0x32.lib
        -del buildDate.h
        -del $(PROJECT)
        -del install_%(APPLICATION).exe
        -del stx.lib
        -del stx.dll
        -del librun.dll
        -del cs3245.dll
        -del $(REQUIRED_FILES)
        -del main.c
        -del *.log
        -rmdir /S /Q resources
        -rmdir /S /Q objbc

# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
%(STARTUP_CLASS).$(O) %(STARTUP_CLASS).$(H): %(STARTUP_CLASS).st $(STCHDR)  ../../../stx/include/Object.$(H)
genAbbrev:: %(STARTUP_CLASS).st
# ENDMAKEDEPEND --- do not remove this line
'.

        ^ def.

    "Modified: / 17-08-2006 / 20:35:44 / cg"
!

nt_dot_mak_resource_rules
    ^ '

RESOURCEFILES: %(APPLICATION)_RESOURCES stx_RESOURCES stx_STYLES stx_BITMAPS

%(APPLICATION)_RESOURCES: resources\%(MODULE)\%(APPLICATION)\NUL
        copy ..\resources\*.rs resources\%(MODULE)\%(APPLICATION)\*.*

stx_RESOURCES: \
        libbasic_RESOURCES \
        libtool_RESOURCES  \
        libtool2_RESOURCES  \
        libview_RESOURCES  \
        libview2_RESOURCES

stx_STYLES: resources\stx\libview\NUL
        copy $(TOP)\libview\styles\mswindowsXP* resources\stx\libview\*.*
        copy $(TOP)\libview\styles\mswindows*.common resources\stx\libview\*.*

stx_BITMAPS: \
        libwidg_BITMAPS

libwidg_BITMAPS: resources\stx\libwidg\bitmaps\NUL
        copy $(TOP)\libwidg\bitmaps\*.xpm resources\stx\libwidg\bitmaps\*.*

libbasic_RESOURCES: resources\stx\libbasic\NUL
        copy $(TOP)\libbasic\resources\*.rs resources\stx\libbasic\*.*

libtool_RESOURCES: resources\stx\libtool\NUL
        copy $(TOP)\libtool\resources\*.rs resources\stx\libtool\*.*

libtool2_RESOURCES: resources\stx\libtool2\NUL
        copy $(TOP)\libtool2\resources\*.rs resources\stx\libtool2\*.*

libview_RESOURCES: resources\stx\libview\NUL
        copy $(TOP)\libview\resources\*.rs resources\stx\libview\*.*

libview2_RESOURCES: resources\stx\libview2\NUL
        copy $(TOP)\libview2\resources\*.rs resources\stx\libview2\*.*

resources\stx\libbasic\NUL: resources\stx\NUL
        mkdir resources\stx\libbasic

resources\stx\libtool\NUL: resources\stx\NUL
        mkdir resources\stx\libtool

resources\stx\libtool2\NUL: resources\stx\NUL
        mkdir resources\stx\libtool2

resources\stx\libview\NUL: resources\stx\NUL
        mkdir resources\stx\libview

resources\stx\libview2\NUL: resources\stx\NUL
        mkdir resources\stx\libview2

resources\stx\libwidg\bitmaps\NUL: resources\stx\libwidg\NUL
        mkdir resources\stx\libwidg\bitmaps

resources\stx\libwidg\NUL: resources\stx\NUL
        mkdir resources\stx\libwidg

resources\stx\NUL: resources\NUL
        mkdir resources\stx

resources\%(MODULE)\%(APPLICATION)\NUL: resources\%(MODULE)\NUL
        mkdir resources\%(MODULE)\%(APPLICATION)

resources\%(MODULE)\NUL: resources\NUL
        mkdir resources\%(MODULE)

resources\NUL:
        mkdir resources

bitmaps\NUL:
        mkdir bitmaps

doc\NUL:
        mkdir doc

'.
!

preRequisiteLine_nt_dot_mak

^'%(FILE_NAME).dll: $(TOP)\%(MODULE_DIRECTORY)\objbc\%(FILE_NAME).dll
        copy $(TOP)\%(MODULE_DIRECTORY)\objbc\%(FILE_NAME).dll *.*
'
!

subProjectLine_nt_dot_mak

^'%(LIBRARY_NAME).dll: $(TOP)\..\%(PATH_TO_SUB_PROJECT)\objbc\%(LIBRARY_NAME).dll
        copy $(TOP)\..\%(PATH_TO_SUB_PROJECT)\objbc\%(LIBRARY_NAME).dll *.*

$(TOP)\..\%(PATH_TO_SUB_PROJECT)\objbc\%(LIBRARY_NAME).dll:
        cd $(TOP)\..\%(PATH_TO_SUB_PROJECT)
        bmake
        -cd $(TOP)\..\%(PATH_TO_MYPROJECT)
'
! !

!ApplicationDefinition class methodsFor:'mappings'!

modules_dot_stx_mappings
    |d|

    d := Dictionary new.
    d 
        at: #'PREREQUISITE_LIBS' put: [self generatePreRequisiteLibs_modules_dot_stx]; 
        at: #'SUBPROJECT_LIBS' put: [self generateSubProjectLines_modules_dot_stx  ]. 

    ^ d
!

nt_dot_mak_mappings
    |d|

    d := super nt_dot_mak_mappings.
    d 
        at: #'APPLICATION' put: [self applicationName];    
        at: #'STARTUP_CLASS' put: [ self startUpClass];
        at: #'STARTUP_SELECTOR' put: [self startUpSelector];
        at: #'REQUIRED_LIBS' put: [self generateRequiredLibs_nt_dot_mak]; 
        at: #'PREREQUISITES_LIBS' put: [self generatePreRequisiteLines_nt_dot_mak  ];  
        at: #'SUBPROJECTS_LIBS' put: [self generateSubProjectLines_nt_dot_mak  ]. 

    self needResources ifTrue:[
        d 
            at: #'REQUIRED_SUPPORT_DIRS' put: 'RESOURCEFILES'.
        d
            at: #'RESOURCE_RULES' put:( self replaceMappings: d 
                                            in: self nt_dot_mak_resource_rules ).
    ].
    ^ d

    "Modified: / 18-08-2006 / 11:43:50 / cg"
!

preRequisiteLine_nt_dot_mak_mappings: aProjectID 

^Dictionary new
    at: #'FILE_NAME' put: [self packageNameFor: aProjectID ];  
    at: #'MODULE_DIRECTORY' put: [ (PackageId from:aProjectID) directory ];     
    yourself

    "Modified: / 18-08-2006 / 12:19:14 / cg"
!

preRequisiteLine_nt_dot_mak_mappingsForClass:aClass

^Dictionary new
    at: #'FILE_NAME' put: [ aClass classFilename asFilename withoutSuffix baseName ];  
    at: #'MODULE_DIRECTORY' put: [ (PackageId from:aClass package) directory ];     
    yourself

    "Modified: / 18-08-2006 / 12:18:58 / cg"
!

subProjectLine_nt_dot_mak_mappings: aProjectID 
    ^ Dictionary new
        at: #'LIBRARY_NAME' put: [self libraryNameFor: aProjectID ];     
        at: #'PATH_TO_SUB_PROJECT' put: [self msdosPathToPackage: aProjectID from: self package]; 
        at: #'PATH_TO_MYPROJECT' put: [self msdosPathToPackage: self package from: aProjectID]; 
        yourself

    "Modified: / 17-08-2006 / 14:28:24 / cg"
! !

!ApplicationDefinition class methodsFor:'mappings support'!

generatePreRequisiteLibs_modules_dot_stx
    ^ String streamContents:[:s |
        self preRequisites do:[:projectID | 
                (projectID startsWith:'stx:') ifTrue:[
                    s nextPutLine:(self packageNameFor:projectID)
                ] ifFalse:[
                   s nextPutLine:(self libraryNameFor:projectID)
                ]
            ].
            self isGUIApplication ifTrue:[
                self guiClassFileNames do:[:eachFilename |
                    s nextPutLine:(eachFilename asFilename withoutSuffix baseName)
                ].
            ].
        ].

    "
        bosch_dapasx_application generatePreRequisiteLibs_modules_dot_stx
    "

    "Modified: / 17-08-2006 / 21:30:44 / cg"
!

generatePreRequisiteLines_nt_dot_mak         

    ^ String streamContents:[:s |
        self preRequisites do:[:eachPackage |
            |mappings newObjectLine|
            mappings := self preRequisiteLine_nt_dot_mak_mappings: eachPackage.
            newObjectLine := self replaceMappings: mappings
                                in: self preRequisiteLine_nt_dot_mak.
            s nextPutAll:newObjectLine. 
            s cr. 
        ].
        self guiClasses do:[:eachClass |
            |mappings newObjectLine|
            mappings := self preRequisiteLine_nt_dot_mak_mappingsForClass: eachClass.
            newObjectLine := self replaceMappings: mappings
                                in: self preRequisiteLine_nt_dot_mak.
            s nextPutAll:newObjectLine. 
            s cr. 
        ].

    ]
"
    bosch_dapasx_Application generatePreRequisiteLines_make_dot_spec 

"

    "Created: / 09-08-2006 / 11:24:39 / fm"
!

generateRequiredLibs_nt_dot_mak
    |string|

    ^ String streamContents:[:s |
        self preRequisites do:[:projectID | 
            s space; nextPutAll:(self packageNameFor:projectID),'.dll'
        ].

        self isGUIApplication ifTrue:[
            self guiClassFileNames do:[:eachFilename |
                s space; nextPutAll:eachFilename
            ].
        ].
        self subProjects do:[:projectID | 
            s space; nextPutAll:(self libraryNameFor:projectID),'.dll'
        ].
    ].

    "
     bosch_dapasx_application generateRequiredLibs_nt_dot_mak
    "

    "Modified: / 17-08-2006 / 21:33:31 / cg"
!

generateSubProjectLines_modules_dot_stx
    |string|

    string := String streamContents:[:s |
            self subProjects do:[:projectID | 
                    (projectID startsWith:'stx:') ifTrue:[
                        "temporary kludge"
                        s nextPutLine:(self packageNameFor:projectID)
                    ] ifFalse:[
                        s nextPutLine:(self libraryNameFor:projectID)
                    ]
                ].
            ].

    ^ string

    "
        bosch_dapasx_application generateSubProjectLines_modules_dot_stx
    "

    "Modified: / 17-08-2006 / 17:22:37 / cg"
!

generateSubProjectLines_nt_dot_mak         

    ^ String streamContents:[:s |
        self subProjects do:[:eachClass |
            |mappings newObjectLine|
            mappings := self subProjectLine_nt_dot_mak_mappings: eachClass.
            newObjectLine := self replaceMappings: mappings
                                in: self subProjectLine_nt_dot_mak.
            s nextPutAll:newObjectLine. 
            s cr. 
        ]
    ]
"
    bosch_dapasx_application generateSubProjectLinesnt_dot_mak 

"

    "Created: / 09-08-2006 / 11:24:39 / fm"
! !

!ApplicationDefinition class methodsFor:'private'!

searchForPreRequisites
    |includedClasses requiredPackageReasons usedClassReasons reasons allSubProjects|

    requiredPackageReasons := Dictionary new.
    usedClassReasons := Dictionary new.

    includedClasses := Set with:self.
    self subProjects do:[:projectID | 
        includedClasses addAll: (self searchForClassesWithProject: projectID asSymbol)
    ].

self halt.
    includedClasses do:[:cls | 
        cls allSuperclassesDo:[:superClass |    
            (usedClassReasons at: superClass ifAbsentPut:[Set new])
                add: (superClass name, ' - Superclass of ', cls name).
        ]
    ].

self halt.
    includedClasses addAll: (usedClassReasons keys).
    includedClasses 
        do:[:includedClass |
            includedClass methodsDo:[:method | 
                    method usedGlobals 
                            do:[:global | |usedClass|        
                                    usedClass := Smalltalk at: global asSymbol. 
                                    (usedClass notNil and:[usedClass isClass and:[usedClass isNameSpace not]]) 
                                        ifTrue:[
                                                (usedClassReasons at: usedClass ifAbsentPut:[Set new])
                                                    add: (usedClass name, ' - Referenced by ', includedClass name,'>>',method name)
                                        ]
                            ]
            ]
        ].
self halt.

    allSubProjects := self searchForSubProjects.
    "/special kludge case: 
    "/  if I do not have subprojects,
    "/  AND I have siblings,
    "/  AND I am an application
    "/  then select those siblings, which are libraries
    allSubProjects isEmpty ifTrue:[
        self isApplicationDefinition ifTrue:[
            allSubProjects := self searchForSiblingProjects 
                select:[:eachSiblingPackageID |
                    |cls|

                    cls := self definitionClassForPackage:eachSiblingPackageID createIfAbsent:false.
                    cls notNil and:[cls isLibraryDefinition]
                ].
        ].
    ].

self halt.
    usedClassReasons 
        keysAndValuesDo:[:usedClass :reasonsPerClass |           
                (allSubProjects includes: usedClass package asString)
                        ifFalse:[
                                usedClass package == Project noProjectID 
                                        ifFalse:[(requiredPackageReasons at:usedClass package ifAbsentPut:[Set new])
                                                    addAll:reasonsPerClass.] 
                        ].
        ].

    Transcript showCR:requiredPackageReasons.
    ^requiredPackageReasons

    "
     self searchForPreRequisites
     bosch_dapasx_Application searchForPreRequisites
     cg_testproject1 searchForPreRequisites
    "

    "Created: / 07-08-2006 / 20:42:39 / fm"
    "Modified: / 07-08-2006 / 21:56:25 / fm"
    "Modified: / 23-08-2006 / 15:38:27 / cg"
! !

!ApplicationDefinition class methodsFor:'testing'!

isApplicationDefinition
    ^ self ~~ ApplicationDefinition

    "Created: / 23-08-2006 / 15:17:38 / cg"
!

isProjectDefinition
    ^ self ~~ ApplicationDefinition

    "Created: / 17-08-2006 / 14:11:56 / cg"
! !

!ApplicationDefinition class methodsFor:'update description'!

forEachMethodsCodeToCompileDo:aTwoArgBlock
    super forEachMethodsCodeToCompileDo:aTwoArgBlock.

    aTwoArgBlock 
        value:self subProjects_code
        value:'description'.

    aTwoArgBlock 
        value:self preRequisites_code
        value:'description'.

    "Created: / 10-08-2006 / 16:35:47 / cg"
    "Modified: / 18-08-2006 / 16:22:57 / cg"
!

preRequisites_code
    |preRequisites|

    preRequisites := self preRequisites asSet.
    preRequisites addAll: self searchForPreRequisites keys.
    preRequisites removeAll: self excludedFromPreRequisites.

    ^ String streamContents:[:s |
        s nextPutLine:'preRequisites'.
        s nextPutLine:'    ^ #('.
        preRequisites do:[:eachPackageID |    
            s nextPutLine:eachPackageID asString storeString
        ].      
        s nextPutLine:')'
    ].

"
    bosch_dapasx_Application preRequisites_code
"

    "Modified: / 08-08-2006 / 19:24:34 / fm"
    "Created: / 17-08-2006 / 21:28:09 / cg"
!

subProjects_code        
    |subProjects|

    subProjects := self searchForSubProjects.
    subProjects removeAll: self excludedFromSubProjects.

    ^ String streamContents:[:s |
        s nextPutLine:'subProjects'.
        s nextPutLine:'    ^ #('.
        subProjects do:[:eachPackageID |    
            s nextPutLine:eachPackageID asString storeString
        ].      
        s nextPutLine:')'
    ].

    "
     bosch_dapasx subProjectsGeneratedString
     stx_goodies subProjectsGeneratedString
    "

    "Modified: / 08-08-2006 / 19:24:34 / fm"
    "Created: / 17-08-2006 / 21:26:51 / cg"
! !

!ApplicationDefinition class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic/ApplicationDefinition.st,v 1.14 2006-08-23 14:43:05 cg Exp $'
! !