-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle.kts
56 lines (47 loc) · 1.12 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
// tag::gradle-npm-plugin[]
import com.github.gradle.node.npm.task.NpmTask
plugins {
java
application
id("com.github.node-gradle.node") version "7.0.2"
}
// end::gradle-npm-plugin[]
repositories {
mavenCentral()
}
// tag::dependencies[]
dependencies {
val vertxVersion = "5.0.0.CR2"
implementation("io.vertx:vertx-web:${vertxVersion}")
}
// end::dependencies[]
// tag::application-main[]
application {
mainClass = "io.vertx.howtos.react.BackendVerticle"
}
// end::application-main[]
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
// tag::gradle-frontend-build[]
node {
version = "22.12.0"
npmVersion = "10.9.0"
download = true
nodeProjectDir = File("src/main/frontend")
}
val buildFrontend by tasks.creating(NpmTask::class) {
args = listOf("run", "build")
dependsOn("npm_install")
}
val copyToWebRoot by tasks.creating(Copy::class) {
from("src/main/frontend/build")
destinationDir = File("build/classes/java/main/webroot")
dependsOn(buildFrontend)
}
val processResources by tasks.getting(ProcessResources::class) {
dependsOn(copyToWebRoot)
}
// end::gradle-frontend-build[]