Cross-platform configurations?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Cross-platform configurations?

Frank Shearar-3
Hi,

I'm rooting around trying to find some pointers on how best to write
cross-platform configurations. At the moment I have
http://www.squeaksource.com/Control/ConfigurationOfControl-fbs.11.mcz
which attempts to have a normal install for Squeak, and add a shim to
Pharo (1.4) in the form of a ControlPharo package.

My problem is that ControlPharo isn't being loaded into a Pharo image.
My baseline looks like this:

baseline10: spec
        <version: '1.0-baseline'>

        spec for: #'common' do: [
                spec blessing: #'baseline'.
                spec repository: 'http://www.squeaksource.com/Control'.
                spec
                        package: 'Control';
                        package: 'ControlTests' with: [
                                spec requires: #('Control' )].
                spec
                        group: 'default' with: #('Core' 'Tests');
                        group: 'Core' with: #('Control');
                        group: 'Tests' with: #('ControlTests') ].
        spec for: #'squeak' do: [ ].
        spec for: #'pharo' do: [
                spec
                        package: 'ControlPharo'].

and the version looks like this:

version11dev: spec
        <version: '1.1.dev' imports: #('1.0-baseline' )>

        spec for: #'common' do: [
                spec blessing: #'development'.
                spec description: 'stable version'.
                spec author: 'fbs'.
                spec timestamp: '07/14/2012 21:37'.
                spec
                        package: 'Control' with: 'Control-fbs.19';
                        package: 'ControlTests' with: 'ControlTests-fbs.15'. ].
                spec for: #squeak do: [ ].
                spec for: #pharo do: [
                        spec
                                package: 'ControlPharo' with: 'ControlPharo-fbs.1' ].

