2019-07-11 08:29:43 +08:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
|
|
import net.fabricmc.loom.task.RemapJarTask
|
|
|
|
|
|
|
|
applyPlatformAndCoreConfiguration()
|
|
|
|
applyShadowConfiguration()
|
|
|
|
|
|
|
|
apply(plugin = "fabric-loom")
|
|
|
|
|
2020-01-24 18:58:14 +08:00
|
|
|
val minecraftVersion = "1.15.2"
|
2020-02-01 06:03:10 +08:00
|
|
|
val yarnMappings = "1.15.2+build.8:v2"
|
|
|
|
val loaderVersion = "0.7.6+build.180"
|
2019-07-11 08:29:43 +08: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 09:11:23 +08:00
|
|
|
listOf(
|
2019-12-11 13:29:33 +08:00
|
|
|
"net.fabricmc.fabric-api:fabric-api-base:0.1.2+28f8190f42",
|
|
|
|
"net.fabricmc.fabric-api:fabric-events-interaction-v0:0.2.6+12515ed975",
|
|
|
|
"net.fabricmc.fabric-api:fabric-events-lifecycle-v0:0.1.2+b7f9825de8",
|
|
|
|
"net.fabricmc.fabric-api:fabric-networking-v0:0.1.7+12515ed975"
|
2019-09-20 09:11:23 +08:00
|
|
|
).forEach {
|
|
|
|
"include"(it)
|
|
|
|
"modImplementation"(it)
|
|
|
|
}
|
2019-07-11 08:29:43 +08:00
|
|
|
|
2019-09-23 04:42:26 +08: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 08:29:43 +08: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 {
|
Add new experimental snapshot API (#524)
* Add new experimental snapshot API
This API intends to replace the existing snapshot API in WorldEdit 8.
It is currently experimental, and the old API is soft-deprecated. Once
it is determined to be stable, the old API will be removed and replaced
with this new one.
It uses TrueVFS instead of TrueZIP, due to the latter's status as
matinence-only, and the face that TrueVFS is NIO-FileSystem compatible,
allowing us to integrate it with NIO's native zipfs. The TrueVFS system
does encompass multiple modules, but users and download + install
truevfs-profile-default as a fatjar. We depend on that profile to show
this as the intended solution.
* Port commands to experimental snapshots. Legacy ones are in sibling classes.
* Add many tests, fix bugs
* Clean up imports
* Verify sorting behaviors, fix bugs
* Add license to test
* Add support for DIM region folders
* Fix tests for Windows paths
* Rewrite tests for even more coverage, fix bugs
* Clean up naming on tests
* Add test for legacy format
* Stop trying to abuse `file://`, use `snapfs:` instead
* Simplify iterPaths
* Use File.separator in FS snap tests
* Fix some bugs from T9N PR (#538)
* Use printInfo/printError to keep colors right
* Escape quotes before they go in the map
* I18N-ify new snapshot code
2019-12-16 19:00:12 +08:00
|
|
|
attributes("Class-Path" to CLASSPATH,
|
2019-07-11 08:29:43 +08:00
|
|
|
"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 15:48:49 +08:00
|
|
|
relocate("org.antlr.v4", "com.sk89q.worldedit.antlr4")
|
2019-07-11 08:29:43 +08:00
|
|
|
|
|
|
|
include(dependency("org.slf4j:slf4j-api"))
|
|
|
|
include(dependency("org.apache.logging.log4j:log4j-slf4j-impl"))
|
2019-10-19 15:48:49 +08:00
|
|
|
include(dependency("org.antlr:antlr4-runtime"))
|
2019-07-11 08:29:43 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register<Jar>("deobfJar") {
|
|
|
|
from(sourceSets["main"].output)
|
|
|
|
archiveClassifier.set("dev")
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
add("archives", tasks.named("deobfJar"))
|
|
|
|
}
|
|
|
|
|
2019-09-20 09:11:23 +08: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 08:29:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.named("assemble").configure {
|
|
|
|
dependsOn("remapShadowJar")
|
|
|
|
}
|