-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle.kts
101 lines (87 loc) · 2.78 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.diffplug.gradle.spotless.SpotlessPlugin
import org.ajoberstar.grgit.Grgit
plugins {
java
id("com.diffplug.spotless") version "6.25.0"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("org.ajoberstar.grgit") version "5.3.0"
idea
eclipse
}
the<JavaPluginExtension>().toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
tasks.compileJava.configure {
options.release.set(8)
}
configurations.all {
attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
}
repositories {
mavenCentral()
maven {
name = "Paper"
url = uri("https://papermc.io/repo/repository/maven-public/")
}
maven {
name = "Mojang"
url = uri("https://libraries.minecraft.net/")
}
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT")
compileOnly("com.mojang:authlib:1.5.25")
implementation("org.bstats:bstats-bukkit:3.1.0")
implementation("org.bstats:bstats-base:3.1.0")
implementation("com.github.cryptomorin:XSeries:11.3.0")
implementation("dev.notmyfault.serverlib:ServerLib:2.3.6")
implementation("io.papermc:paperlib:1.0.8")
compileOnly("org.apache.logging.log4j:log4j-api:2.24.2")
}
var buildNumber by extra("")
ext {
val git: Grgit = Grgit.open {
dir = File("$rootDir/.git")
}
val commit: String? = git.head().abbreviatedId
buildNumber = if (project.hasProperty("buildnumber")) {
project.properties["buildnumber"] as String
} else {
commit.toString()
}
}
version = String.format("%s-%s", rootProject.version, buildNumber)
tasks.named<ShadowJar>("shadowJar") {
archiveClassifier.set(null as String?)
dependencies {
relocate("com.cryptomorin.xseries", "net.arcaniax.buildersutilities.xseries") {
include(dependency("com.github.cryptomorin:XSeries:11.3.0"))
}
relocate("org.bstats", "net.arcaniax.buildersutilities.metrics") {
include(dependency("org.bstats:bstats-base:3.1.0"))
include(dependency("org.bstats:bstats-bukkit:3.1.0"))
}
relocate("io.papermc.lib", "net.arcaniax.buildersutilities.paperlib") {
include(dependency("io.papermc:paperlib:1.0.8"))
}
relocate("org.incendo.serverlib", "net.arcaniax.buildersutilities.serverlib") {
include(dependency("dev.notmyfault.serverlib:ServerLib:2.3.6"))
}
}
minimize()
}
spotless {
java {
licenseHeaderFile(rootProject.file("HEADER.txt"))
target("**/*.java")
}
}
tasks.named<Copy>("processResources") {
filesMatching("plugin.yml") {
expand("version" to project.version)
}
}
tasks.named("build").configure {
dependsOn("shadowJar")
}