[squeak-dev] Sake/Packages

Keith Hodges keith_hodges at yahoo.co.uk
Wed Apr 9 05:50:12 UTC 2008


Dear All,

For those not familiar with the idea, Sake is an attempt to provide 
similar functionality to Make and Rake, only using Smalltalk as the DSL. 
I hope that Sake is simple and sufficiently useful for all Squeak forks 
make use of it.

I apologize that I havent had any time to document Sake in detail, as I 
would normally do... however I would like to show an example of 
Sake/Packages.  Sake/Packages is a reimplementation of Universes, using 
Sake.

Given the recent announcement that the 310 universe is now closed,  I 
think it is time for Sake/Packages to come into its own, since it 
provides the same functionality, from the same data, but is not closed, 
nor is editing restricted in any way. Also the Sake definition of a 
universe is simply a class, so you can subclass it in any way that you 
wish for your own projects.

Below is a SakeTask as generated from the universes package definition.
What follows is a "method", in the class PackagesSqueak310U.

So here is a Sake Task Definition for Seaside.... (info is simply a 
dictionary for non-essential meta information)

----------

PackagesSqueak310U -i- Seaside

    self name: 'Seaside'.
    info category: 'Web Development'.
    info description:
'A framework for building sophisticated web applications in Squeak. 
Develop for the web using reusable, embeddable components and unique 
call/return semantics for moving between pages.'.
    info maintainer: 'Lukas Renggli <renggli at gmail.com>'.
    info homepage: 'http://www.seaside.st/'.
    info squeakMapID: ''.
    info url: 'http://www.squeaksource.com/Seaside/Seaside2.8a1-lr.522.mcz'.
    info version: '2.8.522'.
    info provides: #().

    self dependsOn: #('KomHttpServer').

    self load: [
        Installer 
installUrl:'http://www.squeaksource.com/Seaside/Seaside2.8a1-lr.522.mcz'.
    ].

    self unloadDependsOn: { self taskUnloadDependants }.
    self unload: [
        Installer unload: 'Seaside'.
    ].

-------------

Notice that we have an unload block as well as a load block! This is a 
new and very experimental feature, we can now define unload scripts for 
each package, and Sake/Packages provides a way to capture and publish 
them for some or all image versions. Indeed this feature is barely 
tested, I mention it here simply to intoduce the concept.

usage:

PackagesSqueak310 new Seaside load.  or,  (PackagesSqueak310 
named:'Seaside') load.
PackagesSqueak310 new Seaside unload. or,  (PackagesSqueak310 
named:'Seaside') unload.

Packages/Sake is also supported by Installer in a manner similar to 
universes support, e.g.

Installer sake addPackage: 'PackagesA'; addPackage: 'PackageB'; install.

enjoy...

best regards

Keith

p.s. to load

Installer install: 'Packages'.














More information about the Squeak-dev mailing list