Merge branch '3.1.x'

This commit is contained in:
Andy Wilkinson 2023-06-14 18:20:07 +01:00
commit 0ce2b054d2
3 changed files with 31 additions and 20 deletions

View File

@ -191,9 +191,7 @@ class JavaConventions {
if (isPredictiveTestSelectionEnabled()) { if (isPredictiveTestSelectionEnabled()) {
PredictiveTestSelectionExtension predictiveTestSelection = test.getExtensions() PredictiveTestSelectionExtension predictiveTestSelection = test.getExtensions()
.getByType(PredictiveTestSelectionExtension.class); .getByType(PredictiveTestSelectionExtension.class);
predictiveTestSelection.getEnabled().set(true); predictiveTestSelection.getEnabled().convention(true);
predictiveTestSelection.mustRun((mustRun) -> mustRun.getIncludeClasses()
.add("org.springframework.boot.actuate.autoconfigure.endpoint.web.documentation.*"));
} }
} }

View File

@ -195,26 +195,10 @@ dependencies {
} }
} }
test {
outputs.dir("${buildDir}/generated-snippets")
}
task dependencyVersions(type: org.springframework.boot.build.constraints.ExtractVersionConstraints) { task dependencyVersions(type: org.springframework.boot.build.constraints.ExtractVersionConstraints) {
enforcedPlatform(":spring-boot-project:spring-boot-dependencies") enforcedPlatform(":spring-boot-project:spring-boot-dependencies")
} }
tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) {
dependsOn dependencyVersions
doFirst {
def versionConstraints = dependencyVersions.versionConstraints
def integrationVersion = versionConstraints["org.springframework.integration:spring-integration-core"]
def integrationDocs = String.format("https://docs.spring.io/spring-integration/docs/%s/reference/html/", integrationVersion)
attributes "spring-integration-docs": integrationDocs
}
dependsOn test
inputs.dir("${buildDir}/generated-snippets").withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("generatedSnippets")
}
asciidoctor { asciidoctor {
sources { sources {
include "index.adoc" include "index.adoc"
@ -243,6 +227,32 @@ artifacts {
documentation zip documentation zip
} }
test { tasks.named("test") {
jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED" jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED"
filter {
excludeTestsMatching("org.springframework.boot.actuate.autoconfigure.endpoint.web.documentation.*")
}
}
def documentationTest = tasks.register("documentationTest", Test) {
filter {
includeTestsMatching("org.springframework.boot.actuate.autoconfigure.endpoint.web.documentation.*")
}
jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED"
outputs.dir("${buildDir}/generated-snippets")
predictiveSelection {
enabled = false
}
}
tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) {
dependsOn dependencyVersions
doFirst {
def versionConstraints = dependencyVersions.versionConstraints
def integrationVersion = versionConstraints["org.springframework.integration:spring-integration-core"]
def integrationDocs = String.format("https://docs.spring.io/spring-integration/docs/%s/reference/html/", integrationVersion)
attributes "spring-integration-docs": integrationDocs
}
dependsOn documentationTest
inputs.dir("${buildDir}/generated-snippets").withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("generatedSnippets")
} }

View File

@ -23,4 +23,7 @@ test {
} }
} }
} }
predictiveSelection {
enabled = false
}
} }