-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
119 lines (107 loc) · 3.78 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
plugins {
id 'java'
// id 'idea'
id 'com.github.johnrengelman.shadow' version '6.1.0'
}
group = 'fr.ycraft'
version = '2.0.0-SNAPSHOT'
description = 'Le Plugin de Jump d\'YCraft'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileJava.options.encoding = 'UTF-8'
configurations.all{
// we want to check for all updates as mc utils changes a lot
resolutionStrategy.cacheChangingModulesFor 60, 'seconds'
}
boolean isCI = System.getenv("CI") != null
boolean prod = hasProperty('prod') || isCI
def shadePrefix = "${group}.jump".toString()
repositories {
mavenLocal()
mavenCentral()
maven {
name = 'Nowtryz repo'
url = uri('https://nowtryz.jfrog.io/artifactory/public')
}
maven {
name = 'spigotmc repo'
url = uri('https://hub.spigotmc.org/nexus/content/repositories/snapshots/')
}
// maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven {
name = 'sonatype'
url = uri('https://oss.sonatype.org/content/groups/public/')
}
maven {
name = 'dmulloy2 repo'
url = uri('https://repo.dmulloy2.net/nexus/repository/public/')
}
maven {
name = 'JitPack repo'
url = uri('https://jitpack.io')
}
maven {
name = 'Code MC repo'
url = uri('https://repo.codemc.org/repository/maven-public')
}
}
dependencies {
// Provided APIs
compileOnly 'org.spigotmc:spigot-api:1.16.4-R0.1-SNAPSHOT'
compileOnly 'net.md-5:bungeecord-chat:1.16-R0.3'
compileOnly 'io.netty:netty-all:4.1.25.Final' // netty from minecraft
compileOnly 'com.comphenix.protocol:ProtocolLib:4.5.0'
// compileOnly 'com.google.code.gson:gson:2.2.4' // Gson from minecraft
compileOnly 'mysql:mysql-connector-java:5.1.47' // MySQL connector from bukkit
compileOnly 'commons-lang:commons-lang:2.6' // commons from bukkit
compileOnly 'com.google.guava:guava:21.0' // bukkit's provided guava (supported by guice) (must be shaded for 1.8)
// Annotations
compileOnly 'org.jetbrains:annotations:19.0.0'
compileOnly 'org.projectlombok:lombok:1.18.16'
annotationProcessor 'org.projectlombok:lombok:1.18.16'
// Dependency injection
implementation('com.google.inject:guice:4.2.3') {
exclude module: 'guava'
}
implementation('com.google.inject.extensions:guice-assistedinject:4.2.3') {
exclude module: 'guava'
}
// Dependencies
implementation 'org.dizitart:nitrite:3.4.2' // Optimized local database
compileOnly 'org.mongodb:mongodb-driver-sync:4.0.5'
implementation 'com.google.mug:mug:4.5' // Bi streams
implementation 'fr.mrmicky:FastBoard:1.1.0' // Optimized scoreboards
implementation 'org.bstats:bstats-bukkit:1.7' // BStats
implementation('net.nowtryz.mcutils:mcutils:0.2.0-SNAPSHOT') {
exclude module: 'guava'
}
}
shadowJar {
archiveClassifier.set ''
dependencies {
exclude dependency('com.google.guava:.*')
exclude dependency('commons-lang:commons-lang:2.6')
}
minimize()
relocate 'org.bstats', shadePrefix
if (prod){
relocate 'fr.mrmicky.fastboard', shadePrefix + '.fastboard'
// relocate 'org.apache.commons', shadePrefix
relocate 'org.dizitart.no2', shadePrefix + '.no2'
relocate 'org.h2', shadePrefix + '.h2'
// relocate 'com.mysql', shadePrefix + '.mysql'
relocate 'com.mongodb', shadePrefix + '.mongo'
relocate 'com.fasterxml.jackson', shadePrefix + '.jackson'
relocate 'com.google.mu', shadePrefix + '.mug'
relocate 'com.google.inject', shadePrefix + '.guice'
// relocate 'com.google.common', shadePrefix + '.guava'
}
}
processResources {
expand (
project: project,
)
}
artifacts {
archives shadowJar
}