-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
92 lines (77 loc) · 2.11 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
buildscript {
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id 'java'
id 'org.graalvm.buildtools.native' version '0.10.2'
id "com.github.johnrengelman.shadow" version "8.1.1"
}
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
def className = "com.mageddo.Application"
task debug(type: JavaExec) {
debug = true
classpath = sourceSets.main.runtimeClasspath
main = className
}
task run(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = className
}
// https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html
graalvmNative {
binaries {
main {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.matching("GraalVM Community")
}
// Main options
imageName = project.name
mainClass = className
// debug = true
verbose = true
fallback = false
buildArgs.add('-J-Xmx5G')
}
}
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
compileOnly("com.mageddo.nativeimage:reflection-config-generator:2.4.4")
annotationProcessor("com.mageddo.nativeimage:reflection-config-generator:2.4.4")
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.17.2'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.8.1'
testCompileOnly 'org.projectlombok:lombok:1.18.34'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
implementation "ch.qos.logback:logback-classic:1.5.6"
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.10.3")
testImplementation("org.mockito:mockito-junit-jupiter:5.12.0")
}
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
jar {
manifest {
attributes(
"Main-Class": className
)
}
}
shadowJar {
mergeServiceFiles()
}