2

How do I add an MC package on Pharo (version 3.0)?

MartinW
  • 4,966
  • 2
  • 24
  • 60
amroto
  • 53
  • 7

2 Answers2

4
  1. Open the world menu by clicking into the empty world
  2. Select Monticello Browser
  3. Click on +Package in the upper left corner
  4. enter the name of the package you want to version (must be equivalent to the package name you use to put your packages in)

Note on package names

- acts as a sub package separator, i.e. you can have multiple Monticello packages with the same prefix such as MyPackage-Core-Model, MyPackage-Core-View and MyPackage-Tests. If you create a Monticello package with the name MyPackage it will include all of the sub packages (i.e. all three of the above), if you name it MyPackage-Core it will contain the packages MyPackage-Core-Model and MyPackage-Core-View.

To add repositories to the package (to which it can be saved):

  1. deselect any selected package in the Monticello browser by clicking on such a package
  2. select a repository from the panel on the right
  3. right click that entry
  4. select Add to package... from the context menu
  5. select the package from the dialog

If you don't have the repository you need yet, create it using the +Repository button at the top.

Community
  • 1
  • 1
Max Leske
  • 5,007
  • 6
  • 42
  • 54
4

Max's answer is correct, but you typically would not create an MC Package directly. Usually, you would create a package in the code browser. For example you could:

  • Accept a class definition specifying an unknown category
  • "Add Package…" from the package pane context menu
  • Implement an extension method in an extension protocol specifying an unknown package

In all these cases, a Pharo system package (specifically anRPackage) will be created, as well as an MC package of the same name.

If for some special reason you need to create just an MC package, following Max's instructions will accomplish that.

n.b. while Max's assertion that packages include sub-categories like MyPackage-Core is true in general, it is not true if there is a package that is a better match. So if there was a Pharo package MyPackage-Core, then it would hold all code categorized MyPackage-Core[-.], while MyPackage would hold all other MyPackage[-.]

Sean DeNigris
  • 6,306
  • 1
  • 31
  • 37