mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-23 00:29:51 +00:00
Merge pull request #428 from PolyhedralDev/ver/6.4.0
Ver/6.4.0 2: Electric Boogaloo
This commit is contained in:
@@ -3,7 +3,6 @@ import java.io.File
|
|||||||
import java.io.FileWriter
|
import java.io.FileWriter
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
import java.nio.file.FileSystemNotFoundException
|
|
||||||
import java.nio.file.FileSystems
|
import java.nio.file.FileSystems
|
||||||
import org.gradle.api.DefaultTask
|
import org.gradle.api.DefaultTask
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
@@ -49,28 +48,19 @@ fun Project.configureDistribution() {
|
|||||||
// https://github.com/johnrengelman/shadow/issues/111
|
// https://github.com/johnrengelman/shadow/issues/111
|
||||||
val dest = URI.create("jar:" + tasks.named<ShadowJar>("shadowJar").get().archiveFile.get().asFile.toURI())
|
val dest = URI.create("jar:" + tasks.named<ShadowJar>("shadowJar").get().archiveFile.get().asFile.toURI())
|
||||||
|
|
||||||
val provider = try {
|
FileSystems.newFileSystem(dest, mapOf("create" to "false"), null).use { fs ->
|
||||||
FileSystems.getFileSystem(dest)
|
|
||||||
} catch (e: FileSystemNotFoundException) {
|
|
||||||
null
|
|
||||||
} ?: FileSystems.newFileSystem(dest, mapOf("create" to "false"), null)
|
|
||||||
provider?.use { fs ->
|
|
||||||
forSubProjects(":common:addons") {
|
forSubProjects(":common:addons") {
|
||||||
if (fs.isOpen) {
|
val jar = getJarTask()
|
||||||
val jar = getJarTask()
|
|
||||||
|
println("Packaging addon ${jar.archiveFileName.get()} to $dest. size: ${jar.archiveFile.get().asFile.length() / 1024}KB")
|
||||||
if (jar.archiveFile.get().asFile.exists()) {
|
|
||||||
println("Packaging addon ${jar.archiveFileName.get()} to $dest. size: ${jar.archiveFile.get().asFile.length() / 1024}KB")
|
val boot = if (extra.has("bootstrap") && extra.get("bootstrap") as Boolean) "bootstrap/" else ""
|
||||||
|
val addonPath = fs.getPath("/addons/$boot${jar.archiveFileName.get()}")
|
||||||
val boot = if (extra.has("bootstrap") && extra.get("bootstrap") as Boolean) "bootstrap/" else ""
|
|
||||||
val addonPath = fs.getPath("/addons/$boot${jar.archiveFileName.get()}")
|
if (!addonPath.exists()) {
|
||||||
|
addonPath.parent.createDirectories()
|
||||||
if (!addonPath.exists()) {
|
addonPath.createFile()
|
||||||
addonPath.parent.createDirectories()
|
jar.archiveFile.get().asFile.toPath().copyTo(addonPath, overwrite = true)
|
||||||
addonPath.createFile()
|
|
||||||
jar.archiveFile.get().asFile.toPath().copyTo(addonPath, overwrite = true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ terra.issues=https://github.com/PolyhedralDev/Terra/issues
|
|||||||
terra.wiki=https://github.com/PolyhedralDev/Terra/wiki
|
terra.wiki=https://github.com/PolyhedralDev/Terra/wiki
|
||||||
terra.license=MIT
|
terra.license=MIT
|
||||||
# Gradle options
|
# Gradle options
|
||||||
org.gradle.jvmargs=-Xmx4096M -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC
|
org.gradle.jvmargs=-Xmx4096M -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||||
org.gradle.warning.mode=all
|
org.gradle.warning.mode=all
|
||||||
|
|
||||||
|
|||||||
@@ -27,18 +27,6 @@ dependencies {
|
|||||||
|
|
||||||
modImplementation("net.fabricmc:fabric-loader:${Versions.Mod.fabricLoader}")
|
modImplementation("net.fabricmc:fabric-loader:${Versions.Mod.fabricLoader}")
|
||||||
|
|
||||||
setOf(
|
|
||||||
"fabric-lifecycle-events-v1",
|
|
||||||
"fabric-resource-loader-v0",
|
|
||||||
"fabric-api-base",
|
|
||||||
"fabric-command-api-v2",
|
|
||||||
"fabric-networking-api-v1"
|
|
||||||
).forEach { apiModule ->
|
|
||||||
val module = fabricApi.module(apiModule, Versions.Fabric.fabricAPI)
|
|
||||||
modImplementation(module)
|
|
||||||
include(module)
|
|
||||||
}
|
|
||||||
|
|
||||||
modImplementation("cloud.commandframework", "cloud-fabric", Versions.Libraries.cloud)
|
modImplementation("cloud.commandframework", "cloud-fabric", Versions.Libraries.cloud)
|
||||||
include("cloud.commandframework", "cloud-fabric", Versions.Libraries.cloud)
|
include("cloud.commandframework", "cloud-fabric", Versions.Libraries.cloud)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.14.2",
|
"fabricloader": ">=0.14.2",
|
||||||
"java": ">=17",
|
"java": ">=17",
|
||||||
"minecraft": "1.20.x"
|
"minecraft": "1.20.x",
|
||||||
|
"fabric": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user