APM uses Pluto (a fork of Lua) as the configuration format.
- Be sure to install Pluto, if you haven't already.
- Create a
deps.pluto
file in your project. - Insert the following:
;(require"http".request"//use.agnostic.pm"|>load)()
Now you can describe your dependencies, which can be as simple as this:
git "https://github.com/PlutoLang/pluto-websocket"
To install and update your dependencies, simply run the deps.pluto
script, which can be done by entering pluto deps.pluto
into a command prompt, or using the build system editor integration, if supported.
By default, APM puts downloaded files in the working directory, but e.g. if you want a "lib" folder, you can use:
out "lib"
To avoid breaking changes, you can specify acceptable versions:
git "https://github.com/PlutoLang/pluto-websocket"
version "^1.0"
The ^1.0
constraint is the same as >=1.0 <2.0
.
For the above-described usage to work, the dependency's repository must have an apm.yml in the root folder. For example, pluto-websocket's apm.yml:
lib: websocket.pluto
This tells APM to put the repo's websocket.pluto in your configured output directory.
When making your own library that uses pluto-websocket, you can declare this in apm.yml:
depends:
https://github.com/PlutoLang/pluto-websocket: "^1.0"
If you have more specific requirements, you can explicitly tell APM what to download and where, hence this is called "download mode."
git "https://github.com/PlutoLang/pluto-websocket"
from "websocket.pluto" to "lib/websocket.pluto"
Wildcards and version constraints are also supported in this mode:
git "https://github.com/calamity-inc/warframe-public-export-plus"
version "^0.5"
from "*.json" to "data/*.json"
APM will not look for an apm.yml when processing dependendencies that use this mode.