Skip to content

Commit

Permalink
change: update gradle + loom + use automatic mixin hotswap
Browse files Browse the repository at this point in the history
  • Loading branch information
2No2Name committed Jul 15, 2023
1 parent c32fd8c commit 5af7018
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
23 changes: 18 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import net.fabricmc.loom.task.RemapJarTask

plugins {
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'maven-publish'
id 'net.caffeinemc.mixin-config-plugin' version '1.0-SNAPSHOT'
}
Expand Down Expand Up @@ -47,6 +47,12 @@ sourceSets {
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

repositories {
allprojects {
repositories {
Expand Down Expand Up @@ -132,19 +138,19 @@ tasks.withType(Jar) {
}

task apiJar(type: Jar) {
classifier "api-dev"
archiveClassifier.set("api-dev")

from sourceSets.api.output
}

task remapApiJar(type: RemapJarTask) {
classifier "api"
archiveClassifier.set("api")

input = apiJar.archiveFile.get().asFile
addNestedDependencies = false
}

prepareRemapApiJar.dependsOn(apiJar)
remapApiJar.dependsOn(apiJar)

publishing {
publications {
Expand All @@ -159,4 +165,11 @@ publishing {
}
}
}
build.dependsOn remapApiJar
build.dependsOn remapApiJar

afterEvaluate {
loom.runs.configureEach {
// https://fabricmc.net/wiki/tutorial:mixin_hotswaps
vmArg "-javaagent:${ configurations.compileClasspath.find { it.name.contains("sponge-mixin") } }"
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 5af7018

Please sign in to comment.