com.lesfurets.jenkins.unit.global.lib.LocalSource.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jenkins-pipeline-unit Show documentation
Show all versions of jenkins-pipeline-unit Show documentation
Jenkins Pipeline Unit testing framework
package com.lesfurets.jenkins.unit.global.lib
import groovy.transform.CompileStatic
import groovy.transform.Immutable
@Immutable
@CompileStatic
class LocalSource implements SourceRetriever {
String sourceURL
@Override
List retrieve(String repository, String branch, String targetPath) {
def sourceDir = new File(sourceURL).toPath().resolve("$repository@$branch").toFile()
if (sourceDir.exists()) {
return [sourceDir.toURI().toURL()]
}
throw new IllegalStateException("Directory $sourceDir.path does not exists")
}
static LocalSource localSource(String source) {
new LocalSource(source)
}
@Override
String toString() {
return "LocalSource{" +
"sourceURL='" + sourceURL + '\'' +
'}'
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy