aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-10-20 10:08:18 +1100
committerGitHub <noreply@github.com>2024-10-20 01:08:18 +0200
commit90b869133ec4e7bc5f5a8e2fc29e7f86e8033eba (patch)
treefefa4b9f60913a9f43844c50e733897544bd5f43
parent60c420a4fffb660f684a6e7fee59030f0cb287aa (diff)
downloadSkyHanni-90b869133ec4e7bc5f5a8e2fc29e7f86e8033eba.tar.gz
SkyHanni-90b869133ec4e7bc5f5a8e2fc29e7f86e8033eba.tar.bz2
SkyHanni-90b869133ec4e7bc5f5a8e2fc29e7f86e8033eba.zip
Backend: Update build gradle to allow launching 1.21 (#2764)
-rw-r--r--.github/workflows/build.yml2
-rw-r--r--build.gradle.kts15
-rw-r--r--root.gradle.kts2
3 files changed, 13 insertions, 6 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 45d4ecaa9..c8a130392 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -58,8 +58,6 @@ jobs:
preprocess:
runs-on: ubuntu-latest
name: "Build multi version"
- env:
- SKIP_DETEKT: "true"
steps:
- name: Checkout code
uses: actions/checkout@v4
diff --git a/build.gradle.kts b/build.gradle.kts
index e412f9d92..cddef09fd 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -152,6 +152,9 @@ dependencies {
annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT")
annotationProcessor("com.google.code.gson:gson:2.10.1")
annotationProcessor("com.google.guava:guava:17.0")
+ } else if (target == ProjectTarget.MODERN) {
+ modCompileOnly("net.fabricmc:fabric-loader:0.16.7")
+ modCompileOnly("net.fabricmc.fabric-api:fabric-api:0.102.0+1.21")
}
implementation(kotlin("stdlib-jdk8"))
@@ -159,7 +162,8 @@ dependencies {
exclude(group = "org.jetbrains.kotlin")
}
- modRuntimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.1.0")
+ if (target.isForge) modRuntimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.2.1")
+ else modRuntimeOnly("me.djtheredstoner:DevAuth-fabric:1.2.1")
modCompileOnly("com.github.hannibal002:notenoughupdates:4957f0b:all") {
exclude(module = "unspecified")
@@ -251,6 +255,10 @@ if (target == ProjectTarget.MAIN) {
}
}
+tasks.withType<KotlinCompile> {
+ compilerOptions.jvmTarget.set(JvmTarget.fromTarget(target.minecraftVersion.formattedJavaLanguageVersion))
+}
+
if (target.parent == ProjectTarget.MAIN) {
val mainRes = project(ProjectTarget.MAIN.projectPath).tasks.getAt("processResources")
tasks.named("processResources") {
@@ -331,7 +339,8 @@ if (!MultiVersionStage.activeState.shouldCompile(target)) {
preprocess {
vars.put("MC", target.minecraftVersion.versionNumber)
- vars.put("FORGE", if (target.forgeDep != null) 1 else 0)
+ vars.put("FORGE", if (target.isForge) 1 else 0)
+ vars.put("FABRIC", if (target.isFabric) 1 else 0)
vars.put("JAVA", target.minecraftVersion.javaVersion)
patternAnnotation.set("at.hannibal2.skyhanni.utils.compat.Pattern")
}
@@ -375,7 +384,7 @@ detekt {
tasks.withType<Detekt>().configureEach {
onlyIf {
- System.getenv("SKIP_DETEKT") != "true"
+ target == ProjectTarget.MAIN
}
reports {
diff --git a/root.gradle.kts b/root.gradle.kts
index 22147e02a..834d2b8e4 100644
--- a/root.gradle.kts
+++ b/root.gradle.kts
@@ -2,7 +2,7 @@ import at.skyhanni.sharedvariables.ProjectTarget
import com.replaymod.gradle.preprocess.Node
plugins {
- id("dev.deftu.gradle.preprocess") version "0.6.1"
+ id("dev.deftu.gradle.preprocess") version "0.7.1"
id("net.kyori.blossom") version "1.3.2" apply false
id("gg.essential.loom") version "1.6.+" apply false
kotlin("jvm") version "2.0.0" apply false