license-gradle-plugin icon indicating copy to clipboard operation
license-gradle-plugin copied to clipboard

Plugin doesn't fail build when substitution variables are changed

Open codeaholics opened this issue 12 years ago • 6 comments

  1. Clone codeaholics/license-gradle-plugin-demo.
  2. Run ./gradlew check and observe that it reports a missing header
  3. Run ./gradlew licenseFormatMain and observe that it correctly adds the header
  4. Run ./gradlew check again and observe that it no longer reports the missing header (this is an important step)
  5. Modify the build script and set year (line 28) to something like 2000
  6. 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.

codeaholics avatar Jan 10 '13 22:01 codeaholics

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?

Grinch avatar Jan 20 '14 17:01 Grinch

Would definitely like to see a fix for this.

Grinch avatar Feb 08 '14 17:02 Grinch

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 .

hierynomus avatar Feb 09 '14 14:02 hierynomus

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.

porst17 avatar Jan 13 '16 10:01 porst17

I have to admit this slipped my mind. I would welcome a PR, and will try to have a look at this sometime soon.

hierynomus avatar Jan 15 '16 10:01 hierynomus

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 ...

porst17 avatar Jan 15 '16 12:01 porst17