Java Code Examples for org.gradle.util.GUtil#addToCollection()

The following examples show how to use org.gradle.util.GUtil#addToCollection() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExecHandleBuilder.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ExecHandleBuilder setArgs(Iterable<?> arguments) {
    this.arguments.clear();
    GUtil.addToCollection(this.arguments, arguments);
    return this;
}
 
Example 2
Source File: DefaultConfigurableFileCollection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void setFrom(Object... paths) {
    files.clear();
    GUtil.addToCollection(files, Arrays.asList(paths));
}
 
Example 3
Source File: WorkerProcessBuilder.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkerProcessBuilder sharedPackages(Iterable<String> packages) {
    GUtil.addToCollection(this.packages, packages);
    return this;
}
 
Example 4
Source File: NotationParserBuilder.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public NotationParserBuilder<T> parsers(Iterable<? extends NotationParser<Object, ? extends T>> notationParsers) {
    GUtil.addToCollection(this.notationParsers, notationParsers);
    return this;
}
 
Example 5
Source File: NotationParserBuilder.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public NotationParserBuilder<T> parsers(Iterable<? extends NotationParser<Object, ? extends T>> notationParsers) {
    GUtil.addToCollection(this.notationParsers, notationParsers);
    return this;
}
 
Example 6
Source File: WorkerProcessBuilder.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkerProcessBuilder applicationClasspath(Iterable<File> files) {
    GUtil.addToCollection(applicationClasspath, files);
    return this;
}
 
Example 7
Source File: DefaultConfigurableFileCollection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ConfigurableFileCollection from(Object... paths) {
    GUtil.addToCollection(files, Arrays.asList(paths));
    return this;
}
 
Example 8
Source File: DefaultFileCollectionResolveContext.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private <T> List<T> doResolve(Converter<? extends T> converter) {
    List<T> result = new ArrayList<T>();
    while (!queue.isEmpty()) {
        Object element = queue.remove(0);
        if (element instanceof DefaultFileCollectionResolveContext) {
            DefaultFileCollectionResolveContext nestedContext = (DefaultFileCollectionResolveContext) element;
            converter.convertInto(nestedContext, result, fileResolver);
        } else if (element instanceof FileCollectionContainer) {
            FileCollectionContainer fileCollection = (FileCollectionContainer) element;
            resolveNested(fileCollection);
        } else if (element instanceof FileCollection || element instanceof MinimalFileCollection) {
            converter.convertInto(element, result, fileResolver);
        } else if (element instanceof Task) {
            Task task = (Task) element;
            queue.add(0, task.getOutputs().getFiles());
        } else if (element instanceof TaskOutputs) {
            TaskOutputs outputs = (TaskOutputs) element;
            queue.add(0, outputs.getFiles());
        } else if (element instanceof Closure) {
            Closure closure = (Closure) element;
            Object closureResult = closure.call();
            if (closureResult != null) {
                queue.add(0, closureResult);
            }
        } else if (element instanceof Callable) {
            Callable callable = (Callable) element;
            Object callableResult;
            try {
                callableResult = callable.call();
            } catch (Exception e) {
                throw UncheckedException.throwAsUncheckedException(e);
            }
            if (callableResult != null) {
                queue.add(0, callableResult);
            }
        } else if (element instanceof Iterable) {
            Iterable<?> iterable = (Iterable) element;
            GUtil.addToCollection(queue.subList(0, 0), iterable);
        } else if (element instanceof Object[]) {
            Object[] array = (Object[]) element;
            GUtil.addToCollection(queue.subList(0, 0), Arrays.asList(array));
        } else {
            converter.convertInto(element, result, fileResolver);
        }
    }
    return result;
}
 
Example 9
Source File: UnionFileCollection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public UnionFileCollection(Iterable<? extends FileCollection> source) {
    this.source = GUtil.addToCollection(new LinkedHashSet<FileCollection>(), source);
}
 
Example 10
Source File: UnionFileCollection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public UnionFileCollection(Iterable<? extends FileCollection> source) {
    this.source = GUtil.addToCollection(new LinkedHashSet<FileCollection>(), source);
}
 
Example 11
Source File: DefaultSourceDirectorySet.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public SourceDirectorySet setSrcDirs(Iterable<?> srcPaths) {
    source.clear();
    GUtil.addToCollection(source, srcPaths);
    return this;
}
 
Example 12
Source File: DefaultSourceDirectorySet.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public SourceDirectorySet setSrcDirs(Iterable<?> srcPaths) {
    source.clear();
    GUtil.addToCollection(source, srcPaths);
    return this;
}
 
Example 13
Source File: WorkerProcessBuilder.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkerProcessBuilder applicationClasspath(Iterable<File> files) {
    GUtil.addToCollection(applicationClasspath, files);
    return this;
}
 
Example 14
Source File: WorkerProcessBuilder.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkerProcessBuilder sharedPackages(Iterable<String> packages) {
    GUtil.addToCollection(this.packages, packages);
    return this;
}
 
