Java Code Examples for org.gradle.api.artifacts.PublishArtifact#getType()

The following examples show how to use org.gradle.api.artifacts.PublishArtifact#getType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultArtifactPublicationSet.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void addCandidate(PublishArtifact artifact) {
    if (defaultArtifact == null) {
        artifacts.add(artifact);
        defaultArtifact = artifact;
        return;
    }

    String thisType = artifact.getType();
    String currentType = defaultArtifact.getType();
    if (thisType.equals("ear")) {
        replaceCurrent(artifact);
    } else if (thisType.equals("war")) {
        if (currentType.equals("jar")) {
            replaceCurrent(artifact);
        }
    } else if (!thisType.equals("jar")) {
        artifacts.add(artifact);
    }
}
 
Example 2
Source File: DefaultConfigurationsToArtifactsConverter.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public Artifact createIvyArtifact(PublishArtifact publishArtifact, ModuleRevisionId moduleRevisionId) {
    Map<String, String> extraAttributes = new HashMap<String, String>();
    if (GUtil.isTrue(publishArtifact.getClassifier())) {
        extraAttributes.put(Dependency.CLASSIFIER, publishArtifact.getClassifier());
    }
    String name = publishArtifact.getName();
    if (!GUtil.isTrue(name)) {
        name = moduleRevisionId.getName();
    }
    return new DefaultArtifact(
            moduleRevisionId,
            publishArtifact.getDate(),
            name,
            publishArtifact.getType(),
            publishArtifact.getExtension(),
            extraAttributes);
}
 
Example 3
Source File: DefaultArtifactPublicationSet.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void addCandidate(PublishArtifact artifact) {
    if (defaultArtifact == null) {
        artifacts.add(artifact);
        defaultArtifact = artifact;
        return;
    }

    String thisType = artifact.getType();
    String currentType = defaultArtifact.getType();
    if (thisType.equals("ear")) {
        replaceCurrent(artifact);
    } else if (thisType.equals("war")) {
        if (currentType.equals("jar")) {
            replaceCurrent(artifact);
        }
    } else if (!thisType.equals("jar")) {
        artifacts.add(artifact);
    }
}
 
Example 4
Source File: DefaultArtifactPublicationSet.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void addCandidate(PublishArtifact artifact) {
    if (defaultArtifact == null) {
        artifacts.add(artifact);
        defaultArtifact = artifact;
        return;
    }

    String thisType = artifact.getType();
    String currentType = defaultArtifact.getType();
    if (thisType.equals("ear")) {
        replaceCurrent(artifact);
    } else if (thisType.equals("war")) {
        if (currentType.equals("jar")) {
            replaceCurrent(artifact);
        }
    } else if (!thisType.equals("jar")) {
        artifacts.add(artifact);
    }
}
 
Example 5
Source File: DefaultConfigurationsToArtifactsConverter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public Artifact createIvyArtifact(PublishArtifact publishArtifact, ModuleRevisionId moduleRevisionId) {
    Map<String, String> extraAttributes = new HashMap<String, String>();
    if (GUtil.isTrue(publishArtifact.getClassifier())) {
        extraAttributes.put(Dependency.CLASSIFIER, publishArtifact.getClassifier());
    }
    String name = publishArtifact.getName();
    if (!GUtil.isTrue(name)) {
        name = moduleRevisionId.getName();
    }
    return new DefaultArtifact(
            moduleRevisionId,
            publishArtifact.getDate(),
            name,
            publishArtifact.getType(),
            publishArtifact.getExtension(),
            extraAttributes);
}
 
Example 6
Source File: DefaultArtifactPublicationSet.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void addCandidate(PublishArtifact artifact) {
    if (defaultArtifact == null) {
        artifacts.add(artifact);
        defaultArtifact = artifact;
        return;
    }

    String thisType = artifact.getType();
    String currentType = defaultArtifact.getType();
    if (thisType.equals("ear")) {
        replaceCurrent(artifact);
    } else if (thisType.equals("war")) {
        if (currentType.equals("jar")) {
            replaceCurrent(artifact);
        }
    } else if (!thisType.equals("jar")) {
        artifacts.add(artifact);
    }
}
 
Example 7
Source File: DefaultConfigurationsToArtifactsConverter.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public IvyArtifactName createIvyArtifact(PublishArtifact publishArtifact, ModuleVersionIdentifier moduleVersionIdentifier) {
    Map<String, String> extraAttributes = new HashMap<String, String>();
    if (GUtil.isTrue(publishArtifact.getClassifier())) {
        extraAttributes.put(Dependency.CLASSIFIER, publishArtifact.getClassifier());
    }
    String name = publishArtifact.getName();
    if (!GUtil.isTrue(name)) {
        name = moduleVersionIdentifier.getName();
    }
    return new DefaultIvyArtifactName(name, publishArtifact.getType(), publishArtifact.getExtension(), extraAttributes);
}
 
Example 8
Source File: DefaultConfigurationsToArtifactsConverter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public IvyArtifactName createIvyArtifact(PublishArtifact publishArtifact, ModuleVersionIdentifier moduleVersionIdentifier) {
    Map<String, String> extraAttributes = new HashMap<String, String>();
    if (GUtil.isTrue(publishArtifact.getClassifier())) {
        extraAttributes.put(Dependency.CLASSIFIER, publishArtifact.getClassifier());
    }
    String name = publishArtifact.getName();
    if (!GUtil.isTrue(name)) {
        name = moduleVersionIdentifier.getName();
    }
    return new DefaultIvyArtifactName(name, publishArtifact.getType(), publishArtifact.getExtension(), extraAttributes);
}
 
Example 9
Source File: DefaultArtifactPom.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private ArtifactKey(PublishArtifact artifact) {
    this.type = artifact.getType();
    this.classifier = artifact.getClassifier();
}
 
Example 10
Source File: DefaultArtifactPom.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private ArtifactKey(PublishArtifact artifact) {
    this.type = artifact.getType();
    this.classifier = artifact.getClassifier();
}
 
Example 11
Source File: DefaultArtifactPom.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private ArtifactKey(PublishArtifact artifact) {
    this.type = artifact.getType();
    this.classifier = artifact.getClassifier();
}
 
Example 12
Source File: DefaultArtifactPom.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private ArtifactKey(PublishArtifact artifact) {
    this.type = artifact.getType();
    this.classifier = artifact.getClassifier();
}