|
|
@ -56,6 +56,8 @@ import org.gradle.api.tasks.bundling.Jar;
|
|
|
|
import org.gradle.api.tasks.compile.JavaCompile;
|
|
|
|
import org.gradle.api.tasks.compile.JavaCompile;
|
|
|
|
import org.gradle.api.tasks.javadoc.Javadoc;
|
|
|
|
import org.gradle.api.tasks.javadoc.Javadoc;
|
|
|
|
import org.gradle.api.tasks.testing.Test;
|
|
|
|
import org.gradle.api.tasks.testing.Test;
|
|
|
|
|
|
|
|
import org.gradle.testretry.TestRetryPlugin;
|
|
|
|
|
|
|
|
import org.gradle.testretry.TestRetryTaskExtension;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.build.testing.TestFailuresPlugin;
|
|
|
|
import org.springframework.boot.build.testing.TestFailuresPlugin;
|
|
|
|
import org.springframework.util.FileCopyUtils;
|
|
|
|
import org.springframework.util.FileCopyUtils;
|
|
|
@ -71,7 +73,8 @@ import org.springframework.util.FileCopyUtils;
|
|
|
|
* <ul>
|
|
|
|
* <ul>
|
|
|
|
* <li>{@code sourceCompatibility} is set to {@code 1.8}
|
|
|
|
* <li>{@code sourceCompatibility} is set to {@code 1.8}
|
|
|
|
* <li>{@link SpringJavaFormatPlugin Spring Java Format}, {@link CheckstylePlugin
|
|
|
|
* <li>{@link SpringJavaFormatPlugin Spring Java Format}, {@link CheckstylePlugin
|
|
|
|
* Checkstyle}, and {@link TestFailuresPlugin Test Failures} plugins are applied
|
|
|
|
* Checkstyle}, {@link TestFailuresPlugin Test Failures}, and {@link TestRetryPlugin Test
|
|
|
|
|
|
|
|
* Retry} plugins are applied
|
|
|
|
* <li>{@link Test} tasks are configured to use JUnit Platform and use a max heap of 1024M
|
|
|
|
* <li>{@link Test} tasks are configured to use JUnit Platform and use a max heap of 1024M
|
|
|
|
* <li>{@link JavaCompile}, {@link Javadoc}, and {@link FormatTask} tasks are configured
|
|
|
|
* <li>{@link JavaCompile}, {@link Javadoc}, and {@link FormatTask} tasks are configured
|
|
|
|
* to use UTF-8 encoding
|
|
|
|
* to use UTF-8 encoding
|
|
|
@ -139,10 +142,16 @@ public class ConventionsPlugin implements Plugin<Project> {
|
|
|
|
javadoc.getOptions().source("1.8").encoding("UTF-8");
|
|
|
|
javadoc.getOptions().source("1.8").encoding("UTF-8");
|
|
|
|
withOptionalBuildJavaHome(project, (javaHome) -> javadoc.setExecutable(javaHome + "/bin/javadoc"));
|
|
|
|
withOptionalBuildJavaHome(project, (javaHome) -> javadoc.setExecutable(javaHome + "/bin/javadoc"));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
project.getPlugins().apply(TestRetryPlugin.class);
|
|
|
|
project.getTasks().withType(Test.class, (test) -> {
|
|
|
|
project.getTasks().withType(Test.class, (test) -> {
|
|
|
|
withOptionalBuildJavaHome(project, (javaHome) -> test.setExecutable(javaHome + "/bin/java"));
|
|
|
|
withOptionalBuildJavaHome(project, (javaHome) -> test.setExecutable(javaHome + "/bin/java"));
|
|
|
|
test.useJUnitPlatform();
|
|
|
|
test.useJUnitPlatform();
|
|
|
|
test.setMaxHeapSize("1024M");
|
|
|
|
test.setMaxHeapSize("1024M");
|
|
|
|
|
|
|
|
project.getPlugins().withType(TestRetryPlugin.class, (testRetryPlugin) -> {
|
|
|
|
|
|
|
|
TestRetryTaskExtension testRetry = test.getExtensions().getByType(TestRetryTaskExtension.class);
|
|
|
|
|
|
|
|
testRetry.getFailOnPassedAfterRetry().set(true);
|
|
|
|
|
|
|
|
testRetry.getMaxRetries().set(3);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
project.getTasks().withType(Jar.class, (jar) -> {
|
|
|
|
project.getTasks().withType(Jar.class, (jar) -> {
|
|
|
|
project.afterEvaluate((evaluated) -> {
|
|
|
|
project.afterEvaluate((evaluated) -> {
|
|
|
|