Merge branch 'main' of gitlab.com:jeseibel/distant-horizons

This commit is contained in:
James Seibel
2024-05-20 22:06:59 -05:00
5 changed files with 41 additions and 11 deletions
+27 -5
View File
@@ -12,6 +12,8 @@ plugins {
// Architectury is used here only as a replacement for forge's own loom
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
id 'xyz.wagyourtail.jvmdowngrader' version '0.4.0' apply true
}
@@ -102,6 +104,7 @@ subprojects { p ->
// Apply plugins
apply plugin: "java"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "xyz.wagyourtail.jvmdowngrader"
if (isMinecraftSubProject)
apply plugin: "systems.manifold.manifold-gradle-plugin"
@@ -282,7 +285,7 @@ subprojects { p ->
relocate "com.seibel.distanthorizons.fabriclike", "loaderCommon.${p.name}.com.seibel.distanthorizons.fabriclike" // Move the loader files to a different location
}
}
def librariesLocation = "distanthorizons.libraries"
def librariesLocation = "DistantHorizons.libraries"
// LWJGL
// Only ever shadow the dependencies we use otherwise some stuff would break when running on an external client
@@ -313,6 +316,22 @@ subprojects { p ->
// Using jar.finalizedBy(shadowJar) causes issues so we do this scuffed bypass
jar.dependsOn(shadowJar)
// For downgrading our project to Java 8
if (isMinecraftSubProject) {
task jarDowngrade(type: xyz.wagyourtail.jvmdg.gradle.task.DowngradeJar) {
inputFile = tasks.shadowJar.archiveFile
archiveClassifier = "downgraded-8"
}
task apiDowngrade(type: xyz.wagyourtail.jvmdg.gradle.task.ShadeAPI) {
inputFile = jarDowngrade.archiveFile
archiveClassifier = "downgraded-8-shaded"
}
// We're using a custom downgrade task so we disable the original downgrade tasks
downgradeJar.enabled = false
shadeDowngradedApi.enabled = false
}
// Put stuff from gradle.properties into the mod info
processResources {
@@ -611,14 +630,17 @@ allprojects { p ->
tasks.withType(JavaCompile) {
if (isMinecraftSubProject) {
options.release = rootProject.java_version as Integer
options.release = rootProject.java_version as Integer // Neoforge complains without this
options.compilerArgs += ["-Xplugin:Manifold"]
} else {
options.release = 8; // Core & Api should use Java 8 no matter what
//options.release = rootProject.java_version as Integer // But if you want to test some stuff, then this can be enabled
}
options.encoding = "UTF-8"
}
// Sets the project's actual Java version (it's recommended to use this over the `options.release` method above)
java {
sourceCompatibility = rootProject.java_version
targetCompatibility = rootProject.java_version
}
java {
withSourcesJar()
+2 -2
View File
@@ -23,8 +23,8 @@ loom {
}
remapJar {
inputFile = shadowJar.archiveFile
dependsOn shadowJar
inputFile = apiDowngrade.archiveFile
dependsOn apiDowngrade
}
+2 -2
View File
@@ -51,8 +51,8 @@ loom {
}
remapJar {
inputFile = shadowJar.archiveFile
dependsOn shadowJar
inputFile = apiDowngrade.archiveFile
dependsOn apiDowngrade
}
def addMod(path, enabled) {
+2 -2
View File
@@ -67,8 +67,8 @@ loom {
}
remapJar {
inputFile = shadowJar.archiveFile
dependsOn shadowJar
inputFile = apiDowngrade.archiveFile
dependsOn apiDowngrade
// classifier null
atAccessWideners.add("distanthorizons.accesswidener")
+8
View File
@@ -33,6 +33,14 @@ pluginManagement {
name "ParchmentMC"
url "https://maven.parchmentmc.org"
}
maven { // Used for downgrading Java versions
name "Wagyourtail Release Repository"
url "https://maven.wagyourtail.xyz/releases"
}
maven { // Used for downgrading Java versions
name "Wagyourtail Snapshot Repository"
url "https://maven.wagyourtail.xyz/snapshots"
}
mavenCentral()
gradlePluginPortal()