All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nebula.test.dependencies.ModuleBuilder.groovy Maven / Gradle / Ivy

There is a newer version: 10.6.1
Show newest version
package nebula.test.dependencies

class ModuleBuilder {
    Coordinate module
    String status = 'integration'
    List dependencies = []

    ModuleBuilder(String coordinate) {
        def (group, artifact, version) = coordinate.tokenize(':')
        module = new Coordinate(group: group, artifact: artifact, version: version)
    }

    ModuleBuilder(String group, String artifact, String version) {
        module = new Coordinate(group: group, artifact: artifact, version: version)
    }

    ModuleBuilder addDependency(String dependency) {
        def (group, artifact, version) = dependency.tokenize(':')
        dependencies << new Coordinate(group: group, artifact: artifact, version: version)

        this
    }

    ModuleBuilder addDependency(String group, String artifact, String version) {
        dependencies << new Coordinate(group: group, artifact: artifact, version: version)

        this
    }

    ModuleBuilder setStatus(String status) {
        this.status = status

        this
    }

    DependencyGraphNode build() {
        new DependencyGraphNode(coordinate: module, dependencies: dependencies, status: status)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy