Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Manifest Format

Every section of Kargo.toml. All of them parse and validate today; the Effect column says whether a section currently changes a build. See Implementation Status, and The Manifest for the guided version.

Keys are kebab-case. Maps preserve sorted order when serialized, so generated output is byte-stable.

SectionEffect
[package]🟢 Active
[targets]🟢 Active
[source-sets.<name>]🟢 Active
[dependencies]🟢 Active
[dev-dependencies]🟢 Active
[target.<name>.dependencies]🟢 Active
[flavor.<name>.dependencies]🟡 Parsed, not applied
[plugins]🟢 Active
[ksp] / [ksp-options]🟢 Active
[kapt] / [kapt-options]🟢 Active
[build-config]🟢 Active
[compose]⚪ Parsed
[flavors]🟡 Parsed, not applied
[profile.<name>]🟢 Active
[repositories]🟢 Active
[toolchain]🟢 Active
[workspace]🟡 Parsed, not orchestrated
[catalog]🟡 Parsed, references unresolved
[test]⚪ Parsed
[lint] / [format]⚪ Parsed
[hooks]⚪ Parsed
[signing]⚪ Parsed
[package.docker]⚪ Parsed

[package]

KeyTypeRequiredDescription
namestringyesAlphanumeric, -, _. Validated on load.
versionstringyesMust parse as semver.
kotlinstringyesExact Kotlin compiler version.
groupstringfor publishingMaven group id.
main-classstringfor kargo runJVM entry point, e.g. com.example.MainKt.
descriptionstringnoCarried into the published POM.
authorslistno"Name <email>" entries.
licensestringnoSPDX identifier.
repositorystringnoSource repository URL.
ksp-versionstringnoPins the KSP processor API version.
[package]
name = "my-service"
group = "com.example"
version = "1.2.0"
kotlin = "2.4.21"
description = "Order processing service"
authors = ["Jane Doe <jane@example.com>"]
license = "Apache-2.0"
repository = "https://github.com/example/my-service"
main-class = "com.example.MainKt"

[targets]

A map of target name to options. Names accept kebab-case or camelCase. See the Targets reference for the full list.

[targets.jvm]
java-target = "25"
[targets]
jvm = { java-target = "25" }
android = { min-sdk = 24, target-sdk = 36, compile-sdk = 36 }
ios-arm64 = {}
js = { module-kind = "es" }
KeyApplies toDescription
java-targetjvm, androidBytecode level, e.g. "17", "25".
module-kindjs"es" or "commonjs".
min-sdkandroidMinimum Android API level.
target-sdkandroidAndroid API level targeted.
compile-sdkandroidAndroid API level compiled against.
cinteropnativeC interop definitions, see below.

Android requires min-sdk <= target-sdk; violating it fails validation.

[source-sets.<name>]

Declares what the conventional layout would otherwise infer for one source set.

[source-sets.jvmMain]
kotlin = ["legacy/src/java", "build/generated/kotlin"]
resources = ["legacy/src/resources"]
depends-on = ["commonMain"]

[source-sets.jvmAndAndroidMain]
depends-on = ["commonMain"]
targets = ["jvm", "android"]
KeyTypeDescription
kotlinlistSource roots, relative to the project root, replacing src/<name>/kotlin.
resourceslistResource roots, replacing src/<name>/resources.
depends-onlistParent source sets, replacing the inferred parent.
targetslistThe targets this set compiles into, which is how a grouping the standard hierarchy does not provide gets one.

The name is main or test in the Maven layout, and ends in Main or Test in the multiplatform one. A key left out keeps the convention, so moving the sources says nothing about the resources, and an empty list reads the same way as leaving the key out. Declaring a set is itself what brings it into existence — its directories need not be under src/.

See the Source Sets reference.

[dependencies]

A map of local alias to dependency. Three forms:

[dependencies]
# coordinate shorthand
kotlinx-coroutines-core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0"

# detailed
my-lib = { group = "com.example", artifact = "my-lib", version = "1.0.0" }

# catalog reference
ktor-server = { catalog = "ktor-server", bundle = true }

Detailed form keys:

