|
|
|
@ -141,7 +141,6 @@ public class ConventionsPlugin implements Plugin<Project> {
|
|
|
|
|
});
|
|
|
|
|
project.getTasks().withType(Test.class, (test) -> {
|
|
|
|
|
withOptionalBuildJavaHome(project, (javaHome) -> test.setExecutable(javaHome + "/bin/java"));
|
|
|
|
|
withOptionalTestJavaHome(project, (javaHome) -> test.setExecutable(javaHome + "/bin/java"));
|
|
|
|
|
test.useJUnitPlatform();
|
|
|
|
|
test.setMaxHeapSize("1024M");
|
|
|
|
|
});
|
|
|
|
@ -200,15 +199,7 @@ public class ConventionsPlugin implements Plugin<Project> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void withOptionalBuildJavaHome(Project project, Consumer<String> consumer) {
|
|
|
|
|
withOptionalJavaHome(project, consumer, "buildJavaHome");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void withOptionalTestJavaHome(Project project, Consumer<String> consumer) {
|
|
|
|
|
withOptionalJavaHome(project, consumer, "testJavaHome");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void withOptionalJavaHome(Project project, Consumer<String> consumer, String javaHome) {
|
|
|
|
|
String buildJavaHome = (String) project.findProperty(javaHome);
|
|
|
|
|
String buildJavaHome = (String) project.findProperty("buildJavaHome");
|
|
|
|
|
if (buildJavaHome != null && !buildJavaHome.isEmpty()) {
|
|
|
|
|
consumer.accept(buildJavaHome);
|
|
|
|
|
}
|
|
|
|
|