-
Notifications
You must be signed in to change notification settings - Fork 41k
/
Copy pathbuild.gradle
66 lines (54 loc) · 2.2 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
plugins {
id "java"
id "org.springframework.boot.docker-test"
id "de.undercouch.download"
}
description = "Spring Boot Launch Script Integration Tests"
def jdkVersion = "17.0.11+10"
def jdkArch = "aarch64".equalsIgnoreCase(System.getProperty("os.arch")) ? "aarch64" : "amd64"
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")
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
dockerTestImplementation("org.testcontainers:testcontainers")
}
task syncMavenRepository(type: Sync) {
from configurations.app
into layout.buildDirectory.dir("docker-test-maven-repository")
}
task syncAppSource(type: org.springframework.boot.build.SyncAppSource) {
sourceDirectory = file("spring-boot-launch-script-tests-app")
destinationDirectory = file(layout.buildDirectory.dir("spring-boot-launch-script-tests-app"))
}
task buildApp(type: GradleBuild) {
dependsOn syncAppSource, syncMavenRepository
dir = layout.buildDirectory.dir("spring-boot-launch-script-tests-app")
startParameter.buildCacheEnabled = false
tasks = ["build"]
}
task downloadJdk(type: Download) {
def destFolder = new File(project.gradle.gradleUserHomeDir, "caches/springboot/downloads/jdk/bellsoft")
destFolder.mkdirs()
src "https://download.bell-sw.com/java/${jdkVersion}/bellsoft-jdk${jdkVersion}-linux-${jdkArch}.tar.gz"
dest destFolder
tempAndMove true
overwrite false
retries 3
}
task syncJdkDownloads(type: Sync) {
dependsOn downloadJdk
from "${project.gradle.gradleUserHomeDir}/caches/springboot/downloads/jdk/bellsoft/"
include "bellsoft-jdk${jdkVersion}-linux-${jdkArch}.tar.gz"
into layout.buildDirectory.dir("downloads/jdk/bellsoft/")
}
tasks.named("processDockerTestResources").configure {
dependsOn syncJdkDownloads
}
tasks.named("dockerTest").configure {
dependsOn buildApp
}