Search in sources :

Example 11 with BuildOperationLogger

use of org.gradle.internal.operations.logging.BuildOperationLogger 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)11 BuildOperationLogger (org.gradle.internal.operations.logging.BuildOperationLogger)11 WorkResult (org.gradle.api.tasks.WorkResult)9 NativePlatformInternal (org.gradle.nativeplatform.platform.internal.NativePlatformInternal)7 NativeToolChainInternal (org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal)5 BuildOperationLoggerFactory (org.gradle.internal.operations.logging.BuildOperationLoggerFactory)4 NativeCompileSpec (org.gradle.nativeplatform.toolchain.internal.NativeCompileSpec)4 PlatformToolProvider (org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider)4 File (java.io.File)2 OutputFile (org.gradle.api.tasks.OutputFile)2 DefaultWindowsResourceCompileSpec (org.gradle.language.rc.internal.DefaultWindowsResourceCompileSpec)2 DefaultSwiftCompileSpec (org.gradle.language.swift.tasks.internal.DefaultSwiftCompileSpec)2 SwiftCompileSpec (org.gradle.nativeplatform.toolchain.internal.compilespec.SwiftCompileSpec)2 IncrementalSwiftCompiler (org.gradle.nativeplatform.toolchain.internal.swift.IncrementalSwiftCompiler)2 InputFileDetails (org.gradle.api.tasks.incremental.InputFileDetails)1 DefaultAssembleSpec (org.gradle.language.assembler.internal.DefaultAssembleSpec)1 DefaultStaticLibraryArchiverSpec (org.gradle.nativeplatform.internal.DefaultStaticLibraryArchiverSpec)1 DefaultStripperSpec (org.gradle.nativeplatform.internal.DefaultStripperSpec)1 DefaultSymbolExtractorSpec (org.gradle.nativeplatform.internal.DefaultSymbolExtractorSpec)1 LinkerSpec (org.gradle.nativeplatform.internal.LinkerSpec)1