ProjectDefinition.st
changeset 13614 5606bfa8cbec
parent 13610 ec7ea708ebd2
child 13623 46625f58d8ee
equal deleted inserted replaced
13613:f3c2a2ac07a1 13614:5606bfa8cbec
  4442      Answer true, if new classes have been installed for this package,
  4442      Answer true, if new classes have been installed for this package,
  4443      false if the package's classes have been already present."
  4443      false if the package's classes have been already present."
  4444 
  4444 
  4445     |newStuffHasBeenLoaded meOrMySecondIncarnation|
  4445     |newStuffHasBeenLoaded meOrMySecondIncarnation|
  4446 
  4446 
  4447     self projectIsLoaded ifTrue:[^ false].
  4447     self projectIsLoaded ifTrue:[
       
  4448         asAutoloaded ifFalse:[
       
  4449             "/ to be considered !!
       
  4450 "/            self isFullyLoaded ifFalse:[
       
  4451 "/                self hasAllExtensionsLoaded ifFalse:[
       
  4452 "/                    self loadExtensions.
       
  4453 "/                ].
       
  4454 "/                self loadAllAutoloadedClasses
       
  4455 "/            ].
       
  4456         ].
       
  4457         ^ false
       
  4458     ].
  4448     thisContext isRecursive ifTrue:[self breakPoint:#cg. ^ false].    "/ avoid endless loops
  4459     thisContext isRecursive ifTrue:[self breakPoint:#cg. ^ false].    "/ avoid endless loops
  4449 
  4460 
  4450     newStuffHasBeenLoaded := false.
  4461     newStuffHasBeenLoaded := false.
  4451 
  4462 
  4452     (self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[
  4463     (self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[
  4453 	"/ thisContext fullPrintAll.
  4464         "/ thisContext fullPrintAll.
  4454 	Transcript showCR:('loading %1%2...'
  4465         Transcript showCR:('loading %1%2...'
  4455 			    bindWith:(asAutoloaded ifTrue:['as autoloaded '] ifFalse:[''])
  4466                             bindWith:(asAutoloaded ifTrue:['as autoloaded '] ifFalse:[''])
  4456 			    with:self name).
  4467                             with:self name).
  4457     ].
  4468     ].
  4458 
  4469 
  4459     self rememberOverwrittenExtensionMethods.
  4470     self rememberOverwrittenExtensionMethods.
  4460 
  4471 
  4461     self activityNotification:'Executing pre-load action'.
  4472     self activityNotification:'Executing pre-load action'.
  4462     self preLoadAction.
  4473     self preLoadAction.
  4463 
  4474 
  4464     meOrMySecondIncarnation := self.
  4475     meOrMySecondIncarnation := self.
  4465 
  4476 
  4466     Class withoutUpdatingChangesDo:[
  4477     Class withoutUpdatingChangesDo:[
  4467 	self activityNotification:'Loading prerequisities'.
  4478         self activityNotification:'Loading prerequisities'.
  4468 	self loadPreRequisitesAsAutoloaded:asAutoloaded.
  4479         self loadPreRequisitesAsAutoloaded:asAutoloaded.
  4469 
  4480 
  4470 	self checkPrerequisitesForLoading.
  4481         self checkPrerequisitesForLoading.
  4471 
  4482 
  4472 	asAutoloaded ifFalse:[
  4483         asAutoloaded ifFalse:[
  4473 	    self loadClassLibrary.
  4484             self loadClassLibrary.
  4474 	    "/ could have overloaded my first incarnation
  4485             "/ could have overloaded my first incarnation
  4475 	    meOrMySecondIncarnation := (Smalltalk at:(self name)) ? self.
  4486             meOrMySecondIncarnation := (Smalltalk at:(self name)) ? self.
  4476 	    meOrMySecondIncarnation ~~ self ifTrue:[
  4487             meOrMySecondIncarnation ~~ self ifTrue:[
  4477 		meOrMySecondIncarnation fetchSlotsFrom:self.
  4488                 meOrMySecondIncarnation fetchSlotsFrom:self.
  4478 	    ].
  4489             ].
  4479 	].
  4490         ].
  4480 
  4491 
  4481 	self activityNotification:'Loading extensions'.
  4492         self activityNotification:'Loading extensions'.
  4482 	newStuffHasBeenLoaded := newStuffHasBeenLoaded | meOrMySecondIncarnation loadExtensions.
  4493         newStuffHasBeenLoaded := newStuffHasBeenLoaded | meOrMySecondIncarnation loadExtensions.
  4483 	self activityNotification:'Loading classes'.
  4494         self activityNotification:'Loading classes'.
  4484 	newStuffHasBeenLoaded := newStuffHasBeenLoaded | (meOrMySecondIncarnation loadAllClassesAsAutoloaded:asAutoloaded).
  4495         newStuffHasBeenLoaded := newStuffHasBeenLoaded | (meOrMySecondIncarnation loadAllClassesAsAutoloaded:asAutoloaded).
  4485 "/ no, don't load subProjects here - will lead to a recursion, which leads
  4496 "/ no, don't load subProjects here - will lead to a recursion, which leads
  4486 "/ to some classes being loaded from source (soap)
  4497 "/ to some classes being loaded from source (soap)
  4487 	self activityNotification:'Loading sub projects'.
  4498         self activityNotification:'Loading sub projects'.
  4488 	meOrMySecondIncarnation loadSubProjectsAsAutoloaded:asAutoloaded.
  4499         meOrMySecondIncarnation loadSubProjectsAsAutoloaded:asAutoloaded.
  4489     ].
  4500     ].
  4490     self activityNotification:('Executing post-load action for %1' bindWith:self package).
  4501     self activityNotification:('Executing post-load action for %1' bindWith:self package).
  4491 
  4502 
  4492     "/ mhmh - already done for dll-loaded packages
  4503     "/ mhmh - already done for dll-loaded packages
  4493     "/ meOrMySecondIncarnation initializeAllClasses.
  4504     "/ meOrMySecondIncarnation initializeAllClasses.
  4494     meOrMySecondIncarnation postLoadAction.
  4505     meOrMySecondIncarnation postLoadAction.
  4495 
  4506 
  4496     meOrMySecondIncarnation projectIsLoaded:true.
  4507     meOrMySecondIncarnation projectIsLoaded:true.
  4497     meOrMySecondIncarnation ~~ self ifTrue:[
  4508     meOrMySecondIncarnation ~~ self ifTrue:[
  4498 	self projectIsLoaded:true.
  4509         self projectIsLoaded:true.
  4499     ].
  4510     ].
  4500 
  4511 
  4501     self activityNotification:('Done (%1).' bindWith:self package).
  4512     self activityNotification:('Done (%1).' bindWith:self package).
  4502     ^ newStuffHasBeenLoaded
  4513     ^ newStuffHasBeenLoaded
  4503 
  4514 
  4504     "Created: / 17-08-2006 / 01:01:41 / cg"
  4515     "Created: / 17-08-2006 / 01:01:41 / cg"
  4505     "Modified: / 30-10-2008 / 08:16:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
  4516     "Modified: / 30-10-2008 / 08:16:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
  4506     "Modified: / 22-08-2009 / 12:02:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  4517     "Modified: / 22-08-2009 / 12:02:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  4507     "Modified: / 29-12-2010 / 10:09:34 / cg"
  4518     "Modified: / 21-08-2011 / 17:28:49 / cg"
  4508 !
  4519 !
  4509 
  4520 
  4510 unloadPackage
  4521 unloadPackage
  4511     "unload the project.
  4522     "unload the project.
  4512      Fails if there are still instances of any of my classes in the system"
  4523      Fails if there are still instances of any of my classes in the system"
  5300 
  5311 
  5301     safeForOverwrittenMethods := myFirstIncarnation safeForOverwrittenMethods.
  5312     safeForOverwrittenMethods := myFirstIncarnation safeForOverwrittenMethods.
  5302     extensionOverwriteInfo := myFirstIncarnation extensionOverwriteInfo.
  5313     extensionOverwriteInfo := myFirstIncarnation extensionOverwriteInfo.
  5303 !
  5314 !
  5304 
  5315 
       
  5316 loadAllAutoloadedClasses
       
  5317     self allClasses do:[:cls | cls autoload]
       
  5318 
       
  5319     "Created: / 21-08-2011 / 17:24:13 / cg"
       
  5320 !
       
  5321 
  5305 loadAllClassesAsAutoloaded:asAutoloaded
  5322 loadAllClassesAsAutoloaded:asAutoloaded
  5306     "load (fileIn) classes that should be present -
  5323     "load (fileIn) classes that should be present -
  5307      install as autoloaded classes marked to be autoloaded.
  5324      install as autoloaded classes marked to be autoloaded.
  5308      If asAutoloaded == true, all classes will be installed as autoloaded, even if not marked.
  5325      If asAutoloaded == true, all classes will be installed as autoloaded, even if not marked.
  5309 
  5326 
  6370 ! !
  6387 ! !
  6371 
  6388 
  6372 !ProjectDefinition class methodsFor:'documentation'!
  6389 !ProjectDefinition class methodsFor:'documentation'!
  6373 
  6390 
  6374 version
  6391 version
  6375     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.345 2011-08-20 21:33:53 cg Exp $'
  6392     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.346 2011-08-21 15:29:06 cg Exp $'
  6376 !
  6393 !
  6377 
  6394 
  6378 version_CVS
  6395 version_CVS
  6379     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.345 2011-08-20 21:33:53 cg Exp $'
  6396     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.346 2011-08-21 15:29:06 cg Exp $'
  6380 !
  6397 !
  6381 
  6398 
  6382 version_SVN
  6399 version_SVN
  6383     ^ '§ Id: ProjectDefinition.st 10645 2011-06-09 15:28:45Z vranyj1  §'
  6400     ^ '§ Id: ProjectDefinition.st 10645 2011-06-09 15:28:45Z vranyj1  §'
  6384 ! !
  6401 ! !