[up]

Montcello Package Browser

Index

Introduction

This tool is an adaption of the Squeak/Pharo Monticello repository browser. Monticello is a framework and package format used in the Squeak/Pharo Smalltalk dialect.

Notice, that ST/X tradiationally uses a different packaging scheme, which is based on individual source files and package-meta-description being contained as class-methods in so called ProjectDefinition classes. These are regular Smalltalk source code files, which are compiled with the package-classes and usually bundled in a single DLL (a binary class library).

The main use of monticello is to aid in bringing Squeak code to Smalltalk/X and vice versa. Please read the hints and notes below regarding possible problems when importing and exporting code.

Opening the Monticello Browser

You find the menu item for opening under the Launcher's "Tools" - "Monticello Browser" menu.
Alternatively, evaluate "MCRepositoryBrowser open" in a workspace.

Adding a Repository

If you want to import a Monticello package file (".mcz" suffix), copy it to a common repository folder and add this directory via the "Repository" - "Add Directory Repository" menu item. Alternatively, connect to a public Squeak repository via either the "Add Directory Repository (URL)" or "Add Directory Repository (Expression)" menu functions.

You'll find such expressions in the squeaksource repository, under the "Registration" headline. For example in "http://www.squeaksource.com/@pAUgNekdCaXrMHvg/c4Orvnq3", you will find the expression:

    MCHttpRepository
	location: 'http://www.squeaksource.com/OpenCL'
	user: ''
	password: ''
Copy and paste this expression into the input dialog after selecting the "Repository" - "Add Repository (Expression)" menu item.

When selected, a repository's packages are shown in the center list.
When a package is selected in the center list, the package's versions are shown in the right list.

Browsing a Package

Selection of a package's version enables the "Browse" and "Load" buttons. If the package has already been ported and verified to be compatible with ST/X, you can directly load it. Otherwise, it is recommended to inspect its contents first: press the "Browse" button to get a change-list browser on the package's contents.

In the change-list, take a look for any overrides - these are methods which are already present in the image and would be overwritten when the package is loaded. The changeset browser highlights such conflicts with a red exclamation mark.

If any such are present, it is recommended to manually step through each entry in the browser and apply the change by pressing "Accept". Thus loading the package incrementally. Skip any conflicting definitions. A future version if the Monticello browser may make this a more convenient operation, if it turns out to be a common task. For now, as this needs to be done only once (when the Squeak package is loaded for the very first time) this little inconvenience should be acceptable.

Loading a Package

You can (and often should) load the package into a separate namespace to reduce the chances for class name conflicts. Also, be aware that the Monticello package naming scheme is different from ST/X's scheme: Therefore, you may also set the ST/X package name, into which the code is to be loaded. Use the menu items "Loading" - "Set Target Package" / "Set Target Namespace" to specify those before loading/applying changes.

Getting the code initially loaded into ST/X is usually the biggest obstacle in your way. Once that has been acomplished, run the unit tests, check for incompatible message sends and fix the code. Then save it as Monticello package, or check it into your ST/X source code repository.

Saving a Package

Once you have the package loaded, it is a good idea to save it as a new version (possibly with an added "-stx" suffix in the Monticello package name). Usually you will save the package on a local folder repository - at least initially. It is a good idea to save even the first initial imported version as a reference against the original, even if that does not yet pass any unit test suite and is not executable.

Saving is not done from within the Monticello Browser, but in a System Browser instead. There, switch the "View"-mode to "Package", select the package to be saved, and execute the "Monticello"-"Commit or Write mcz File" menu item. This saves the selected package as a Monticello package - either in a public repository or locally in the file system (use the above directory repository for that). Generated mcz packages should load immediately into another ST/X system, but may require some porting effort, when importing into Squeak or another Smalltalk dialect.

When saving to a public (aka Squeak-) repository, make sure that you check the code for compatibility issues - the browser provides some special static code checks for this (although they may not cover all compatibility issues). Otherwise, make it clear to others, that this is an ST/X-only package, by appending an "-stx" suffix to the mcz file name.

Especially, make sure that the code is syntactically compatible with the target system. In particular, this means that End-of-Line comments and Namespaces should not be used in the code, if it is ever to be loaded into a non-ST/X Smalltalk.


[stx logo] Copyright © 2013-2016 Claus Gittinger, all rights reserved

<cg at exept.de>

Doc $Revision: 1.11 $ $Date: 2021/03/13 18:24:54 $