Gradle Distribution Plugin

From NovaOrdis Knowledge Base
Revision as of 22:53, 28 July 2018 by Ovidiu (talk | contribs)
Jump to navigation Jump to search

External

Internal


Overview

The Distribution plugin builds archives that serve as distributions of the project. They typically contain the executable application and other supporting files, such as the documentation. The Distribution plugin is part of the Application plugin flow. The plugin adds an extension named "distributions" of type DistributionContainer. It also creates a single distribution in the distributions container, named "main". Multiple distributions can be configured.

The distribution files are created in $buildDir/distributions/$project.name-$project.version.<ext>.

Building Custom Files with the Distribution

All files in the ./src/<distribution-name>/dist directory will be automatically included in the distribution.

Additional files can be added by configuring the Distribution object:

apply plugin: 'distribution'

...

distributions {
    main {
        baseName = 'someName'
        contents {
            from { 'src/readme' }
        }
    }
}

Multiple Distributions

See "Adding extra distributions" in documentation.