• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ResolvedDependency类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.gradle.api.artifacts.ResolvedDependency的典型用法代码示例。如果您正苦于以下问题:Java ResolvedDependency类的具体用法?Java ResolvedDependency怎么用?Java ResolvedDependency使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ResolvedDependency类属于org.gradle.api.artifacts包,在下文中一共展示了ResolvedDependency类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultLenientConfiguration.java


示例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;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:16,代码来源:DefaultLenientConfiguration.java


示例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);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:ErrorHandlingConfigurationResolver.java


示例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);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:ErrorHandlingConfigurationResolver.java


示例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;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:DefaultResolvedDependency.java


示例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));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultResolvedDependency.java


示例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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:14,代码来源:DefaultResolvedDependency.java


示例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);
}
 
开发者ID:OSSIndex,项目名称:ossindex-gradle-plugin,代码行数:9,代码来源:GradleArtifact.java


示例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);
            }
    );
}
 
开发者ID:OSSIndex,项目名称:ossindex-gradle-plugin,代码行数:8,代码来源:GradleArtifact.java


示例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;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:DefaultResolvedDependency.java


示例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);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:10,代码来源:DefaultResolvedDependency.java


示例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;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:DefaultResolvedArtifact.java


示例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();
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:9,代码来源:DefaultResolvedArtifact.java


示例16: walk

import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
private void walk(final boolean top, ResolvedDependency dep) {
    Set<ResolvedArtifact> artifacts = dep.getModuleArtifacts();
    for (ResolvedArtifact each : artifacts) {
        String[] parts = dep.getName().split(":");
        String groupId = parts[0];
        String artifactId = parts[1];
        String version = parts[2];
        this.tool.dependency("compile", groupId, artifactId, version, each.getExtension(),
                             each.getClassifier(), each.getFile(), top);
    }

    dep.getChildren().forEach(d -> walk(false, d));
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:14,代码来源:PackageTask.java


示例17: getNonCheckstyleDeps

import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
protected static Set<String> getNonCheckstyleDeps(final Configuration pConfiguration)
{
    Set<String> result = new HashSet<>();
    for (ResolvedDependency dep : pConfiguration.getResolvedConfiguration().getFirstLevelModuleDependencies()) {
        if (!CreateJarEclipseTask.isCheckstyle(dep)) {
            result.add(dep.getName());
            for (final ResolvedDependency rd : dep.getChildren()) {
                result.add(rd.getName());
            }
        }
    }
    return result;
}
 
开发者ID:checkstyle-addons,项目名称:checkstyle-addons,代码行数:14,代码来源:CreateFatJarTask.java


示例18: getPublishedDependencyLibs

import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
/**
 * Scan the dependencies of the specified configurations and return a list of File objects for each dependency.
 * Resolves the configurations if they are still unresolved.
 *
 * @param pTask the calling task
 * @param pDepConfig the current dependency configuration
 * @return list of files
 */
public static Set<File> getPublishedDependencyLibs(@Nonnull final Task pTask,
    @Nonnull final DependencyConfig pDepConfig)
{
    Set<File> result = new HashSet<>();
    Configuration cfg = new ClasspathBuilder(pTask.getProject()).buildMainRuntimeConfiguration(pDepConfig);
    for (ResolvedDependency dep : cfg.getResolvedConfiguration().getFirstLevelModuleDependencies()) {
        if (!isCheckstyle(dep)) {
            for (ResolvedArtifact artifact : dep.getAllModuleArtifacts()) {
                result.add(artifact.getFile());
            }
        }
    }
    return result;
}
 
开发者ID:checkstyle-addons,项目名称:checkstyle-addons,代码行数:23,代码来源:CreateJarEclipseTask.java


示例19: inferArchives

import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
private List<JApiCmpWorkerAction.Archive> inferArchives(FileCollection fc) {
    if (fc instanceof Configuration) {
        final List<JApiCmpWorkerAction.Archive> archives = new ArrayList<>();
        Set<ResolvedDependency> firstLevelModuleDependencies = ((Configuration) fc).getResolvedConfiguration().getFirstLevelModuleDependencies();
        for (ResolvedDependency moduleDependency : firstLevelModuleDependencies) {
            collectArchives(archives, moduleDependency);
        }
        return archives;
    }

    return toArchives(fc);
}
 
开发者ID:melix,项目名称:japicmp-gradle-plugin,代码行数:13,代码来源:JapicmpTask.java


示例20: collectArchives

import org.gradle.api.artifacts.ResolvedDependency; //导入依赖的package包/类
private void collectArchives(final List<JApiCmpWorkerAction.Archive> archives, ResolvedDependency resolvedDependency) {
    String version = resolvedDependency.getModule().getId().getVersion();
    archives.add(new JApiCmpWorkerAction.Archive(resolvedDependency.getAllModuleArtifacts().iterator().next().getFile(), version));
    for (ResolvedDependency dependency : resolvedDependency.getChildren()) {
        collectArchives(archives, dependency);
    }
}
 
开发者ID:melix,项目名称:japicmp-gradle-plugin,代码行数:8,代码来源:JapicmpTask.java



注:本文中的org.gradle.api.artifacts.ResolvedDependency类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MessageListener类代码示例发布时间:2022-05-22
下一篇:
Java CreateParentParam类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap