-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
68 lines (54 loc) · 1.66 KB
/
build.gradle.kts
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
import org.gradle.api.tasks.testing.logging.TestLogEvent.*
plugins {
java
application
}
group = "com.example"
version = "1.0.0-SNAPSHOT"
repositories {
mavenCentral()
}
val vertxVersion = "5.0.0.CR3"
val junitJupiterVersion = "5.9.1"
val launcherModule = "com.example.module_example"
val launcherClassName = "com.example.module_example.MainVerticle"
application {
mainModule.set(launcherModule)
mainClass.set(launcherClassName)
}
dependencies {
implementation(platform("io.vertx:vertx-stack-depchain:$vertxVersion"))
implementation("io.vertx:vertx-launcher-application")
implementation("io.vertx:vertx-web")
testImplementation("io.vertx:vertx-junit5")
testImplementation("org.junit.jupiter:junit-jupiter:$junitJupiterVersion")
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.register<JavaExec>("jlink") {
group = "build"
dependsOn(project.tasks.first { it.name.contains("build") })
mainClass.set("jdk.tools.jlink.internal.Main")
mainModule.set("jdk.jlink")
var modulePath = files()
modulePath.from(configurations.runtimeClasspath)
modulePath.from(tasks.jar)
args = listOf(
"--module-path",
modulePath.joinToString(":"),
"--add-modules",
"java.base,java.compiler,java.logging,java.naming,jdk.unsupported,${application.mainModule.get()}",
"--output",
"build/jlink-image-test",
"--launcher",
"launch=${application.mainModule.get()}/${application.mainClass.get()}"
)
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events = setOf(PASSED, SKIPPED, FAILED)
}
}