diff --git a/extensions/project-descriptor.md b/extensions/project-descriptor.md index 83531a7c..646a594e 100644 --- a/extensions/project-descriptor.md +++ b/extensions/project-descriptor.md @@ -7,81 +7,154 @@ A project descriptor is a file that MAY contain configuration for apps, services - [Project Descriptor](#project-descriptor) - [Table of Contents](#table-of-contents) - - [Schema](#schema) - - [`[project]`](#project) - - [`[[project.licenses]]`](#projectlicenses) - - [`[build.include]` and `[build.exclude]`](#buildinclude-and-buildexclude) - - [`[[build.buildpacks]]`](#buildbuildpacks) - - [`[[build.env]]`](#buildenv) - - [`[metadata]`](#metadata) + - [Schema Version](#schema-version) + - [Special Value Types](#special-value-types) + - [Top Level Tables](#top-level-tables) + - [Non-`_` Tables](#non-_-tables) + - [`_`](#_) + - [`_.licenses` (optional)](#_licenses-optional) + - [`_.metadata` (optional)](#_metadata-optional) + - [`io.buildpacks` (optional)](#iobuildpacks-optional) + - [`io.buildpacks.builder` (optional)](#iobuildpacksbuilder-optional) + - [`io.buildpacks.include` (optional) and `io.buildpacks.exclude` (optional)](#iobuildpacksinclude-optional-and-iobuildpacksexclude-optional) + - [`io.buildpacks.group` (optional)](#iobuildpacksgroup-optional) + - [`io.buildpacks.pre.group` (optional)](#iobuildpackspregroup-optional) + - [`io.buildpacks.post.group` (optional)](#iobuildpackspostgroup-optional) + - [`io.buildpacks.build.env` (optional)](#iobuildpacksbuildenv-optional) - [Example](#example) -## Schema +## Schema Version -The TOML schema of the project descriptor is the following: +This document specifies Project Descriptor Schema Version `0.2`. + +The Schema Version format follows the form of the [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version): + +* MUST be in form . or , where is equivalent to .0 +* When is greater than 0 increments to SHALL exclusively indicate additive changes + +## Special Value Types + +* `schema-version` - A string that follows the format of [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version). +* `uri` - A string that follows the format of [RFC3986](https://tools.ietf.org/html/rfc3986). + +## Top Level Tables + +### Non-`_` Tables + +All other tables besides `_` will use reverse domains, i.e. buildpacks.io will be `[io.buildpacks]`. These tables can be optionally versioned with a schema version number using the `schema-version` field. All these tables are optional. + +### `_` + +The TOML schema of the project section of the project descriptor: ```toml -[project] +[_] +schema-version = "" id = "" # machine readable name = "" # human readable version = "" authors = [""] -documentation-url = "" -source-url = "" +documentation-url = "" +source-url = "" -[[project.licenses]] +[[_.licenses]] type = "" uri = "" -[build] -include = [""] -exclude = [""] -[[build.buildpacks]] -id = "" -version = "" -uri = "" -[[build.env]] -name = "" -value = "" -[metadata] +[_.metadata] # additional arbitrary keys allowed ``` -The following sections describe each part of the schema in detail. - -## `[project]` - -The top-level `[project]` table MAY contain configuration about the repository, including `id` and `version`. It MAY also include metadata about how it is authored, documented, and version controlled. - -The `project.id` +The top-level `_` table MAY contain configuration about the repository, including `id` and `version`. It MAY also include metadata about how it is authored, documented, and version controlled. It MUST contain `schema-version` to denote which schema version the descriptor is using. ```toml -[project] +[_] +schema-version = "" id = "" name = "" version = "" +authors = [""] +documentation-url = "" +source-url = "" ``` +* `schema-version` - version identifier for the schema of the `_` table and structure of the project descriptor file. * `id` - (optional) the machine readable identifier of the project (ex. "com.example.myservice") * `name` - (optional) the human readable name of the project (ex. "My Example Service") * `version` - (optional) and arbitrary string representing the version of the project * `authors` - (optional) the names and/or email addresses of the project's authors -* `documentation-url` - (optional) a URL to the documentation for the project +* `documentation-url` - (optional) a URL to the documentation for the project. * `source-url` - (optional) a URL to the source code for the project -## `[[project.licenses]]` +#### `_.licenses` (optional) -An optional list of project licenses. +This table MAY contain project licenses. + +```toml +[[_.licenses]] +type = "" +uri = "" +``` * `type` - This MAY use the [SPDX 2.1 license expression](https://spdx.org/spdx-specification-21-web-version), but is not limited to identifiers in the [SPDX Licenses List](https://spdx.org/licenses/). * `uri` - If this project is using a nonstandard license, then this key MAY be specified in lieu of or in addition to `type` to point to the license. -## `[build.include]` and `[build.exclude]` +#### `_.metadata` (optional) -A optional list of files to include in the build (while excluding everything else): +This is a free form table for users to use as they see fit. The keys in this table are not validated. ```toml -[build] +[_.metadata.foo] +checksum = "a28a0d7772df1f918da2b1102da4ff35" +``` + + +### `io.buildpacks` (optional) + +This is the Cloud Native Buildpacks' section of the project descriptor. The TOML schema is the following: + +``` +[io.buildpacks] +builder = "" +include = [""] +exclude = [""] + +[[io.buildpacks.group]] +id = "" +version = "" +uri = "" + + [io.buildpacks.group.script] + api = "" + shell = "" + inline = "