From aa6baf42790ff7a711e82fd9f9650da30a7055ba Mon Sep 17 00:00:00 2001 From: Patrick Koenig Date: Tue, 5 Jan 2021 14:15:24 -0800 Subject: [PATCH] Comments and fix tests --- .../com/palantir/baseline/plugins/BaselineEncoding.java | 4 ++-- .../baseline/BaselineEncodingIntegrationTest.groovy | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/BaselineEncoding.java b/gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/BaselineEncoding.java index 2cb9c7b3e..d7806cba5 100644 --- a/gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/BaselineEncoding.java +++ b/gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/BaselineEncoding.java @@ -24,8 +24,8 @@ public final class BaselineEncoding implements Plugin { @Override public void apply(Project project) { - project.getTasks().withType(JavaCompile.class).configureEach(t -> { - t.getOptions().setEncoding("UTF-8"); + project.getTasks().withType(JavaCompile.class).configureEach(javaCompileTask -> { + javaCompileTask.getOptions().setEncoding("UTF-8"); }); } } diff --git a/gradle-baseline-java/src/test/groovy/com/palantir/baseline/BaselineEncodingIntegrationTest.groovy b/gradle-baseline-java/src/test/groovy/com/palantir/baseline/BaselineEncodingIntegrationTest.groovy index 43b8bfaff..94bde79fc 100644 --- a/gradle-baseline-java/src/test/groovy/com/palantir/baseline/BaselineEncodingIntegrationTest.groovy +++ b/gradle-baseline-java/src/test/groovy/com/palantir/baseline/BaselineEncodingIntegrationTest.groovy @@ -68,6 +68,7 @@ class BaselineEncodingIntegrationTest extends AbstractPluginTest { then: BuildResult result = with('compileJava').build() result.task(":compileJava").outcome == TaskOutcome.SUCCESS + !result.output.contains("unmappable character") } def 'compileJava fails with other encoding'() { @@ -76,7 +77,8 @@ class BaselineEncodingIntegrationTest extends AbstractPluginTest { file('src/main/java/test/Test.java').text = javaFile then: - BuildResult result = with('compileJava').buildAndFail() - result.task(":compileJava").outcome == TaskOutcome.FAILED + BuildResult result = with('compileJava').build() + result.task(":compileJava").outcome == TaskOutcome.SUCCESS + result.output.contains("unmappable character") } }