This message was deleted.
# community-support
s
This message was deleted.
v
You cannot unfortunately
😢 1
s
Is there another way to set
org.gradle.java.installations.paths
for auto-detection of toolchains programmatically? Or another way to achieve the same thing, programmatically point the auto-detection at other paths to look at?
v
Make sure the path is in an environment variable and configure that environment variable as source for installation paths in
gradle.properties
.
Besides that, https://github.com/gradle/gradle/issues/16245 might be of interest too
s
Unfortunately I cannot ensure that the path is in an environment variable. In my case, a toolchain gets bootstrapped at build time (to a path that I can only determine at build time), and I can't set environment variables for the running process.
I guess your latter issue will be solved by the toolchain SPI coming with (hopefully) Gradle 7.6, or?
v
No, not at all
With the toolchain SPI you can only tell where to download if a toolchain is not found
That doesn't help at all, even if I would give some local location.
I have the same use-case as you, building a runtime image in the build and then wanting for example
run
and
test
to use that runtime image.
With the toolchain SPI it would maybe then one time use that local location to auto-provision the toolchain, but then use that provisioned toolchain, whether the built one changes or not
That wouldn't help in any way but just make things worse.
The only way I know currently is to not use toolchains for that use-case currently, but set the toolchain to a
null
producing provider to make the toolchain unset and configuring the
executable
to the built runtime path.
s
Oh, I was hoping that the upcoming toolchain SPI would also allow provide a local file path instead of a URL / URI, or implement some magic to not provision / copy the toolchain if it points to a
file:///
URI, but instead use it from there as-is.
v
At least I'm not aware of that. But even if it were that way, it would also have to cover absence, because on a clean build, the runtime is probably not there yet when the toolchain discovery is done.