(Now note the #pharo vs #'pharo' - I know that's wrong, and just
happens to work, but using #'pharo' doesn't fix the configuration.)

What have I missed?

frank
Reply | Threaded
Open this post in threaded view
|

Re: Cross-platform configurations?

Frank Shearar-3
On 30 August 2012 08:59, Frank Shearar <[hidden email]> wrote:

> Hi,
>
> I'm rooting around trying to find some pointers on how best to write
> cross-platform configurations. At the moment I have
> http://www.squeaksource.com/Control/ConfigurationOfControl-fbs.11.mcz
> which attempts to have a normal install for Squeak, and add a shim to
> Pharo (1.4) in the form of a ControlPharo package.
>
> My problem is that ControlPharo isn't being loaded into a Pharo image.
> My baseline looks like this:
>
> baseline10: spec
>         <version: '1.0-baseline'>
>
>         spec for: #'common' do: [
>                 spec blessing: #'baseline'.
>                 spec repository: 'http://www.squeaksource.com/Control'.
>                 spec
>                         package: 'Control';
>                         package: 'ControlTests' with: [
>                                 spec requires: #('Control' )].
>                 spec
>                         group: 'default' with: #('Core' 'Tests');
>                         group: 'Core' with: #('Control');
>                         group: 'Tests' with: #('ControlTests') ].
>         spec for: #'squeak' do: [ ].
>         spec for: #'pharo' do: [
>                 spec
>                         package: 'ControlPharo'].

This should (and does now) say

<snip>
                spec
                        group: 'default' with: #('Core' 'Tests');
                        group: 'Tests' with: #('ControlTests')].
        spec for: #'squeak' do: [
                spec
                        group: 'Core' with: #('Control')].
        spec for: #'pharo' do: [
                spec
                        package: 'ControlPharo'.
                spec
                        group: 'Core' with: #('Control' 'ControlPharo')].

Note the 'Core' group being defined differently for #'common' and #'pharo'.

frank

> and the version looks like this:
>
> version11dev: spec
>         <version: '1.1.dev' imports: #('1.0-baseline' )>
>
>         spec for: #'common' do: [
>                 spec blessing: #'development'.
>                 spec description: 'stable version'.
>                 spec author: 'fbs'.
>                 spec timestamp: '07/14/2012 21:37'.
>                 spec
>                         package: 'Control' with: 'Control-fbs.19';
>                         package: 'ControlTests' with: 'ControlTests-fbs.15'. ].
>                 spec for: #squeak do: [ ].
>                 spec for: #pharo do: [
>                         spec
>                                 package: 'ControlPharo' with: 'ControlPharo-fbs.1' ].
>
> (Now note the #pharo vs #'pharo' - I know that's wrong, and just
> happens to work, but using #'pharo' doesn't fix the configuration.)
>
> What have I missed?
>
> frank
Reply | Threaded
Open this post in threaded view
|

Re: Cross-platform configurations?

Dale Henrichs
Frank,

The pattern for including a platform-specific package is the following:

    spec
        for: #'pharo'
        do: [
            spec
                package: 'Control' with: [ spec includes: 'ControlPharo' ];
                package: 'ControlPharo' with: [ spec requires: 'Control' ] ]

The `includes:` message says that 'ControlPharo' should be "included in the load" whenever 'Control' is referenced.

Then you specify that 'ControlPharo' is loaded after `Control`....

This is much better than using a group (I think) because `ControlPharo` is tightly coupled to 'Control'...

Dale

----- Original Message -----
| From: "Frank Shearar" <[hidden email]>
| To: [hidden email]
| Sent: Thursday, August 30, 2012 11:38:45 AM
| Subject: [Metacello] Re: Cross-platform configurations?
|
| On 30 August 2012 08:59, Frank Shearar <[hidden email]>
| wrote:
| > Hi,
| >
| > I'm rooting around trying to find some pointers on how best to
| > write
| > cross-platform configurations. At the moment I have
| > http://www.squeaksource.com/Control/ConfigurationOfControl-fbs.11.mcz
| > which attempts to have a normal install for Squeak, and add a shim
| > to
| > Pharo (1.4) in the form of a ControlPharo package.
| >
| > My problem is that ControlPharo isn't being loaded into a Pharo
| > image.
| > My baseline looks like this:
| >
| > baseline10: spec
| >         <version: '1.0-baseline'>
| >
| >         spec for: #'common' do: [
| >                 spec blessing: #'baseline'.
| >                 spec repository:
| >                 'http://www.squeaksource.com/Control'.
| >                 spec
| >                         package: 'Control';
| >                         package: 'ControlTests' with: [
| >                                 spec requires: #('Control' )].
| >                 spec
| >                         group: 'default' with: #('Core' 'Tests');
| >                         group: 'Core' with: #('Control');
| >                         group: 'Tests' with: #('ControlTests') ].
| >         spec for: #'squeak' do: [ ].
| >         spec for: #'pharo' do: [
| >                 spec
| >                         package: 'ControlPharo'].
|
| This should (and does now) say
|
| <snip>
| spec
| group: 'default' with: #('Core' 'Tests');
| group: 'Tests' with: #('ControlTests')].
| spec for: #'squeak' do: [
| spec
| group: 'Core' with: #('Control')].
| spec for: #'pharo' do: [
| spec
| package: 'ControlPharo'.
| spec
| group: 'Core' with: #('Control' 'ControlPharo')].
|
| Note the 'Core' group being defined differently for #'common' and
| #'pharo'.
|
| frank
|
| > and the version looks like this:
| >
| > version11dev: spec
| >         <version: '1.1.dev' imports: #('1.0-baseline' )>
| >
| >         spec for: #'common' do: [
| >                 spec blessing: #'development'.
| >                 spec description: 'stable version'.
| >                 spec author: 'fbs'.
| >                 spec timestamp: '07/14/2012 21:37'.
| >                 spec
| >                         package: 'Control' with: 'Control-fbs.19';
| >                         package: 'ControlTests' with:
| >                         'ControlTests-fbs.15'. ].
| >                 spec for: #squeak do: [ ].
| >                 spec for: #pharo do: [
| >                         spec
| >                                 package: 'ControlPharo' with:
| >                                 'ControlPharo-fbs.1' ].
| >
| > (Now note the #pharo vs #'pharo' - I know that's wrong, and just
| > happens to work, but using #'pharo' doesn't fix the configuration.)
| >
| > What have I missed?
| >
| > frank
|
Reply | Threaded
Open this post in threaded view
|

Re: Cross-platform configurations?

Frank Shearar-3
On 31 August 2012 05:33, Dale Henrichs <[hidden email]> wrote:

> Frank,
>
> The pattern for including a platform-specific package is the following:
>
>     spec
>         for: #'pharo'
>         do: [
>             spec
>                 package: 'Control' with: [ spec includes: 'ControlPharo' ];
>                 package: 'ControlPharo' with: [ spec requires: 'Control' ] ]
>
> The `includes:` message says that 'ControlPharo' should be "included in the load" whenever 'Control' is referenced.
>
> Then you specify that 'ControlPharo' is loaded after `Control`....
>
> This is much better than using a group (I think) because `ControlPharo` is tightly coupled to 'Control'...

Ah, thanks Dale! (ControlPharo is actually completely independent of
Control: it's a single method that Squeak has and Pharo doesn't.
Control is thus heavily dependent on ControlPharo though.)

frank

> Dale
>
> ----- Original Message -----
> | From: "Frank Shearar" <[hidden email]>
> | To: [hidden email]
> | Sent: Thursday, August 30, 2012 11:38:45 AM
> | Subject: [Metacello] Re: Cross-platform configurations?
> |
> | On 30 August 2012 08:59, Frank Shearar <[hidden email]>
> | wrote:
> | > Hi,
> | >
> | > I'm rooting around trying to find some pointers on how best to
> | > write
> | > cross-platform configurations. At the moment I have
> | > http://www.squeaksource.com/Control/ConfigurationOfControl-fbs.11.mcz
> | > which attempts to have a normal install for Squeak, and add a shim
> | > to
> | > Pharo (1.4) in the form of a ControlPharo package.
> | >
> | > My problem is that ControlPharo isn't being loaded into a Pharo
> | > image.
> | > My baseline looks like this:
> | >
> | > baseline10: spec
> | >         <version: '1.0-baseline'>
> | >
> | >         spec for: #'common' do: [
> | >                 spec blessing: #'baseline'.
> | >                 spec repository:
> | >                 'http://www.squeaksource.com/Control'.
> | >                 spec
> | >                         package: 'Control';
> | >                         package: 'ControlTests' with: [
> | >                                 spec requires: #('Control' )].
> | >                 spec
> | >                         group: 'default' with: #('Core' 'Tests');
> | >                         group: 'Core' with: #('Control');
> | >                         group: 'Tests' with: #('ControlTests') ].
> | >         spec for: #'squeak' do: [ ].
> | >         spec for: #'pharo' do: [
> | >                 spec
> | >                         package: 'ControlPharo'].
> |
> | This should (and does now) say
> |
> | <snip>
> |               spec
> |                       group: 'default' with: #('Core' 'Tests');
> |                       group: 'Tests' with: #('ControlTests')].
> |       spec for: #'squeak' do: [
> |               spec
> |                       group: 'Core' with: #('Control')].
> |       spec for: #'pharo' do: [
> |               spec
> |                       package: 'ControlPharo'.
> |               spec
> |                       group: 'Core' with: #('Control' 'ControlPharo')].
> |
> | Note the 'Core' group being defined differently for #'common' and
> | #'pharo'.
> |
> | frank
> |
> | > and the version looks like this:
> | >
> | > version11dev: spec
> | >         <version: '1.1.dev' imports: #('1.0-baseline' )>
> | >
> | >         spec for: #'common' do: [
> | >                 spec blessing: #'development'.
> | >                 spec description: 'stable version'.
> | >                 spec author: 'fbs'.
> | >                 spec timestamp: '07/14/2012 21:37'.
> | >                 spec
> | >                         package: 'Control' with: 'Control-fbs.19';
> | >                         package: 'ControlTests' with:
> | >                         'ControlTests-fbs.15'. ].
> | >                 spec for: #squeak do: [ ].
> | >                 spec for: #pharo do: [
> | >                         spec
> | >                                 package: 'ControlPharo' with:
> | >                                 'ControlPharo-fbs.1' ].
> | >
> | > (Now note the #pharo vs #'pharo' - I know that's wrong, and just
> | > happens to work, but using #'pharo' doesn't fix the configuration.)
> | >
> | > What have I missed?
> | >
> | > frank
> |