Janet 1.39.1-e9c6678 Documentation
(Other Versions:
1.38.0
1.37.1
1.36.0
1.35.0
1.34.0
1.31.0
1.29.1
1.28.0
1.27.0
1.26.0
1.25.1
1.24.0
1.23.0
1.22.0
1.21.0
1.20.0
1.19.0
1.18.1
1.17.1
1.16.1
1.15.0
1.13.1
1.12.2
1.11.1
1.10.1
1.9.1
1.8.1
1.7.0
1.6.0
1.5.1
1.5.0
1.4.0
1.3.1
)
The Janet Project Manager (jpm)
JPM is a build tool that can be installed along with Janet to help build and install libraries for Janet. The main uses are installing dependencies, compiling C/C++ to native libraries, and other project management tasks. The source code for JPM can be found at https://github.com/janet-lang/jpm.git. With janet already installed, JPM is also self bootstrapping.
git clone --depth=1 https://github.com/janet-lang/jpm.git
cd jpm
sudo janet bootstrap.janet
The bootstrap script can also be configured to install jpm to
different directories by setting the DESTDIR
environment
variable. Ideally, jpm should be installed to the same tree as Janet,
although this is not strictly required. See the README in jpm's
repository for more information.
Updating JPM
Once installed and configured, JPM can update itself from the git repository at any time.
sudo jpm install jpm
jpm
's main functions are installing dependencies and building native
Janet modules, but it is meant to be used for much of the life-cycle for
Janet projects. Since Janet code doesn't usually need to be compiled, you
don't always need jpm
, especially for scripts, but jpm
comes
with some functionality that is difficult to duplicate, like compiling Janet
source code and all imported modules into a statically linked executable for
distribution.
Glossary
A self-contained unit of Janet source code as recognized by jpm
is called a project. A project is a directory containing a
project.janet
file, which contains build recipes. Often, a
project will correspond to a single git repository, and contain a
single library. However, a project's project.janet
file can
contain build recipes for as many libraries, native extensions, and
executables as it wants. Each of these recipes builds an
artifact. Artifacts are the output files that will either be
distributed or installed on the end-user or developer's machine.