use of org.gradle.api.tasks.InputFile in project atlas by alibaba.
the class AwbDexTask method doTaskAction.
private void doTaskAction(@Nullable Collection<File> inputFiles, @Nullable File inputDir, boolean incremental) throws InterruptedException, ProcessException, IOException {
File outFolder = getOutputFolder();
if (!incremental) {
emptyFolder(outFolder);
}
// if some of our .jar input files exist, just reset the inputDir to null
for (File inputFile : inputFiles) {
if (inputFile.exists()) {
inputDir = null;
}
}
if (inputDir != null) {
inputFiles = getProject().files(inputDir).getFiles();
}
ProcessOutputHandler outputHandler = new ParsingProcessOutputHandler(new ToolOutputParser(new DexParser(), Message.Kind.ERROR, getILogger()), new ToolOutputParser(new DexParser(), getILogger()), getBuilder().getErrorReporter());
getBuilder().convertByteCode(inputFiles, getOutputFolder(), getMultiDexEnabled(), getMainDexListFile(), getDexOptions(), getOptimize(), outputHandler);
}
use of org.gradle.api.tasks.InputFile in project gradle by gradle.
the class InstallXCTestBundle method getBundleBinary.
@SkipWhenEmpty
@Nullable
@Optional
@PathSensitive(PathSensitivity.NAME_ONLY)
@InputFile
protected File getBundleBinary() {
RegularFile bundle = getBundleBinaryFile().get();
File bundleFile = bundle.getAsFile();
if (!bundleFile.exists()) {
return null;
}
return bundleFile;
}
use of org.gradle.api.tasks.InputFile in project gradle by gradle.
the class XCTest method getRunScript.
/**
* Workaround for when the task is given an input file that doesn't exist
*/
@SkipWhenEmpty
@Nullable
@Optional
@PathSensitive(PathSensitivity.ABSOLUTE)
@InputFile
protected File getRunScript() {
RegularFile runScript = getRunScriptFile().get();
File runScriptFile = runScript.getAsFile();
if (!runScriptFile.exists()) {
return null;
}
return runScriptFile;
}
use of org.gradle.api.tasks.InputFile in project gradle by gradle.
the class GeneratorTask method generate.
@SuppressWarnings("UnusedDeclaration")
@TaskAction
void generate() {
File inputFile = getInputFileIfExists();
if (inputFile != null) {
try {
domainObject = generator.read(inputFile);
} catch (RuntimeException e) {
throw new GradleException(String.format("Cannot parse file '%s'.\n" + " Perhaps this file was tinkered with? In that case try delete this file and then retry.", inputFile), e);
}
} else {
domainObject = generator.defaultInstance();
}
beforeConfigured.execute(domainObject);
generator.configure(domainObject);
afterConfigured.execute(domainObject);
generator.write(domainObject, getOutputFile());
}
Aggregations