forked from Elytrium/FastMOTD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
154 lines (132 loc) · 5.44 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
//file:noinspection GroovyAssignabilityCheck
plugins {
id("java")
id("checkstyle")
id("com.github.spotbugs").version("5.0.7")
id("org.cadixdev.licenser").version("0.6.1")
id("com.github.johnrengelman.shadow").version("7.1.2")
}
setGroup("net.elytrium")
setVersion("1.0.6")
java {
setSourceCompatibility(JavaVersion.VERSION_17)
setTargetCompatibility(JavaVersion.VERSION_17)
}
compileJava {
getOptions().setEncoding("UTF-8")
}
repositories {
mavenCentral()
maven {
setName("elytrium-repo")
setUrl("https://maven.elytrium.net/repo/")
}
maven {
setName("papermc-repo")
setUrl("https://papermc.io/repo/repository/maven-public/")
}
maven() {
setName("sonatype-snapshots-repo")
setUrl("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
}
dependencies {
implementation("net.elytrium.commons:kyori:1.3.0")
implementation("net.elytrium.commons:velocity:1.3.0")
implementation("net.elytrium.commons:utils:1.3.0")
implementation("net.elytrium:fastprepare:1.0.8")
implementation("net.elytrium:serializer:1.1.1")
implementation('it.unimi.dsi:fastutil-core:8.5.11')
compileOnly("com.velocitypowered:velocity-api:3.3.0-SNAPSHOT")
annotationProcessor("com.velocitypowered:velocity-api:3.3.0-SNAPSHOT")
compileOnly("com.velocitypowered:velocity-proxy:3.3.0-SNAPSHOT")
compileOnly('com.github.spotbugs:spotbugs-annotations:4.7.3')
// Needs for some velocity methods.
compileOnly('io.netty:netty-codec:4.1.86.Final')
compileOnly('io.netty:netty-handler:4.1.86.Final')
implementation("org.bstats:bstats-velocity:3.0.0")
}
shadowJar {
getArchiveClassifier().set("")
exclude("it/unimi/dsi/fastutil/booleans/**")
exclude("it/unimi/dsi/fastutil/bytes/**")
exclude("it/unimi/dsi/fastutil/chars/**")
exclude("it/unimi/dsi/fastutil/doubles/**")
exclude("it/unimi/dsi/fastutil/floats/**")
exclude("it/unimi/dsi/fastutil/longs/**")
exclude("it/unimi/dsi/fastutil/shorts/**")
exclude("it/unimi/dsi/fastutil/io/**")
exclude("it/unimi/dsi/fastutil/objects/*ObjectArray*")
exclude("it/unimi/dsi/fastutil/objects/*ObjectAVL*")
exclude("it/unimi/dsi/fastutil/objects/*Object*Big*")
exclude("it/unimi/dsi/fastutil/objects/*Object2Boolean*")
exclude("it/unimi/dsi/fastutil/objects/*Object2Byte*")
exclude("it/unimi/dsi/fastutil/objects/*Object2Char*")
exclude("it/unimi/dsi/fastutil/objects/*Object2Double*")
exclude("it/unimi/dsi/fastutil/objects/*Object2Float*")
exclude("it/unimi/dsi/fastutil/objects/*Object2IntArray*")
exclude("it/unimi/dsi/fastutil/objects/*Object2IntAVL*")
exclude("it/unimi/dsi/fastutil/objects/*Object2IntRB*")
exclude("it/unimi/dsi/fastutil/objects/*Object2Long*")
exclude("it/unimi/dsi/fastutil/objects/*Object2Object*")
exclude("it/unimi/dsi/fastutil/objects/*Object2Reference*")
exclude("it/unimi/dsi/fastutil/objects/*Object2Short*")
exclude("it/unimi/dsi/fastutil/objects/*ObjectRB*")
exclude("it/unimi/dsi/fastutil/objects/*Reference*")
exclude("it/unimi/dsi/fastutil/ints/*Int2Boolean*")
exclude("it/unimi/dsi/fastutil/ints/*Int2Byte*")
exclude("it/unimi/dsi/fastutil/ints/*Int2Char*")
exclude("it/unimi/dsi/fastutil/ints/*Int2Double*")
exclude("it/unimi/dsi/fastutil/ints/*Int2Float*")
exclude("it/unimi/dsi/fastutil/ints/*Int2Long*")
exclude("it/unimi/dsi/fastutil/ints/*Int2Short*")
exclude("it/unimi/dsi/fastutil/ints/*Int2Reference*")
exclude("it/unimi/dsi/fastutil/ints/IntAVL*")
exclude("it/unimi/dsi/fastutil/ints/IntArray*")
exclude("it/unimi/dsi/fastutil/ints/*IntBi*")
exclude("it/unimi/dsi/fastutil/ints/Int*Pair")
exclude("it/unimi/dsi/fastutil/ints/IntLinked*")
exclude("it/unimi/dsi/fastutil/ints/IntList*")
exclude("it/unimi/dsi/fastutil/ints/IntHeap*")
exclude("it/unimi/dsi/fastutil/ints/IntRB*")
exclude("it/unimi/dsi/fastutil/ints/IntSorted*")
exclude("it/unimi/dsi/fastutil/ints/*Priority*")
exclude("it/unimi/dsi/fastutil/ints/*BigList*")
relocate("org.bstats", "net.elytrium.fastmotd.thirdparty.org.bstats")
relocate("net.elytrium.fastprepare", "net.elytrium.fastmotd.thirdparty.fastprepare")
relocate("net.elytrium.commons", "net.elytrium.fastmotd.thirdparty.commons")
relocate("net.elytrium.serializer", "net.elytrium.fastmotd.thirdparty.serializer")
}
license {
setHeader(file("HEADER.txt"))
}
checkstyle {
setToolVersion("10.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")
}
}
}
artifacts {
archives(shadowJar)
}
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)