3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-09 13:00:05 +01:00
FastAsyncWorldEdit/worldedit-fabric/build.gradle.kts

104 Zeilen
3.2 KiB
Plaintext

2019-07-11 02:29:43 +02:00
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.fabricmc.loom.task.RemapJarTask
applyPlatformAndCoreConfiguration()
applyShadowConfiguration()
apply(plugin = "fabric-loom")
val minecraftVersion = "1.14.4"
2019-09-20 03:11:23 +02:00
val yarnMappings = "1.14.4+build.12"
val loaderVersion = "0.6.2+build.166"
2019-07-11 02:29:43 +02:00
configurations.all {
resolutionStrategy {
force("com.google.guava:guava:21.0")
}
}
dependencies {
"compile"(project(":worldedit-core"))
"compile"("org.apache.logging.log4j:log4j-slf4j-impl:2.8.1")
"minecraft"("com.mojang:minecraft:$minecraftVersion")
"mappings"("net.fabricmc:yarn:$yarnMappings")
"modCompile"("net.fabricmc:fabric-loader:$loaderVersion")
2019-09-20 03:11:23 +02:00
listOf(
"net.fabricmc.fabric-api:fabric-api-base:0.1.0+2983bc0442",
"net.fabricmc.fabric-api:fabric-events-interaction-v0:0.1.1+591e97ae42",
"net.fabricmc.fabric-api:fabric-events-lifecycle-v0:0.1.1+591e97ae42",
"net.fabricmc.fabric-api:fabric-networking-v0:0.1.3+591e97ae42"
).forEach {
"include"(it)
"modImplementation"(it)
}
2019-07-11 02:29:43 +02:00
// Hook these up manually, because Fabric doesn't seem to quite do it properly.
"compileClasspath"("net.fabricmc:sponge-mixin:${project.versions.mixin}")
"annotationProcessor"("net.fabricmc:sponge-mixin:${project.versions.mixin}")
"annotationProcessor"("net.fabricmc:fabric-loom:${project.versions.loom}")
2019-07-11 02:29:43 +02:00
"testCompile"("org.mockito:mockito-core:1.9.0-rc1")
}
configure<BasePluginConvention> {
archivesBaseName = "$archivesBaseName-mc$minecraftVersion"
}
tasks.named<Copy>("processResources") {
// this will ensure that this task is redone when the versions change.
inputs.property("version", project.ext["internalVersion"])
from(sourceSets["main"].resources.srcDirs) {
include("fabric.mod.json")
expand("version" to project.ext["internalVersion"])
}
// copy everything else except the mod json
from(sourceSets["main"].resources.srcDirs) {
exclude("fabric.mod.json")
}
}
tasks.named<Jar>("jar") {
manifest {
attributes("Class-Path" to "truezip.jar WorldEdit/truezip.jar js.jar WorldEdit/js.jar",
"WorldEdit-Version" to project.version)
}
}
tasks.named<ShadowJar>("shadowJar") {
archiveClassifier.set("dist-dev")
dependencies {
relocate("org.slf4j", "com.sk89q.worldedit.slf4j")
relocate("org.apache.logging.slf4j", "com.sk89q.worldedit.log4jbridge")
2019-10-19 09:48:49 +02:00
relocate("org.antlr.v4", "com.sk89q.worldedit.antlr4")
2019-07-11 02:29:43 +02:00
include(dependency("org.slf4j:slf4j-api"))
include(dependency("org.apache.logging.log4j:log4j-slf4j-impl"))
2019-10-19 09:48:49 +02:00
include(dependency("org.antlr:antlr4-runtime"))
2019-07-11 02:29:43 +02:00
}
}
tasks.register<Jar>("deobfJar") {
from(sourceSets["main"].output)
archiveClassifier.set("dev")
}
artifacts {
add("archives", tasks.named("deobfJar"))
}
2019-09-20 03:11:23 +02:00
tasks.register<RemapJarTask>("remapShadowJar") {
val shadowJar = tasks.getByName<ShadowJar>("shadowJar")
dependsOn(shadowJar)
input.set(shadowJar.archiveFile)
archiveFileName.set(shadowJar.archiveFileName.get().replace(Regex("-dev\\.jar$"), ".jar"))
addNestedDependencies.set(true)
2019-07-11 02:29:43 +02:00
}
tasks.named("assemble").configure {
dependsOn("remapShadowJar")
}