use of org.gradle.api.file.RegularFileProperty in project gradle by gradle.
the class BuildDependenciesOnlyFileCollectionResolveContext method add.
@Override
public FileCollectionResolveContext add(Object element) {
// TODO - need to sync with DefaultFileCollectionResolveContext
if (element instanceof Buildable) {
taskContext.add(element);
} else if (element instanceof Task) {
taskContext.add(element);
} else if (element instanceof TaskOutputs) {
TaskOutputs outputs = (TaskOutputs) element;
taskContext.add(outputs.getFiles());
} else if (element instanceof RegularFileProperty || element instanceof DirectoryProperty) {
taskContext.add(element);
} else if (element instanceof Closure) {
Closure closure = (Closure) element;
Object closureResult = closure.call();
if (closureResult != null) {
add(closureResult);
}
} else if (element instanceof Callable) {
Callable callable = (Callable) element;
Object callableResult = uncheckedCall(callable);
if (callableResult != null) {
add(callableResult);
}
} else if (element instanceof Iterable && !(element instanceof Path)) {
// Ignore Path
Iterable<?> iterable = (Iterable) element;
for (Object value : iterable) {
add(value);
}
} else if (element instanceof Object[]) {
Object[] array = (Object[]) element;
for (Object value : array) {
add(value);
}
}
// Everything else assume has no dependencies
return this;
}
Aggregations