use of org.apache.maven.doxia.sink.Sink in project felix by apache.
the class BaselineReport method startPackage.
@Override
protected void startPackage(final Object context, boolean mismatch, String packageName, String shortDelta, String delta, Version newerVersion, Version olderVersion, Version suggestedVersion, DiffMessage diffMessage, Map<String, String> attributes) {
final Context ctx = (Context) context;
final Sink sink = ctx.sink;
sink.list();
sink.listItem();
sink.figure();
sink.figureGraphics("./images/baseline/package.gif");
sink.figure_();
sink.text(" ");
sink.monospaced();
sink.text(packageName);
sink.monospaced_();
if (diffMessage != null) {
sink.text(" ");
sink.figure();
sink.figureGraphics("./images/baseline/" + diffMessage.getType().name() + ".gif");
sink.figure_();
sink.text(" ");
sink.italic();
sink.text(diffMessage.getMessage());
sink.italic_();
sink.text(" (newer version: ");
sink.monospaced();
sink.text(newerVersion.toString());
sink.monospaced_();
sink.text(", older version: ");
sink.monospaced();
sink.text(olderVersion.toString());
if (suggestedVersion != null) {
sink.monospaced_();
sink.text(", suggested version: ");
sink.monospaced();
sink.text(suggestedVersion.toString());
}
sink.monospaced_();
sink.text(")");
}
}
use of org.apache.maven.doxia.sink.Sink in project maven-dependency-plugin by apache.
the class AnalyzeReportMojo method executeReport.
// Mojo methods -----------------------------------------------------------
/*
* @see org.apache.maven.plugin.Mojo#execute()
*/
@Override
public void executeReport(Locale locale) throws MavenReportException {
if (skip) {
getLog().info("Skipping plugin execution");
return;
}
// Step 0: Checking pom availability
if ("pom".equals(project.getPackaging())) {
getLog().info("Skipping pom project");
return;
}
if (outputDirectory == null || !outputDirectory.exists()) {
getLog().info("Skipping project with no Target directory");
return;
}
// Step 1: Analyze the project
ProjectDependencyAnalysis analysis;
try {
analysis = analyzer.analyze(project);
if (usedDependencies != null) {
analysis = analysis.forceDeclaredDependenciesUsage(usedDependencies);
}
} catch (ProjectDependencyAnalyzerException exception) {
throw new MavenReportException("Cannot analyze dependencies", exception);
}
// remove everything that's not in the compile scope
if (ignoreNonCompile) {
analysis = analysis.ignoreNonCompile();
}
// Step 2: Create sink and bundle
Sink sink = getSink();
ResourceBundle bundle = getBundle(locale);
// Step 3: Generate the report
AnalyzeReportView analyzethis = new AnalyzeReportView();
analyzethis.generateReport(analysis, sink, bundle);
}
use of org.apache.maven.doxia.sink.Sink in project maven-plugins by apache.
the class InvokerReport method renderBuildJob.
private void renderBuildJob(BuildJob buildJob, Locale locale) {
Sink sink = getSink();
sink.tableRow();
StringBuilder buffer = new StringBuilder();
if (!StringUtils.isEmpty(buildJob.getName()) && !StringUtils.isEmpty(buildJob.getDescription())) {
buffer.append(buildJob.getName());
buffer.append(" : ");
buffer.append(buildJob.getDescription());
} else {
buffer.append(buildJob.getProject());
}
sinkCell(sink, buffer.toString());
// FIXME image
sinkCell(sink, buildJob.getResult());
sinkCell(sink, secondsFormat.format(buildJob.getTime()));
sinkCell(sink, buildJob.getFailureMessage());
sink.tableRow_();
}
use of org.apache.maven.doxia.sink.Sink in project maven-plugins by apache.
the class AnalyzeReportMojo method executeReport.
// Mojo methods -----------------------------------------------------------
/*
* @see org.apache.maven.plugin.Mojo#execute()
*/
@Override
public void executeReport(Locale locale) throws MavenReportException {
if (skip) {
getLog().info("Skipping plugin execution");
return;
}
// Step 0: Checking pom availability
if ("pom".equals(project.getPackaging())) {
getLog().info("Skipping pom project");
return;
}
if (outputDirectory == null || !outputDirectory.exists()) {
getLog().info("Skipping project with no Target directory");
return;
}
// Step 1: Analyze the project
ProjectDependencyAnalysis analysis;
try {
analysis = analyzer.analyze(project);
if (usedDependencies != null) {
analysis = analysis.forceDeclaredDependenciesUsage(usedDependencies);
}
} catch (ProjectDependencyAnalyzerException exception) {
throw new MavenReportException("Cannot analyze dependencies", exception);
}
// remove everything that's not in the compile scope
if (ignoreNonCompile) {
analysis = analysis.ignoreNonCompile();
}
// Step 2: Create sink and bundle
Sink sink = getSink();
ResourceBundle bundle = getBundle(locale);
// Step 3: Generate the report
AnalyzeReportView analyzethis = new AnalyzeReportView();
analyzethis.generateReport(analysis, sink, bundle);
}
Aggregations