Setting environment variables from Gradle
问题 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? 回答1: 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" 回答2: It is impossible to set