Native: How to get the ToolChain used/chosen by Gradle 4.4 for a build or a project?

Hi

Since Gradle 4.4 support the automatic discovery of the underlying toolchains (especially VisualSudio 2017), how a script can know which toolchain has been chosen by Gradle in a non compiling task (for exemple in the top level build, in a Exec task)?

Hi,

does the method VisualCppToolChain.isVisualCpp2015() help you? Still, that is no public API.
I think there is currently no way how to obtain the version of VisualStudio via the public API.
I guess your best bet is that https://github.com/gradle/gradle-native/issues/324 gets implemented.

Cheers,
Stefan

That’s some kind of property that I am looking for. But there should be also
VisualCppToolChain.isVisualCpp2017()
VisualCppToolChain.isVisualCpp2015()
VisualCppToolChain.isVisualCpp2013()
VisualCppToolChain.isVisualCpp2012()
VisualCppToolChain.isVisualCpp2010()

and the same for gcc (version 4.7, 4.9, 5.1, etc…) & clang idem