Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 2.02 KB

README.org

File metadata and controls

53 lines (39 loc) · 2.02 KB

Prolog-Package-Manager (PPM)

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.

Instal PPM

  1. Install a recent version of SWI-Prolog.
  2. Start Prolog and call the following goal: pack_install('git://github.com/wouterbeek/Prolog-Package-Manager').

Install a package through PPM

Suppose you want to install package Prolog-Library-Collection from user wouterbeek, published at https://github.com/wouterbeek/Prolog-Library-Collection:

  1. Run SWI-Prolog and load PPM: [library(ppm)].
  2. Run ppm_install(wouterbeek, 'Prolog-Library-Collection').
  3. 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)).
  4. 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.)

Publish a package through PPM

Suppose that user foo wants to publish a package called bar:

  1. Develop the package locally in a Git-controlled directory.
  2. 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"}
    ]}
        
  3. Start Prolog and load PPM: [library(ppm)]. (For convenience, this line can be added to the Prolog startup file: ~~/.swiplrc~)
  4. Publish a specific version of your package with the following call: ppm_publish(bar, version(0,1,0)).