--- a/ProjectDefinition.st Thu Sep 19 10:18:18 2013 +0100
+++ b/ProjectDefinition.st Fri Sep 27 23:47:30 2013 +0100
@@ -714,11 +714,13 @@
"
!
-projectIsLoaded:something
- projectIsLoaded := something.
- something ifTrue:[
+projectIsLoaded:aBoolean
+ projectIsLoaded := aBoolean.
+ aBoolean ifTrue:[
"register myself as dependent - I want to get notified on method changes"
self class addDependent:self.
+ self postLoadAction.
+ self executeHooks: #postLoad.
].
!
@@ -926,21 +928,18 @@
This is used by the systembrowser to pass in a CodeGeneratorTool with undo support.
If nil is passed in, the recurlar compiler is used (no undo support)"
- |oldSpec newSpec newCode extensionMethods idx|
+ |oldSpec newSpec newCode idx|
oldSpec := self extensionMethodNames.
- newSpec := oldSpec copy.
- extensionMethods := self extensionMethods.
-
- idx := (1 to:newSpec size-1 by:2)
+
+ idx := (1 to:oldSpec size-1 by:2)
detect:[:i |
- ((newSpec at:i) = className)
- and:[ (newSpec at:i+1) = selector ]]
- ifNone:nil.
- idx isNil ifTrue:[ ^ self ].
+ ((oldSpec at:i) = className)
+ and:[ (oldSpec at:i+1) = selector ]]
+ ifNone:[ ^ self ].
"/ attention: there are two spec-elements per method
- newSpec := newSpec removeFromIndex:idx toIndex:idx+1.
+ newSpec := oldSpec copyWithoutIndex:idx toIndex:idx+1.
newCode := self extensionMethodNames_code_For:newSpec.
self compile:newCode categorized:'description - contents' using:compilerOrNil
@@ -1195,9 +1194,11 @@
!
initializeAllProjectDefinitions
- "needs everything else (especially the compiler etc.) to be initialized.
- Therefore, its not invoked by #initialize, but instead explicitely,
- by Smalltalk"
+ "tells all already loaded project definition classes that it is loaded
+ (i.e. calls postLoadAction).
+ This needs everything else (especially the compiler etc.) to be initialized.
+ Therefore, it's not invoked by the projDef's #initialize,
+ but instead explicitely, by Smalltalk as a late step in the startup."
|isStandAloneApp|
@@ -5066,8 +5067,6 @@
"/ mhmh - already done for dll-loaded packages
"/ meOrMySecondIncarnation initializeAllClasses.
- meOrMySecondIncarnation postLoadAction.
- meOrMySecondIncarnation executeHooks: #postLoad.
meOrMySecondIncarnation projectIsLoaded:true.
meOrMySecondIncarnation ~~ self ifTrue:[
@@ -5914,9 +5913,9 @@
"
!
-executeHooks: hook
- "Execute all hooks annotate by given symbol. Currently supported
- hooks are: #preLoad, #postLoad, #preUnload."
+executeHooks: hookSymbol
+ "Execute all hooks annotated by the given hook-symbol.
+ Currently supported hooks are: #preLoad, #postLoad, #preUnload."
| cls |
@@ -5924,11 +5923,11 @@
[ cls notNil ] whileTrue:[
cls class selectorsAndMethodsDo:[:selector :method|
- (method annotationAt: hook) notNil ifTrue:[
+ (method annotationAt: hookSymbol) notNil ifTrue:[
method numArgs == 0 ifTrue:[
self perform: selector
] ifFalse:[
- self error:'Hook for %1 must have no arguments' mayProceed: true.
+ self error:'Hook for %1 may not have arguments' mayProceed: true.
]
]
].
@@ -7530,11 +7529,11 @@
!ProjectDefinition class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.482 2013-08-07 09:53:31 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.485 2013-09-23 08:20:42 stefan Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.482 2013-08-07 09:53:31 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.485 2013-09-23 08:20:42 stefan Exp $'
!
version_HG