use of org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider in project gradle by gradle.
the class DefaultToolChainSelector method select.
public Result<SwiftPlatform> select(SwiftPlatform 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.SWIFT;
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);
SwiftVersion sourceCompatibility = requestPlatform.getSourceCompatibility();
if (sourceCompatibility == null && toolProvider.isAvailable()) {
sourceCompatibility = toSwiftVersion(toolProvider.getCompilerMetadata(ToolType.SWIFT_COMPILER).getVersion());
}
SwiftPlatform targetPlatform = new DefaultSwiftPlatform(requestPlatform.getTargetMachine(), sourceCompatibility, targetNativePlatform);
return new DefaultResult<SwiftPlatform>(toolChain, toolProvider, targetPlatform);
}
use of org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider in project gradle by gradle.
the class NativeBinaryRules method assignToolsToNativeBinary.
private static void assignToolsToNativeBinary(NativeBinarySpecInternal nativeBinary, NativeBinarySpec nativeBinarySpec, NativeToolChainRegistryInternal toolChains) {
NativeToolChainInternal toolChain = toolChainFor(nativeBinarySpec, toolChains);
PlatformToolProvider toolProvider = toolChain.select((NativePlatformInternal) nativeBinarySpec.getTargetPlatform());
nativeBinary.setToolChain(toolChain);
nativeBinary.setPlatformToolProvider(toolProvider);
}
use of org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider in project gradle by gradle.
the class SwiftCompile method createCompiler.
private Compiler<SwiftCompileSpec> createCompiler() {
NativePlatformInternal targetPlatform = Cast.cast(NativePlatformInternal.class, this.targetPlatform.get());
NativeToolChainInternal toolChain = Cast.cast(NativeToolChainInternal.class, getToolChain().get());
PlatformToolProvider toolProvider = toolChain.select(targetPlatform);
return toolProvider.newCompiler(SwiftCompileSpec.class);
}
use of org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider in project gradle by gradle.
the class AbstractLinkTask method createCompiler.
@SuppressWarnings("unchecked")
private Compiler<LinkerSpec> createCompiler() {
NativePlatformInternal targetPlatform = Cast.cast(NativePlatformInternal.class, this.targetPlatform.get());
NativeToolChainInternal toolChain = Cast.cast(NativeToolChainInternal.class, getToolChain().get());
PlatformToolProvider toolProvider = toolChain.select(targetPlatform);
Class<LinkerSpec> linkerSpecType = (Class<LinkerSpec>) createLinkerSpec().getClass();
return toolProvider.newCompiler(linkerSpecType);
}
use of org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider in project gradle by gradle.
the class ExtractSymbols method createCompiler.
private Compiler<SymbolExtractorSpec> createCompiler() {
NativePlatformInternal targetPlatform = Cast.cast(NativePlatformInternal.class, this.targetPlatform.get());
NativeToolChainInternal toolChain = Cast.cast(NativeToolChainInternal.class, getToolChain().get());
PlatformToolProvider toolProvider = toolChain.select(targetPlatform);
return toolProvider.newCompiler(SymbolExtractorSpec.class);
}
Aggregations