forked from CKATEPTb-minecraft/TableclothPluginBlank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
114 lines (98 loc) · 3.15 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
import proguard.gradle.ProGuardTask
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("com.guardsquare:proguard-gradle:7.2.1")
}
}
plugins {
id("java")
id("maven-publish")
id("com.github.johnrengelman.shadow").version("7.1.0")
id("io.github.gradle-nexus.publish-plugin").version("1.1.0")
// https://github.com/PaperMC/paperweight
id("io.papermc.paperweight.userdev").version("1.3.8")
}
group = "dev.ckateptb.minecraft"
version = "1.1.0-SNAPSHOT"
val rootPackage = "${project.group}.${project.name.toLowerCase()}"
val internal = "${rootPackage}.internal"
repositories {
mavenCentral()
maven("https://repo.animecraft.fun/repository/maven-snapshots/")
}
dependencies {
paperDevBundle("1.19.2-R0.1-SNAPSHOT")
implementation("dev.ckateptb.common:TableclothConfig:1.0.0-SNAPSHOT")
compileOnly("org.projectlombok:lombok:+")
annotationProcessor("org.projectlombok:lombok:+")
}
tasks {
shadowJar {
relocate("org.spongepowered", "${internal}.org.spongepowered")
}
register<ProGuardTask>("shrink") {
dependsOn(shadowJar)
injars(shadowJar.get().outputs.files)
outjars("${project.buildDir}/libs/${project.name}-${project.version}.jar")
ignorewarnings()
libraryjars("${System.getProperty("java.home")}/jmods")
keep(mapOf("includedescriptorclasses" to true), "public class !${internal}.** { *; }")
keepattributes("RuntimeVisibleAnnotations,RuntimeVisibleParameterAnnotations,RuntimeVisibleTypeAnnotations")
dontobfuscate()
dontoptimize()
}
build {
// Uncomment next line if u need only embed, without shrink
dependsOn(reobfJar, shadowJar)
// Comment next line if u need only embed, without shrink
// dependsOn(reobfJar, "shrink")
}
publish {
// Uncomment next line if u need only embed
dependsOn(reobfJar, shadowJar)
// Comment next line if u need only embed, without shrink
// dependsOn(reobfJar, "shrink")
}
withType<JavaCompile> {
options.encoding = "UTF-8"
}
named<Copy>("processResources") {
filesMatching("plugin.yml") {
expand(
"projectVersion" to project.version,
"projectName" to project.name,
"projectMainClass" to "${rootPackage}.${project.name}"
)
}
from("LICENSE") {
rename { "${project.name.toUpperCase()}_${it}" }
}
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
publishing {
publications {
publications.create<MavenPublication>("mavenJava") {
artifacts {
artifact(tasks.getByName("shrink").outputs.files.singleFile)
}
}
}
}
nexusPublishing {
repositories {
create("myNexus") {
nexusUrl.set(uri("https://repo.animecraft.fun/"))
snapshotRepositoryUrl.set(uri("https://repo.animecraft.fun/repository/maven-snapshots/"))
username.set(System.getenv("NEXUS_USERNAME"))
password.set(System.getenv("NEXUS_PASSWORD"))
}
}
}