forked from mung3r/MyWarp
-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle
102 lines (87 loc) · 3.71 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
import ru.vyarus.gradle.plugin.animalsniffer.signature.BuildSignatureTask
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
id "ru.vyarus.animalsniffer" version "1.7.1"
}
configurations.create("createSignature")
repositories {
maven { url 'https://raw.github.com/mywarp/repo/master/releases' }
maven { url 'https://raw.github.com/mywarp/repo/master/snapshots' }
maven { url "https://hub.spigotmc.org/nexus/content/groups/public/" } //Bukkit API
maven { url "https://maven.enginehub.org/repo/" } //SquirrelID
maven { url "https://repo.mikeprimm.com" } //DynmapAPI
}
dependencies {
implementation project(":mywarp-core")
implementation "org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT"
implementation "com.sk89q:squirrelid:0.2.0"
implementation "net.milkbowl.vault:VaultAPI:1.7"
implementation "org.anjocaido:essentialsgroupmanager:2.10.1"
implementation "de.bananaco:bpermissions:2.10.5"
implementation "us.dynmap:DynmapCoreAPI:1.9.4"
runtimeOnly "com.github.MyWarp:slf4bukkit:ca7affe246"
runtimeOnly "com.h2database:h2:1.4.200"
implementation "org.codehaus.mojo:animal-sniffer-annotations:1.23"
signature "org.codehaus.mojo.signature:java18:1.0@signature"
//required to build custom signature
createSignature "org.bukkit:bukkit:1.7.10-R0.1-SNAPSHOT"
//try to stay compatible with the last 'official' version
createSignature "com.google.guava:guava:10.0.1"
//bundled by Bukkit 1.7.10, we should try to stay compatible
}
task sig(type: BuildSignatureTask) {
//build new signature as an extension to the JDK's
signatures configurations.signature
files configurations.createSignature
}
animalsniffer {
//use the signature generated above
signatures = sig.outputFiles
excludeJars "bukkit-*"
excludeJars "guava-*"
//the cache cannot be used due to incompatibilities with Java 8,
//see https://github.com/xvik/gradle-animalsniffer-plugin/wiki/Check-task-performance#known-issues
}
processResources {
filesMatching("**/plugin.yml") {
expand(projectName: project.projectName,
version: project.internalVersion,
projectDescription: project.projectDescription,
url: project.url
)
}
}
shadowJar {
def internalPath = "io.github.mywarp.mywarp.internal"
// exclude various text files from libraries
exclude "**/META-INF/LICENSE*"
exclude "**/META-INF/DEPENDENCIES*"
exclude "**/META-INF/NOTICE*"
exclude "**/META-INF/README.txt"
dependencies {
include(dependency(":mywarp-core"))
include(dependency("org.jooq:jooq"))
include(dependency("org.reactivestreams:reactive-streams")) //used by JOOQ
include(dependency("org.flywaydb:flyway-core"))
include(dependency("org.slf4j:slf4j-api"))
include(dependency("com.github.MyWarp:slf4bukkit"))
include(dependency("com.sk89q:squirrelid"))
include(dependency("com.github.mywarp.intake:intake"))
include(dependency("com.h2database:h2"))
include(dependency("com.flowpowered:flow-math"))
}
relocate("org.jooq", "${internalPath}.jooq")
relocate("org.reactivestreams", "${internalPath}.reactivestreams")
relocate("org.flywaydb", "${internalPath}.flyway")
relocate("org.h2", "${internalPath}.h2")
relocate("com.flowpowered", "${internalPath}.flow-math")
relocate("org.slf4j", "${internalPath}.slf4j")
relocate("info.ronjenkins", "${internalPath}.slf4bukkit")
relocate("com.sk89q.intake", "${internalPath}.intake")
relocate("com.sk89q.squirrelid", "${internalPath}.squirrelid")
//exclude unused classes
minimize {
exclude(dependency("com.h2database:h2:.*"))
}
}
build.finalizedBy(shadowJar)