diff -r 29435f7970ed -r 49e54dc8ecc0 ProjectDefinition.st --- a/ProjectDefinition.st Thu Sep 21 17:36:24 2006 +0200 +++ b/ProjectDefinition.st Thu Sep 21 17:36:28 2006 +0200 @@ -587,6 +587,264 @@ " ! ! +!ProjectDefinition class methodsFor:'code generation'! + +classNamesAndAttributes_code_ignoreOldDefinition:ignoreOldDefinition + ^ String streamContents:[:s | + s nextPutLine:'classNamesAndAttributes'. + s nextPutLine:' ^ #('. + s tab; nextPutLine:'"/ or ( attributes...)'. + self searchForClasses do:[:eachClass | + |oldSpec attributes oldSpecEntry| + + oldSpec := self classNamesAndAttributes. + + (eachClass isLoaded not or:[eachClass isPrivate not]) ifTrue:[ + oldSpecEntry := oldSpec detect:[:entry | entry first = eachClass name] ifNone:nil. + ignoreOldDefinition ifTrue:[ + "/ take autoload attribute from current state + oldSpecEntry notNil ifTrue:[ + attributes := oldSpecEntry copyFrom:2. + attributes := attributes copyWithout:#autoload. + ] ifFalse:[ + attributes := #() + ]. + eachClass isLoaded ifFalse:[ + attributes isEmpty ifTrue:[ + attributes := attributes , #( autoload ). + ] + ]. + ] ifFalse:[ + "/ keep any existing attribute + oldSpecEntry notNil ifTrue:[ + attributes := oldSpecEntry copyFrom:2. + ] ifFalse:[ + attributes := eachClass isLoaded ifTrue:[ #() ] ifFalse:[ #( autoload ) ]. + ]. + ]. + + s tab. + attributes isEmptyOrNil ifTrue:[ + s nextPutAll:eachClass name asString storeString. + ] ifFalse:[ + s nextPutAll:'('; nextPutAll:eachClass name asString storeString. + attributes do:[:eachAttribute | s nextPutAll:' '. s nextPutAll:eachAttribute storeString.]. + s nextPutAll:')'. + ]. + s cr. + ] + ]. + s nextPutLine:' )' + ]. + +" + stx_libbasic3 classNamesAndAttributes_code +" + + "Modified: / 08-08-2006 / 19:24:34 / fm" + "Created: / 17-08-2006 / 21:03:07 / cg" + "Modified: / 19-09-2006 / 17:14:17 / cg" +! + +companyName_code + ^ String streamContents:[:s | + s nextPutLine:'companyName'. + s nextPutLine:' "Return a companyname which will appear in .rc"'. + s cr; nextPutLine:' ^ ',self companyName storeString. + ]. + + " + self companyName_code + stx_libbasic3 companyName_code + " + + "Created: / 18-08-2006 / 16:20:42 / cg" +! + +compileDescriptionMethods + (self isLibraryDefinition + or:[ self isApplicationDefinition ] ) ifFalse:[ + self error:'I am abstract - must be a subclass of Libray- or ApplicationDefinition.' + ]. + + self + forEachMethodsCodeToCompileDo:[:code :category | + self compile:code categorized:category + ]. + +"/ self instAndClassMethodsDo:[:m | m package:self package]. + + " + DapasXProject compileDescriptionMethods + DapasX_Datenbasis compileDescriptionMethods + bosch_dapasx_interactiver_editor compileDescriptionMethods + stx_libbasic compileDescriptionMethods + " + + "Created: / 09-08-2006 / 18:00:31 / fm" + "Modified: / 05-09-2006 / 13:46:29 / cg" +! + +description_code + ^ String streamContents:[:s | + s nextPutLine:'description'. + s nextPutLine:' "Return a description string which will appear in nt.def / bc.def"'. + s cr; nextPutLine:' ^ ',self description asString storeString. + ]. + + " + self description_code + stx_libbasic3 description_code + " + + "Created: / 17-08-2006 / 21:24:01 / cg" + "Modified: / 18-08-2006 / 16:16:24 / cg" +! + +extensionMethodNames_code + ^ String streamContents:[:s | + s nextPutLine:'extensionMethodNames'. + s nextPutLine:' ^ #('. + self searchForExtensions do:[:eachMethod | + s nextPutAll:eachMethod mclass name storeString. + s nextPutAll:' '. + s nextPutLine: eachMethod selector storeString. + ]. + s nextPutLine:' )' + ]. + +" + self extensionMethodNames_code +" + + "Created: / 17-08-2006 / 21:21:48 / cg" +! + +forEachContentsMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition + aTwoArgBlock + value:(self classNamesAndAttributes_code_ignoreOldDefinition:ignoreOldDefinition) + value:'description - contents'. + + aTwoArgBlock + value: self extensionMethodNames_code + value: 'description - contents'. + + aTwoArgBlock + value: self preRequisites_code + value: 'description'. + + "Created: / 15-09-2006 / 16:47:54 / cg" + "Modified: / 20-09-2006 / 14:58:59 / cg" +! + +forEachMethodsCodeToCompileDo:aTwoArgBlock + self forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:false +! + +forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition + aTwoArgBlock + value:(self classNamesAndAttributes_code_ignoreOldDefinition:ignoreOldDefinition) + value:'description - contents'. + + aTwoArgBlock + value: self extensionMethodNames_code + value: 'description - contents'. + + (self class implements:#description) ifFalse:[ + aTwoArgBlock + value: self description_code + value: 'description - project information'. + ]. + (self class implements:#productName) ifFalse:[ + aTwoArgBlock + value: self productName_code + value: 'description - project information'. + ]. + (self class implements:#companyName) ifFalse:[ + aTwoArgBlock + value: self companyName_code + value: 'description - project information'. + ]. + (self class implements:#legalCopyright) ifFalse:[ + aTwoArgBlock + value: self legalCopyright_code + value: 'description - project information'. + ]. + + "Created: / 18-08-2006 / 16:22:37 / cg" + "Modified: / 30-08-2006 / 19:04:11 / cg" +! + +legalCopyright_code + ^ String streamContents:[:s | + s nextPutLine:'legalCopyright'. + s nextPutLine:' "Return a copyright string which will appear in .rc"'. + s cr; nextPutLine:' ^ ',self legalCopyright storeString. + ]. + + " + self legalCopyright_code + stx_libbasic3 legalCopyright_code + " + + "Created: / 18-08-2006 / 16:21:01 / cg" +! + +preRequisites_code + |preRequisites| + + preRequisites := self preRequisites asSet. + preRequisites addAll: self searchForPreRequisites keys. + + self isApplicationDefinition ifTrue:[ + preRequisites add:'stx:libcomp'. + self isGUIApplication ifTrue:[ + preRequisites add:'stx:libbasic2'. + preRequisites add:'stx:libview'. + preRequisites add:'stx:libview2'. + preRequisites add:'stx:libwidg'. + preRequisites add:'stx:libwidg2'. + preRequisites add:'stx:libui'. + ]. + ]. + + preRequisites removeAll: self excludedFromPreRequisites. + preRequisites remove:self package. + + ^ String streamContents:[:s | + s nextPutLine:'preRequisites'. + s nextPutLine:' ^ #('. + preRequisites asSortedCollection do:[:eachPackageID | + s nextPutLine:eachPackageID asString storeString + ]. + s nextPutLine:')' + ]. + + " + bosch_dapasx_application preRequisites_code + demo_demoApp1 preRequisites_code + " + + "Modified: / 08-08-2006 / 19:24:34 / fm" + "Created: / 17-08-2006 / 21:28:09 / cg" + "Modified: / 21-09-2006 / 17:37:28 / cg" +! + +productName_code + ^ String streamContents:[:s | + s nextPutLine:'productName'. + s nextPutLine:' "Return a product name which will appear in .rc"'. + s cr; nextPutLine:' ^ ',self productName storeString. + ]. + + " + self productName_code + stx_libbasic3 productName_code + " + + "Created: / 18-08-2006 / 16:14:19 / cg" +! ! + !ProjectDefinition class methodsFor:'defaults'! applicationTypes @@ -2903,265 +3161,10 @@ "Modified: / 23-08-2006 / 14:24:38 / cg" ! ! -!ProjectDefinition class methodsFor:'update description'! - -classNamesAndAttributes_code_ignoreOldDefinition:ignoreOldDefinition - ^ String streamContents:[:s | - s nextPutLine:'classNamesAndAttributes'. - s nextPutLine:' ^ #('. - s tab; nextPutLine:'"/ or ( attributes...)'. - self searchForClasses do:[:eachClass | - |oldSpec attributes oldSpecEntry| - - oldSpec := self classNamesAndAttributes. - - (eachClass isLoaded not or:[eachClass isPrivate not]) ifTrue:[ - oldSpecEntry := oldSpec detect:[:entry | entry first = eachClass name] ifNone:nil. - ignoreOldDefinition ifTrue:[ - "/ take autoload attribute from current state - oldSpecEntry notNil ifTrue:[ - attributes := oldSpecEntry copyFrom:2. - attributes := attributes copyWithout:#autoload. - ] ifFalse:[ - attributes := #() - ]. - eachClass isLoaded ifFalse:[ - attributes isEmpty ifTrue:[ - attributes := attributes , #( autoload ). - ] - ]. - ] ifFalse:[ - "/ keep any existing attribute - oldSpecEntry notNil ifTrue:[ - attributes := oldSpecEntry copyFrom:2. - ] ifFalse:[ - attributes := eachClass isLoaded ifTrue:[ #() ] ifFalse:[ #( autoload ) ]. - ]. - ]. - - s tab. - attributes isEmptyOrNil ifTrue:[ - s nextPutAll:eachClass name asString storeString. - ] ifFalse:[ - s nextPutAll:'('; nextPutAll:eachClass name asString storeString. - attributes do:[:eachAttribute | s nextPutAll:' '. s nextPutAll:eachAttribute storeString.]. - s nextPutAll:')'. - ]. - s cr. - ] - ]. - s nextPutLine:' )' - ]. - -" - stx_libbasic3 classNamesAndAttributes_code -" - - "Modified: / 08-08-2006 / 19:24:34 / fm" - "Created: / 17-08-2006 / 21:03:07 / cg" - "Modified: / 19-09-2006 / 17:14:17 / cg" -! - -companyName_code - ^ String streamContents:[:s | - s nextPutLine:'companyName'. - s nextPutLine:' "Return a companyname which will appear in .rc"'. - s cr; nextPutLine:' ^ ',self companyName storeString. - ]. - - " - self companyName_code - stx_libbasic3 companyName_code - " - - "Created: / 18-08-2006 / 16:20:42 / cg" -! - -compileDescriptionMethods - (self isLibraryDefinition - or:[ self isApplicationDefinition ] ) ifFalse:[ - self error:'I am abstract - must be a subclass of Libray- or ApplicationDefinition.' - ]. - - self - forEachMethodsCodeToCompileDo:[:code :category | - self compile:code categorized:category - ]. - -"/ self instAndClassMethodsDo:[:m | m package:self package]. - - " - DapasXProject compileDescriptionMethods - DapasX_Datenbasis compileDescriptionMethods - bosch_dapasx_interactiver_editor compileDescriptionMethods - stx_libbasic compileDescriptionMethods - " - - "Created: / 09-08-2006 / 18:00:31 / fm" - "Modified: / 05-09-2006 / 13:46:29 / cg" -! - -description_code - ^ String streamContents:[:s | - s nextPutLine:'description'. - s nextPutLine:' "Return a description string which will appear in nt.def / bc.def"'. - s cr; nextPutLine:' ^ ',self description asString storeString. - ]. - - " - self description_code - stx_libbasic3 description_code - " - - "Created: / 17-08-2006 / 21:24:01 / cg" - "Modified: / 18-08-2006 / 16:16:24 / cg" -! - -extensionMethodNames_code - ^ String streamContents:[:s | - s nextPutLine:'extensionMethodNames'. - s nextPutLine:' ^ #('. - self searchForExtensions do:[:eachMethod | - s nextPutAll:eachMethod mclass name storeString. - s nextPutAll:' '. - s nextPutLine: eachMethod selector storeString. - ]. - s nextPutLine:' )' - ]. - -" - self extensionMethodNames_code -" - - "Created: / 17-08-2006 / 21:21:48 / cg" -! - -forEachContentsMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition - aTwoArgBlock - value:(self classNamesAndAttributes_code_ignoreOldDefinition:ignoreOldDefinition) - value:'description - contents'. - - aTwoArgBlock - value: self extensionMethodNames_code - value: 'description - contents'. - - aTwoArgBlock - value: self preRequisites_code - value: 'description'. - - "Created: / 15-09-2006 / 16:47:54 / cg" - "Modified: / 20-09-2006 / 14:58:59 / cg" -! - -forEachMethodsCodeToCompileDo:aTwoArgBlock - self forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:false -! - -forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition - aTwoArgBlock - value:(self classNamesAndAttributes_code_ignoreOldDefinition:ignoreOldDefinition) - value:'description - contents'. - - aTwoArgBlock - value: self extensionMethodNames_code - value: 'description - contents'. - - (self class implements:#description) ifFalse:[ - aTwoArgBlock - value: self description_code - value: 'description - project information'. - ]. - (self class implements:#productName) ifFalse:[ - aTwoArgBlock - value: self productName_code - value: 'description - project information'. - ]. - (self class implements:#companyName) ifFalse:[ - aTwoArgBlock - value: self companyName_code - value: 'description - project information'. - ]. - (self class implements:#legalCopyright) ifFalse:[ - aTwoArgBlock - value: self legalCopyright_code - value: 'description - project information'. - ]. - - "Created: / 18-08-2006 / 16:22:37 / cg" - "Modified: / 30-08-2006 / 19:04:11 / cg" -! - -legalCopyright_code - ^ String streamContents:[:s | - s nextPutLine:'legalCopyright'. - s nextPutLine:' "Return a copyright string which will appear in .rc"'. - s cr; nextPutLine:' ^ ',self legalCopyright storeString. - ]. - - " - self legalCopyright_code - stx_libbasic3 legalCopyright_code - " - - "Created: / 18-08-2006 / 16:21:01 / cg" -! - -preRequisites_code - |preRequisites| - - preRequisites := self preRequisites asSet. - preRequisites addAll: self searchForPreRequisites keys. - - preRequisites add:'stx:libcomp'. - self isGUIApplication ifTrue:[ - preRequisites add:'stx:libbasic2'. - preRequisites add:'stx:libview'. - preRequisites add:'stx:libview2'. - preRequisites add:'stx:libwidg'. - preRequisites add:'stx:libwidg2'. - preRequisites add:'stx:libui'. - ]. - - 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 - demo_demoApp1 preRequisites_code - " - - "Modified: / 08-08-2006 / 19:24:34 / fm" - "Created: / 17-08-2006 / 21:28:09 / cg" - "Modified: / 20-09-2006 / 18:21:00 / cg" -! - -productName_code - ^ String streamContents:[:s | - s nextPutLine:'productName'. - s nextPutLine:' "Return a product name which will appear in .rc"'. - s cr; nextPutLine:' ^ ',self productName storeString. - ]. - - " - self productName_code - stx_libbasic3 productName_code - " - - "Created: / 18-08-2006 / 16:14:19 / cg" -! ! - !ProjectDefinition class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.78 2006-09-21 15:36:22 stefan Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.79 2006-09-21 15:36:28 cg Exp $' ! ! ProjectDefinition initialize!