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

项目:Reer    文件:IvyDescriptorFileGenerator.java   
private void writeDependencies(OptionalAttributeXmlWriter xmlWriter) throws IOException {
    xmlWriter.startElement("dependencies");
    for (IvyDependencyInternal dependency : dependencies) {
        xmlWriter.startElement("dependency")
                .attribute("org", dependency.getOrganisation())
                .attribute("name", dependency.getModule())
                .attribute("rev", dependency.getRevision())
                .attribute("conf", dependency.getConfMapping());

        if (!dependency.isTransitive()) {
            xmlWriter.attribute("transitive", "false");
        }

        for (DependencyArtifact dependencyArtifact : dependency.getArtifacts()) {
            printDependencyArtifact(dependencyArtifact, xmlWriter);
        }
        for(ExcludeRule excludeRule : dependency.getExcludeRules()) {
            writeDependencyExclude(excludeRule, xmlWriter);
        }
        xmlWriter.endElement();
    }
    xmlWriter.endElement();
}
项目:gradle-project-config    文件:PomConfigurator.java   
/**
 * Add dependencies to the POM
 *
 * Adds all dependencies from the provided configuration with the provided scope to the POM and to the set of
 * existing dependencies. Dependencies are only added if they are not contained in the set of existing dependencies.
 *
 * @param dependencies Element to add dependencies to
 * @param configuration Configuration whose provides depencencies to add
 * @param scope Scope to use for added depencencies
 */
