A package manager for SWI-Prolog.
Prolog Package Manager (PPM) makes it easy to install Prolog code by
using the Github service. The only requirements are that (i) the
repository is open / publicly available, (ii) contains a /prolog
folder with Prolog module files, and (iii) has a ppm.json
file
specifying its dependencies.
- Install a recent version of SWI-Prolog.
- Start Prolog and call the following goal:
pack_install('git://github.com/wouterbeek/Prolog-Package-Manager').
Suppose you want to install package Prolog-Library-Collection
from
user wouterbeek
, published at
https://github.com/wouterbeek/Prolog-Library-Collection:
- Run SWI-Prolog and load PPM:
[library(ppm)].
- Run
ppm_install(wouterbeek, 'Prolog-Library-Collection').
- In order to access package modules from the Prolog library path,
PPM must be loaded first (see step 1). You automate this step by
adding the following line to the Prolog startup file
(~~/.swiplrc~):
:- use_module(library(ppm)).
- Package modules can now be loaded from the Prolog library path.
(E.g.,
[library(atom_ext)].
loads a specific module from the Prolog-Library-Collection.)
Suppose that user foo
wants to publish a package called bar
:
- Develop the package locally in a Git-controlled directory.
- Make sure the direcotry contains a file called
ppm.json
that specifies its dependencies (if any). For example:{"dependencies": [ {"user": "wouterbeek", "repo": "Prolog-Library-Collection"} ]}
- Start Prolog and load PPM:
[library(ppm)].
(For convenience, this line can be added to the Prolog startup file: ~~/.swiplrc~) - Publish a specific version of your package with the following
call:
ppm_publish(bar, version(0,1,0)).