2019-04-24 20:36:49 +02:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
|
|
|
|
|
2018-07-31 22:12:41 +02:00
|
|
|
plugins {
|
|
|
|
id 'java'
|
2018-10-28 04:45:35 +01:00
|
|
|
id 'checkstyle'
|
2018-07-31 22:12:41 +02:00
|
|
|
}
|
|
|
|
|
2021-03-31 22:04:06 +02:00
|
|
|
apply plugin: 'org.cadixdev.licenser'
|
2018-10-28 04:45:35 +01:00
|
|
|
apply from: '../gradle/checkstyle.gradle'
|
2019-03-29 02:46:45 +01:00
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
2018-07-31 22:12:41 +02:00
|
|
|
|
2021-03-31 22:04:06 +02:00
|
|
|
license {
|
|
|
|
header = project.rootProject.file('HEADER.txt')
|
|
|
|
}
|
|
|
|
|
2018-07-31 22:12:41 +02:00
|
|
|
jar {
|
|
|
|
manifest {
|
2018-09-04 03:02:11 +02:00
|
|
|
def buildNumber = System.getenv("BUILD_NUMBER") ?: "unknown"
|
2019-06-13 00:10:33 +02:00
|
|
|
def version
|
|
|
|
if (project.version.endsWith("-SNAPSHOT")) {
|
|
|
|
version = "${project.version} (git-${project.ext.getCurrentShortRevision()}-b${buildNumber})"
|
|
|
|
} else {
|
|
|
|
version = "${project.version}"
|
|
|
|
}
|
2018-09-04 03:02:11 +02:00
|
|
|
|
2018-07-31 22:12:41 +02:00
|
|
|
attributes 'Main-Class': 'com.velocitypowered.proxy.Velocity'
|
2018-10-25 07:56:41 +02:00
|
|
|
attributes 'Implementation-Title': "Velocity"
|
2018-09-04 03:02:11 +02:00
|
|
|
attributes 'Implementation-Version': version
|
2018-10-25 07:56:41 +02:00
|
|
|
attributes 'Implementation-Vendor': "Velocity Contributors"
|
2019-04-26 01:12:22 +02:00
|
|
|
attributes 'Multi-Release': 'true'
|
2018-07-31 22:12:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-29 03:01:33 +01:00
|
|
|
shadowJar {
|
2019-04-24 20:36:49 +02:00
|
|
|
transform(Log4j2PluginsCacheFileTransformer)
|
2019-03-29 03:01:33 +01:00
|
|
|
}
|
|
|
|
|
2018-12-29 23:22:36 +01:00
|
|
|
tasks.withType(Checkstyle) {
|
|
|
|
exclude('**/com/velocitypowered/proxy/protocol/packet/*.java')
|
2021-12-09 19:46:11 +01:00
|
|
|
// TODO: Remove during l4j2 2.15 update
|
|
|
|
exclude('**/org/apache/logging/log4j/core/**/*.java')
|
2018-12-29 23:22:36 +01:00
|
|
|
}
|
|
|
|
|
2018-07-31 22:12:41 +02:00
|
|
|
dependencies {
|
2018-09-30 05:28:44 +02:00
|
|
|
// Note: we depend on the API twice, first the main sourceset, and then the annotation processor.
|
2020-08-22 01:09:04 +02:00
|
|
|
implementation project(':velocity-api')
|
|
|
|
implementation project(':velocity-api').sourceSets.ap.output
|
|
|
|
implementation project(':velocity-native')
|
2018-08-07 16:24:01 +02:00
|
|
|
|
2020-08-22 01:09:04 +02:00
|
|
|
implementation "io.netty:netty-codec:${nettyVersion}"
|
|
|
|
implementation "io.netty:netty-codec-haproxy:${nettyVersion}"
|
|
|
|
implementation "io.netty:netty-codec-http:${nettyVersion}"
|
|
|
|
implementation "io.netty:netty-handler:${nettyVersion}"
|
|
|
|
implementation "io.netty:netty-transport-native-epoll:${nettyVersion}"
|
|
|
|
implementation "io.netty:netty-transport-native-epoll:${nettyVersion}:linux-x86_64"
|
2020-12-10 04:25:06 +01:00
|
|
|
implementation "io.netty:netty-transport-native-epoll:${nettyVersion}:linux-aarch_64"
|
2018-08-07 16:24:01 +02:00
|
|
|
|
2020-08-22 01:09:04 +02:00
|
|
|
implementation "org.apache.logging.log4j:log4j-api:${log4jVersion}"
|
|
|
|
implementation "org.apache.logging.log4j:log4j-core:${log4jVersion}"
|
|
|
|
implementation "org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}"
|
|
|
|
implementation "org.apache.logging.log4j:log4j-iostreams:${log4jVersion}"
|
2021-01-25 07:50:56 +01:00
|
|
|
implementation "org.apache.logging.log4j:log4j-jul:${log4jVersion}"
|
2018-08-07 16:24:01 +02:00
|
|
|
|
2020-08-22 01:09:04 +02:00
|
|
|
implementation 'net.sf.jopt-simple:jopt-simple:5.0.4' // command-line options
|
|
|
|
implementation 'net.minecrell:terminalconsoleappender:1.2.0'
|
2021-09-01 12:36:00 +02:00
|
|
|
runtimeOnly 'org.jline:jline-terminal-jansi:3.20.0' // Needed for JLine
|
|
|
|
runtimeOnly 'com.lmax:disruptor:3.4.4' // Async loggers
|
2018-08-07 16:24:01 +02:00
|
|
|
|
2021-06-24 16:10:34 +02:00
|
|
|
implementation 'it.unimi.dsi:fastutil-core:8.5.4'
|
2020-12-07 02:50:57 +01:00
|
|
|
|
|
|
|
implementation(platform("net.kyori:adventure-bom:${adventureVersion}"))
|
|
|
|
implementation("net.kyori:adventure-nbt")
|
2018-08-11 03:32:27 +02:00
|
|
|
|
2021-09-01 12:36:00 +02:00
|
|
|
implementation 'org.asynchttpclient:async-http-client:2.12.3'
|
2018-12-29 15:28:24 +01:00
|
|
|
|
2021-09-01 12:36:00 +02:00
|
|
|
implementation 'com.spotify:completable-futures:0.3.5'
|
2020-06-21 05:24:32 +02:00
|
|
|
|
2021-09-01 12:36:00 +02:00
|
|
|
implementation 'com.electronwill.night-config:toml:3.6.4'
|
2018-12-29 15:28:24 +01:00
|
|
|
|
2021-09-01 12:36:00 +02:00
|
|
|
implementation 'org.bstats:bstats-base:2.2.1'
|
2021-05-23 21:38:35 +02:00
|
|
|
implementation 'org.lanternpowered:lmbda:2.0.0'
|
|
|
|
|
2021-09-01 12:36:00 +02:00
|
|
|
implementation 'com.github.ben-manes.caffeine:caffeine:3.0.3'
|
2021-01-26 12:58:16 +01:00
|
|
|
|
2021-10-31 21:27:03 +01:00
|
|
|
implementation 'space.vectrix.flare:flare:2.0.0'
|
|
|
|
implementation 'space.vectrix.flare:flare-fastutil:2.0.0'
|
|
|
|
|
2021-09-01 12:36:00 +02:00
|
|
|
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.4.0'
|
2020-06-25 03:31:39 +02:00
|
|
|
|
2020-08-22 01:09:04 +02:00
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
|
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
|
2021-06-24 16:10:34 +02:00
|
|
|
testImplementation "org.mockito:mockito-core:3.+"
|
2018-07-31 22:12:41 +02:00
|
|
|
}
|
|
|
|
|
2020-12-14 20:39:39 +01:00
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
|
|
|
|
2018-08-11 03:32:27 +02:00
|
|
|
shadowJar {
|
2021-06-24 16:10:34 +02:00
|
|
|
// Exclude all the collection types we don't intend to use
|
2018-08-11 03:32:27 +02:00
|
|
|
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/**'
|
2021-06-24 16:10:34 +02:00
|
|
|
exclude 'it/unimi/dsi/fastutil/longs/**'
|
|
|
|
exclude 'it/unimi/dsi/fastutil/shorts/**'
|
|
|
|
|
|
|
|
// Exclude the fastutil IO utilities - we don't use them.
|
|
|
|
exclude 'it/unimi/dsi/fastutil/io/**'
|
|
|
|
|
2021-11-01 14:47:57 +01:00
|
|
|
// Exclude most of the int types - Object2IntMap have a values() method that returns an
|
|
|
|
// IntCollection, and we need Int2ObjectMap
|
|
|
|
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/*Int2Int*'
|
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/*Int2Long*'
|
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/*Int2Short*'
|
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/*Int2Reference*'
|
2018-08-11 03:32:27 +02:00
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/IntAVL*'
|
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/IntArray*'
|
2021-06-24 16:10:34 +02:00
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/*IntBi*'
|
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/Int*Pair'
|
2018-12-29 19:30:50 +01:00
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/IntLinked*'
|
2018-08-11 03:32:27 +02:00
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/IntList*'
|
2021-06-24 16:10:34 +02:00
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/IntHeap*'
|
2018-08-11 03:32:27 +02:00
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/IntOpen*'
|
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/IntRB*'
|
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/IntSorted*'
|
2018-12-29 19:30:50 +01:00
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/*Priority*'
|
|
|
|
exclude 'it/unimi/dsi/fastutil/ints/*BigList*'
|
2021-06-24 16:10:34 +02:00
|
|
|
|
|
|
|
// Try to exclude everything BUT Object2Int{LinkedOpen,Open,CustomOpen}HashMap
|
2018-08-11 03:32:27 +02:00
|
|
|
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*'
|
2021-06-24 16:10:34 +02:00
|
|
|
|
|
|
|
// Exclude Checker Framework annotations
|
2018-12-25 15:32:11 +01:00
|
|
|
exclude 'org/checkerframework/checker/**'
|
2021-01-26 12:58:16 +01:00
|
|
|
|
|
|
|
relocate 'org.bstats', 'com.velocitypowered.proxy.bstats'
|
2018-08-11 03:32:27 +02:00
|
|
|
}
|
|
|
|
|
2018-07-31 22:12:41 +02:00
|
|
|
artifacts {
|
|
|
|
archives shadowJar
|
2018-08-07 16:24:01 +02:00
|
|
|
}
|