use of org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal in project gradle by gradle.
the class AbstractNativeSourceCompileTask method getCompilerVersion.
/**
* The compiler used, including the type and the version.
*
* @since 4.4
*/
@Nullable
@Optional
@Nested
protected CompilerVersion getCompilerVersion() {
NativeToolChainInternal toolChain = (NativeToolChainInternal) getToolChain().get();
NativePlatformInternal targetPlatform = (NativePlatformInternal) getTargetPlatform().get();
PlatformToolProvider toolProvider = toolChain.select(targetPlatform);
Compiler<? extends NativeCompileSpec> compiler = toolProvider.newCompiler(createCompileSpec().getClass());
if (!(compiler instanceof VersionAwareCompiler)) {
return null;
}
return ((VersionAwareCompiler) compiler).getVersion();
}
use of org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal in project gradle by gradle.
the class DefaultToolChainSelector method select.
public Result<CppPlatform> select(CppPlatform requestPlatform) {
DefaultNativePlatform targetNativePlatform = newNativePlatform(requestPlatform.getTargetMachine());
// TODO - push all this stuff down to the tool chain and let it create the specific platform and provider
NativeLanguage sourceLanguage = NativeLanguage.CPP;
NativeToolChainInternal toolChain = getToolChain(sourceLanguage, targetNativePlatform);
// TODO - don't select again here, as the selection is already performed to select the toolchain
PlatformToolProvider toolProvider = toolChain.select(sourceLanguage, targetNativePlatform);
CppPlatform targetPlatform = new DefaultCppPlatform(requestPlatform.getTargetMachine(), targetNativePlatform);
return new DefaultResult<CppPlatform>(toolChain, toolProvider, targetPlatform);
}
use of org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal in project gradle by gradle.
the class DefaultToolChainSelector method getToolChain.
private NativeToolChainInternal getToolChain(NativeLanguage sourceLanguage, NativePlatformInternal targetNativePlatform) {
NativeToolChainRegistryInternal registry = modelRegistry.realize("toolChains", NativeToolChainRegistryInternal.class);
NativeToolChainInternal toolChain = registry.getForPlatform(sourceLanguage, targetNativePlatform);
toolChain.assertSupported();
return toolChain;
}
Aggregations