本文整理匯總了Java中org.gradle.api.file.FileCollection.isEmpty方法的典型用法代碼示例。如果您正苦於以下問題:Java FileCollection.isEmpty方法的具體用法?Java FileCollection.isEmpty怎麽用?Java FileCollection.isEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.gradle.api.file.FileCollection
的用法示例。
在下文中一共展示了FileCollection.isEmpty方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getManagedJvmArgs
import org.gradle.api.file.FileCollection; //導入方法依賴的package包/類
/**
* @return the list of jvm args we manage explicitly, for example, max heaps size or file encoding.
* The result is a subset of options returned by {@link #getAllImmutableJvmArgs()}
*/
public List<String> getManagedJvmArgs() {
List<String> args = new ArrayList<String>();
if (minHeapSize != null) {
args.add("-Xms" + minHeapSize);
}
if (maxHeapSize != null) {
args.add("-Xmx" + maxHeapSize);
}
FileCollection bootstrapClasspath = getBootstrapClasspath();
if (!bootstrapClasspath.isEmpty()) {
args.add("-Xbootclasspath:" + bootstrapClasspath.getAsPath());
}
// These are implemented as a system property, but don't really function like one
// So we include it in this “no system property” set.
formatSystemProperties(immutableSystemProperties, args);
if (assertionsEnabled) {
args.add("-ea");
}
if (debug) {
args.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005");
}
return args;
}
示例2: isEmpty
import org.gradle.api.file.FileCollection; //導入方法依賴的package包/類
@Override
public boolean isEmpty() {
for (FileCollection collection : getSourceCollections()) {
if (!collection.isEmpty()) {
return false;
}
}
return true;
}
示例3: FindBugsSpecBuilder
import org.gradle.api.file.FileCollection; //導入方法依賴的package包/類
public FindBugsSpecBuilder(FileCollection classes) {
if(classes == null || classes.isEmpty()){
throw new InvalidUserDataException("No classes configured for FindBugs analysis.");
}
this.classes = classes;
}
示例4: has
import org.gradle.api.file.FileCollection; //導入方法依賴的package包/類
private boolean has(FileCollection fileCollection) {
return fileCollection != null && !fileCollection.isEmpty();
}
示例5: addMainOptions
import org.gradle.api.file.FileCollection; //導入方法依賴的package包/類
private void addMainOptions() {
if (!includeMainOptions) {
return;
}
CompileOptions compileOptions = spec.getCompileOptions();
List<String> compilerArgs = compileOptions.getCompilerArgs();
if (!releaseOptionIsSet(compilerArgs)) {
String sourceCompatibility = spec.getSourceCompatibility();
if (sourceCompatibility != null) {
args.add("-source");
args.add(sourceCompatibility);
}
String targetCompatibility = spec.getTargetCompatibility();
if (targetCompatibility != null) {
args.add("-target");
args.add(targetCompatibility);
}
}
File destinationDir = spec.getDestinationDir();
if (destinationDir != null) {
args.add("-d");
args.add(destinationDir.getPath());
}
if (compileOptions.isVerbose()) {
args.add("-verbose");
}
if (compileOptions.isDeprecation()) {
args.add("-deprecation");
}
if (!compileOptions.isWarnings()) {
args.add("-nowarn");
}
if (compileOptions.isDebug()) {
if (compileOptions.getDebugOptions().getDebugLevel() != null) {
args.add("-g:" + compileOptions.getDebugOptions().getDebugLevel().trim());
} else {
args.add("-g");
}
} else {
args.add("-g:none");
}
if (compileOptions.getEncoding() != null) {
args.add("-encoding");
args.add(compileOptions.getEncoding());
}
if (compileOptions.getBootClasspath() != null) { //TODO: move bootclasspath to platform
args.add("-bootclasspath");
args.add(compileOptions.getBootClasspath());
}
if (compileOptions.getExtensionDirs() != null) {
args.add("-extdirs");
args.add(compileOptions.getExtensionDirs());
}
FileCollection sourcepath = compileOptions.getSourcepath();
Iterable<File> classpath = spec.getClasspath();
if ((sourcepath != null && !sourcepath.isEmpty()) || (includeClasspath && (classpath != null && classpath.iterator().hasNext()))) {
args.add("-sourcepath");
args.add(sourcepath == null ? emptyFolder(spec.getTempDir()) : sourcepath.getAsPath());
}
if (compilerArgs != null) {
args.addAll(compilerArgs);
}
}
示例6: execute
import org.gradle.api.file.FileCollection; //導入方法依賴的package包/類
public void execute(TaskInternal task, TaskStateInternal state, TaskExecutionContext context) {
FileCollection sourceFiles = task.getInputs().getSourceFiles();
if (task.getInputs().getHasSourceFiles() && sourceFiles.isEmpty()) {
TaskArtifactState taskArtifactState = context.getTaskArtifactState();
FileCollection outputFiles = taskArtifactState.getExecutionHistory().getOutputFiles();
if (outputFiles == null) {
state.setOutcome(TaskExecutionOutcome.UP_TO_DATE);
LOGGER.info("Skipping {} as it has no source files and no history of previous output files.", task);
} else if (outputFiles.isEmpty()) {
state.setOutcome(TaskExecutionOutcome.UP_TO_DATE);
LOGGER.info("Skipping {} as it has no source files and no previous output files.", task);
} else {
Set<File> outputFileSet = outputFiles.getFiles();
boolean deletedFiles = false;
boolean debugEnabled = LOGGER.isDebugEnabled();
for (File file : outputFileSet) {
if (file.isFile()) {
if (file.delete()) {
if (debugEnabled) {
LOGGER.debug("Deleted stale output file '{}'.", file.getAbsolutePath());
}
} else {
state.setOutcome(new GradleException(String.format("Could not delete file: '%s'.", file.getAbsolutePath())));
return;
}
deletedFiles = true;
}
}
if (deletedFiles) {
LOGGER.info("Cleaned previous output of {} as it has no source files.", task);
state.setOutcome(TaskExecutionOutcome.EXECUTED);
} else {
state.setOutcome(TaskExecutionOutcome.UP_TO_DATE);
}
}
taskInputsListener.onExecute(task, Cast.cast(FileCollectionInternal.class, sourceFiles));
return;
} else {
taskInputsListener.onExecute(task, Cast.cast(FileCollectionInternal.class, task.getInputs().getFiles()));
}
executer.execute(task, state, context);
}