-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
83 lines (68 loc) · 2.72 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id 'java'
// Use ShadowJAR to build the JAR
id 'com.github.johnrengelman.shadow' version '8.1.1'
// Use Blossom to replace tokens
id 'net.kyori.blossom' version '1.3.0'
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
ext {
pluginName = 'BloomAB'
pluginVersion = '1.5.6'
pluginDescription = 'Anti bot protection for Bloom servers'
pluginAuthor = 'Bloom'
pluginWebsite = 'https://bloom.host'
}
subprojects {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'java-library'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'net.kyori.blossom'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://jitpack.io' }
maven { url 'https://maven.geri.dev/releases' }
}
dependencies {
// Include minimessage api
implementation 'net.kyori:adventure-text-serializer-gson:4.16.0'
implementation 'net.kyori:adventure-text-minimessage:4.16.0'
implementation 'net.kyori:adventure-platform-bukkit:4.3.2'
implementation 'ch.jalu:configme:1.4.1'
// This is needed for older versions of Minecraft.
implementation 'org.yaml:snakeyaml:2.2'
// Use GSON for JSON processing
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
}
}
// Task to create a single 'fat' JAR including all subprojects
task uberJar(type: ShadowJar) {
// Relocate important dependencies to avoid any collisions at runtime
relocate 'org.yaml', 'host.bloom.ab.dependencies.snakeyaml'
relocate 'ch.jalu', 'host.bloom.ab.dependencies.configme'
relocate 'com.google.gson', 'host.bloom.ab.dependencies.gson'
relocate 'org.apache.commons', 'host.bloom.ab.dependencies.apache.commons'
// do not relocate, Kyori does not like being relocated, it will scream about "no class found"
//relocate 'net.kyori', 'host.bloom.ab.dependencies.kyori'
// Set the output file name and location
archiveFileName = "${project.ext.pluginName}-${project.ext.pluginVersion}.jar"
// Include all subprojects' source sets and dependencies
subprojects.each { subproject ->
from subproject.sourceSets.main.output
configurations = [subproject.configurations.runtimeClasspath]
}
}
// Make sure the uberJar task is executed after all subprojects are built
tasks.uberJar.dependsOn subprojects*.tasks*.build