Distribution

API Documentation:Distribution

A distribution allows to bundle an application or a library including dependencies, sources...

Properties

PropertyDescription
contents

The contents of the distribution.

distributionBaseName

The baseName of the distribution, used in naming the distribution archives.

name

The name of this distribution.

Methods

MethodDescription
contents(action)

Configures the contents of the distribution.

Script blocks

No script blocks

Property details

CopySpec contents (read-only)

The contents of the distribution.

Property<String> distributionBaseName

The baseName of the distribution, used in naming the distribution archives.

If the Distribution.getName() of this distribution is "main" this defaults to the project's name. Otherwise it is "$project.name-$this.name".

String name (read-only)

The name of this distribution.

Method details

CopySpec contents(Action<? super CopySpec> action)

Configures the contents of the distribution.

Can be used to configure the contents of the distribution:

plugins {
    id 'distribution'
}

distributions {
    main {
        contents {
            from "src/readme"
        }
    }
}

The DSL inside the contents\{ } block is the same DSL used for Copy tasks.