use of org.gradle.api.tasks.Optional 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;
}
use of org.gradle.api.tasks.Optional 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;
}
use of org.gradle.api.tasks.Optional in project gradle by gradle.
the class AbstractNativeSourceCompileTask method getCompilerVersion.
/**
* The compiler used, including the type and the version.
*
* @since 4.4
*/
@Nullable
@Optional
@Nested
protected CompilerVersion getCompilerVersion() {
NativeToolChainInternal toolChain = (NativeToolChainInternal) getToolChain().get();
NativePlatformInternal targetPlatform = (NativePlatformInternal) getTargetPlatform().get();
PlatformToolProvider toolProvider = toolChain.select(targetPlatform);
Compiler<? extends NativeCompileSpec> compiler = toolProvider.newCompiler(createCompileSpec().getClass());
if (!(compiler instanceof VersionAwareCompiler)) {
return null;
}
return ((VersionAwareCompiler) compiler).getVersion();
}
Aggregations