forked from Arcaniax-Development/goBrush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
99 lines (85 loc) · 2.94 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.cadixdev.gradle.licenser.LicenseExtension
import org.ajoberstar.grgit.Grgit
plugins {
java
`java-library`
id("com.github.johnrengelman.shadow") version "7.1.2"
id("org.cadixdev.licenser") version "0.6.1"
id("org.ajoberstar.grgit") version "4.1.1"
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 {
compileOnly("io.papermc.paper:paper-api:1.18.1-R0.1-SNAPSHOT")
compileOnly("net.md-5:bungeecord-api:1.18-R0.1-SNAPSHOT")
compileOnly("com.mojang:authlib:1.5.25")
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit:2.0.0")
implementation("net.lingala.zip4j:zip4j:2.9.1")
implementation("dev.notmyfault.serverlib:ServerLib:2.3.1")
implementation("org.bstats:bstats-bukkit:2.2.1")
implementation("org.bstats:bstats-base:2.2.1")
implementation("io.papermc:paperlib:1.0.7")
}
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)
configure<LicenseExtension> {
header.set(resources.text.fromFile(file("HEADER.txt")))
include("**/*.java")
exclude("**/XMaterial.java")
newLine.set(false)
}
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.7"))
}
}
minimize()
}
tasks.named("build").configure {
dependsOn("shadowJar")
}