Java 类org.gradle.api.artifacts.FileCollectionDependency 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ProjectLibraries.java   
private Set<GradleLibrary> getLibrariesForFileDependencies(
        Configuration configuration, LibraryScope scope) {
    Set<GradleLibrary> libraries = new LinkedHashSet<GradleLibrary>();
    for (Dependency dependency : configuration.getIncoming().getDependencies()) {
        if (dependency instanceof FileCollectionDependency) {
            FileCollectionDependency fileDependency = (FileCollectionDependency) dependency;
            for (File file : fileDependency.resolve()) {
                libraries.add(
                        new GradleLibrary(fileDependency.getGroup(), file, scope));
            }
        }
        else if (dependency instanceof ProjectDependency) {
            ProjectDependency projectDependency = (ProjectDependency) dependency;
            libraries.addAll(getLibrariesForFileDependencies(
                    projectDependency.getProjectConfiguration(), scope));
        }
    }
    return libraries;
}
项目:spring-boot-concourse    文件:ProjectLibraries.java   
private Set<GradleLibrary> getLibrariesForFileDependencies(
        Configuration configuration, LibraryScope scope) {
    Set<GradleLibrary> libraries = new LinkedHashSet<GradleLibrary>();
    for (Dependency dependency : configuration.getIncoming().getDependencies()) {
        if (dependency instanceof FileCollectionDependency) {
            FileCollectionDependency fileDependency = (FileCollectionDependency) dependency;
            for (File file : fileDependency.resolve()) {
                libraries.add(
                        new GradleLibrary(fileDependency.getGroup(), file, scope));
            }
        }
        else if (dependency instanceof ProjectDependency) {
            ProjectDependency projectDependency = (ProjectDependency) dependency;
            libraries.addAll(getLibrariesForFileDependencies(
                    projectDependency.getProjectConfiguration(), scope));
        }
    }
    return libraries;
}
项目:contestparser    文件:ProjectLibraries.java   
private Set<GradleLibrary> getLibrariesForFileDependencies(
        Configuration configuration, LibraryScope scope) {
    Set<GradleLibrary> libraries = new LinkedHashSet<GradleLibrary>();
    for (Dependency dependency : configuration.getIncoming().getDependencies()) {
        if (dependency instanceof FileCollectionDependency) {
            FileCollectionDependency fileDependency = (FileCollectionDependency) dependency;
            for (File file : fileDependency.resolve()) {
                libraries.add(
                        new GradleLibrary(fileDependency.getGroup(), file, scope));
            }
        }
        else if (dependency instanceof ProjectDependency) {
            ProjectDependency projectDependency = (ProjectDependency) dependency;
            libraries.addAll(getLibrariesForFileDependencies(
                    projectDependency.getProjectConfiguration(), scope));
        }
    }
    return libraries;
}
项目:Reer    文件:DefaultLenientConfiguration.java   
/**
 * Recursive, includes unsuccessfully resolved artifacts
 *
 * @param dependencySpec dependency spec
 */
private void visitArtifacts(Spec<? super Dependency> dependencySpec, AttributeContainerInternal requestedAttributes, SelectedArtifactResults artifactResults, SelectedFileDependencyResults fileDependencyResults, ArtifactVisitor visitor) {
    ArtifactVisitor transformingVisitor = artifactTransformer.visitor(visitor, requestedAttributes);

    //this is not very nice might be good enough until we get rid of ResolvedConfiguration and friends
    //avoid traversing the graph causing the full ResolvedDependency graph to be loaded for the most typical scenario
    if (dependencySpec == Specs.SATISFIES_ALL) {
        if (transformingVisitor.includeFiles()) {
            fileDependencyResults.getFiles().visit(transformingVisitor);
        }
        artifactResults.getArtifacts().visit(transformingVisitor);
        return;
    }

    if (transformingVisitor.includeFiles()) {
        for (Map.Entry<FileCollectionDependency, ResolvedArtifactSet> entry: fileDependencyResults.getFirstLevelFiles().entrySet()) {
            if (dependencySpec.isSatisfiedBy(entry.getKey())) {
                entry.getValue().visit(transformingVisitor);
            }
        }
    }

    CachingDirectedGraphWalker<DependencyGraphNodeResult, ResolvedArtifact> walker = new CachingDirectedGraphWalker<DependencyGraphNodeResult, ResolvedArtifact>(new ResolvedDependencyArtifactsGraph(transformingVisitor, fileDependencyResults));

    DependencyGraphNodeResult rootNode = loadTransientGraphResults(artifactResults).getRootNode();
    for (DependencyGraphNodeResult node : getFirstLevelNodes(dependencySpec)) {
        node.getArtifactsForIncomingEdge(rootNode).visit(transformingVisitor);
        walker.add(node);
    }
    walker.findValues();
}
项目:Reer    文件:DefaultDependenciesToModuleDescriptorConverter.java   
private void addDependencies(BuildableLocalComponentMetadata metaData, ConfigurationInternal configuration) {
    AttributeContainerInternal attributes = configuration.getAttributes().asImmutable();
    for (Dependency dependency : configuration.getDependencies()) {
        if (dependency instanceof ModuleDependency) {
            ModuleDependency moduleDependency = (ModuleDependency) dependency;
            metaData.addDependency(dependencyDescriptorFactory.createDependencyDescriptor(configuration.getName(), attributes, moduleDependency));
        } else if (dependency instanceof FileCollectionDependency) {
            final FileCollectionDependency fileDependency = (FileCollectionDependency) dependency;
            metaData.addFiles(configuration.getName(), new DefaultLocalFileDependencyMetadata(fileDependency));
        } else {
            throw new IllegalArgumentException("Cannot convert dependency " + dependency + " to local component dependency metadata.");
        }
    }
}
项目:Reer    文件:DefaultConfiguration.java   
@Override
public void registerWatchPoints(FileSystemSubset.Builder builder) {
    for (Dependency dependency : allDependencies) {
        if (dependency instanceof FileCollectionDependency) {
            FileCollection files = ((FileCollectionDependency) dependency).getFiles();
            ((FileCollectionInternal) files).registerWatchPoints(builder);
        }
    }
    super.registerWatchPoints(builder);
}
项目:Reer    文件:DefaultDependenciesToModuleDescriptorConverter.java   
DefaultLocalFileDependencyMetadata(FileCollectionDependency fileDependency) {
    this.fileDependency = fileDependency;
}
项目:Reer    文件:DefaultDependenciesToModuleDescriptorConverter.java   
@Override
public FileCollectionDependency getSource() {
    return fileDependency;
}
项目:Reer    文件:FileDependencyCollectingGraphVisitor.java   
@Override
public Map<FileCollectionDependency, ResolvedArtifactSet> getFirstLevelFiles() {
    return rootFiles;
}
项目:Reer    文件:SelectedFileDependencyResults.java   
/**
 * Returns the direct dependencies of the root node.
 */
Map<FileCollectionDependency, ResolvedArtifactSet> getFirstLevelFiles();
项目:Reer    文件:LocalFileDependencyMetadata.java   
/**
 * Remove this.
 */
FileCollectionDependency getSource();