-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
79 lines (67 loc) · 2.18 KB
/
build.gradle
File metadata and controls
79 lines (67 loc) · 2.18 KB
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
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'com.gradleup.shadow' version '9.4.1'
}
group = 'github.io'
version = '1.0.2'
repositories {
mavenCentral()
maven { url = "https://repo.papermc.io/repository/maven-public/" }
maven { url = "https://oss.sonatype.org/content/groups/public/" }
maven { url = "https://maven.enginehub.org/repo/" }
maven { url = 'https://jitpack.io' }
}
dependencies {
// Compile-time dependencies
annotationProcessor("org.projectlombok:lombok:1.18.44")
compileOnly("org.projectlombok:lombok:1.18.44")
compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
compileOnly("com.github.NighterDevelopment:SmartSpawner:1.6.4")
// Shadowed dependencies
implementation("com.github.NighterDevelopment:PluginUpdateCore:1.0.4")
implementation("com.github.NighterDevelopment:PluginLangCore:1.0.2")
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
withSourcesJar()
withJavadocJar()
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.release.set(21)
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching(['plugin.yml', 'paper-plugin.yml']) {
expand props
}
}
jar {
archiveBaseName.set("SSAddon-SpawnerLimiter")
archiveVersion.set("${version}")
from sourceSets.main.output
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
enabled = false // Disable default jar task
}
shadowJar {
archiveBaseName.set("SSAddon-SpawnerLimiter")
archiveVersion.set("${version}")
archiveClassifier.set('')
// Relocate dependencies to avoid conflicts
relocate 'io.github.pluginupdatecore', 'github.io.ssaspawnerlimiter.libs.pluginupdatecore'
relocate 'io.github.pluginlangcore', 'github.io.ssaspawnerlimiter.libs.pluginlangcore'
// Reduce jar size by merging service files and minimizing
mergeServiceFiles()
minimize()
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA'
// destinationDirectory = file('C:\\Users\\notni\\OneDrive\\Desktop\\paper_1.21.8\\plugins')
}
build {
dependsOn shadowJar
}