We switched for our project from ant to gradle. Now the gradle script looks like this
[...]
def filterFile = System.getProperty('filter.file')
[...]
All tasks heavily depend on the environment variable filterFile. We use eclipse (Oxygen.2 Decemeber 2017) with buildship (2.2.1 v20180125-1441) (which came somehow preinstalled with eclipse? Is that correct that buildship automaticaly comes with eclipse?)
The only way I could make it work is set the variable on task level see screenshot
The same DOES NOT work on project level:
When I now remove the setting on the task and put it on the project global setting and execute the very same task it says:
Program Arguments: None
Build Scans Enabled: false
Offline Mode Enabled: false
Gradle Tasks: copyHtml
Filter file null not loaded, some tasks may fail
while this works when I set it on the task level.
This are my preference settings for gradle in eclipse:
Can you please explain of how to set a project wide environment variable. BTW: I googled the problem and found out about home directory gradle.properties file. But I think this will set project variables and NOT environment variables. As we switched from ant to gradle the gradle build script depends on System.getProperty('filter.file') which might be the wrong way to set this up for gradle but it's the remainigs from the migration from ant so it would be hard for us to change this for every task (as we have plenty of them).
Please advise!