license-gradle-plugin
license-gradle-plugin copied to clipboard
Plugin doesn't fail build when substitution variables are changed
- Clone codeaholics/license-gradle-plugin-demo.
- Run ./gradlew check and observe that it reports a missing header
- Run ./gradlew licenseFormatMain and observe that it correctly adds the header
- Run ./gradlew check again and observe that it no longer reports the missing header (this is an important step)
- Modify the build script and set year (line 28) to something like 2000
- Run ./gradlew check and observe that it does NOT report the incorrect header
I believe that the task should be recording some or all of its input properties (and variable substitutions) using TaskInputs.property() otherwise Gradle skips the task execution because it doesn't realise that properties which would affect the result have changed.
I've noticed that license-gradle-plugin doesn't actually update my licenses when I change substituted variables in my build.gradle, I have to actually screw up a license somewhere not related to the variable and re-run it just for it to go through them all and update them.
Any chance this could be fixed in the next release?
Would definitely like to see a fix for this.
Will have a look as soon as I have some time. On Feb 8, 2014 6:03 PM, "Steven Downer" [email protected] wrote:
Would definitely like to see a fix for this.
Reply to this email directly or view it on GitHubhttps://github.com/hierynomus/license-gradle-plugin/issues/14#issuecomment-34549132 .
I seems like this issue still persists in 2016. Any chance to have this fixed shortly? Updating years and lists of authors is a frequently occurring task and I would be glad if this plugin would support this important use case properly.
I have to admit this slipped my mind. I would welcome a PR, and will try to have a look at this sometime soon.
I never built a gradle plugin so far and I am also unfamiliar with groovy (besides writing simple gradle build scripts). I don't think I will be able to fix this on my own.
Anyway, it looks to me that the up-to-date check only recognized changes in the license file. The substitution variables seem to be ignored. Probably what @codeaholics already mentioned above who seems to be more familiar with writing gradle plugins ...