Search in sources :

Example 1 with SkipWhenEmpty

use of org.gradle.api.tasks.SkipWhenEmpty in project gradle by gradle.

the class InstallXCTestBundle method getBundleBinary.

@SkipWhenEmpty
@Nullable
@Optional
@InputFile
protected File getBundleBinary() {
    RegularFile bundle = getBundleBinaryFile().get();
    File bundleFile = bundle.getAsFile();
    if (!bundleFile.exists()) {
        return null;
    }
    return bundleFile;
}
Also used : RegularFile(org.gradle.api.file.RegularFile) File(java.io.File) RegularFile(org.gradle.api.file.RegularFile) InputFile(org.gradle.api.tasks.InputFile) SkipWhenEmpty(org.gradle.api.tasks.SkipWhenEmpty) Optional(org.gradle.api.tasks.Optional) Nullable(javax.annotation.Nullable) InputFile(org.gradle.api.tasks.InputFile)

Example 2 with SkipWhenEmpty

use of org.gradle.api.tasks.SkipWhenEmpty 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
@InputFile
protected File getRunScript() {
    RegularFile runScript = getRunScriptFile().get();
    File runScriptFile = runScript.getAsFile();
    if (!runScriptFile.exists()) {
        return null;
    }
    return runScriptFile;
}
Also used : RegularFile(org.gradle.api.file.RegularFile) File(java.io.File) RegularFile(org.gradle.api.file.RegularFile) InputFile(org.gradle.api.tasks.InputFile) SkipWhenEmpty(org.gradle.api.tasks.SkipWhenEmpty) Optional(org.gradle.api.tasks.Optional) Nullable(javax.annotation.Nullable) InputFile(org.gradle.api.tasks.InputFile)

Aggregations

File (java.io.File)2 Nullable (javax.annotation.Nullable)2 RegularFile (org.gradle.api.file.RegularFile)2 InputFile (org.gradle.api.tasks.InputFile)2 Optional (org.gradle.api.tasks.Optional)2 SkipWhenEmpty (org.gradle.api.tasks.SkipWhenEmpty)2