-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild.gradle
126 lines (103 loc) · 4.07 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
//file:noinspection GroovyAssignabilityCheck
plugins {
id("java")
id("checkstyle")
id("com.github.spotbugs").version("5.0.5")
id("org.cadixdev.licenser").version("0.6.1")
id("com.github.johnrengelman.shadow").version("7.1.2")
}
setGroup("net.elytrium")
setVersion("1.0.11-SNAPSHOT")
compileJava {
getOptions().setEncoding("UTF-8")
}
java {
setSourceCompatibility(JavaVersion.VERSION_11)
setTargetCompatibility(JavaVersion.VERSION_11)
}
repositories {
mavenCentral()
maven {
setName("elytrium-repo")
setUrl("https://maven.elytrium.net/repo/")
}
maven {
setName("papermc-repo")
setUrl("https://repo.papermc.io/repository/maven-public/")
}
maven {
setName("opencollab-repo")
setUrl("https://repo.opencollab.dev/maven-snapshots/")
}
}
dependencies {
compileOnly("net.elytrium.limboapi:api:$limboapiVersion")
compileOnly("net.elytrium:limboauth:$limboauthVersion")
compileOnly("net.elytrium.commons:config:$elytriumCommonsVersion")
compileOnly("net.elytrium.commons:utils:$elytriumCommonsVersion")
compileOnly("net.elytrium.commons:velocity:$elytriumCommonsVersion")
compileOnly("net.elytrium.commons:kyori:$elytriumCommonsVersion")
compileOnly("com.velocitypowered:velocity-api:$velocityVersion")
annotationProcessor("com.velocitypowered:velocity-api:$velocityVersion")
implementation("net.dv8tion:JDA:$jdaVersion") {
exclude module: "opus-java"
}
implementation("org.telegram:telegrambots:$telegrambotsVersion")
implementation("com.vk.api:sdk:$vkVersion")
implementation("com.maxmind.geoip2:geoip2:$geoipVersion")
implementation("org.apache.commons:commons-compress:$apacheCompressCommonsVersion")
implementation("org.bstats:bstats-velocity:$bstatsVersion")
compileOnly("com.github.spotbugs:spotbugs-annotations:$spotbugsVersion")
}
shadowJar {
getArchiveClassifier().set("")
exclude("META-INF/maven/**")
exclude("META-INF/INFO_BIN")
exclude("META-INF/INFO_SRC")
exclude("org/slf4j/**")
exclude("google/protobuf/**")
exclude("com/google/protobuf/**")
exclude("org/apache/commons/codec/language/**")
exclude("org/checkerframework/**")
exclude("**/package-info.class")
minimize()
// Why are we increasing the size of the plugin if we can do that? :thinking:
relocate("org.bstats", "net.elytrium.limboapi.thirdparty.org.bstats")
exclude("org/bstats/**")
relocate("net.dv8tion.jda", "net.elytrium.limboauth.socialaddon.thirdparty.net.dv8tion.jda")
relocate("org.telegram.telegrambots", "net.elytrium.limboauth.socialaddon.thirdparty.org.telegram.telegrambots")
relocate("com.vk.api", "net.elytrium.limboauth.socialaddon.thirdparty.com.vk.api")
relocate("net.elytrium.commons.velocity", "net.elytrium.limboapi.thirdparty.commons.velocity")
relocate("net.elytrium.commons.kyori", "net.elytrium.limboapi.thirdparty.commons.kyori")
relocate("net.elytrium.commons.config", "net.elytrium.limboapi.thirdparty.commons.config")
}
license {
setHeader(file("HEADER.txt"))
}
checkstyle {
setToolVersion("9.2.1")
setConfigFile(file("${this.getRootDir()}/config/checkstyle/checkstyle.xml"))
setConfigProperties("configDirectory": "${this.getRootDir()}/config/checkstyle")
// The build should immediately fail if we have errors.
setMaxErrors(0)
setMaxWarnings(0)
}
spotbugsMain {
setExcludeFilter(file("${this.getRootDir()}/config/spotbugs/suppressions.xml"))
reports {
html {
getRequired().set(true)
getOutputLocation().set(file("${this.getBuildDir()}/reports/spotbugs/main/spotbugs.html"))
setStylesheet("fancy-hist.xsl")
}
}
}
sourceSets.main.getJava().srcDir(getTasks().register("generateTemplates", Copy) { task ->
task.getInputs().properties("version": getVersion())
task.from(file("src/main/templates"))
.into(getLayout().getBuildDirectory().dir("generated/sources/templates"))
.expand("version": getVersion())
}.map {
it.getOutputs()
})
assemble.dependsOn(shadowJar)