Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.28 KB

how-to-use-as-dependency-in-pharo.md

File metadata and controls

42 lines (31 loc) · 1.28 KB

How to use Mole as dependency in a Pharo product

In order to include Mole as part of your project, you should reference the package in your product baseline:

  1. Define the Mole repository and version to be used, and the baseline groups you want to depend on (usually it will be Deployment).

    If you're unsure on what to depend use the Dependency Analyzer tool to choose an appropriate group including the packages you need.

  2. Create a method like this one in the baseline class of your product:

    setUpDependencies: spec
    
      spec
        baseline: 'Mole'
        with: [ spec repository: 'github://github://ba-st/Mole:v{XX}' ];
        project: 'Mole-Deployment'
        copyFrom: 'Mole' with: [ spec loads: 'Deployment' ]

    This will create Mole-Deployment as a valid target that can be used as requirement in your own packages.

    Replace {XX} with the version you want to depend on

  3. Use the new loading target as a requirement on your packages. For example:

    baseline: spec
    
    <baseline>
    spec
      for: #pharo
      do: [
        self setUpDependencies: spec.
        spec
          package: 'My-Package'
          with: [ spec requires: #('Mole-Deployment') ] ]