CadixDev / licenser

A simple license header manager for Gradle
https://git.io/licenser
MIT License
51 stars 18 forks source link
gradle-plugin

licenser

licenser is a simple license header manager for Gradle. It can automatically ensure that the source files contain a predefined license header and optionally generate them automatically using a Gradle task. It provides several options as configuration (e.g. variables in the license header, included file types, style of license header) so it can be customized for each project.

Features

Usage

For a simple project you only need to apply the licenser plugin to your project:

plugins {
    id 'org.cadixdev.licenser' version '0.6.1'
}

This will apply the LICENSE file found in the project directory to all common source file types known to licenser.

Tasks

Name Description
checkLicenses Verifies the license headers for the selected source files.
updateLicenses Updates the license headers in the selected source files. Will create a backup in build/tmp/updateLicense<SourceSet>/original.
checkLicense<SourceSet> Verifies the license headers for the specified source set.
updateLicense<SourceSet> Updates the license headers in the specified source set. Will create a backup in build/tmp/updateLicense<SourceSet>/original.
checkLicenseAndroid<SourceSet> Same as checkLicense<SourceSet>, but for Android source sets.
updateLicenseAndroid<SourceSet> Same as updateLicense<SourceSet>, but for Android source sets.
checkLicenseCustom<Name> Same as checkLicense<SourceSet>, but for custom tasks.
updateLicenseCustom<Name> Same as updateLicense<SourceSet>, but for custom tasks.
licenseCheck Alias for checkLicenses
licenseFormat Alias for updateLicenses

Configuration

The plugin can be configured using the license extension on the project.