72 lines
2.1 KiB
Groovy
72 lines
2.1 KiB
Groovy
apply plugin: 'fabric-loom'
|
|
|
|
dependencies {
|
|
shadow "net.playeranalytics:platform-abstraction-layer-api:$palVersion"
|
|
implementation project(path: ":common", configuration: 'shadow')
|
|
shadow project(path: ":common", configuration: 'shadow')
|
|
compileOnly project(":api")
|
|
modImplementation('me.lucko:fabric-permissions-api:0.1-SNAPSHOT')
|
|
|
|
minecraft "com.mojang:minecraft:1.19"
|
|
mappings "net.fabricmc:yarn:1.19+build.1:v2"
|
|
modImplementation "net.fabricmc:fabric-loader:0.14.7"
|
|
|
|
// Fabric API
|
|
Set<String> apiModules = [
|
|
'fabric-api-base',
|
|
'fabric-command-api-v2',
|
|
'fabric-entity-events-v1',
|
|
'fabric-lifecycle-events-v1',
|
|
'fabric-networking-api-v1'
|
|
]
|
|
|
|
apiModules.forEach {
|
|
modImplementation(fabricApi.module(it, "0.55.3+1.19"))
|
|
}
|
|
|
|
testImplementation project(path: ":common", configuration: 'testArtifacts')
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.release = 17
|
|
}
|
|
|
|
processResources {
|
|
inputs.property "version", project.ext.fullVersion
|
|
|
|
filesMatching("fabric.mod.json") {
|
|
expand "version": project.ext.fullVersion
|
|
}
|
|
}
|
|
|
|
shadowJar {
|
|
configurations = [project.configurations.shadow]
|
|
exclude('net.fabricmc:*')
|
|
exclude('/mappings/')
|
|
|
|
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'
|
|
}
|
|
|
|
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)
|