protected void addDependencies(Element dependencies, Configuration configuration, String scope) {
    for (@NonNull Dependency dependency : configuration.getDependencies()) {
        if (dependency instanceof ModuleDependency) {
            ModuleDependency moduleDependency = (ModuleDependency) dependency;

            if (moduleDependency.getArtifacts().isEmpty()) {
                addDependency(dependencies, moduleDependency, moduleDependency.getName(), null, "jar", scope);
            }
            else {
                for (DependencyArtifact artifact : moduleDependency.getArtifacts()) {
                    addDependency(dependencies, moduleDependency, artifact.getName(), artifact.getClassifier(),
                            artifact.getType(), scope);
                }
            }
        }
    }
}
项目:Pushjet-Android    文件:IvyDescriptorFileGenerator.java   
private void writeDependencies(OptionalAttributeXmlWriter xmlWriter) throws IOException {
    xmlWriter.startElement("dependencies");
    for (IvyDependencyInternal dependency : dependencies) {
        xmlWriter.startElement("dependency")
                .attribute("org", dependency.getOrganisation())
                .attribute("name", dependency.getModule())
                .attribute("rev", dependency.getRevision())
                .attribute("conf", dependency.getConfMapping());

        for (DependencyArtifact dependencyArtifact : dependency.getArtifacts()) {
            printDependencyArtifact(dependencyArtifact, xmlWriter);
        }
        xmlWriter.endElement();
    }
    xmlWriter.endElement();
}
项目:Pushjet-Android    文件:IvyDescriptorFileGenerator.java   
private void writeDependencies(OptionalAttributeXmlWriter xmlWriter) throws IOException {
    xmlWriter.startElement("dependencies");
    for (IvyDependencyInternal dependency : dependencies) {
        xmlWriter.startElement("dependency")
                .attribute("org", dependency.getOrganisation())
                .attribute("name", dependency.getModule())
                .attribute("rev", dependency.getRevision())
                .attribute("conf", dependency.getConfMapping());

        for (DependencyArtifact dependencyArtifact : dependency.getArtifacts()) {
            printDependencyArtifact(dependencyArtifact, xmlWriter);
        }
        xmlWriter.endElement();
    }
    xmlWriter.endElement();
}
项目:Reer    文件:MavenPomFileGenerator.java   
private void addDependency(MavenDependencyInternal mavenDependency, String scope) {
    if (mavenDependency.getArtifacts().size() == 0) {
        addDependency(mavenDependency, mavenDependency.getArtifactId(), scope, null, null);
    } else {
        for (DependencyArtifact artifact : mavenDependency.getArtifacts()) {
            addDependency(mavenDependency, artifact.getName(), scope, artifact.getType(), artifact.getClassifier());
        }
    }
}
项目:Reer    文件:AbstractIvyDependencyDescriptorFactory.java   
protected Set<IvyArtifactName> convertArtifacts(Set<DependencyArtifact> dependencyArtifacts) {
    return CollectionUtils.collect(dependencyArtifacts, new Transformer<IvyArtifactName, DependencyArtifact>() {
        @Override
        public IvyArtifactName transform(DependencyArtifact dependencyArtifact) {
            return new DefaultIvyArtifactName(dependencyArtifact.getName(), dependencyArtifact.getType(), getExtension(dependencyArtifact), dependencyArtifact.getClassifier());
        }
    });
}
项目:Reer    文件:IvyDescriptorFileGenerator.java   
private boolean usesClassifier() {
    for (IvyArtifact artifact : artifacts) {
        if (artifact.getClassifier() != null) {
            return true;
        }
    }
    for (IvyDependencyInternal dependency : this.dependencies) {
        for (DependencyArtifact dependencyArtifact : dependency.getArtifacts()) {
            if (dependencyArtifact.getClassifier() != null) {
                return true;
            }
        }
    }
    return false;
}
项目:Reer    文件:IvyDescriptorFileGenerator.java   
private void printDependencyArtifact(DependencyArtifact dependencyArtifact, OptionalAttributeXmlWriter xmlWriter) throws IOException {
    // TODO Use IvyArtifact here
    xmlWriter.startElement("artifact")
            .attribute("name", dependencyArtifact.getName())
            .attribute("type", dependencyArtifact.getType())
            .attribute("ext", dependencyArtifact.getExtension())
            .attribute("m:classifier", dependencyArtifact.getClassifier())
            .endElement();
}
项目: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));
    }
}
项目:Pushjet-Android    文件:MavenPomFileGenerator.java   
private void addDependency(MavenDependencyInternal mavenDependency, String scope) {
    if (mavenDependency.getArtifacts().size() == 0) {
        addDependency(mavenDependency, mavenDependency.getArtifactId(), scope, null, null);
    } else {
        for (DependencyArtifact artifact : mavenDependency.getArtifacts()) {
            addDependency(mavenDependency, artifact.getName(), scope, artifact.getType(), artifact.getClassifier());
        }
    }
}
项目:Pushjet-Android    文件:IvyDescriptorFileGenerator.java   
private boolean usesClassifier() {
    for (IvyArtifact artifact : artifacts) {
        if (artifact.getClassifier() != null) {
            return true;
        }
    }
    for (IvyDependencyInternal dependency : this.dependencies) {
        for (DependencyArtifact dependencyArtifact : dependency.getArtifacts()) {
            if (dependencyArtifact.getClassifier() != null) {
                return true;
            }
        }
    }
    return false;
}
项目:Pushjet-Android    文件:IvyDescriptorFileGenerator.java   
private void printDependencyArtifact(DependencyArtifact dependencyArtifact, OptionalAttributeXmlWriter xmlWriter) throws IOException {
    // TODO Use IvyArtifact here
    xmlWriter.startElement("artifact")
            .attribute("name", dependencyArtifact.getName())
            .attribute("type", dependencyArtifact.getType())
            .attribute("ext", dependencyArtifact.getExtension())
            .attribute("m:classifier", dependencyArtifact.getClassifier())
            .endElement();
}
项目: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    文件:MavenPomFileGenerator.java   
private void addDependency(MavenDependencyInternal mavenDependency, String scope) {
    if (mavenDependency.getArtifacts().size() == 0) {
        addDependency(mavenDependency, mavenDependency.getArtifactId(), scope, null, null);
    } else {
        for (DependencyArtifact artifact : mavenDependency.getArtifacts()) {
            addDependency(mavenDependency, artifact.getName(), scope, artifact.getType(), artifact.getClassifier());
        }
    }
}
项目:Pushjet-Android    文件:IvyDescriptorFileGenerator.java   
private boolean usesClassifier() {
    for (IvyArtifact artifact : artifacts) {
        if (artifact.getClassifier() != null) {
            return true;
        }
    }
    for (IvyDependencyInternal dependency : this.dependencies) {
        for (DependencyArtifact dependencyArtifact : dependency.getArtifacts()) {
            if (dependencyArtifact.getClassifier() != null) {
                return true;
            }
        }
    }
    return false;
}
项目:Pushjet-Android    文件:IvyDescriptorFileGenerator.java   
private void printDependencyArtifact(DependencyArtifact dependencyArtifact, OptionalAttributeXmlWriter xmlWriter) throws IOException {
    // TODO Use IvyArtifact here
    xmlWriter.startElement("artifact")
            .attribute("name", dependencyArtifact.getName())
            .attribute("type", dependencyArtifact.getType())
            .attribute("ext", dependencyArtifact.getExtension())
            .attribute("m:classifier", dependencyArtifact.getClassifier())
            .endElement();
}
项目: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));
    }
}
项目:Reer    文件:DefaultMavenDependency.java   
public DefaultMavenDependency(String groupId, String artifactId, String version, Collection<DependencyArtifact> artifacts) {
    this(groupId, artifactId, version);
    this.artifacts.addAll(artifacts);
}
项目:Reer    文件:DefaultMavenDependency.java   
public DefaultMavenDependency(String groupId, String artifactId, String version, Collection<DependencyArtifact> artifacts, Collection<ExcludeRule> excludeRules) {
    this(groupId, artifactId, version, artifacts);
    this.excludeRules.addAll(excludeRules);
}
项目:Reer    文件:DefaultMavenDependency.java   
public Collection<DependencyArtifact> getArtifacts() {
    return artifacts;
}
项目:Reer    文件:AbstractIvyDependencyDescriptorFactory.java   
private String getExtension(DependencyArtifact artifact) {
    return artifact.getExtension() != null ? artifact.getExtension() : artifact.getType();
}
项目:Reer    文件:DefaultIvyPublication.java   
private void addProjectDependency(ProjectDependency dependency, String confMapping) {
    ModuleVersionIdentifier identifier = projectDependencyResolver.resolve(dependency);
    ivyDependencies.add(new DefaultIvyDependency(
            identifier.getGroup(), identifier.getName(), identifier.getVersion(), confMapping, dependency.isTransitive(), Collections.<DependencyArtifact>emptyList(), dependency.getExcludeRules()));
}
项目:Reer    文件:DefaultIvyDependency.java   
public DefaultIvyDependency(String organisation, String module, String revision, String confMapping, boolean transitive, Collection<DependencyArtifact> artifacts) {
    this(organisation, module, revision, confMapping, transitive);
    this.artifacts.addAll(artifacts);
}
项目:Reer    文件:DefaultIvyDependency.java   
public DefaultIvyDependency(String organisation, String module, String revision, String confMapping, boolean transitive, Collection<DependencyArtifact> artifacts, Collection<ExcludeRule> excludeRules) {
    this(organisation, module, revision, confMapping, transitive, artifacts);
    this.excludeRules.addAll(excludeRules);
}
项目:Reer    文件:DefaultIvyDependency.java   
public Iterable<DependencyArtifact> getArtifacts() {
    return artifacts;
}
项目:Reer    文件:AbstractModuleDependency.java   
public Set<DependencyArtifact> getArtifacts() {
    return artifacts;
}
项目:Reer    文件:AbstractModuleDependency.java   
public void setArtifacts(Set<DependencyArtifact> artifacts) {
    this.artifacts = artifacts;
}
项目:Reer    文件:AbstractModuleDependency.java   
public AbstractModuleDependency addArtifact(DependencyArtifact artifact) {
    artifacts.add(artifact);
    return this;
}
项目:Reer    文件:AbstractModuleDependency.java   
public DependencyArtifact artifact(Closure configureClosure) {
    return artifact(ClosureBackedAction.of(configureClosure));
}
项目:Reer    文件:AbstractModuleDependency.java   
protected void copyTo(AbstractModuleDependency target) {
    super.copyTo(target);
    target.setArtifacts(new HashSet<DependencyArtifact>(getArtifacts()));
    target.setExcludeRuleContainer(new DefaultExcludeRuleContainer(getExcludeRules()));
    target.setTransitive(isTransitive());
}
项目:Pushjet-Android    文件:DefaultMavenDependency.java   
public DefaultMavenDependency(String groupId, String artifactId, String version, Collection<DependencyArtifact> artifacts) {
    this(groupId, artifactId, version);
    this.artifacts.addAll(artifacts);
}
项目:Pushjet-Android    文件:DefaultMavenDependency.java   
public DefaultMavenDependency(String groupId, String artifactId, String version, Collection<DependencyArtifact> artifacts, Collection<ExcludeRule> excludeRules) {
    this(groupId, artifactId, version, artifacts);
    this.excludeRules.addAll(excludeRules);
}
项目:Pushjet-Android    文件:DefaultMavenDependency.java   
public Collection<DependencyArtifact> getArtifacts() {
    return artifacts;
}
项目:Pushjet-Android    文件:DefaultIvyDependency.java   
public DefaultIvyDependency(String organisation, String module, String revision, String confMapping, Collection<DependencyArtifact> artifacts) {
    this(organisation, module, revision, confMapping);
    this.artifacts.addAll(artifacts);
}
项目:Pushjet-Android    文件:DefaultIvyDependency.java   
public Iterable<DependencyArtifact> getArtifacts() {
    return artifacts;
}
项目:Pushjet-Android    文件:DefaultMavenDependency.java   
public DefaultMavenDependency(String groupId, String artifactId, String version, Collection<DependencyArtifact> artifacts) {
    this(groupId, artifactId, version);
    this.artifacts.addAll(artifacts);
}
项目:Pushjet-Android    文件:DefaultMavenDependency.java   
public Collection<DependencyArtifact> getArtifacts() {
    return artifacts;
}
项目:Pushjet-Android    文件:DefaultIvyDependency.java   
public DefaultIvyDependency(String organisation, String module, String revision, String confMapping, Collection<DependencyArtifact> artifacts) {
    this(organisation, module, revision, confMapping);
    this.artifacts.addAll(artifacts);
}
项目:Pushjet-Android    文件:DefaultIvyDependency.java   
public Iterable<DependencyArtifact> getArtifacts() {
    return artifacts;
}