use of org.gradle.api.file.RegularFile in project gradle by gradle.
the class FileContentValueSource method obtain.
@Nullable
@Override
public T obtain() {
@Nullable final RegularFile regularFile = getParameters().getFile().getOrNull();
if (regularFile == null) {
return null;
}
final File file = regularFile.getAsFile();
if (!file.isFile()) {
return null;
}
return obtainFrom(file);
}
use of org.gradle.api.file.RegularFile 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.file.RegularFile 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.file.RegularFile in project gradle by gradle.
the class CreateMD5 method createHashes.
@TaskAction
public void createHashes() {
// <1>
WorkQueue workQueue = getWorkerExecutor().processIsolation(workerSpec -> {
workerSpec.getClasspath().from(getCodecClasspath());
workerSpec.forkOptions(options -> {
// <2>
options.setMaxHeapSize("64m");
});
});
for (File sourceFile : getSource().getFiles()) {
Provider<RegularFile> md5File = getDestinationDirectory().file(sourceFile.getName() + ".md5");
workQueue.submit(GenerateMD5.class, parameters -> {
parameters.getSourceFile().set(sourceFile);
parameters.getMD5File().set(md5File);
});
}
}
Aggregations