-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
144 lines (121 loc) · 4.54 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
144 lines (121 loc) · 4.54 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import io.papermc.paperweight.userdev.ReobfArtifactConfiguration
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
apply(from = "generatePaperLibrariesYaml.gradle.kts")
plugins {
kotlin("jvm") version "2.4.0"
alias(libs.plugins.gradleup.shadow)
alias(libs.plugins.paperweight)
}
group = "com.github.encryptsl"
version = providers.gradleProperty("plugin_version").get()
description = providers.gradleProperty("plugin_description").get()
val props = project.properties.mapValues { it.value.toString() }
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://central.sonatype.com/repository/maven-snapshots/") {
name = "sonatype-snapshots"
mavenContent {
snapshotsOnly()
}
}
maven("https://jitpack.io")
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
maven("https://repo.codemc.io/repository/maven-public/")
maven("https://repo.codemc.io/repository/creatorfromhell/")
maven("https://repo.rosewooddev.io/repository/public/")
mavenLocal()
flatDir {
dirs("lib")
}
}
kotlin {
jvmToolchain(25)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_25)
}
}
dependencies {
// Minecraft / Paper
paperweight.paperDevBundle(providers.gradleProperty("server_version").get())
compileOnly(libs.placeholderapi)
compileOnly(libs.vaultunlocked)
compileOnly(libs.miniplaceholders.api)
compileOnly(libs.bundles.economy.plugins)
implementation(libs.hikaricp)
implementation(libs.bundles.exposed)
implementation(libs.bundles.database.drivers)
implementation(libs.bundles.flyway)
implementation(libs.bundles.kotlin)
implementation(libs.bundles.cloud)
implementation(libs.configlib)
implementation(libs.commons.csv)
implementation(libs.config.updater)
implementation(libs.ktor.client.core) {
exclude("org.jetbrains.kotlinx", "kotlinx-io-core")
}
implementation(libs.bundles.ktor)
// Internal implementations (You can even shadow these if you want)
implementation(libs.bstats)
implementation(libs.miniplaceholders)
// Test
testImplementation(libs.junit.jupiter)
testImplementation(libs.bundles.exposed)
testImplementation(libs.hikaricp)
testImplementation(libs.bundles.database.drivers)
testRuntimeOnly(libs.junit.launcher)
testImplementation(libs.flyway.core.test)
}
sourceSets {
getByName("main") {
java { srcDir("src/main/java") }
kotlin { srcDir("src/main/kotlin") }
}
}
tasks {
processResources {
// Triggers generation before the resources process
dependsOn("generatePaperLibrariesYaml")
filesMatching(listOf("plugin.yml", "paper-plugin.yml")) {
expand(props)
}
}
shadowJar {
archiveFileName.set("${providers.gradleProperty("plugin_name").get()}-${project.version}.jar")
// We will keep the relocations
relocate("org.bstats", "com.github.encryptsl.metrics")
// This prevents ShadowJAR from packaging third-party libraries,
// generator will still be able to see them in the runtimeClasspath.
configurations = emptyList()
// bStats and MiniPlaceholders to be included in the JAR (since they aren't in the paper-libraries) from(sourceSets.main.get().output)
configurations = listOf(project.configurations.getByName("runtimeClasspath"))
// We'll exclude the groups listed in paper-libraries.yml file
dependencies {
exclude(dependency("org.jetbrains.kotlin:.*:.*"))
exclude(dependency("org.jetbrains.kotlinx:.*:.*"))
exclude(dependency("org.jetbrains.exposed:.*:.*"))
exclude(dependency("io.ktor:.*:.*"))
exclude(dependency("org.incendo:.*:.*"))
exclude(dependency("com.zaxxer:.*:.*"))
exclude(dependency("org.flywaydb:.*:.*"))
exclude(dependency("org.mariadb.jdbc:.*:.*"))
exclude(dependency("org.postgresql:.*:.*"))
exclude(dependency("org.xerial:.*:.*"))
exclude(dependency("de.exlll:.*:.*"))
}
mergeServiceFiles()
}
test {
useJUnitPlatform()
}
compileJava {
options.encoding = "UTF-8"
options.release.set(25)
options.compilerArgs.add("-Xlint:deprecation")
}
build {
dependsOn(shadowJar)
}
}
paperweight.reobfArtifactConfiguration = ReobfArtifactConfiguration.MOJANG_PRODUCTION