|
|
@ -147,6 +147,10 @@ class JavaConventions {
|
|
|
|
project.getTasks().withType(Test.class, (test) -> {
|
|
|
|
project.getTasks().withType(Test.class, (test) -> {
|
|
|
|
test.useJUnitPlatform();
|
|
|
|
test.useJUnitPlatform();
|
|
|
|
test.setMaxHeapSize("1024M");
|
|
|
|
test.setMaxHeapSize("1024M");
|
|
|
|
|
|
|
|
if (buildingWithJava8(project)) {
|
|
|
|
|
|
|
|
test.systemProperty("java.security.properties",
|
|
|
|
|
|
|
|
getClass().getClassLoader().getResource("jdk-8156584-security.properties"));
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> project.getDependencies()
|
|
|
|
project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> project.getDependencies()
|
|
|
|
.add(JavaPlugin.TEST_RUNTIME_ONLY_CONFIGURATION_NAME, "org.junit.platform:junit-platform-launcher"));
|
|
|
|
.add(JavaPlugin.TEST_RUNTIME_ONLY_CONFIGURATION_NAME, "org.junit.platform:junit-platform-launcher"));
|
|
|
@ -176,13 +180,17 @@ class JavaConventions {
|
|
|
|
if (!args.contains("-parameters")) {
|
|
|
|
if (!args.contains("-parameters")) {
|
|
|
|
args.add("-parameters");
|
|
|
|
args.add("-parameters");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!project.hasProperty("toolchainVersion") && JavaVersion.current() == JavaVersion.VERSION_1_8) {
|
|
|
|
if (buildingWithJava8(project)) {
|
|
|
|
args.addAll(Arrays.asList("-Werror", "-Xlint:unchecked", "-Xlint:deprecation", "-Xlint:rawtypes",
|
|
|
|
args.addAll(Arrays.asList("-Werror", "-Xlint:unchecked", "-Xlint:deprecation", "-Xlint:rawtypes",
|
|
|
|
"-Xlint:varargs"));
|
|
|
|
"-Xlint:varargs"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean buildingWithJava8(Project project) {
|
|
|
|
|
|
|
|
return !project.hasProperty("toolchainVersion") && JavaVersion.current() == JavaVersion.VERSION_1_8;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void configureSpringJavaFormat(Project project) {
|
|
|
|
private void configureSpringJavaFormat(Project project) {
|
|
|
|
project.getPlugins().apply(SpringJavaFormatPlugin.class);
|
|
|
|
project.getPlugins().apply(SpringJavaFormatPlugin.class);
|
|
|
|
project.getTasks().withType(FormatTask.class, (formatTask) -> formatTask.setEncoding("UTF-8"));
|
|
|
|
project.getTasks().withType(FormatTask.class, (formatTask) -> formatTask.setEncoding("UTF-8"));
|
|
|
|