All Projects → CadixDev → licenser

CadixDev / licenser

Licence: MIT license
A simple license header manager for Gradle

Programming Languages

groovy
2714 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to licenser

GradleMongoPlugin
Gradle plugin for running a managed instance of Mongo.
Stars: ✭ 48 (+50%)
Mutual labels:  gradle-plugin
gretty
Advanced gradle plugin for running web-apps on jetty and tomcat.
Stars: ✭ 116 (+262.5%)
Mutual labels:  gradle-plugin
RapidMavenPushPlugin
A Gradle plugin : Upload Artifacts to Multi Maven Repository
Stars: ✭ 21 (-34.37%)
Mutual labels:  gradle-plugin
spotbugs-gradle-plugin
plugins.gradle.org/plugin/com.github.spotbugs
Stars: ✭ 137 (+328.13%)
Mutual labels:  gradle-plugin
gradle-http-plugin
Gradle plugin providing support for using HttpBuilder-NG to make HTTP requests as Gradle Tasks.
Stars: ✭ 30 (-6.25%)
Mutual labels:  gradle-plugin
npm-publish
Gradle plugin for NPM package publishing. Allows for arbitrary publishing as well as seamless integration with Kotlin JS/MPP plugins.
Stars: ✭ 66 (+106.25%)
Mutual labels:  gradle-plugin
gradle-j2cl-plugin
Gradle J2CL Plugin
Stars: ✭ 18 (-43.75%)
Mutual labels:  gradle-plugin
gradle-release-plugin
Gradle plugin providing very minimal release version numbering (Git-specific)
Stars: ✭ 43 (+34.38%)
Mutual labels:  gradle-plugin
moko-network
Network components with codegeneration of rest api for mobile (android & ios) Kotlin Multiplatform development
Stars: ✭ 107 (+234.38%)
Mutual labels:  gradle-plugin
webdriver-binaries-gradle-plugin
A Gradle plugin that downloads and caches WebDriver binaries specific to the OS the build runs on
Stars: ✭ 31 (-3.12%)
Mutual labels:  gradle-plugin
harmonica
Kotlin Database Migration Tool. This tool makes it really easy to create table, index, add columns, and so on, with Kotlin DSL.
Stars: ✭ 123 (+284.38%)
Mutual labels:  gradle-plugin
graphql-java-codegen-gradle-plugin
Gradle plugin for graphql-java-codegen
Stars: ✭ 19 (-40.62%)
Mutual labels:  gradle-plugin
jetbrains-gradle-plugins
Gradle plugins for Docker, Terraform and Liquibase.
Stars: ✭ 22 (-31.25%)
Mutual labels:  gradle-plugin
boost
Boost Maven and Gradle plugins for MicroProfile development
Stars: ✭ 27 (-15.62%)
Mutual labels:  gradle-plugin
scalatest-junit-runner
JUnit 5 runner for Scalatest
Stars: ✭ 30 (-6.25%)
Mutual labels:  gradle-plugin
gradle-plugin-starter
Gradle plugin template project
Stars: ✭ 34 (+6.25%)
Mutual labels:  gradle-plugin
gradle-scalafmt
Gradle plugin for scalafmt
Stars: ✭ 25 (-21.87%)
Mutual labels:  gradle-plugin
gradle-marytts-voicebuilding-plugin
A replacement for the legacy VoiceImportTools in MaryTTS
Stars: ✭ 14 (-56.25%)
Mutual labels:  gradle-plugin
kgql
GraphQL Document wrapper generator for Kotlin Multiplatform Project and Android
Stars: ✭ 54 (+68.75%)
Mutual labels:  gradle-plugin
xmake-gradle
A gradle plugin that integrates xmake seamlessly
Stars: ✭ 31 (-3.12%)
Mutual labels:  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

  • Apply pre-defined license header in a file to the source files of the source sets or any other set of files (configurable)
  • Variable substitution in the license header file
  • Apply license header only to certain files (include/exclude possible)
  • Apply special license headers to matching files
  • Support for Android projects

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.

  • Custom header file source: (Default: LICENSE in project directory)

    license {
        header = project.file('HEADER.txt')
    }
  • Variable substitution in the license header:

    license {
        header = project.file('HEADER.txt')
        properties {
            name = 'Company'
            year = 2018
        }
    
        // Example license header: Copyright (C) ${year} ${name}
    }
  • Toggle new empty line after the license header: (Default: true)

    license {
        newLine = false // Disables the new line
    }
  • Ignore existing license headers: (Default: false)

    license {
        skipExistingHeaders = true // Ignore existing license headers on files
    }
  • Exclude/include certain file types: (Default: Excludes files without standard comment format and binary files)

    license {
        include '**/*.java' // Apply license header ONLY to Java files
        // OR
        exclude '**/*.properties' // Apply license header NOT to properties files
    }
  • Apply special license header to some matching files:

    license {
        // Apply special license header to one source file
        matching('**/ThirdPartyLibrary.java') {
            header = file('THIRDPARTY-LICENSE.txt')
        }
        
        // Apply special license header to matching source files
        matching(includes: ['**/thirdpartylibrary/**', '**/ThirdPartyLibrary.java']) {
            header = file('THIRDPARTY-LICENSE.txt')
        }
    }
  • Custom tasks: Apply license header to files outside of source set:

    license {
        tasks {
            gradle {
                files.from('build.gradle.kts', 'settings.gradle.kts', 'gradle.properties')
                // header = ... (optional)
            }
            directory {
                files.from('path/to/directory')
                // include/exclude ... (optional)
            }
        }
    }
  • Manage file extension to license header styles:

    license {
        style {
            java = 'JAVADOC' // Sets Java license header style to JAVADOC (/**)
        }
    }
  • Other options:

    license {
        // Ignore failures and only print a warning on license violations
        ignoreFailures = true
    
        // Read/write files with platform charset (Default: UTF-8)
        charset = Charset.defaultCharset().name()
    
        // Override the line ending used for license files (Default: system line ending)
        lineEnding = '\n'
    }
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].