Hi I’m using ant.exec to start and spawn a process but I can’t get the ‘env’ attribute to work. From the Ant documentation “It is possible to specify environment variables to pass to the system command via nested <env>
elements.”
ant.exec(executable: "/usr/bin/node", spawn: "true") {
env(key: "NODE_PATH", value = "/usr/lib/node_modules")
arg(value: "$projectDir/restStaticServer/js/restAndStaticServer.js")
arg(value: "logging=true")
}
This results in the following error:
Execution failed for task ':startProxyServer'.
> No signature of method: java.util.Collections$UnmodifiableMap.call() is applicable for argument types: (java.util.LinkedHashMap, java.lang.String) values: [[key:NODE_PATH], /usr/lib/node_modules]
Possible solutions: wait(), any(), clear(), size(), values(), grep()
I don’t get any errors if I remove the ‘env’ attribute. Is setting the env attribute supported? If so am I doing something wrong?
This is using Gradle 2.5 on Ubuntu 14.04.
Thanks,
Rich.