sdkman / sdkman-cli

The SDKMAN! Command Line Interface
https://sdkman.io
Apache License 2.0
5.97k stars 629 forks source link

Changes to `env` parameter not taken in account by gradle incremental build #487

Open samuelkister opened 7 years ago

samuelkister commented 7 years ago

Hello,

when rebuilding the client with another setting of -Penv=xxx without making changes to the source code, the task :prepareScripts is up to date, and thus the right server settings are not set correctly in the output.

Exemple :

17:49 samuel@ra% gradle clean Environment is set to: local :clean

BUILD SUCCESSFUL

Total time: 0.939 secs 17:49 samuel@ra% gradle -Penv=local assemble
Environment is set to: local :prepareScripts :assembleArchive :compileJava UP-TO-DATE :compileGroovy UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :jar :assemble

BUILD SUCCESSFUL

Total time: 1.01 secs 17:49 samuel@ra% gradle -Penv=production assemble Environment is set to: production :prepareScripts UP-TO-DATE :assembleArchive UP-TO-DATE :compileJava UP-TO-DATE :compileGroovy UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :jar UP-TO-DATE :assemble UP-TO-DATE

BUILD SUCCESSFUL

Total time: 0.933 secs

I would suggest to add inputs.property("environment", environment)̀ at the beginning of the prepareScript task.

marc0der commented 7 years ago

Feel free to raise a pull request for this, I'd be happy to merge it.