-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
67 lines (56 loc) · 1.51 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
plugins {
id("com.palantir.docker") version "0.22.0"
id("com.palantir.docker-run") version "0.22.0"
}
version = "0.1.0"
group = "com.github.pintowar"
subprojects {
version = project.version
group = project.group
apply(plugin = "idea")
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
}
tasks.create("copyClientResources") {
dependsOn(":client:build")
group = "build"
doLast {
copy {
from(project(":client").buildDir.absolutePath)
into("${project(":server").buildDir}/resources/main/public")
}
}
}
tasks.create("assembleServerAndClient") {
dependsOn("copyClientResources", ":server:assemble")
group = "build"
description = "Build combined server & client JAR"
doLast {
copy {
from(fileTree("${project(":server").buildDir}/libs/"))
into("$rootDir/build/")
}
logger.quiet("JAR generated at $rootDir/build/. It combines the server and client projects.")
}
}
tasks.getByPath(":server:assemble").mustRunAfter(":copyClientResources")
tasks.create<Delete>("clean") {
group = "build"
description = "Clean the client bundle"
delete("build")
}
docker {
// dependsOn(tasks.getByName("assembleServerAndClient"))
name = "pintowar/opta-pacient:$version"
tag("latest", "pintowar/opta-pacient:latest")
files("$rootDir/build/server.jar")
}
dockerRun {
name = "opta-pacient"
image = docker.name
clean = true
daemonize = false
}