Plan/Plan/fabric/build.gradle
Henri Schubin c49276369f
Component API by Vankka (#2665)
Adds a new Component API that allows converting between color code representations in Strings
2022-10-16 13:21:49 +03:00

130 lines
3.9 KiB
Groovy

apply plugin: 'fabric-loom'
dependencies {
shadow project(path: ":api")
shadow project(path: ":extensions")
shadow project(path: ":common")
shadow project(path: ":common", configuration: "swaggerJson")
shadow "net.playeranalytics:platform-abstraction-layer-api:$palVersion"
minecraft "com.mojang:minecraft:1.19.1"
mappings "net.fabricmc:yarn:1.19.1+build.1:v2"
modImplementation "net.fabricmc:fabric-loader:0.14.8"
modImplementation('me.lucko:fabric-permissions-api:0.2-SNAPSHOT')
// Fabric API
Set<String> apiModules = [
'fabric-api-base',
'fabric-command-api-v2',
'fabric-entity-events-v1',
'fabric-lifecycle-events-v1',
'fabric-networking-api-v1',
'fabric-message-api-v1'
]
apiModules.forEach {
modImplementation(fabricApi.module(it, "0.58.5+1.19.1"))
}
testImplementation project(path: ":common", configuration: 'testArtifacts')
}
tasks.withType(JavaCompile).configureEach {
options.release.set(17)
}
processResources {
inputs.property "version", project.ext.fullVersion
filesMatching("fabric.mod.json") {
expand "version": project.ext.fullVersion
}
}
shadowJar {
configurations = [project.configurations.shadow]
from findProject(':extensions:adventure').tasks.shadowJar.archiveFile
exclude('net.fabricmc:*')
exclude('/mappings/')
// Exclude these files
exclude "**/*.svg"
exclude "**/*.psd"
exclude "**/*.map"
exclude "LICENSE*.txt"
exclude "jetty-dir.css"
exclude "**/module-info.class"
exclude "module-info.class"
exclude 'META-INF/versions/' // Causes Sponge to crash
exclude 'mozilla/**/*'
// Exclude extra dependencies
exclude 'org/apache/http/**/*' // Unnecessary http client depended on by geolite2 implementation
exclude "org/junit/**/*" // see extensions/build.gradle
exclude "org/opentest4j/**/*" // see extensions/build.gradle
exclude "org/checkerframework/**/*" // Dagger compiler
exclude "com/google/common/**/*"
exclude "com/google/thirdparty/**/*"
// Exclude swagger
exclude "org/yaml/**/*"
exclude "nonapi/**/*"
exclude "io/github/classgraph/**/*"
exclude "io/swagger/**/*"
exclude "com/sun/activation/**/*"
exclude "jakarta/activation/**/*"
exclude "jakarta/validation/**/*"
exclude "jakarta/ws/**/*"
exclude "jakarta/xml/**/*"
exclude "javassist/**/*"
relocate('org.apache', 'plan.org.apache') {
exclude 'org/apache/logging/**'
}
relocate 'dagger', 'plan.dagger'
// Don't relocate MySQL or SQLite since they are loaded with a isolated class loader
// relocate 'org.sqlite', 'plan.org.sqlite'
// relocate 'com.mysql', 'plan.com.mysql'
// relocate 'com.google.protobuf', 'plan.com.mysql.cj.x.google.protobuf'
relocate 'javax.inject', 'plan.javax.inject'
relocate 'com.github.benmanes', 'plan.com.github.benmanes'
relocate 'dev.vankka.dependencydownload', 'plan.dev.vankka.dependencydownload'
relocate 'com.maxmind', 'plan.com.maxmind'
relocate 'com.fasterxml', 'plan.com.fasterxml'
relocate 'com.zaxxer', 'plan.com.zaxxer'
relocate 'com.google.gson', 'plan.com.google.gson'
relocate 'com.google.errorprone', 'plan.com.google.errorprone'
relocate 'org.bstats', 'plan.org.bstats'
relocate 'org.eclipse.jetty', 'plan.org.eclipse.jetty'
relocate 'jakarta.servlet', 'plan.jakarta.servlet'
relocate 'javax.servlet', 'plan.javax.servlet'
relocate 'org.slf4j', 'plan.org.slf4j'
relocate 'org.json.simple', 'plan.org.json.simple'
mergeServiceFiles()
}
prepareRemapJar {
dependsOn tasks.shadowJar
}
remapJar {
dependsOn tasks.shadowJar
mustRunAfter tasks.shadowJar
input = shadowJar.archiveFile.get()
addNestedDependencies = true
destinationDirectory.set(file("$rootDir/builds/"))
archiveBaseName.set('PlanFabric')
archiveClassifier.set('')
}
shadowJar.finalizedBy(remapJar)