Skip to content

Commit

Permalink
polish execution status logging
Browse files Browse the repository at this point in the history
  • Loading branch information
aegershman committed May 4, 2021
1 parent eeff2c5 commit c2eb0b2
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ protected ResultsContainer listResults() throws MojoExecutionException {
MeterRegistry meterRegistry = meterRegistryProvider.registry();

Path baseDir = getBaseDir();
getLog().info(String.format("Using active recipe(s) %s", activeRecipes));
getLog().info(String.format("Using active styles(s) %s", activeStyles));
if (activeRecipes.isEmpty()) {
return new ResultsContainer(baseDir, emptyList());
}
Expand All @@ -214,6 +216,7 @@ protected ResultsContainer listResults() throws MojoExecutionException {
styles = env.activateStyles(activeStyles);
Recipe recipe = env.activateRecipes(activeRecipes);

getLog().info("Validating recipes...");
Collection<Validated> validated = recipe.validateAll();
List<Validated.Invalid> failedValidations = validated.stream().map(Validated::failures)
.flatMap(Collection::stream).collect(toList());
Expand All @@ -232,7 +235,6 @@ protected ResultsContainer listResults() throws MojoExecutionException {
ExecutionContext ctx = executionContext();

getLog().info("Parsing Java files...");

sourceFiles.addAll(JavaParser.fromJavaVersion()
.styles(styles)
.classpath(
Expand All @@ -249,7 +251,6 @@ protected ResultsContainer listResults() throws MojoExecutionException {
.parse(javaSources, baseDir, ctx));

getLog().info("Parsing YAML files...");

sourceFiles.addAll(
new YamlParser()
.parse(
Expand All @@ -262,9 +263,8 @@ protected ResultsContainer listResults() throws MojoExecutionException {
baseDir,
ctx)
);

getLog().info("Parsing properties files...");

sourceFiles.addAll(
new PropertiesParser()
.parse(
Expand All @@ -278,8 +278,7 @@ protected ResultsContainer listResults() throws MojoExecutionException {
ctx)
);

getLog().info("Parsing XML files ...");

getLog().info("Parsing XML files...");
sourceFiles.addAll(
new XmlParser()
.parse(
Expand All @@ -293,13 +292,11 @@ protected ResultsContainer listResults() throws MojoExecutionException {
ctx)
);

getLog().info("Parsing POM ...");

getLog().info("Parsing POM...");
Maven pomAst = parseMaven(baseDir, ctx);
sourceFiles.add(pomAst);

getLog().info(String.format("Running recipe(s) %s", activeRecipes));

getLog().info("Running recipe(s)...");
List<Result> results = recipe.run(sourceFiles, ctx);

return new ResultsContainer(baseDir, results);
Expand Down

0 comments on commit c2eb0b2

Please sign in to comment.