forked from Arcaniax-Development/goBrush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
101 lines (87 loc) · 2.98 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
`java-library`
id("com.github.johnrengelman.shadow") version "8.1.1"
id("com.diffplug.spotless") version "6.18.0"
id("org.ajoberstar.grgit") version "5.2.0"
idea
eclipse
}
the<JavaPluginExtension>().toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
configurations.all {
attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
}
tasks.compileJava.configure {
options.release.set(8)
}
repositories {
mavenCentral()
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
maven { url = uri("https://libraries.minecraft.net/") }
maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") }
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
}
dependencies {
implementation(platform("com.intellectualsites.bom:bom-newest:1.27"))
compileOnly("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT")
compileOnly("net.md-5:bungeecord-api:1.19-R0.1-SNAPSHOT")
compileOnly("com.mojang:authlib:1.5.25")
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit")
implementation("net.lingala.zip4j:zip4j:2.11.5")
implementation("dev.notmyfault.serverlib:ServerLib")
implementation("org.bstats:bstats-bukkit:3.0.2")
implementation("org.bstats:bstats-base:3.0.2")
implementation("io.papermc:paperlib:")
}
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)
spotless {
java {
licenseHeaderFile(rootProject.file("HEADER.txt"))
targetExclude("**/XMaterial.java")
target("**/*.java")
}
}
tasks.named<Copy>("processResources") {
filesMatching("plugin.yml") {
expand("version" to project.version)
}
}
tasks.named<ShadowJar>("shadowJar") {
archiveClassifier.set(null as String?)
dependencies {
relocate("net.lingala.zip4j", "com.arcaniax.zip4j") {
include(dependency("net.lingala.zip4j:zip4j"))
}
relocate("org.incendo.serverlib", "com.arcaniax.gobrush.serverlib") {
include(dependency("dev.notmyfault.serverlib:ServerLib:2.3.1"))
}
relocate("org.bstats", "com.arcaniax.gobrush.metrics") {
include(dependency("org.bstats:bstats-base"))
include(dependency("org.bstats:bstats-bukkit"))
}
relocate("io.papermc.lib", "com.arcaniax.gobrush.paperlib") {
include(dependency("io.papermc:paperlib:1.0.8"))
}
}
minimize()
}
tasks.named("build").configure {
dependsOn("shadowJar")
}