-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
117 lines (99 loc) · 3.18 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
116
117
plugins {
id("java")
id("com.github.johnrengelman.shadow") version "8.1.1"
}
group = "com.marcpg.poopermc"
version = "1.1.3+build.1"
description = "An all-in-one solution for servers. Everything from administration tools, to moderation utilities and database support."
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
base {
archivesName.set("${rootProject.name}-Universal")
}
repositories {
mavenLocal()
mavenCentral()
maven("https://marcpg.com/repo/")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
implementation(project(":common"))
implementation(project(":paper"))
implementation(project(":velocity"))
}
subprojects {
apply(plugin = "java")
apply(plugin = "com.github.johnrengelman.shadow")
version = rootProject.version
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
repositories {
mavenLocal()
mavenCentral()
maven("https://marcpg.com/repo/")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
implementation("dev.dejvokep:boosted-yaml:1.3.2")
implementation("com.marcpg:libpg:0.1.1")
implementation("com.google.code.gson:gson:2.11.0")
if (project.name != "common")
implementation(project(":common"))
if (project.name != "setup")
implementation("com.alessiodp.libby:libby-core:2.0.0-SNAPSHOT")
}
tasks {
jar {
dependsOn(shadowJar)
}
build {
dependsOn(shadowJar)
}
shadowJar {
relocate("com.alessiodp.libby", "com.marcpg.libs.libby")
relocate("dev.dejvokep.boostedyaml", "com.marcpg.libs.boostedyaml")
relocate("com.marcpg.poopermc", "com.marcpg.common")
relocate("org.bstats", "com.marcpg.common")
exclude("**/icon.png", "**/translations.properties", "net/kyori/**")
if (project.name != "setup") exclude("com/sun/jna/**")
}
processResources {
filter {
it.replace("\${version}", version.toString())
}
}
}
}
tasks {
build {
dependsOn(shadowJar, "copyJars")
}
clean {
delete(file("build/platforms"))
}
shadowJar {
relocate("com.alessiodp.libby", "com.marcpg.libs.libby")
relocate("dev.dejvokep.boostedyaml", "com.marcpg.libs.boostedyaml")
relocate("org.bstats", "com.marcpg.common")
exclude("**/icon.png", "com/sun/jna/**", "net/kyori/**")
}
}
fun outputTasks(): List<Task> {
return listOf(
"shadowJar",
":setup:shadowJar",
":paper:shadowJar",
":velocity:shadowJar",
).map { tasks.findByPath(it)!! }
}
tasks.register<Copy>("copyJars") {
outputTasks().forEach {
from(it) {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
}
into(file("build/platforms"))
rename("(.*)-all.jar", "$1.jar")
}