Open plinto
Docs›Reference

plinto.conf

Reference

A project's file, next to its src/. See Projects for what it is for.

Syntax

JSON without the ceremony:

A mistake names its line and column:

plinto.conf:4:3: error: duplicate key 'build' (first defined at 3:3)

Keys

Key What it says
name the project's name, which is its package's: HelloApp (required). Letters, digits, ., _ and -, starting with a letter or digit
version its version line: 1.0 (required). Letters, digits, ., _, + and -, starting with a letter or digit
build its build system: JavaBuild (required)
build-dependencies the build system, its toolchain and what else the build runs
dependencies what the code uses
test-dependencies what only the tests use
main what a program runs, which makes the project a program: see below
args what a program starts with: [--port, 8080]
packager how a program is packed to run on a server; leave it out for Archive, the default, or Docker for an image (how)
dependency-resolution which version wins where the project reaches two: see below
group a group for the jar's manifest, for JVM projects

A build system may add its own, such as java: { … } for Java and typescript: for TypeScript.

A program: main and args

A project that names its main is a program: plinto run starts it, and a release packs it to run on a server. Without one it is a library, which other projects use. main says what runs in the language's own words, and args what it starts with, before the arguments plinto run is given:

Build system main is For example
JavaBuild, KotlinBuild the main class main = shop.Main, main = shop.MainKt
NodeBuild a file in src/ main = src/server.ts
PythonBuild the module python -m runs main = Shop.server, or main = Shop for its __main__.py
GoBuild the folder of the package main main = src, main = src/cmd/server
RustBuild the binary's root, in src/ main = src/main.rs
ElixirBuild the application's module main = Shop.Application
plinto.conf
name = Shop
version = 1.0
build = GoBuild
main = src/cmd/server
args = [--port, 8080]
build-dependencies: { GoBuild = 1.0, Go = 1.27 }

Projects written before main and args named them otherwise, such as main-class, main-package or run: { args = [...] }, or had a file where the language puts one, such as src/main.rs. They still build the same, and the build warns with the line to write instead.

Dependencies

dependencies: {
  MyLib = 1.0                                       # a line: its newest release in the group
  Guava = 33.7.2-jre                                # an exact version
  Serde: { version = 1.0.229, features = [derive] } # with more for the build system
}

A version must be one the group has, exactly or as a line it points somewhere: see Version rules.

dependency-resolution

When the libraries a project uses need two versions of one package, the build stops and shows the tree:

app uses LibOne 2.0 and 1.0, but a project can use only one version of a package:
  app
  ├── LibOne 2.0
  └── LibTwo 1.0
      └── LibOne 1.0
Pick one in app's plinto.conf (any version the group has):
  dependency-resolution: {
    LibOne = 2.0   # or 1.0
  }

The pick holds for that project's whole tree, and only for it. An entry that resolves no conflict is an error, so the block never outlives its reason.