KeyTypeDescription
groupstringMaven group id. Required.
artifactstringMaven artifact id. Required.
versionstringExact version. Empty means "from an imported BOM".
scopestringcompile (default), runtime, provided, test, system, import.
optionalboolNot propagated to consumers.
classifierstringFor platform-specific artifacts.
exclusionsarray of tables{ group, artifact }; omit artifact for the whole group.
[dependencies.jackson-databind]
group = "com.fasterxml.jackson.core"
artifact = "jackson-databind"
version = "2.16.1"

[[dependencies.jackson-databind.exclusions]]
group = "org.slf4j"
artifact = "slf4j-log4j12"

Catalog form keys: catalog (the entry name) and bundle (whether the name refers to a bundle).

[dev-dependencies]

Identical shape. On the test compile and runtime classpath only; never published.

[target.<name>.dependencies]

Dependencies that apply only when building that target.

[target.jvm.dependencies]
ktor-client-okhttp = "io.ktor:ktor-client-okhttp:2.3.0"

[target.ios.dependencies]
ktor-client-darwin = "io.ktor:ktor-client-darwin:2.3.0"

[flavor.<name>.dependencies]

🟡 Parsed, not yet applied to builds.

[flavor.free.dependencies]
ad-sdk = "com.example:ad-sdk:2.0.0"

Note the singular flavor here, versus plural flavors for definitions.

[plugins]

Kotlin compiler plugins by id. A bare string, or a table with a version.

[plugins]
serialization = "org.jetbrains.kotlin.plugin.serialization"
parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version = "2.4.21" }

Without version, the plugin tracks package.kotlin.

[ksp]

KSP annotation processors, in dependency form.

[ksp]
room-compiler = "androidx.room:room-compiler:2.6.1"

[ksp-options]

String options passed to KSP processors.

[ksp-options]
"room.schemaLocation" = "build/schemas"
"room.incremental" = "true"

[kapt]

KAPT annotation processors, for libraries that have not moved to KSP.

[kapt]
dagger-compiler = "com.google.dagger:dagger-compiler:2.59.2"

Only what this section declares runs. Generated sources land in build/<target>/<profile>/generated/kapt/sources and join the main compile; the Java stubs the processors read stay in generated/kapt/stubs.

Every pass is a full pass — there is no incremental KAPT — and kapt's own javacOption has no manifest key. KAPT is deprecated upstream, so prefer [ksp] when a processor offers both.

[kapt-options]

Options for the KAPT processors, passed as -A<key>=<value> the same way a javac invocation would pass them.

[kapt-options]
"dagger.fastInit" = "enabled"

[build-config]

Compile-time constants emitted into a generated BuildConfig object. Values are strings and support ${env:…} interpolation.

[build-config]
API_VERSION = "v2"
TELEMETRY_ENABLED = "false"

Merged with flavor build-config, flavors taking precedence.

[compose]

⚪ Parsed; the compiler plugin is not applied yet.

[compose]
enabled = true

See Compose Multiplatform.

[flavors]

🟡 Parsed and validated; not applied to builds.

[flavors]
dimensions = ["tier", "environment"]
default = { tier = "paid", environment = "staging" }
exclude = [{ tier = "free", environment = "production" }]

[flavors.tier.free]
build-config = { IS_PAID = "false" }
application-id-suffix = ".free"

[flavors.tier.paid.signing]
keystore = "release.keystore"
key-alias = "paid-release"
store-password-cmd = "op read 'op://Dev/Keystore/password'"
KeyTypeDescription
dimensionslistOrdered axes. Order determines variant naming.
defaulttableFlavor per dimension, used when none is specified.
excludearray of tablesCombinations that do not exist.

Per-flavor keys, under [flavors.<dimension>.<flavor>]:

KeyTypeDescription
build-configtableConstants for this flavor.
application-id-suffixstringAppended to the application id.
signingtablekeystore, key-alias, store-password-cmd.

See Flavors and Variants.

[profile.<name>]

[profile.dev]
debug = true
optimization = false

[profile.release]
debug = false
optimization = true
compiler-args = ["-Xjvm-default=all"]
KeyTypeDescription
debugboolEmit debug symbols.
optimizationboolEnable compiler optimizations.
compiler-argslistExtra flags passed to the compiler verbatim.

dev and release exist without being declared. Any other name defines a custom profile. See Build Profiles.

[repositories]

A map of name to URL or table. Maven Central is always available and tried last.

