[ANN] Metacello - 0.6 alpha is ready for the brave amongst you

0 views
Skip to first unread message

Dale Henrichs

unread,
Jun 15, 2009, 8:21:41 PM6/15/09
to montice...@googlegroups.com
To load Metacello 0.6:

1. unload Metacello package, if you've got Metacello-dkh.148 or older in your
image. I did some major repackaging/refactoring and since I'm moving away
from the Metacello-dkh.xxx package, you can expect the usual problems unless
you unload the package first.
2. load Metacello-All-dkh.4 from http://seaside.gemstone.com/ss/metacello. This
will load the following packages versions:

Metacello-Core-dkh.187.mcz,
Metacello-MC-dkh.45.mcz,
Metacello-Samples-dkh.35.mcz,
Metacello-Tests-dkh.195.mcz,
Metacello-MetacelloProject-dkh.36.mcz,
Metacello-SampleTests-dkh.6.mcz

3. To get the absolute latest code, execute the following expression in a
workspace:

MetacelloMetacelloProject updateProject.
MetacelloMetacelloProject load: '0.6'.

4. delete the Metacello-All package, it is convenient to bootstrap Metacello
using the package, but isn't needed once you've got Metacello installed.
Doing an #updateProject and #load: serves the same purpose as reloading
Metacello-All.

If you look at the class MetacelloMetacelloProject you will see that there is a later version (.07) defined, but that is my working version and I will continuing development there. Once you've got 0.6 loaded, you shouldn't have to monkey with the Metacello project code (I'll talk about how bug fixes will be distributed later on).

If you have problems or bugs to report let me know - Metacello has been tested on Pharo, Squeak and GemStone (the GemStone version requires some system bugfixes, so let me know if you plan to play with Metacello on GemStone).

Since last Friday I've been using Metacello to manage Metacello. You've already seen the loading commands: #updateProject and #load:, but once you've got version 0.6 loaded you _could_ use the following expression to track my work as I make progress on version 0.7:

MetacelloMetacelloProject updateProject
ifTrue: [ MetacelloMetacelloProject load: '0.7' ].

That's the expression I use to update Metacello to the latest development version when working in the various Squeak/Pharo/GemStone images. #updateProject loads the latest version of the Metacello-MetacelloProject package from the repository. #updateProject returns true if a newer version was laoded. #load: loads the packages for version 0.7 into the image.

When I'm working on Metacello itself, I use the following expression to save my work:

MetacelloMetacelloProject savePackages
ifTrue: [
(MetacelloMetacelloProject updatePackageMethodsFor: '0.7')
ifTrue: [ MetacelloMetacelloProject saveProject ]].

#savePackages commits all of the dirty packages in the Metacello project and returns true if any packages were committed. #updatePackageMethodsFor: updates the package methods with the new package versions from #savePackages and returns true if new versions of the methods were created (i.e., changes in package versions were detected). #saveProject commits the Metacello-MetacelloProject package. You should follow the #projects:attribute: #version:attribute: pragma pattern in MetacelloMetacelloProject to make it possible to use #updatePackageMethodsFor:.

This list of commands basically represents the full extent of commands that are currently tested/supported. There are more commands that are functioning, but I haven't thoroughly tested them on live packages. The bulk of testing is done with a 'recording' loader that doesn't actually load packages. It records information about the load request, like packages listed in load order and repositories used...But the small set of commands I've touched on are pretty useful.

MetacelloMetacelloProject is a good place to look for examples, since I've been living with it for a few days. There's no conditional code, no groups, just versions and packages. There is an example of the use of the #baseline attribute. I'll cover #baseline attributes in a follow on message.

MondrianSampleMetacelloProject is a good example of the use of the required project 'OmniBrowser'. When you look at #require0214Baseline, you'll see that there is a versionString '0.2' and the operator #'>='. The whole required specification is interpreted as:

1. If the class named 'OBSampleMetacelloProject' does not exist in the image,
load the latest version of the 'Metacello-Samples' package from the
'http://seaside.gemstone.com/ss/metacello' repository.
2. If there the loaded version of OBSampleMetacelloProject is greater than or
equal to '0.2', nothing else need be done.
3. If the loaded version is 'indeterminent' (i.e., doesn't match exactly any of
the versions defined for OBSampleMetacelloProject), then compare the version
for each of the packages in version '0.2' to the currently loaded package
versions. If all of the currently loaded package versions are greater than or
equal to the package version defined in version '0.2', then nothing else need
be done.
4. If we've gotten this far, the 'OB-Standard' package (and all of it's required
packages) are loaded using the package versions in version '0.2' of
OBSampleMetacelloProject.

WA29SampleMetacelloProject has groups, packages, conditional packages, conditional versions and baselines. I have loaded 2.9.0-alpha2 in a Squeak3.10-7159-basic image.

2.9.0-alpha3 has been loaded into a Squeak3.10 image and pharo.1-10332dev09.06.2.

2.9.0-alpha4 has been loaded into Squeak, Pharo and a GLASS.230-dkh.186 image.

The packages all load without initialization or load errors. If you were to do development with version 2.9.0-alpha4, you'd use the following expressions (just like the Metacello project expressions):

WA29SampleMetacelloProject updateProject
ifTrue: [ WA29SampleMetacelloProject load: '2.9.0-alpha4' ].

WA29SampleMetacelloProject savePackages
ifTrue: [
(WA29SampleMetacelloProject updatePackageMethodsFor: '2.9.0-alpha4')
ifTrue: [ WA29SampleMetacelloProject saveProject ]].

I've used these expression in Squeak. Around noon today I loaded the original version of 2.9.0-alpha4 and then manually loaded the latest versions of all of the packages into my image using a Monticello Browserand then used #updatePackageMethodsFor to update the package versions in the #packages290a4* methods and then saved the Sample package.

I expect the LOAD related commands to pretty much work as expected. UNLOAD and UPDATE need to be implemented still. I also have work to do with blessings, version comparison/required projects and integrating any feedback I get from the alpha.

This is really the first alpha, so don't bet the house on the current implementation. I plan on doing some internal refactoring, but I don't anticipate making significant changes to the API, unless I hear differently from users of the alpha.

I am definitely willing to help folks get started on defining and maintaining their own Metacello projects - it'll help understand your usage patterns and requirements better. I do plan on doing more documentation for Metacello (I plan a follow on post with a few of the basics within the next day or so), but I will probably time the docs with the beta release.

If and when we find bugs, I plan on fixing them on a branch like 0.6.1, etc. while I continue development on 0.7 and you'll load the bugfix using the following expression:

MetacelloMetacelloProject updateProject
ifTrue: [ MetacelloMetacelloProject load: '0.6.1' ].

Let me know what you think when you've had a chance to look at (and play with) the sample projects.

Dale

Reply all
Reply to author
Forward
0 new messages