conditional loading of packages in BaselineOf/ConfigurationOf

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

conditional loading of packages in BaselineOf/ConfigurationOf

Peter Uhnak
Hi,

is it possible to specify _natively_ (in the BaselineOf spec itself) a conditional loading of packages?

Example usage:
I have package with extensions for Calypso, but Calypso is not always loaded, so I want to load the package only if Calypso is present.

The ugly way (because it's a hack and you cannot see the condition by looking at the project spec):

self environment at: #ClyBrowser ifPresent: [
spec package: 'My-Calypso-Extensions'.
].

The imagined way (or something along the lines):

spec package: 'My-Calypso-Extensions' with: [ spec condition: [ self environment includesKey: #ClyBrowser ] ]


Is this possible? Or is there some other recommended way how to approach this?

Thanks,
Peter
Reply | Threaded
Open this post in threaded view
|

Re: conditional loading of packages in BaselineOf/ConfigurationOf

CyrilFerlicot
On 05/04/2018 09:53, Peter Uhnák wrote:

> Hi,
>
> is it possible to specify _natively_ (in the BaselineOf spec itself) a
> conditional loading of packages?
>
> Example usage:
> I have package with extensions for Calypso, but Calypso is not always
> loaded, so I want to load the package only if Calypso is present.
>
> The ugly way (because it's a hack and you cannot see the condition by
> looking at the project spec):
>
> self environment at: #ClyBrowser ifPresent: [
> spec package: 'My-Calypso-Extensions'.
> ].
>
> The imagined way (or something along the lines):
>
> spec package: 'My-Calypso-Extensions' with: [ spec condition: [ self
> environment includesKey: #ClyBrowser ] ]
>
>
> Is this possible? Or is there some other recommended way how to approach
> this?
>
> Thanks,
> Peter


Hi Peter,

Maybe this can help you:

https://code.google.com/archive/p/metacello/wikis/CustomProjectAttrributes.wiki

--
Cyril Ferlicot
https://ferlicot.fr