Search in sources :

Example 1 with CommitIdentifierType

use of com.typelead.gradle.eta.api.SourceRepository.CommitIdentifierType in project gradle-eta by typelead.

the class DefaultEtaGitDependency method create.

public static DefaultEtaGitDependency create(Project project, Map<String, String> attributes) {
    validateAttributes(attributes);
    String packageName = attributes.get(PACKAGE_ATTRIBUTE);
    String location = attributes.get(LOCATION_ATTRIBUTE);
    String commit = attributes.get(COMMIT_ATTRIBUTE);
    String branch = attributes.get(BRANCH_ATTRIBUTE);
    String tag = attributes.get(TAG_ATTRIBUTE);
    CommitIdentifierType commitIdType;
    String commitId;
    if (commit != null) {
        commitIdType = COMMIT;
        commitId = commit;
    } else if (tag != null) {
        commitIdType = TAG;
        commitId = tag;
    } else {
        commitIdType = BRANCH;
        commitId = branch;
    }
    return new DefaultEtaGitDependency(project, packageName, new SourceRepository(location, commitIdType, commitId));
}
Also used : CommitIdentifierType(com.typelead.gradle.eta.api.SourceRepository.CommitIdentifierType) SourceRepository(com.typelead.gradle.eta.api.SourceRepository)

Aggregations

SourceRepository (com.typelead.gradle.eta.api.SourceRepository)1 CommitIdentifierType (com.typelead.gradle.eta.api.SourceRepository.CommitIdentifierType)1