-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
104 lines (83 loc) · 2.38 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.incremental.mkdirsOrThrow
plugins {
java
kotlin("jvm") version "1.7.20"
application
id("com.github.johnrengelman.shadow") version "7.1.2" apply false
id("com.palantir.git-version") version "1.0.0"
}
group = "explode"
version = "3.0.0"
allprojects {
if(!this.name.startsWith("explode")) {
tasks.withType<ShadowJar> {
dependencies {
exclude(project(":booster"))
exclude(project(":resource"))
exclude(project(":labyrinth"))
exclude(project(":labyrinth-mongodb"))
exclude(project(":gatekeeper"))
exclude(dependency("org.jetbrains.kotlin:.*"))
}
}
}
}
repositories {
mavenCentral()
}
dependencies {
implementation(project(":booster"))
implementation(project(":resource"))
implementation(project(":labyrinth"))
implementation(project(":labyrinth-mongodb"))
implementation(project(":gatekeeper"))
testImplementation(kotlin("test"))
}
application {
mainClass.set("explode2.booster.BoosterMainKt")
tasks.run.get().workingDir = rootProject.projectDir.resolve("run")
}
allprojects {
repositories {
mavenCentral()
maven("https://jitpack.io")
maven("https://libraries.minecraft.net") {
mavenContent {
includeGroup("com.mojang")
}
}
maven {
name = "Taskeren Repo Snapshot"
url = uri("http://play.elytra.cn:31055/snapshots")
isAllowInsecureProtocol = true
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
tasks.build {
dependsOn(tasks["gatherArtifact"])
}
val gitVersion: groovy.lang.Closure<String> by extra
task("gatherArtifact") {
dependsOn(":explode-all:shadowJar", ":explode-proxy:shadowJar")
doLast {
logger.info("building artifact")
// ensure that the output dir is present
val outputDir = file("build/gather-builds").apply(File::mkdirsOrThrow)
val gitVer = runCatching { gitVersion() }.getOrElse { "NO-GIT-TAG" }
subprojects.forEach { p ->
println("collecting project: $p")
runCatching {
p.buildDir.resolve("libs").copyRecursively(outputDir.resolve(gitVer).resolve(p.name), true)
}.onFailure {
logger.warn("Unable to copy ${p.buildDir}/libs to ${outputDir.resolve(gitVer).resolve(p.name)}", it)
}
}
}
}