
Previously, the project version was used while filtering the apps source during syncing but it was not considered as an input to the task. This could result in the syncing being skipped even though the project's version had changed. This commit introduces a new custom task to make the configuration more declarative and to allow the necessary input configuration to be done in a single place. Closes gh-28197
48 lines
1.5 KiB
Groovy
48 lines
1.5 KiB
Groovy
plugins {
|
|
id "java"
|
|
id "org.springframework.boot.conventions"
|
|
id "org.springframework.boot.integration-test"
|
|
}
|
|
|
|
description = "Spring Boot Launch Script Integration Tests"
|
|
|
|
toolchain {
|
|
maximumCompatibleJavaVersion = JavaLanguageVersion.of(15)
|
|
}
|
|
|
|
configurations {
|
|
app
|
|
}
|
|
|
|
dependencies {
|
|
app project(path: ":spring-boot-project:spring-boot-dependencies", configuration: "mavenRepository")
|
|
app project(path: ":spring-boot-project:spring-boot-parent", configuration: "mavenRepository")
|
|
app project(path: ":spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin", configuration: "mavenRepository")
|
|
|
|
intTestImplementation(enforcedPlatform(project(":spring-boot-project:spring-boot-parent")))
|
|
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
|
intTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
|
|
intTestImplementation("org.testcontainers:testcontainers")
|
|
}
|
|
|
|
task syncMavenRepository(type: Sync) {
|
|
from configurations.app
|
|
into "${buildDir}/int-test-maven-repository"
|
|
}
|
|
|
|
task syncAppSource(type: org.springframework.boot.build.SyncAppSource) {
|
|
sourceDirectory = file("spring-boot-launch-script-tests-app")
|
|
destinationDirectory = file("${buildDir}/spring-boot-launch-script-tests-app")
|
|
}
|
|
|
|
task buildApp(type: GradleBuild) {
|
|
dependsOn syncAppSource, syncMavenRepository
|
|
dir = "${buildDir}/spring-boot-launch-script-tests-app"
|
|
startParameter.buildCacheEnabled = false
|
|
tasks = ["build"]
|
|
}
|
|
|
|
intTest {
|
|
dependsOn buildApp
|
|
enabled = !JavaVersion.current().java9Compatible
|
|
} |