-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
67 lines (54 loc) · 1.7 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
67
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.0-M2'
id 'io.spring.dependency-management' version '1.1.3'
id 'org.graalvm.buildtools.native' version '0.9.24'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '20'
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-validation'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation 'org.testcontainers:mongodb'
}
tasks.named('test') {
useJUnitPlatform()
}
tasks.named('bootBuildImage') {
buildpacks = ["gcr.io/paketo-buildpacks/graalvm", "urn:cnb:builder:paketo-buildpacks/java-native-image"]
environment["BP_JVM_VERSION"] = "20.0.2"
environment["BP_NATIVE_IMAGE"] = "true"
environment["BP_NATIVE_IMAGE_BUILD_ARGUMENTS"] = "--enable-preview"
}
tasks.withType(JavaCompile).each {
it.options.compilerArgs.add('--enable-preview')
}
tasks.withType(JavaExec) {
jvmArgs += '--enable-preview'
}
test {
jvmArgs(['--enable-preview'])
}
graalvmNative {
binaries {
main {
buildArgs.add('--enable-preview')
}
}
}
/*java {
toolchain { languageVersion = JavaLanguageVersion.of(20) }
}*/
test.onlyIf {!project.hasProperty("skipTests")}