Hi guys
I finished to find a stupid bug today. Now the moose reloader works.
The idea is that you can freeze a complete Moose tools and be able to take a 1.4 image and
reload all the packages
that were loaded when you snapshot it.
I could reload the latest version of Moose in a 1.4 image.
I published the result on ConfigurationOfMoose.
Gofer new
url: 'http://smalltalkhub.com/mc/StephaneDucasse/MooseReloader/main'
username: ''
password: '';
package: 'ReloaderForMoose';
load
Here is the comment of this class.
I'm a kind of saver/loader that knows how to save and load list of packages by
recursively navigating metacello configurationOf. To work I need a metacello record and a
place to save package version.
Here are examples to create a spec of packages to be saved.
===========================================
In an image containing the loaded configuration of the tools you want to version execute
the following:
Reloader new
configurationRecordInput: (((Smalltalk globals at: #ConfigurationOfMoose) project
version: 'default') ignoreImage: true; record) ;
repositoryClass: MooseConfigurationRepositoryForPharo14;
publishNewVersion
Reloader new
configurationRecordInput: (((Smalltalk globals at: #ConfigurationOfMoose) project
version: 'default') ignoreImage: true; record) ;
repositoryClass: ConfigurationOfMoose;
publishNewVersion
It will produce a method called scriptXxx in the repositoryClass you specify.
Here is an example of such method.
script5
^ #(
#('ConfigurationOfFame-StephaneDucasse.6.mcz'
'http://www.squeaksource.com/Fame/' 'ConfigurationOfFame' )
#('ConfigurationOfMooseAlgos-TudorGirba.28.mcz'
'http://www.squeaksource.com/MooseAlgos/' 'ConfigurationOfMooseAlgos' )
......
)
You can then use this method as follows, for example in a ConfigurationOf you can
flatVersion47: spec
<version: '4.7-flat'>
spec for: #common do: [
self populateSpec: spec with: self script5 ]
Note that the populateSpec: with: is generated when necessary.
Reloading.
===================================
In another image you can reload the configuration in two different ways:
either by using metacello or by using the reloader.
Using metacello is simple if you created a method similar to
flatVersion47: spec
<version: '4.7-flat'>
spec for: #common do: [
self populateSpec: spec with: self script5 ]
just execute
(ConfigurationOfMoose project version: '4.7-flat') load
If you do not use a configurationOf you can simply invoke the method reload: with the
number of the script
using the method
reload: aNumber
and it will load all the packages you previously specified.
reloadLatest
will load the latest script version
Typical use cases are:
------------------------------------
Reloader new
repositoryClass: MooseConfigurationRepositoryForPharo14;
reload: 2
Reloader new
repositoryClass: SynectiqueCaseOneConfigurationRepository;
publishNewVersion
Reloader new
repositoryClass: SynectiqueCaseOneConfigurationRepository;
loginSpecification: {{ '*squeaksource*' . 'sd' . 'xyxyx'} . {
'*ss3*' . 'StephaneDucasse' . 'xxxx'} . { '*' . ''
. ''}};
reload: 2
===================================================
Implementation Notes.
First version fully working on metacello records.
Let me know if it works for you.
Stef