From d70e41006d896b839c8413f37656bfe30c5b0091 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Sun, 23 Jun 2024 21:02:17 +0200 Subject: [PATCH] Add ReplayStudio as submodule instead of JitPack Because JitPack breaks Gradle variants so we get the Java 17 jar even when we use the Java 8 variant. This works for building via Gradle. However it does not work for usage from IntelliJ, where you must currently publishToMavenLocal ReplayStudio and then depend on that version. Still looking for a better solution there. --- .gitmodules | 3 +++ ReplayStudio | 1 + build.gradle.kts | 8 +++++++- settings.gradle.kts | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 160000 ReplayStudio diff --git a/.gitmodules b/.gitmodules index 0d1b3611..b8b3fdb2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,3 +5,6 @@ [submodule "src/main/resources/assets/replaymod/lang"] path = src/main/resources/assets/replaymod/lang url = https://github.com/ReplayMod/Translations +[submodule "ReplayStudio"] + path = ReplayStudio + url = ../ReplayStudio diff --git a/ReplayStudio b/ReplayStudio new file mode 160000 index 00000000..5d17653d --- /dev/null +++ b/ReplayStudio @@ -0,0 +1 @@ +Subproject commit 5d17653db9b10f4b4741ab4af659595855cd10f8 diff --git a/build.gradle.kts b/build.gradle.kts index d7bb33d6..2b0f1bfd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -156,7 +156,13 @@ dependencies { implementation(shadow("com.github.ReplayMod.JavaBlend:2.79.0:a0696f8")!!) - implementation(shadow("com.github.ReplayMod:ReplayStudio:5d17653db9")!!) + implementation(shadow("com.github.ReplayMod:ReplayStudio") { + attributes { + // Force use of jar (as opposed to classes directory) because only the jar contains the relocated ViaVersion + // Doesn't seem to work for IDE though, so will have to publishToMavenLocal it for that. + attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR)) + } + }) // FIXME this should be pulled in by ReplayStudio, and IntelliJ sees it, but javac for some reason does not implementation("com.github.viaversion:opennbt:0a02214") // 2.0-SNAPSHOT (ViaVersion Edition) diff --git a/settings.gradle.kts b/settings.gradle.kts index dac8a4c8..92068ff5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -74,6 +74,8 @@ val replayModVersions = listOf( rootProject.buildFileName = "root.gradle.kts" +includeBuild("ReplayStudio") + include(":jGui") project(":jGui").apply { projectDir = file("jGui")