2019-07-11 08:45:33 +08:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
|
|
import net.minecraftforge.gradle.common.util.RunConfig
|
|
|
|
import net.minecraftforge.gradle.userdev.UserDevExtension
|
|
|
|
import net.minecraftforge.gradle.userdev.tasks.GenerateSRG
|
|
|
|
import net.minecraftforge.gradle.userdev.tasks.RenameJarInPlace
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
id("net.minecraftforge.gradle")
|
|
|
|
}
|
|
|
|
|
|
|
|
applyPlatformAndCoreConfiguration()
|
|
|
|
applyShadowConfiguration()
|
|
|
|
|
2020-02-01 06:03:10 +08:00
|
|
|
val minecraftVersion = "1.15.2"
|
|
|
|
val mappingsMinecraftVersion = "1.15.1"
|
|
|
|
val forgeVersion = "31.0.14"
|
2019-07-11 08:45:33 +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.11.2")
|
|
|
|
|
|
|
|
"minecraft"("net.minecraftforge:forge:$minecraftVersion-$forgeVersion")
|
|
|
|
}
|
|
|
|
|
|
|
|
configure<UserDevExtension> {
|
|
|
|
mappings(mapOf(
|
|
|
|
"channel" to "snapshot",
|
2020-02-02 14:11:40 +08:00
|
|
|
"version" to "20200201-$mappingsMinecraftVersion"
|
2019-07-11 08:45:33 +08:00
|
|
|
))
|
|
|
|
|
2019-09-05 11:55:47 +08:00
|
|
|
accessTransformer(file("src/main/resources/META-INF/accesstransformer.cfg"))
|
|
|
|
|
2019-07-11 08:45:33 +08:00
|
|
|
runs {
|
|
|
|
val runConfig = Action<RunConfig> {
|
|
|
|
properties(mapOf(
|
|
|
|
"forge.logging.markers" to "SCAN,REGISTRIES,REGISTRYDUMP",
|
|
|
|
"forge.logging.console.level" to "debug"
|
|
|
|
))
|
|
|
|
workingDirectory = project.file("run").canonicalPath
|
|
|
|
source(sourceSets["main"])
|
|
|
|
}
|
|
|
|
create("client", runConfig)
|
|
|
|
create("server", runConfig)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
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"])
|
|
|
|
inputs.property("forgeVersion", forgeVersion)
|
|
|
|
|
|
|
|
// replace stuff in mcmod.info, nothing else
|
|
|
|
from(sourceSets["main"].resources.srcDirs) {
|
|
|
|
include("META-INF/mods.toml")
|
|
|
|
|
|
|
|
// replace version and mcversion
|
|
|
|
expand(
|
|
|
|
"version" to project.ext["internalVersion"],
|
|
|
|
"forgeVersion" to forgeVersion
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
// copy everything else except the mcmod.info
|
|
|
|
from(sourceSets["main"].resources.srcDirs) {
|
|
|
|
exclude("META-INF/mods.toml")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.named<Jar>("jar") {
|
|
|
|
manifest {
|
2019-07-11 08:59:23 +08:00
|
|
|
attributes("WorldEdit-Version" to project.version)
|
2019-07-11 08:45:33 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.named<ShadowJar>("shadowJar") {
|
|
|
|
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:45:33 +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:48:31 +08:00
|
|
|
include(dependency("de.schlichtherle:truezip"))
|
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
|
|
|
include(dependency("net.java.truevfs:truevfs-profile-default_2.13"))
|
2019-07-11 08:48:31 +08:00
|
|
|
include(dependency("org.mozilla:rhino"))
|
2019-07-11 09:55:09 +08:00
|
|
|
}
|
|
|
|
minimize {
|
|
|
|
exclude(dependency("org.mozilla:rhino"))
|
2019-07-11 08:45:33 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
afterEvaluate {
|
|
|
|
val reobf = extensions.getByName<NamedDomainObjectContainer<RenameJarInPlace>>("reobf")
|
|
|
|
reobf.maybeCreate("shadowJar").run {
|
|
|
|
mappings = tasks.getByName<GenerateSRG>("createMcpToSrg").output
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register<Jar>("deobfJar") {
|
|
|
|
from(sourceSets["main"].output)
|
|
|
|
archiveClassifier.set("dev")
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
add("archives", tasks.named("deobfJar"))
|
|
|
|
}
|