use of com.uber.jenkins.phabricator.provider.InstanceProvider in project phabricator-jenkins-plugin by uber.
the class PhabricatorNotifier method getCoverageProvider.
/**
* Get the cobertura coverage for the build
*
* @param build The current build
* @param listener The build listener
* @return The current cobertura coverage, if any
*/
private CoverageProvider getCoverageProvider(AbstractBuild build, BuildListener listener, Set<String> includeFileNames) {
if (!build.getResult().isBetterOrEqualTo(Result.UNSTABLE)) {
return null;
}
Logger logger = new Logger(listener.getLogger());
InstanceProvider<CoverageProvider> provider = new InstanceProvider<CoverageProvider>(Jenkins.getInstance(), COBERTURA_PLUGIN_NAME, COBERTURA_CLASS_NAME, logger);
CoverageProvider coverage = provider.getInstance();
if (coverage == null) {
return null;
}
coverage.setBuild(build);
coverage.setIncludeFileNames(includeFileNames);
coverage.setCoverageReportPattern(coverageReportPattern);
if (coverage.hasCoverage()) {
return coverage;
} else {
logger.info(UBERALLS_TAG, "No cobertura results found");
return null;
}
}
use of com.uber.jenkins.phabricator.provider.InstanceProvider in project phabricator-jenkins-plugin by uber.
the class PhabricatorNotifier method getUnitProvider.
private UnitTestProvider getUnitProvider(AbstractBuild build, BuildListener listener) {
Logger logger = new Logger(listener.getLogger());
InstanceProvider<UnitTestProvider> provider = new InstanceProvider<UnitTestProvider>(Jenkins.getInstance(), JUNIT_PLUGIN_NAME, JUNIT_CLASS_NAME, logger);
UnitTestProvider unitProvider = provider.getInstance();
if (unitProvider == null) {
return null;
}
unitProvider.setBuild(build);
return unitProvider;
}
Aggregations