use of org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal in project gradle by gradle.
the class WindowsResourceCompile method compile.
@TaskAction
public void compile(InputChanges inputs) {
BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
NativeCompileSpec spec = new DefaultWindowsResourceCompileSpec();
spec.setTempDir(getTemporaryDir());
spec.setObjectFileDir(getOutputDir());
spec.include(getIncludes());
spec.source(getSource());
spec.setMacros(getMacros());
spec.args(getCompilerArgs().get());
spec.setIncrementalCompile(inputs.isIncremental());
spec.setOperationLogger(operationLogger);
NativeToolChainInternal nativeToolChain = (NativeToolChainInternal) toolChain.get();
NativePlatformInternal nativePlatform = (NativePlatformInternal) targetPlatform.get();
PlatformToolProvider platformToolProvider = nativeToolChain.select(nativePlatform);
WorkResult result = doCompile(spec, platformToolProvider);
setDidWork(result.getDidWork());
}
use of org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal 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.NativeToolChainInternal in project gradle by gradle.
the class AbstractNativeBinarySpec method getBinaryBuildAbility.
@Override
protected BinaryBuildAbility getBinaryBuildAbility() {
NativeToolChainInternal toolChainInternal = (NativeToolChainInternal) getToolChain();
NativePlatformInternal platformInternal = (NativePlatformInternal) getTargetPlatform();
return new ToolSearchBuildAbility(toolChainInternal.select(platformInternal));
}
use of org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal 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.NativeToolChainInternal 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);
}
Aggregations