use of aQute.libg.reporter.ReporterAdapter in project bnd by bndtools.
the class UTF8PropertiesTest method testEmptySpace.
public void testEmptySpace() throws IOException {
UTF8Properties p = new UTF8Properties();
ReporterAdapter ra = new ReporterAdapter();
p.load("version 1.1\n ", null, ra);
assertEquals("1.1", p.get("version"));
assertEquals(1, p.size());
}
use of aQute.libg.reporter.ReporterAdapter in project bnd by bndtools.
the class UTF8PropertiesTest method testPackageinfo.
public void testPackageinfo() throws IOException {
UTF8Properties p = new UTF8Properties();
ReporterAdapter ra = new ReporterAdapter();
p.load("version 1.0.1", null, ra);
assertEquals("1.0.1", p.get("version"));
assertEquals(1, p.size());
}
use of aQute.libg.reporter.ReporterAdapter in project bnd by bndtools.
the class HttpClient method setLog.
public void setLog(File log) throws IOException {
IO.mkdirs(log.getParentFile());
reporter = new ReporterAdapter(IO.writer(log));
}
use of aQute.libg.reporter.ReporterAdapter in project bnd by bndtools.
the class FileRepo method init.
/**
* Initialize the repository Subclasses should first call this method and
* then if it returns true, do their own initialization
*
* @return true if initialized, false if already had been initialized.
* @throws Exception
*/
protected boolean init() throws Exception {
if (inited)
return false;
inited = true;
if (reporter == null) {
ReporterAdapter reporter = trace ? new ReporterAdapter(System.out) : new ReporterAdapter();
reporter.setTrace(trace);
reporter.setExceptions(trace);
this.reporter = reporter;
}
logger.debug("init");
if (!root.isDirectory()) {
IO.mkdirs(root);
if (!root.isDirectory())
throw new IllegalArgumentException("Location cannot be turned into a directory " + root);
exec(init, root.getAbsolutePath());
}
if (hasIndex)
index = new PersistentMap<ResourceDescriptor>(new File(root, ".index"), ResourceDescriptor.class);
open();
return true;
}
use of aQute.libg.reporter.ReporterAdapter in project bnd by bndtools.
the class BaselineMojo method execute.
public void execute() throws MojoExecutionException, MojoFailureException {
if (skip) {
logger.debug("skip project as configured");
return;
}
Artifact artifact = RepositoryUtils.toArtifact(project.getArtifact());
List<RemoteRepository> aetherRepos = getRepositories(artifact);
setupBase(artifact);
try {
if (base.getVersion() == null || base.getVersion().isEmpty()) {
searchForBaseVersion(artifact, aetherRepos);
}
if (base.getVersion() != null && !base.getVersion().isEmpty()) {
ArtifactResult artifactResult = locateBaseJar(aetherRepos);
Reporter reporter;
if (fullReport) {
reporter = new ReporterAdapter(System.out);
((ReporterAdapter) reporter).setTrace(true);
} else {
reporter = new ReporterAdapter();
}
Baseline baseline = new Baseline(reporter, new DiffPluginImpl());
if (checkFailures(artifact, artifactResult, baseline)) {
if (continueOnError) {
logger.warn("The baselining check failed when checking {} against {} but the bnd-baseline-maven-plugin is configured not to fail the build.", artifact, artifactResult.getArtifact());
} else {
throw new MojoExecutionException("The baselining plugin detected versioning errors");
}
} else {
logger.info("Baselining check succeeded checking {} against {}", artifact, artifactResult.getArtifact());
}
} else {
if (failOnMissing) {
throw new MojoExecutionException("Unable to locate a previous version of the artifact");
} else {
logger.warn("No previous version of {} could be found to baseline against", artifact);
}
}
} catch (RepositoryException re) {
throw new MojoExecutionException("Unable to locate a previous version of the artifact", re);
} catch (Exception e) {
throw new MojoExecutionException("An error occurred while calculating the baseline", e);
}
}
Aggregations