Java 类org.gradle.api.internal.artifacts.dependencies.DefaultDependencyArtifact 实例源码

项目:ARCHIVE-wildfly-swarm    文件:GradleArtifactResolvingHelper.java   
private Set<ResolvedDependency> doResolve(final Collection<ArtifactSpec> deps) {
    final Configuration config = this.project.getConfigurations().detachedConfiguration();
    final DependencySet dependencySet = config.getDependencies();

    deps.forEach(spec -> {
        final DefaultExternalModuleDependency d =
                new DefaultExternalModuleDependency(spec.groupId(), spec.artifactId(), spec.version());
        final DefaultDependencyArtifact da =
                new DefaultDependencyArtifact(spec.artifactId(), spec.type(), spec.type(), spec.classifier(), null);
        d.addArtifact(da);
        d.getExcludeRules().add(new DefaultExcludeRule());
        dependencySet.add(d);
    });

    return config.getResolvedConfiguration().getFirstLevelModuleDependencies();
}
项目:Reer    文件:ModuleFactoryHelper.java   
public static void addExplicitArtifactsIfDefined(ExternalDependency moduleDependency, String artifactType, String classifier) {
    String actualArtifactType = artifactType;
    if (actualArtifactType == null) {
        if (classifier != null) {
            actualArtifactType = DependencyArtifact.DEFAULT_TYPE;
        }
    } else {
        moduleDependency.setTransitive(false);
    }
    if (actualArtifactType != null) {
        moduleDependency.addArtifact(new DefaultDependencyArtifact(moduleDependency.getName(),
                actualArtifactType, actualArtifactType, classifier, null));
    }
}
项目:wildfly-swarm    文件:GradleArtifactResolvingHelper.java   
private Collection<ResolvedArtifact> doResolve(final Collection<ArtifactSpec> deps, boolean transitive) {
    final Configuration config = this.project.getConfigurations().detachedConfiguration().setTransitive(transitive);
    final DependencySet dependencySet = config.getDependencies();

    deps.forEach(spec -> {
        if (projects.containsKey(spec.groupId() + ":" + spec.artifactId() + ":" + spec.version())) {
            dependencySet.add(new DefaultProjectDependency((ProjectInternal) projects.get(spec.groupId() + ":" + spec.artifactId() + ":" + spec.version()), new DefaultProjectAccessListener(), false));
        } else {
            final DefaultExternalModuleDependency d =
                    new DefaultExternalModuleDependency(spec.groupId(), spec.artifactId(), spec.version());
            final DefaultDependencyArtifact da =
                    new DefaultDependencyArtifact(spec.artifactId(), spec.type(), spec.type(), spec.classifier(), null);
            d.addArtifact(da);
            dependencySet.add(d);
        }
    });

    if (transitive) {
        return config
                .getResolvedConfiguration()
                .getResolvedArtifacts();
    }

    return config
            .getResolvedConfiguration()
            .getFirstLevelModuleDependencies()
            .stream()
            .map(dep -> dep.getModuleArtifacts())
            .flatMap(artifacts -> artifacts.stream())
            .collect(Collectors.toList());
}
项目:Pushjet-Android    文件:ModuleFactoryHelper.java   
public static void addExplicitArtifactsIfDefined(ExternalDependency moduleDependency, String artifactType, String classifier) {
    String actualArtifactType = artifactType;
    if (actualArtifactType == null) {
        if (classifier != null) {
            actualArtifactType = DependencyArtifact.DEFAULT_TYPE;
        }
    } else {
        moduleDependency.setTransitive(false);
    }
    if (actualArtifactType != null) {
        moduleDependency.addArtifact(new DefaultDependencyArtifact(moduleDependency.getName(),
                actualArtifactType, actualArtifactType, classifier, null));
    }
}
项目:Pushjet-Android    文件:ModuleFactoryHelper.java   
public static void addExplicitArtifactsIfDefined(ExternalDependency moduleDependency, String artifactType, String classifier) {
    String actualArtifactType = artifactType;
    if (actualArtifactType == null) {
        if (classifier != null) {
            actualArtifactType = DependencyArtifact.DEFAULT_TYPE;
        }
    } else {
        moduleDependency.setTransitive(false);
    }
    if (actualArtifactType != null) {
        moduleDependency.addArtifact(new DefaultDependencyArtifact(moduleDependency.getName(),
                actualArtifactType, actualArtifactType, classifier, null));
    }
}