Tooling api - support for relative paths in gradle.properties

Hi!

I’m having some difficulty using the gradle tooling api with relative paths in set in gradle.properies.

A simple example of this:

org.gradle.java.home=../../../../../Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home

If I use the tooling API to run a build from a project with the above set, I get an error “Could not fetch model of type ‘GradleProject’ using Gradle distribution”

If I use the gradle wrapper from the root of the project, it works fine.

Another example of using relative paths in gradle.properties:

org.gradle.jvmargs=-Djavax.net.ssl.trustStore="../../../../modules/Common/security/cacerts" -Djavax.net.ssl.trustStorePassword=<trust-password>

Is there any way I can specify the “current working directory”, or similar, to let gradle run it’s build from the root of the corresponding project, to ensure relative paths work?

Is this limitation of the tooling API well known and is there any documentation that states this limitation of the tooling api?

I’ve found a similar bug report for intellij (which i assume uses the tooling api): https://youtrack.jetbrains.com/issue/IDEABKL-7164

Thanks in advance for any advice on this.

This (very old) thread seems related: Is it possible to set the process 'cwd' (aka 'working directory') via the tooling API?