Skip to content

Commit

Permalink
Backend: Update build gradle to allow launching 1.21 (#2764)
Browse files Browse the repository at this point in the history
  • Loading branch information
CalMWolfs authored Oct 19, 2024
1 parent 60c420a commit 90b8691
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 12 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,18 @@ 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"))
shadowImpl("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") {
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")
Expand Down Expand Up @@ -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") {
Expand Down Expand Up @@ -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")
}
Expand Down Expand Up @@ -375,7 +384,7 @@ detekt {

tasks.withType<Detekt>().configureEach {
onlyIf {
System.getenv("SKIP_DETEKT") != "true"
target == ProjectTarget.MAIN
}

reports {
Expand Down
2 changes: 1 addition & 1 deletion root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 90b8691

Please sign in to comment.