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

Open
samuelkister opened this Issue Nov 12, 2016 · 1 comment

Projects

None yet

2 participants

@samuelkister
samuelkister commented Nov 12, 2016 edited

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.

@samuelkister samuelkister changed the title from Change of `env` variable not taken in account by gradle incremental build to Changes to `env` parameter not taken in account by gradle incremental build Nov 15, 2016
@marc0der
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment