-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
219 lines (152 loc) · 6.49 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
/*
* MiniGame Player Queue is a Minecraft plugin for mini-game modes.
* Copyright (C) 2020-2021 RoyalBlueRanger
*
* Licensed under MIT License. Please see the LICENSE document
* as found in the root directory of this project.
*
*/
import java.text.SimpleDateFormat
import java.util.Date
apply plugin: 'java'
//apply plugin: 'maven'
//apply plugin: 'maven-publish'
apply plugin: 'com.github.johnrengelman.shadow'
archivesBaseName = 'MiniGamePlayerQueue'
group = 'com.royalblueranger.mgpq'
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = "UTF-8"
ext.targetArchiveClassifier = 'Java1.8'
sourceCompatibility = 1.8
targetCompatibility = 1.8
// Lists all versions of java that are available to the toolchain
// $ ./gradlew -q javaToolchains
// Specify the java version's location as found in the javaToolchains.
// $ ./gradlew build -Dorg.gradle.java.home="C:\Program Files\Java\jdk1.8.0_291"
//java {
// toolchain {
// languageVersion.set(JavaLanguageVersion.of(8))
//// languageVersion.set(JavaLanguageVersion.of(16))
// }
//}
repositories {
mavenCentral()
maven { url "https://maven.sk89q.com/repo/" }
// maven { url "https://mvnrepository.com/artifact/org.apache.commons/commons-lang3" }
maven { url = "https://hub.spigotmc.org/nexus/content/groups/public" }
maven { url = "https://repo.lucko.me/" }
maven { url = "https://repo.codemc.org/repository/maven-public/" }
maven { url = "https://repo.inventivetalent.org/content/groups/public/" }
// maven { url = 'http://repo.extendedclip.com/content/repositories/placeholderapi/' }
maven { url = "https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc" }
maven { url = "https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind" }
// maven { url = 'https://mvnrepository.com/artifact/com.github.cryptomorin' }
// maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
// maven { url = "http://nexus.hc.to/content/repositories/pub_releases" }
// maven { url = "http://repo.mvdw-software.be/content/groups/public/" }
// maven { url = 'https://maven.enginehub.org/repo/' }
//maven { url = "https://jitpack.io" }
}
configurations {
deployerJars
}
dependencies {
implementation 'org.bstats:bstats-base:3.0.0'
implementation 'org.bstats:bstats-bukkit:3.0.0'
// implementation 'org.apache.commons:commons-lang3:3.10'
// implementation 'com.google.guava:guava:19.0'
// implementation 'com.google.code.gson:gson:2.8.6'
// implementation 'org.inventivetalent.spiget-update:bukkit:1.4.2-SNAPSHOT'
// implementation 'org.apache.commons:commons-lang3:3.9'
// implementation 'me.clip:placeholderapi:2.9.1'
implementation "com.fasterxml.jackson.core:jackson-databind:2.11.3"
implementation 'net.luckperms:api:5.0'
// implementation 'me.lucko.luckperms:luckperms-api:4.0'
compileOnly 'org.xerial:sqlite-jdbc:3.32.3.2'
// implementation 'com.github.cryptomorin:XSeries:7.5.4'
// implementation 'com.github.cryptomorin:XSeries:7.2.1'
// implementation 'com.github.cryptomorin:XSeries:6.3.2.1'
// 1.9.4-R0.1-SNAPSHOT has been the version used for a long time:
// compileOnly 'org.spigotmc:spigot-api:1.9.4-R0.1-SNAPSHOT'
// 1.12.2-R0.1-SNAPSHOT works well:
// compileOnly 'org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT'
// 1.13.2 fails since deprecated functions have been removed.
compileOnly 'org.spigotmc:spigot-api:1.13.2-R0.1-SNAPSHOT'
compileOnly 'net.milkbowl.vault:VaultAPI:1.6'
testImplementation 'junit:junit:4.12'
// compileOnly 'com.github.PrisonTeam:Prison:bleeding-SNAPSHOT'
// implementation 'com.github.PrisonTeam:Prison:3.2.6'
}
/* Two different ways to enable utf-8 encoding within gradle, but not sure its
* even needed at this time. Keeping for a few builds to make sure all is ok.
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
*/
println """
==========================================================================
You are building the MiniGame Player Queue plugin
Version: ${project.version}
Build time: ${getCurrentTimestamp()}
Output files are located in /build/libs
The runnable JAR is usually named MiniGamePlayerQueue.jar
Example: The spigot build artifact is build/libs/MiniGamePlayerQueue.jar
==========================================================================
"""
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
}
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
def getCurrentTimestamp()
{
SimpleDateFormat df = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss")
return df.format (new Date())
}
/*
clean {
delete "${rootProject.name}.jar"
}
*/
processResources {
from(sourceSets.main.resources.srcDirs) {
expand 'version': project.version
include 'plugin.yml', 'config.yml'
}
from(sourceSets.main.resources.srcDirs) {
exclude 'plugin.yml', 'config.yml'
}
// Need to have includ duplicates for the version to be updated in the plugin.yml file.
// Also the final build is actually smaller with include.
duplicatesStrategy = DuplicatesStrategy.INCLUDE // allow duplicates
// duplicatesStrategy = DuplicatesStrategy.EXCLUDE // do not allow duplicates
}
shadowJar {
dependencies {
include(dependency('org.bstats:bstats-base:3.0.0'))
include(dependency('org.bstats:bstats-bukkit:3.0.0'))
// include(dependency('org.xerial:sqlite-jdbc:3.32.3.2'))
// include(dependency('com.google.code.gson:gson:2.8.6'))
// include(dependency('org.apache.commons:commons-lang3:3.10'))
// include(dependency('me.clip:placeholderapi:2.9.1'))
// include(dependency('org.bstats:bstats-bukkit:1.5'))
// include(dependency('org.inventivetalent.spiget-update:bukkit:1.4.2-SNAPSHOT'))
// include(dependency('com.github.cryptomorin:XSeries:7.5.4'))
}
relocate 'org.bstats', 'com.royalblueranger.mgpq.blues.shadded.bstats'
// relocate 'org.bstats.bukkit', 'com.royalblueranger.mgpq.spigot'
// relocate 'org.inventivetalent.update.spiget', 'com.royalblueranger.mgpq.spiget'
// relocate 'com.cryptomorin', 'com.royalblueranger.mgpq.cryptomorin'
classifier ''
archiveVersion = ''
minimize()
}
build.dependsOn(shadowJar)