Example 15
Source File: DefaultConfigurableFileCollection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void setFrom(Object... paths) {
    files.clear();
    GUtil.addToCollection(files, Arrays.asList(paths));
}
 
Example 16
Source File: DefaultFileCollectionResolveContext.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private <T> List<T> doResolve(Converter<? extends T> converter) {
    List<T> result = new ArrayList<T>();
    while (!queue.isEmpty()) {
        Object element = queue.remove(0);
        if (element instanceof DefaultFileCollectionResolveContext) {
            DefaultFileCollectionResolveContext nestedContext = (DefaultFileCollectionResolveContext) element;
            converter.convertInto(nestedContext, result, fileResolver);
        } else if (element instanceof FileCollectionContainer) {
            FileCollectionContainer fileCollection = (FileCollectionContainer) element;
            resolveNested(fileCollection);
        } else if (element instanceof FileCollection || element instanceof MinimalFileCollection) {
            converter.convertInto(element, result, fileResolver);
        } else if (element instanceof Task) {
            Task task = (Task) element;
            queue.add(0, task.getOutputs().getFiles());
        } else if (element instanceof TaskOutputs) {
            TaskOutputs outputs = (TaskOutputs) element;
            queue.add(0, outputs.getFiles());
        } else if (element instanceof Closure) {
            Closure closure = (Closure) element;
            Object closureResult = closure.call();
            if (closureResult != null) {
                queue.add(0, closureResult);
            }
        } else if (element instanceof Callable) {
            Callable callable = (Callable) element;
            Object callableResult;
            try {
                callableResult = callable.call();
            } catch (Exception e) {
                throw UncheckedException.throwAsUncheckedException(e);
            }
            if (callableResult != null) {
                queue.add(0, callableResult);
            }
        } else if (element instanceof Iterable) {
            Iterable<?> iterable = (Iterable) element;
            GUtil.addToCollection(queue.subList(0, 0), iterable);
        } else if (element instanceof Object[]) {
            Object[] array = (Object[]) element;
            GUtil.addToCollection(queue.subList(0, 0), Arrays.asList(array));
        } else {
            converter.convertInto(element, result, fileResolver);
        }
    }
    return result;
}
 
Example 17
Source File: DefaultFileCollectionResolveContext.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private <T> List<T> doResolve(Converter<? extends T> converter) {
    List<T> result = new ArrayList<T>();
    while (!queue.isEmpty()) {
        Object element = queue.remove(0);
        if (element instanceof DefaultFileCollectionResolveContext) {
            DefaultFileCollectionResolveContext nestedContext = (DefaultFileCollectionResolveContext) element;
            converter.convertInto(nestedContext, result, fileResolver);
        } else if (element instanceof FileCollectionContainer) {
            FileCollectionContainer fileCollection = (FileCollectionContainer) element;
            resolveNested(fileCollection);
        } else if (element instanceof FileCollection || element instanceof MinimalFileCollection) {
            converter.convertInto(element, result, fileResolver);
        } else if (element instanceof Task) {
            Task task = (Task) element;
            queue.add(0, task.getOutputs().getFiles());
        } else if (element instanceof TaskOutputs) {
            TaskOutputs outputs = (TaskOutputs) element;
            queue.add(0, outputs.getFiles());
        } else if (element instanceof Closure) {
            Closure closure = (Closure) element;
            Object closureResult = closure.call();
            if (closureResult != null) {
                queue.add(0, closureResult);
            }
        } else if (element instanceof Callable) {
            Callable callable = (Callable) element;
            Object callableResult;
            try {
                callableResult = callable.call();
            } catch (Exception e) {
                throw UncheckedException.throwAsUncheckedException(e);
            }
            if (callableResult != null) {
                queue.add(0, callableResult);
            }
        } else if (element instanceof Iterable) {
            Iterable<?> iterable = (Iterable) element;
            GUtil.addToCollection(queue.subList(0, 0), iterable);
        } else if (element instanceof Object[]) {
            Object[] array = (Object[]) element;
            GUtil.addToCollection(queue.subList(0, 0), Arrays.asList(array));
        } else {
            converter.convertInto(element, result, fileResolver);
        }
    }
    return result;
}
 
Example 18
Source File: DefaultConfigurableFileCollection.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ConfigurableFileCollection from(Object... paths) {
    GUtil.addToCollection(files, Arrays.asList(paths));
    return this;
}
 
Example 19
Source File: CachingDirectedGraphWalker.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
/**
 * Adds some start nodes.
 */
public CachingDirectedGraphWalker add(Iterable<? extends N> values) {
    GUtil.addToCollection(startNodes, values);
    return this;
}
 
Example 20
Source File: UnionFileCollection.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public UnionFileCollection(Iterable<? extends FileCollection> source) {
    this.source = GUtil.addToCollection(new LinkedHashSet<FileCollection>(), source);
}