hierynomus / license-gradle-plugin

Manage your license(s)
http://www.javadude.nl
Other
409 stars 114 forks source link

License won't be applied to gradle build files, in multi-module project #176

Open konstantinosraptis91 opened 5 years ago

konstantinosraptis91 commented 5 years ago

I have created a multi-module project and I want to apply a common license (.txt file) to every java class and every build.gradle file (root & submodules). The weird issue here is that license been applied successfully to all java classes but not in build.gradle files. Is there any limitations with .gradle files? I thought that the default plugin behaviour should do that without any special configuration.

My root's project build.gradle file configuration looks like this:

  plugins {
         id "com.github.hierynomus.license" version "0.15.0"
  }
  allprojects {
         apply plugin: "license"

         license {
               header = rootProject.file('LICENSE-HEADER-2.0.txt')
               ext.year = '2016-2019'
               ext.name = 'NAME'
               includes(["**/*.java", "**/*.properties", "**/*.groovy", "**/*.gradle"])
               skipExistingHeaders = true
               ignoreFailures = true
        }
  }

gradle version: 5.3

pranavvij commented 5 years ago

Any updates on this ??

aalmiray commented 4 years ago

The configuration is applied per sourceSet, such as main and test. Gradle files are not part of these sourceSets thus they are never updated. As a temporary workaround you'll have to define a custom task of type LicenseCheck that can be applied to Gradle files.