I need to execute from Gradle an Ant script which relies on environment variables.
Ant uses <property environment="env"/>
for it.
I tried to do env.foo="bar"
in Gradle, but it throws a Groovy exception.
What is the proper way to pass environment variables from Gradle to Ant?
In File Explorer right-click on the This PC (or Computer ) icon, then click Properties -> Advanced System Settings -> Environmental Variables . Under System Variables select Path , then click Edit . Add an entry for C:\Gradle\gradle-7.5.1\bin . Click OK to save.
From the gradle 2.0 docs, i see something like this is possible
test {
environment "LD_LIBRARY_PATH", "lib"
}
Or in this case could use this
systemProperty "java.library.path", "lib"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With