Search in sources :

Example 1 with DependentSourceSet

use of org.gradle.language.base.DependentSourceSet in project gradle by gradle.

the class DefaultJvmBinarySpec method collectDependencies.

public static List<DependencySpec> collectDependencies(final BinarySpec binary, @Nullable final SourceComponentSpec owner, final Collection<DependencySpec>... specificDependencies) {
    List<DependencySpec> dependencies = Lists.newArrayList();
    if (specificDependencies != null) {
        for (Collection<DependencySpec> deps : specificDependencies) {
            dependencies.addAll(deps);
        }
    }
    Collection<LanguageSourceSet> binarySources = binary.getSources().values();
    Iterable<LanguageSourceSet> sourceSets = owner != null ? Iterables.concat(owner.getSources().values(), binarySources) : binarySources;
    for (LanguageSourceSet sourceSet : sourceSets) {
        if (sourceSet instanceof DependentSourceSet) {
            dependencies.addAll(((DependentSourceSet) sourceSet).getDependencies().getDependencies());
        }
    }
    return dependencies;
}
Also used : DependentSourceSet(org.gradle.language.base.DependentSourceSet) LanguageSourceSet(org.gradle.language.base.LanguageSourceSet) DependencySpec(org.gradle.platform.base.DependencySpec)

Aggregations

DependentSourceSet (org.gradle.language.base.DependentSourceSet)1 LanguageSourceSet (org.gradle.language.base.LanguageSourceSet)1 DependencySpec (org.gradle.platform.base.DependencySpec)1