Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define a ConfigurationOf with a #development version that depends on a baseline?

In Pharo, I want to define a Metacello's ConfigurationOfNand2Tetris that has just one package:

ConfigurationOfNand2Tetris>>baseline01: spec
  <version: '0.1-baseline'>

  spec
    for: #common
    do: [ 
      spec
        blessing: #baseline;
        repository: 'http://www.smalltalkhub.com/mc/DamienCassou/Nand2Tetris/main';
        package: 'Nand2Tetris' ]

ConfigurationOfNand2Tetris>>development: spec
  <symbolicVersion: #development>

  spec for: #common version: '0.1-baseline'.

When I execute MetacelloToolBox validateConfiguration: ConfigurationOfNand2Tetris I always get 2 warnings:

  • Warning: Symbolic version #development refers to a version'0.1-baseline' whose blessing #baseline is not #development { notDevelopmentVersion } [ #validateVersionSpecForSymbolicVersion:symbolicVersion: ]
  • Warning: Only baseline defined (no version defined). { onlyBaselineVersion } [ #validatePragmas ]
like image 433
Damien Cassou Avatar asked Apr 02 '13 11:04

Damien Cassou


3 Answers

If you want to just depend on a baseline, the metaphor for that in Metacello is to use the #bleedingEdge blessing. Also, you can explicitly deny other symbolic versions:

ConfigurationOfNand2Tetris>>baseline01: spec
  <version: '0.1-baseline'>

  spec
    for: #common
    do: [ 
      spec
        blessing: #baseline;
        repository: 'http://www.smalltalkhub.com/mc/DamienCassou/Nand2Tetris/main';
        package: 'Nand2Tetris' ]

ConfigurationOfNand2Tetris>>bleedingEdge: spec
  <symbolicVersion: #bleedingEdge>
  spec for: #common version: '0.1-baseline'.

ConfigurationOfNand2Tetris>>development: spec
  <symbolicVersion: #'development'>
  spec for: #'common' version: #'notDefined'.

ConfigurationOfNand2Tetris>>stable: spec
  <symbolicVersion: #'stable'>
  spec for: #'common' version: #'notDefined'.

The idea here is that #stable and #development versions link to explicitely enumbered versions, whereas #bleedingEdge always points to the latest versions.

This should avoid the first warning. I think, as long as you do not have released a version, you can safely ignore the second warning.

like image 115
Tobias Avatar answered Oct 18 '22 16:10

Tobias


Usually you'll define your baseline and then also a #versionN: method:

ConfigurationOfNand2Tetris>>version01: spec
  <version: '0.1' imports: #('0.1-baseline')>

  spec
    for: #common do: [ 
      spec
        blessing: #baseline;
        package: 'Nand2Tetris' with: 'Nand2Tetris-yourname.22'].
like image 38
Frank Shearar Avatar answered Oct 18 '22 16:10

Frank Shearar


I think you forgot to implement :

ConfigurationOfNand2Tetris>>version01: spec

<version: '0.1' imports: #('0.1-baseline' )>

spec for: #'common' do: [
    spec blessing: #'development'.
    spec description: 'some description'.
    spec author: 'yourName'.
    spec timestamp: '1/15/2013 16:13'.
    spec  
        package: 'Nand2Tetris' with: 'Nand2Tetris-yourName.versionNumber']

Then you should change :

ConfigurationOfNand2Tetris>>development: spec

  <symbolicVersion: #development>

  spec for: #'common' version: '0.1'.
like image 20
ClementBera Avatar answered Oct 18 '22 14:10

ClementBera