use of jetbrains.buildServer.buildTriggers.vcs.git.GitVersion in project teamcity-git by JetBrains.
the class GitVersionProvider method version.
@DataProvider
public static Object[][] version(Method testMethod) throws Exception {
String gitPath = getGitPath();
GitVersion version = new AgentGitFacadeImpl(gitPath).version().call();
RequiredGitVersion requirement = testMethod.getAnnotation(RequiredGitVersion.class);
if (requirement == null)
requirement = testMethod.getDeclaringClass().getAnnotation(RequiredGitVersion.class);
if (requirement == null) {
return new Object[][] { new Object[] { new GitExec(gitPath, version) } };
} else {
GitVersion minRequired = GitVersion.parse("git version " + requirement.min());
if (version.isLessThan(minRequired)) {
return new Object[0][];
} else {
return new Object[][] { new Object[] { new GitExec(gitPath, version) } };
}
}
}
Aggregations