Search in sources :

Example 1 with StaticLibraryArchiverSpec

use of org.gradle.nativeplatform.internal.StaticLibraryArchiverSpec in project gradle by gradle.

the class LibExeStaticLibraryArchiver method execute.

@Override
public WorkResult execute(final StaticLibraryArchiverSpec spec) {
    final StaticLibraryArchiverSpec transformedSpec = specTransformer.transform(spec);
    final List<String> args = argsTransformer.transform(transformedSpec);
    invocationContext.getArgAction().execute(args);
    new VisualCppOptionsFileArgsWriter(spec.getTempDir()).execute(args);
    final CommandLineToolInvocation invocation = invocationContext.createInvocation("archiving " + spec.getOutputFile().getName(), args, spec.getOperationLogger());
    buildOperationProcessor.run(commandLineToolInvocationWorker, new Action<BuildOperationQueue<CommandLineToolInvocation>>() {

        @Override
        public void execute(BuildOperationQueue<CommandLineToolInvocation> buildQueue) {
            buildQueue.setLogLocation(spec.getOperationLogger().getLogLocation());
            buildQueue.add(invocation);
        }
    });
    return new SimpleWorkResult(true);
}
Also used : StaticLibraryArchiverSpec(org.gradle.nativeplatform.internal.StaticLibraryArchiverSpec) CommandLineToolInvocation(org.gradle.nativeplatform.toolchain.internal.CommandLineToolInvocation) BuildOperationQueue(org.gradle.internal.operations.BuildOperationQueue) SimpleWorkResult(org.gradle.api.internal.tasks.SimpleWorkResult)

Example 2 with StaticLibraryArchiverSpec

use of org.gradle.nativeplatform.internal.StaticLibraryArchiverSpec in project gradle by gradle.

the class CreateStaticLibrary method link.

@TaskAction
public void link() {
    StaticLibraryArchiverSpec spec = new DefaultStaticLibraryArchiverSpec();
    spec.setTempDir(getTemporaryDir());
    spec.setOutputFile(getOutputFile());
    spec.objectFiles(getSource());
    spec.args(getStaticLibArgs());
    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
    spec.setOperationLogger(operationLogger);
    Compiler<StaticLibraryArchiverSpec> compiler = Cast.uncheckedCast(toolChain.select(targetPlatform).newCompiler(spec.getClass()));
    WorkResult result = BuildOperationLoggingCompilerDecorator.wrap(compiler).execute(spec);
    setDidWork(result.getDidWork());
}
Also used : DefaultStaticLibraryArchiverSpec(org.gradle.nativeplatform.internal.DefaultStaticLibraryArchiverSpec) StaticLibraryArchiverSpec(org.gradle.nativeplatform.internal.StaticLibraryArchiverSpec) DefaultStaticLibraryArchiverSpec(org.gradle.nativeplatform.internal.DefaultStaticLibraryArchiverSpec) BuildOperationLogger(org.gradle.internal.operations.logging.BuildOperationLogger) WorkResult(org.gradle.api.tasks.WorkResult) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

StaticLibraryArchiverSpec (org.gradle.nativeplatform.internal.StaticLibraryArchiverSpec)2 SimpleWorkResult (org.gradle.api.internal.tasks.SimpleWorkResult)1 TaskAction (org.gradle.api.tasks.TaskAction)1 WorkResult (org.gradle.api.tasks.WorkResult)1 BuildOperationQueue (org.gradle.internal.operations.BuildOperationQueue)1 BuildOperationLogger (org.gradle.internal.operations.logging.BuildOperationLogger)1 DefaultStaticLibraryArchiverSpec (org.gradle.nativeplatform.internal.DefaultStaticLibraryArchiverSpec)1 CommandLineToolInvocation (org.gradle.nativeplatform.toolchain.internal.CommandLineToolInvocation)1