Skip to content

Commit

Permalink
Update for rewrite 7.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sambsnyd committed Mar 20, 2021
1 parent cabe818 commit 7f2f435
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 35 deletions.
2 changes: 1 addition & 1 deletion plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ val plugin: Configuration by configurations.creating
configurations.getByName("compileOnly").extendsFrom(plugin)

// Fixed version numbers because com.gradle.plugin-publish will publish poms with requested rather than resolved versions
val rewriteVersion = "7.0.0-rc.8"
val rewriteVersion = "7.0.1"
val prometheusVersion = "1.3.0"
val nettyVersion = "1.1.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,30 +141,6 @@ protected ExecutionContext executionContext() {
return new InMemoryExecutionContext(t -> getLog().warn(t.getMessage(), t));
}

protected Parser.Listener listener() {
return new Parser.Listener() {
@Override
public void onError(String message) {
getLog().error(message);
}

@Override
public void onError(String message, Throwable t) {
getLog().error(message, t);
}

@Override
public void onWarn(String message) {
getLog().info(message);
}

@Override
public void onWarn(String message, Throwable t) {
getLog().info(message, t);
}
};
}

protected ResultsContainer listResults() {
try (MeterRegistryProvider meterRegistryProvider = new MeterRegistryProvider(getLog(), metricsUri, metricsUsername, metricsPassword)) {
MeterRegistry meterRegistry = meterRegistryProvider.registry();
Expand All @@ -190,7 +166,6 @@ protected ResultsContainer listResults() {
.map(AbstractRewriteTask::toRealPath)
.collect(toList());
ExecutionContext ctx = executionContext();
Parser.Listener listener = listener();

sourceFiles.addAll(
JavaParser.fromJavaVersion()
Expand All @@ -202,9 +177,7 @@ protected ResultsContainer listResults() {
);

sourceFiles.addAll(
YamlParser.builder()
.doOnParse(listener)
.build()
new YamlParser()
.parse(getResources().getFiles().stream()
.filter(it -> it.isFile() && it.getName().endsWith(".yml") || it.getName().endsWith(".yaml"))
.map(File::toPath)
Expand All @@ -214,9 +187,7 @@ protected ResultsContainer listResults() {
));

sourceFiles.addAll(
PropertiesParser.builder()
.doOnParse(listener)
.build()
new PropertiesParser()
.parse(
getResources().getFiles().stream()
.filter(it -> it.isFile() && it.getName().endsWith(".properties"))
Expand All @@ -227,9 +198,7 @@ protected ResultsContainer listResults() {
));

sourceFiles.addAll(
XmlParser.builder()
.doOnParse(listener)
.build().parse(
new XmlParser().parse(
getResources().getFiles().stream()
.filter(it -> it.isFile() && it.getName().endsWith(".xml"))
.map(File::toPath)
Expand Down

0 comments on commit 7f2f435

Please sign in to comment.