本文整理汇总了Java中org.gradle.api.artifacts.ResolvedDependency类的典型用法代码示例。如果您正苦于以下问题:Java ResolvedDependency类的具体用法?Java ResolvedDependency怎么用?Java ResolvedDependency使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResolvedDependency类属于org.gradle.api.artifacts包,在下文中一共展示了ResolvedDependency类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolve
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
@Override
public ArtifactSpec resolve(final ArtifactSpec spec) {
if (spec.file != null) {
return spec;
}
final Iterator<ResolvedDependency> iterator =
doResolve(new HashSet<>(Collections.singletonList(spec))).iterator();
if (iterator.hasNext()) {
spec.file = iterator.next()
.getModuleArtifacts()
.iterator().next()
.getFile();
return spec;
}
return null;
}
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:20,代码来源:GradleArtifactResolvingHelper.java
示例2: doResolve
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
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();
}
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:17,代码来源:GradleArtifactResolvingHelper.java
示例3: getFirstLevelModuleDependencies
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
public Set<ResolvedDependency> getFirstLevelModuleDependencies(Spec<? super Dependency> dependencySpec) {
Set<ResolvedDependency> matches = new LinkedHashSet<ResolvedDependency>();
for (DependencyGraphNodeResult node : getFirstLevelNodes(dependencySpec)) {
matches.add(node.getPublicView());
}
return matches;
}
示例4: getAllModuleDependencies
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
public Set<ResolvedDependency> getAllModuleDependencies() {
Set<ResolvedDependency> resolvedElements = new LinkedHashSet<ResolvedDependency>();
Deque<ResolvedDependency> workQueue = new LinkedList<ResolvedDependency>();
workQueue.addAll(loadTransientGraphResults(selectedArtifacts).getRootNode().getPublicView().getChildren());
while (!workQueue.isEmpty()) {
ResolvedDependency item = workQueue.removeFirst();
if (resolvedElements.add(item)) {
final Set<ResolvedDependency> children = item.getChildren();
if (children != null) {
workQueue.addAll(children);
}
}
}
return resolvedElements;
}
示例5: getFirstLevelModuleDependencies
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
@Override
public Set<ResolvedDependency> getFirstLevelModuleDependencies() {
try {
return lenientConfiguration.getFirstLevelModuleDependencies();
} catch (Throwable e) {
throw wrapException(e, resolveContext);
}
}
示例6: getAllModuleDependencies
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
@Override
public Set<ResolvedDependency> getAllModuleDependencies() {
try {
return lenientConfiguration.getAllModuleDependencies();
} catch (Throwable e) {
throw wrapException(e, resolveContext);
}
}
示例7: getAllModuleArtifacts
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
public Set<ResolvedArtifact> getAllModuleArtifacts() {
if (allModuleArtifactsCache == null) {
Set<ResolvedArtifact> allArtifacts = new LinkedHashSet<ResolvedArtifact>();
allArtifacts.addAll(getModuleArtifacts());
for (ResolvedDependency childResolvedDependency : getChildren()) {
allArtifacts.addAll(childResolvedDependency.getAllModuleArtifacts());
}
allModuleArtifactsCache = allArtifacts;
}
return allModuleArtifactsCache;
}
示例8: getArtifactsForIncomingEdge
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
@Override
public ResolvedArtifactSet getArtifactsForIncomingEdge(DependencyGraphNodeResult parent) {
if (!parents.contains(parent)) {
throw new InvalidUserDataException("Provided dependency (" + parent + ") must be a parent of: " + this);
}
return CompositeArtifactSet.of(parentArtifacts.get((ResolvedDependency) parent));
}
示例9: getAllArtifacts
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
public Set<ResolvedArtifact> getAllArtifacts(ResolvedDependency parent) {
if (allArtifactsCache.get(parent) == null) {
Set<ResolvedArtifact> allArtifacts = new LinkedHashSet<ResolvedArtifact>();
allArtifacts.addAll(getArtifacts(parent));
for (ResolvedDependency childResolvedDependency : getChildren()) {
for (ResolvedDependency childParent : childResolvedDependency.getParents()) {
allArtifacts.addAll(childResolvedDependency.getAllArtifacts(childParent));
}
}
allArtifactsCache.put(parent, allArtifacts);
}
return allArtifactsCache.get(parent);
}
示例10: GradleArtifact
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
public GradleArtifact(GradleArtifact parent, ResolvedDependency gradleArtifact) {
this.parent = parent;
children = new HashSet<>();
name = gradleArtifact.getModule().getId().getName();
group = gradleArtifact.getModule().getId().getGroup();
version = gradleArtifact.getModule().getId().getVersion();
addChildren(gradleArtifact);
}
示例11: addChildren
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
private void addChildren(ResolvedDependency gradleArtifact) {
gradleArtifact.getChildren().forEach(c -> {
GradleArtifact child = new GradleArtifact(this, c);
children.add(child);
}
);
}
示例12: getParentArtifacts
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
public Set<ResolvedArtifact> getParentArtifacts(ResolvedDependency parent) {
if (!parents.contains(parent)) {
throw new InvalidUserDataException("Provided dependency (" + parent + ") must be a parent of: " + this);
}
Set<ResolvedArtifact> artifacts = parentArtifacts.get(parent);
return artifacts == null ? Collections.<ResolvedArtifact>emptySet() : artifacts;
}
示例13: addParentSpecificArtifacts
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
public void addParentSpecificArtifacts(ResolvedDependency parent, Set<ResolvedArtifact> artifacts) {
Set<ResolvedArtifact> parentArtifacts = this.parentArtifacts.get(parent);
if (parentArtifacts == null) {
parentArtifacts = new TreeSet<ResolvedArtifact>(new ResolvedArtifactComparator());
this.parentArtifacts.put(parent, parentArtifacts);
}
parentArtifacts.addAll(artifacts);
moduleArtifacts.addAll(artifacts);
}
示例14: DefaultResolvedArtifact
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
public DefaultResolvedArtifact(ResolvedModuleVersion owner, Factory<ResolvedDependency> ownerSource, IvyArtifactName artifact, Factory<File> artifactSource, long id) {
this.ownerSource = ownerSource;
this.owner = owner;
this.artifact = artifact;
this.id = id;
this.artifactSource = artifactSource;
}
示例15: getResolvedDependency
import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
public ResolvedDependency getResolvedDependency() {
DeprecationLogger.nagUserOfDeprecated(
"ResolvedArtifact.getResolvedDependency()",
"For version info use ResolvedArtifact.getModuleVersion(), to access the dependency graph use ResolvedConfiguration.getFirstLevelModuleDependencies()"
);
//resolvedDependency is expensive so lazily create it
return ownerSource.create();
}