-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
115 lines (97 loc) · 2.84 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
105
106
107
108
109
110
111
112
113
114
115
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
kotlin("jvm") version "1.6.10" apply false
id("io.freefair.lombok") version "6.0.0-m2"
id("com.github.johnrengelman.shadow") version "7.0.0"
}
group = "dev.austech"
version = "2.0.0-SNAPSHOT"
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
implementation(project(":common", "shadow"))
implementation(project(":spigot", "shadow"))
implementation(project(":bungeecord", "shadow"))
}
tasks {
withType<ProcessResources> {
expand("version" to project.version)
}
}
subprojects {
apply(plugin = "java")
apply(plugin = "idea")
apply(plugin = "kotlin")
apply(plugin = "com.github.johnrengelman.shadow")
apply(plugin = "io.freefair.lombok")
group = project.group
version = project.version
repositories {
mavenCentral()
maven {
url = uri("https://jitpack.io")
}
maven {
url = uri("https://repo.alessiodp.com/releases/")
}
}
dependencies {
compileOnly("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10")
compileOnly("com.github.simplix-softworks:SimplixStorage:3.2.3")
compileOnly("net.kyori:adventure-api:4.10.1")
compileOnly("net.kyori:adventure-text-minimessage:4.10.1")
implementation("com.squareup.okio:okio:3.0.0") {
exclude("org.jetbrains.kotlin")
}
compileOnly("net.dv8tion:JDA:5.0.0-alpha.9") {
exclude("opus-java")
}
}
sourceSets {
main {
java.srcDir("src/main/kotlin")
resources.srcDir("src/main/resources")
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks {
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
}
tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
relocate("net.kyori.adventure", "dev.austech.betterstaffchat.depend.adventure")
relocate("de.leonhard.storage", "dev.austech.betterstaffchat.depend.storage")
relocate("kotlin", "dev.austech.betterstaffchat.depend.kotlin")
relocate("net.dv8tion.jda", "dev.austech.betterstaffchat.depend.discord")
relocate("okio", "dev.austech.betterstaffchat.depend.okio")
}
task<Copy>("copyJars") {
outputTasks().forEach { from(it) }
rename("(.*)-all.jar", "$1.jar")
into("jars")
}
fun outputTasks(): List<Task?> {
return arrayOf("shadowJar", ":common:shadowJar", ":spigot:shadowJar", ":bungeecord:shadowJar").map {
tasks.findByPath(it)
}
}
task("cleanJars") {
delete("jars")
}
tasks.named("clean") {
dependsOn("cleanJars")
}
tasks.named("build") {
dependsOn("shadowJar")
dependsOn("copyJars")
}