-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathbuild.gradle
142 lines (115 loc) · 4.76 KB
/
build.gradle
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
139
140
141
142
plugins {
id 'java'
id 'io.github.goooler.shadow' version "8.1.7"
}
group = 'com.ordwen'
version="2.3.0"
// get the initial version from the project properties
def initialVersion = project.hasProperty('version') ? project.version : '1.0.0'
// get the current branch name
def branchName = System.getenv("GIT_BRANCH") ?: 'local'
branchName = branchName.replaceFirst(/^origin\//, '')
println "Branch: ${branchName}"
// get Jenkins build number (if available)
def buildNumber = System.getenv("BUILD_NUMBER") ?: "local"
if (branchName.contains('master')) {
version = initialVersion // stable release
} else if (branchName.contains('dev')) {
version = "${initialVersion}-SNAPSHOT" // snapshot release
} else {
version = "${initialVersion}-${branchName}" // feature branch
}
// append build number for SNAPSHOT versions
if (version.contains("SNAPSHOT") && buildNumber != "local") {
version = "${version}-b${buildNumber}"
}
println "Current version: ${version}"
repositories {
mavenCentral()
maven { url = 'https://repo.papermc.io/repository/maven-public/' }
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url = 'https://oss.sonatype.org/content/groups/public/' }
maven { url = 'https://repo.rosewooddev.io/repository/public/' }
maven { url = 'https://jitpack.io' }
maven { url = 'https://maven.citizensnpcs.co/repo' }
maven { url = 'https://mvn.lumine.io/repository/maven-public/' }
maven { url = 'https://libraries.minecraft.net/' }
maven { url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/' }
maven { url = "https://repo.codemc.org/repository/maven-public/" }
maven { url = 'https://repo.bg-software.com/repository/api/' }
maven { url = 'https://mvn-repo.arim.space/lesser-gpl3/' }
maven { url = 'https://repo.rosewooddev.io/repository/public/' }
maven { url = "https://nexus.phoenixdevt.fr/repository/maven-public/" }
maven { url = "https://maven.enginehub.org/repo/"}
maven { url = 'https://repo.glaremasters.me/repository/towny/'}
flatDir { dirs 'libs' }
}
dependencies {
/* database management */
compileOnly 'com.zaxxer:HikariCP:5.0.1'
compileOnly 'com.h2database:h2:2.2.220'
/* Spigot */
compileOnly 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT'
/* Folia */
implementation 'space.arim.morepaperlib:morepaperlib:0.4.3'
/* Mojang auth API for heads */
compileOnly 'com.mojang:authlib:1.5.25'
/* economy & points */
compileOnly 'com.github.MilkBowl:VaultAPI:1.7'
compileOnly 'org.black_ixx:playerpoints:3.2.2'
compileOnly files('libs/CoinsEngine-2.3.4.jar')
compileOnly('com.github.Realizedd:TokenManager:3.2.4') { transitive = false }
/* npcs */
compileOnly('net.citizensnpcs:citizens-main:2.0.35-SNAPSHOT') { exclude group: '*', module: '*' }
/* mobs */
compileOnly 'io.lumine:Mythic-Dist:5.0.3-SNAPSHOT'
compileOnly files('libs/EliteMobs-9.1.11.jar')
/* stackers */
compileOnly 'dev.rosewood:rosestacker:1.4.13'
compileOnly 'com.bgsoftware:WildStackerAPI:3.8.0'
/* guis */
compileOnly 'me.clip:placeholderapi:2.11.6'
compileOnly 'com.gmail.filoghost.holographicdisplays:holographicdisplays-api:2.4.9'
/* custom items */
compileOnly 'com.github.oraxen:oraxen:1.157.0'
compileOnly 'com.github.LoneDev6:API-ItemsAdder:3.6.3-beta-14'
compileOnly 'net.Indyuce:MMOItems-API:6.9.2-SNAPSHOT'
compileOnly 'io.lumine:MythicLib-dist:1.5.2-SNAPSHOT'
compileOnly('me.kryniowesegryderiusz:kgenerators-core:7.3') { exclude group: '*', module: '*' }
compileOnly files('libs/PyroFishingPro-4.9.12.jar')
/* auto restart */
compileOnly 'com.github.N0RSKA:UltimateAutoRestartAPI:2023.12'
/* protection */
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.7'
compileOnly 'com.palmergames.bukkit.towny:towny:0.100.3.1'
/* vote */
compileOnly 'com.github.NuVotifier:NuVotifier:2.7.2'
}
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}
shadowJar {
archiveFileName.set("${project.name}-${project.version}.jar")
relocate 'io.papermc.lib', 'com.ordwen.odailyquests.lib.paperlib'
relocate 'space.arim.morepaperlib', 'com.ordwen.odailyquests.lib.morepaperlib'
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
tasks.build {
dependsOn shadowJar
}