build.gradle
//file:noinspection SpellCheckingInspection
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
group = 'com.teamyomi'
version = '2.0.0'
repositories {
mavenCentral()
maven { url = 'https://jitpack.io' }
maven { url = 'https://papermc.io/repo/repository/maven-public/' }
maven { url = 'https://oss.sonatype.org/content/groups/public/' }
maven { url = 'https://libraries.minecraft.net' }
maven { url = 'https://repo.aikar.co/content/groups/aikar/' }
maven { url = 'https://repo.pcgamingfreaks.at/repository/maven-everything' }
}
dependencies {
implementation('com.j256.ormlite:ormlite-core:6.1') // ORMLite
implementation('net.dv8tion:JDA:5.0.0-alpha.9') { exclude module: 'opus-java' } // JDA
compileOnly('org.slf4j:slf4j-api:1.7.36') // SLF4J for JDA
implementation('org.apache.logging.log4j:log4j-slf4j-impl:2.17.2') // Log4j 2 SLF4J Binding (for JDA)
implementation('co.aikar:acf-paper:0.5.1-SNAPSHOT') // ACF
compileOnly('org.xerial:sqlite-jdbc:3.36.0.3') // SQLite JDBC
compileOnly('com.mojang:authlib:3.3.39') // Mojang Authlib
compileOnly('io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT') // Paper API
compileOnly('at.pcgamingfreaks:Minepacks-API:2.4.5.1') // Minepacks API (included in plugin JAR)
compileOnly('com.github.MilkBowl:VaultAPI:1.7.1') // Vault API
}
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
options.encoding('UTF-8')
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
compileJava {
options.encoding = 'UTF-8'
options.compilerArgs += [ '-parameters' ] // Advised by ACF
options.fork = true
options.forkOptions.executable = 'javac'
}
shadowJar {
// May contain libraries that no longer used by EXMCore but these are just rules
relocate('ch.qos.logback', 'lib.logback')
relocate('co.aikar.commands', 'lib.acf')
relocate('co.aikar.locales', 'lib.acf.locales')
relocate('com.fasterxml.jackson', 'lib.jackson')
relocate('com.iwebpp.crypto', 'lib.crypto')
relocate('com.j256.ormlite', 'lib.ormlite')
relocate('com.neovisionaries.ws.client', 'lib.wsclient')
relocate('gnu.trove', 'lib.trove')
relocate('io.vavr', 'lib.vavr')
relocate('javax.annotation', 'lib.annotation.javax')
relocate('net.dv8tion.jda', 'lib.jda')
relocate('okhttp3', 'lib.okhttp3')
relocate('okio', 'lib.okio')
relocate('org.apache.commons.collections4', 'lib.collections4')
relocate('org.apache.logging.log4j', 'lib.log4j')
relocate('org.apache.logging.slf4j', 'lib.slf4j')
relocate('org.bouncycastle', 'lib.bouncycastle')
relocate('org.intellij.lang.annotation', 'lib.annotation.intellij')
relocate('org.javacord', 'lib.javacord')
relocate('org.jetbrains.annotations', 'lib.annotation.jetbrains')
relocate('org.slf4j', 'lib.slf4j')
//minimize()
}
jar.finalizedBy(shadowJar)