use of org.gradle.api.tasks.TaskAction in project gradle by gradle.
the class AbstractLinkTask method link.
@TaskAction
public void link() {
SimpleStaleClassCleaner cleaner = new SimpleStaleClassCleaner(getOutputs());
cleaner.setDestinationDir(getDestinationDirectory().get().getAsFile());
cleaner.execute();
if (getSource().isEmpty()) {
setDidWork(cleaner.getDidWork());
return;
}
LinkerSpec spec = createLinkerSpec();
spec.setTargetPlatform(getTargetPlatform().get());
spec.setTempDir(getTemporaryDir());
spec.setOutputFile(getLinkedFile().get().getAsFile());
spec.objectFiles(getSource());
spec.libraries(getLibs());
spec.args(getLinkerArgs().get());
spec.setDebuggable(getDebuggable().get());
BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
spec.setOperationLogger(operationLogger);
Compiler<LinkerSpec> compiler = createCompiler();
compiler = BuildOperationLoggingCompilerDecorator.wrap(compiler);
WorkResult result = compiler.execute(spec);
setDidWork(result.getDidWork());
}
use of org.gradle.api.tasks.TaskAction in project gradle by gradle.
the class ExtractSymbols method extractSymbols.
// TODO: Need to track version/implementation of symbol extraction tool.
@TaskAction
public void extractSymbols() {
BuildOperationLogger operationLogger = getServices().get(BuildOperationLoggerFactory.class).newOperationLogger(getName(), getTemporaryDir());
SymbolExtractorSpec spec = new DefaultSymbolExtractorSpec();
spec.setBinaryFile(binaryFile.get().getAsFile());
spec.setSymbolFile(symbolFile.get().getAsFile());
spec.setOperationLogger(operationLogger);
Compiler<SymbolExtractorSpec> symbolExtractor = createCompiler();
symbolExtractor = BuildOperationLoggingCompilerDecorator.wrap(symbolExtractor);
WorkResult result = symbolExtractor.execute(spec);
setDidWork(result.getDidWork());
}
use of org.gradle.api.tasks.TaskAction in project gradle by gradle.
the class PluginUnderTestMetadata method generate.
@TaskAction
public void generate() {
Properties properties = new Properties();
if (getPluginClasspath() != null && !getPluginClasspath().isEmpty()) {
properties.setProperty(IMPLEMENTATION_CLASSPATH_PROP_KEY, implementationClasspath());
}
File outputFile = new File(getOutputDirectory(), METADATA_FILE_NAME);
saveProperties(properties, outputFile);
}
use of org.gradle.api.tasks.TaskAction in project gradle by gradle.
the class RunApplication method startApplication.
@TaskAction
public void startApplication() {
DeploymentRegistry registry = getDeploymentRegistry();
JavaApplicationHandle handle = registry.get(getPath(), JavaApplicationHandle.class);
if (handle == null) {
JavaExecHandleBuilder builder = getExecActionFactory().newJavaExec();
builder.setClasspath(classpath);
builder.setMain(mainClassName);
builder.setArgs(arguments);
registry.start(getPath(), changeBehavior, JavaApplicationHandle.class, builder);
}
}
use of org.gradle.api.tasks.TaskAction in project gradle by gradle.
the class CreateStartScripts method generate.
@TaskAction
public void generate() {
StartScriptGenerator generator = new StartScriptGenerator(unixStartScriptGenerator, windowsStartScriptGenerator);
generator.setApplicationName(getApplicationName());
generator.setMainClassName(getMainClassName());
generator.setDefaultJvmOpts(getDefaultJvmOpts());
generator.setOptsEnvironmentVar(getOptsEnvironmentVar());
generator.setExitEnvironmentVar(getExitEnvironmentVar());
generator.setClasspath(getRelativeClasspath());
generator.setScriptRelPath(getExecutableDir() + "/" + getUnixScript().getName());
generator.generateUnixScript(getUnixScript());
generator.generateWindowsScript(getWindowsScript());
}
Aggregations