Search in sources :

Example 1 with NativeCompileSpec

use of org.gradle.nativeplatform.toolchain.internal.NativeCompileSpec in project gradle by gradle.

the class AbstractNativeCompileTask method compile.

@TaskAction
public void compile(IncrementalTaskInputs inputs) {
    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
    NativeCompileSpec spec = createCompileSpec();
    spec.setTargetPlatform(targetPlatform.get());
    spec.setTempDir(getTemporaryDir());
    spec.setObjectFileDir(objectFileDir.get().getAsFile());
    spec.include(includes);
    spec.source(getSource());
    spec.setMacros(getMacros());
    spec.args(getCompilerArgs().get());
    spec.setPositionIndependentCode(isPositionIndependentCode());
    spec.setDebuggable(isDebuggable());
    spec.setOptimized(isOptimized());
    spec.setIncrementalCompile(inputs.isIncremental());
    spec.setOperationLogger(operationLogger);
    configureSpec(spec);
    NativeToolChainInternal nativeToolChain = (NativeToolChainInternal) toolChain.get();
    NativePlatformInternal nativePlatform = (NativePlatformInternal) targetPlatform.get();
    PlatformToolProvider platformToolProvider = nativeToolChain.select(nativePlatform);
    setDidWork(doCompile(spec, platformToolProvider).getDidWork());
}
Also used : NativeToolChainInternal(org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal) BuildOperationLogger(org.gradle.internal.operations.logging.BuildOperationLogger) PlatformToolProvider(org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider) NativeCompileSpec(org.gradle.nativeplatform.toolchain.internal.NativeCompileSpec) NativePlatformInternal(org.gradle.nativeplatform.platform.internal.NativePlatformInternal) TaskAction(org.gradle.api.tasks.TaskAction)

Example 2 with NativeCompileSpec

use of org.gradle.nativeplatform.toolchain.internal.NativeCompileSpec in project gradle by gradle.

the class WindowsResourceCompile method compile.

@TaskAction
public void compile(IncrementalTaskInputs 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());
    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());
}
Also used : NativeToolChainInternal(org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal) BuildOperationLogger(org.gradle.internal.operations.logging.BuildOperationLogger) DefaultWindowsResourceCompileSpec(org.gradle.language.rc.internal.DefaultWindowsResourceCompileSpec) PlatformToolProvider(org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider) NativeCompileSpec(org.gradle.nativeplatform.toolchain.internal.NativeCompileSpec) NativePlatformInternal(org.gradle.nativeplatform.platform.internal.NativePlatformInternal) WorkResult(org.gradle.api.tasks.WorkResult) TaskAction(org.gradle.api.tasks.TaskAction)

Example 3 with NativeCompileSpec

use of org.gradle.nativeplatform.toolchain.internal.NativeCompileSpec 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());
}
Also used : NativeToolChainInternal(org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal) BuildOperationLogger(org.gradle.internal.operations.logging.BuildOperationLogger) DefaultWindowsResourceCompileSpec(org.gradle.language.rc.internal.DefaultWindowsResourceCompileSpec) PlatformToolProvider(org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider) NativeCompileSpec(org.gradle.nativeplatform.toolchain.internal.NativeCompileSpec) NativePlatformInternal(org.gradle.nativeplatform.platform.internal.NativePlatformInternal) WorkResult(org.gradle.api.tasks.WorkResult) TaskAction(org.gradle.api.tasks.TaskAction)

Example 4 with NativeCompileSpec

use of org.gradle.nativeplatform.toolchain.internal.NativeCompileSpec in project gradle by gradle.

the class AbstractNativeCompileTask method compile.

@TaskAction
protected void compile(InputChanges inputs) {
    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
    NativeCompileSpec spec = createCompileSpec();
    spec.setTargetPlatform(targetPlatform.get());
    spec.setTempDir(getTemporaryDir());
    spec.setObjectFileDir(objectFileDir.get().getAsFile());
    spec.include(includes);
    spec.systemInclude(systemIncludes);
    spec.source(getSource());
    spec.setMacros(getMacros());
    spec.args(getCompilerArgs().get());
    spec.setPositionIndependentCode(isPositionIndependentCode());
    spec.setDebuggable(isDebuggable());
    spec.setOptimized(isOptimized());
    spec.setIncrementalCompile(inputs.isIncremental());
    spec.setOperationLogger(operationLogger);
    configureSpec(spec);
    NativeToolChainInternal nativeToolChain = (NativeToolChainInternal) toolChain.get();
    NativePlatformInternal nativePlatform = (NativePlatformInternal) targetPlatform.get();
    PlatformToolProvider platformToolProvider = nativeToolChain.select(nativePlatform);
    setDidWork(doCompile(spec, platformToolProvider).getDidWork());
}
Also used : NativeToolChainInternal(org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal) BuildOperationLogger(org.gradle.internal.operations.logging.BuildOperationLogger) PlatformToolProvider(org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider) NativeCompileSpec(org.gradle.nativeplatform.toolchain.internal.NativeCompileSpec) NativePlatformInternal(org.gradle.nativeplatform.platform.internal.NativePlatformInternal) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

TaskAction (org.gradle.api.tasks.TaskAction)4 BuildOperationLogger (org.gradle.internal.operations.logging.BuildOperationLogger)4 NativePlatformInternal (org.gradle.nativeplatform.platform.internal.NativePlatformInternal)4 NativeCompileSpec (org.gradle.nativeplatform.toolchain.internal.NativeCompileSpec)4 NativeToolChainInternal (org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal)4 PlatformToolProvider (org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider)4 WorkResult (org.gradle.api.tasks.WorkResult)2 DefaultWindowsResourceCompileSpec (org.gradle.language.rc.internal.DefaultWindowsResourceCompileSpec)2