[repositories]
google = "https://maven.google.com"
internal = { url = "https://nexus.example.com/maven", username = "${env:NEXUS_USER}", password = "${env:NEXUS_PASS}" }
shared = { url = "https://nexus.example.com/maven", auth = "my-nexus" }
KeyTypeDescription
urlstringRepository base URL. Required in table form.
usernamestringBasic auth user. Use ${env:…}.
passwordstringBasic auth password or token. Use ${env:…}.
authstringName of a [credentials.*] entry in global config.

[toolchain]

[toolchain]
jdk = "25"
kotlin-mirror = "https://mirror.example.com/kotlin"
auto-download = true
KeyTypeDescription
jdkstringA major version, or an absolute path.
kotlin-mirrorstringAlternative to the JetBrains release archive.
auto-downloadboolDefault true. Set false for air-gapped builds.

See Toolchains.

[workspace]

🟡 Parsed; member builds are not orchestrated yet.

[workspace]
members = ["app", "shared", "libs/*"]
exclude = ["experimental"]

Globs are supported in members. A workspace root usually has no [package]. See Workspaces.

[catalog]

🟡 Parsed; { catalog = … } references are not resolved yet.

[catalog.versions]
ktor = "2.3.0"

[catalog.libraries]
ktor-server-core = { group = "io.ktor", artifact = "ktor-server-core", version.ref = "ktor" }
ktor-client-core = { group = "io.ktor", artifact = "ktor-client-core", version = "2.3.0" }

[catalog.bundles]
ktor-server = ["ktor-server-core", "ktor-server-netty"]

[catalog.plugins]
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
SubsectionShape
versionsname to version string
librariesname to { group, artifact, version or version.ref }
bundlesname to a list of library names
pluginsname to { id, version or version.ref }

See Version Catalogs.

[test]

⚪ Parsed; coverage is not implemented.

[test.coverage]
engine = "kover"
min-line = 80
min-branch = 70
exclude = ["**/generated/**", "**/BuildConfig.*"]
KeyTypeDescription
enginestringkover or jacoco.
min-lineintegerFail below this line coverage percentage.
min-branchintegerFail below this branch coverage percentage.
excludelistGlob patterns excluded from measurement.

[lint]

⚪ Parsed; the linter is not implemented.

[lint]
rules = ["naming", "style", "complexity"]
severity = "warning"

See the Lint Rules reference.

[format]

⚪ Parsed; the formatter is not implemented.

[format]
style = "official"
indent = 4
max-line-length = 120

[hooks]

⚪ Parsed; no lifecycle phase dispatches hooks yet.

A map of phase name to a list of commands.

[hooks]
pre-build = ["fmt --check", "lint"]
post-compile = ["./scripts/generate-openapi.sh"]
post-test = ["coverage-report"]

Phase names are listed in Plugins and Hooks.

[signing]

⚪ Parsed; publishing is not implemented.

[signing]
gpg-key = "${env:GPG_KEY_ID}"
gpg-password = "${env:GPG_PASSPHRASE}"

[package.docker]

⚪ Parsed; packaging is not implemented.

[package.docker]
base-image = "eclipse-temurin:25-jre-alpine"
ports = [8080]
entrypoint = "java -jar /app/app.jar"
labels = { maintainer = "team@example.com" }

[target.<name>.cinterop.<name>]

⚪ Parsed; CInterop is not implemented.

[target.ios-arm64.cinterop.mylib]
def-file = "src/nativeInterop/cinterop/mylib.def"
headers = ["include/mylib.h"]
compiler-opts = ["-Iinclude"]
linker-opts = ["-L/usr/local/lib", "-lmylib"]

Environment interpolation

Any string value may contain ${env:VAR}, resolved before TOML parsing from .kargo.env and then the process environment. An unresolved reference is an error naming the variable.

[repositories]
internal = { url = "${env:NEXUS_URL}", username = "${env:NEXUS_USER}", password = "${env:NEXUS_PASS}" }

Validation

Checked when the manifest loads, before any build work:

  • package.name is non-empty and contains only alphanumerics, -, and _
  • package.version parses as semver
  • Android min-sdk <= target-sdk
  • Target names are recognized, in [targets] and in a source set's targets
  • [source-sets] names end in Main or Test (or are main/test), and their depends-on edges form no cycle
  • [flavors] default and exclude reference declared dimensions and flavors

Failures report the offending key rather than a generic parse error.