Skip to content

Commit

Permalink
Comments and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoenig10 committed Jan 5, 2021
1 parent ccb6d69 commit aa6baf4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public final class BaselineEncoding implements Plugin<Project> {

@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");
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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'() {
Expand All @@ -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")
}
}

0 comments on commit aa6baf4

Please sign in to comment.