This repository was archived by the owner on May 6, 2024. It is now read-only.
forked from Arcaniax-Development/goPaint_1.14
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
138 lines (112 loc) · 4.57 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription
plugins {
`java-library`
id("com.github.johnrengelman.shadow") version "8.1.1" // Shades and relocates dependencies, See https://imperceptiblethoughts.com/shadow/introduction/
id("com.diffplug.spotless") version "6.20.0"
id("xyz.jpenilla.run-paper") version "2.1.0" // Adds runServer and runMojangMappedServer tasks for testing
id("net.minecrell.plugin-yml.bukkit") version "0.6.0" // Automatic plugin.yml generation
idea
eclipse
}
group = "net.arcaniax.gopaint"
version = "1.0.1"
description = "GoPaint is a plugin that's designed to simplify painting inside of Minecraft"
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17)) // Configure the java toolchain. This allows gradle to auto-provision JDK 17 on systems that only have JDK 8 installed for example.
}
repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://libraries.minecraft.net/")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
compileOnly("org.jetbrains:annotations:24.0.1")
annotationProcessor("org.jetbrains:annotations:24.0.1")
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")
implementation("io.papermc:paperlib:")
compileOnly("com.mojang:authlib:1.5.25")
implementation(platform("com.intellectualsites.bom:bom-newest:1.34"))
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core")
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit") { isTransitive = false }
implementation("org.bstats:bstats-bukkit:3.0.2")
implementation("org.bstats:bstats-base:3.0.2")
}
tasks {
build {
dependsOn(shadowJar)
}
compileJava {
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
// Set the release flag. This configures what version bytecode the compiler will emit, as well as what JDK APIs are usable.
// See https://openjdk.java.net/jeps/247 for more information.
options.release.set(8)
options.compilerArgs.addAll(arrayListOf("-Xlint:all", "-Xlint:-processing", "-Xdiags:verbose"))
}
processResources {
filteringCharset = Charsets.UTF_8.name() // We want UTF-8 for everything
}
shadowJar {
archiveBaseName.set(project.name)
archiveClassifier.set("")
// Shadow classes
// helper function to relocate a package into our package
fun reloc(originPkg: String, targetPkg: String) = relocate(originPkg, "${project.group}.deps.${targetPkg}")
reloc("net.lingala.zip4j", "zip4j")
reloc("org.bstats", "metrics")
reloc("io.papermc.lib", "paperlib")
}
runServer {
// Configure the Minecraft version for our task.
minecraftVersion("1.20.4")
// IntelliJ IDEA debugger setup: https://docs.papermc.io/paper/dev/debugging#using-a-remote-debugger
jvmArgs("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005")
systemProperty("terminal.jline", false)
systemProperty("terminal.ansi", true)
}
}
bukkit {// Options: https://github.com/Minecrell/plugin-yml#bukkit
// Plugin main class (required)
main = "${project.group}.GoPaintPlugin"
// Plugin Information
name = "GoPaint"
prefix = "GP"
version = "${project.version}"
description = "${project.description}"
website = "https://github.com/milkdrinkers/GoPaintContinued"
authors = listOf("Arcaniax")
contributors = listOf("darksaid98")
apiVersion = "1.13"
// Misc properties
load = net.minecrell.pluginyml.bukkit.BukkitPluginDescription.PluginLoadOrder.POSTWORLD // STARTUP or POSTWORLD
depend = listOf("FastAsyncWorldEdit")
softDepend = listOf()
commands {
register("gopaint") {
description = "goPaint command"
aliases = listOf("gp")
}
}
permissions {
register("gopaint.use") {
default = BukkitPluginDescription.Permission.Default.OP
}
register("gopaint.admin") {
default = BukkitPluginDescription.Permission.Default.FALSE
}
register("gopaint.world.bypass") {
default = BukkitPluginDescription.Permission.Default.FALSE
}
}
}
configurations.all {
attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
}
spotless {
java {
licenseHeaderFile(rootProject.file("HEADER.txt"))
targetExclude("**/XMaterial.java")
target("**/*.java")
}
}