Project

The Project model is a base schema that craft applications can modify to meet the needs of their respective domains.

Schema

name

Type

str

Description

The name of the project. This is used when uploading, publishing, or installing.

The project name must consist only of lower-case ASCII letters (a-z), numerals (0-9), and hyphens (-). It must contain at least one letter, not start or end with a hyphen, and not contain two consecutive hyphens. The maximum length is 40 characters.

Examples

name: ubuntu
name: jupyterlab-desktop
name: lxd
name: digikam
name: kafka
name: mysql-router-k8s

title

Type

str

Description

A human-readable title.

Examples

title: Ubuntu Linux
title: Jupyter Lab Desktop
title: LXD
title: DigiKam
title: Apache Kafka
title: MySQL Router K8s charm

version

Type

str

Description

The version of the project, enclosed in quotation marks.

Examples

version: '0.1'
version: 1.0.0
version: v1.0.0
version: '24.04'

summary

Type

str

Description

A short description of the project.

Examples

summary: Linux for Human Beings
summary: The cross-platform desktop application for JupyterLab
summary: Container and VM manager
summary: Photo Management Program
summary: Charm for routing MySQL databases in Kubernetes
summary: An open-source event streaming platform for high-performance data pipelines

description

Type

str

Description

The full description of the project.

This is a free-form field, but it is typically assigned one to two brief paragraphs describing what the project does and who may find it useful.

base

Type

str

Description

The base layer used as the project’s run-time environment.

If the build-base key is unset, then the base key also determines the project’s build environment.

build-base

Type

str

Description

This key determines the project’s build environment.

platforms

Type

dict[str, Platform]

Description

Determines which architectures the project builds and runs on.

If the platform name is a valid Debian architecture, the build-on and build-for keys can be omitted.

The platform name describes a build-on-build-for pairing. When setting build-on and build-for, the name is arbitrary but it’s recommended to match the platform name to the architecture set by build-for.

Examples

platforms:
  amd64:
    build-on:
      - amd64
    build-for:
      - amd64
  arm64:
    build-on:
      - amd64
      - arm64
    build-for:
      - arm64

contact

Type

str | list[str]

Description

The author’s contact links and email addresses.

Examples

contact:
  - [email protected]
  - https://example.com/contact

issues

Type

str | list[str]

Description

The links and email addresses for submitting issues, bugs, and feature requests.

Examples

issues:
  - [email protected]
  - https://example.com/issues

source-code

Type

str | list[str]

Description

The links to the source code of the project.

Examples

source-code:
  - https://github.com/canonical/craft-application

license

Type

str

Description

The project’s license as an SPDX expression.

Currently, only SPDX 2.1 expressions are supported.

For “or later” and “with exception” license styles, refer to Appendix V of the SPDX Specification 2.1.

Examples

license: GPL-3.0+
license: Apache-2.0

adopt-info

Type

str

Description

Selects a part to inherit metadata from.

Examples

adopt-info: foo-part

parts

Type

dict[str, Part]

Description

The self-contained software pieces needed to create the final artifact.

A part’s behavior is driven by its plugin. Custom behavior can be defined with the override- keys.

Examples

parts:
  cloud-init:
    plugin: python
    source-type: git
    source: https://git.launchpad.net/cloud-init

package-repositories

Type

list[dict[str, Any]]

Description

The APT package repositories to use as sources for build and stage packages.

The Debian, Personal Package Archive (PPA), and Ubuntu Cloud Archive (UCA) package formats are supported.

Examples

package-repositories:
  - type: apt
    components:
      - main
    suites:
      - xenial
    key-id: 78E1918602959B9C59103100F1831DDAFC42E99D
    url: http://ppa.launchpad.net/snappy-dev/snapcraft-daily/ubuntu