From 0ab6ebfed5d8bc903475f0c271564415de02eb75 Mon Sep 17 00:00:00 2001 From: Asoji Date: Sun, 5 May 2024 12:31:51 -0700 Subject: [PATCH 1/2] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Quick=201.20.6=20updat?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 52 ++++++++++-------------- gradle.properties | 10 ++--- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 27 insertions(+), 37 deletions(-) diff --git a/build.gradle b/build.gradle index bd77e7e..f3c814c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,23 +1,21 @@ plugins { - id 'fabric-loom' version '0.12-SNAPSHOT' + id 'fabric-loom' version '1.6-SNAPSHOT' id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 - archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group - dependencies { - //to change the versions see the gradle.properties file + // To change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" + // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}" + } processResources { @@ -28,45 +26,37 @@ processResources { } } -// ensure that the encoding is set to UTF-8, no matter what the system default is -// this fixes some edge cases with special characters not displaying correctly -// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html -tasks.withType(JavaCompile) { - options.encoding = "UTF-8" +tasks.withType(JavaCompile).configureEach { + it.options.release = 21 } -// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task -// if it is present. -// If you remove this task, sources will not be generated. -task sourcesJar(type: Jar, dependsOn: classes) { - classifier = "sources" - from sourceSets.main.allSource +java { + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // if it is present. + // If you remove this line, sources will not be generated. + withSourcesJar() + + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } jar { - from "LICENSE" + from("LICENSE") { + rename { "${it}_${project.base.archivesName.get()}"} + } } // configure the maven publication publishing { publications { - mavenJava(MavenPublication) { - // add all the jars that should be included when publishing to maven - artifact(jar) { - builtBy remapJar - } - artifact("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}.jar"){ - builtBy remapJar - } - artifact(sourcesJar) { - builtBy remapSourcesJar - } + create("mavenJava", MavenPublication) { + artifactId = project.archives_base_name + from components.java } } - // select the repositories you want to publish to + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. repositories { // uncomment to publish to the local maven - // mavenLocal() } } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 7dabe73..4fd912b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,14 +1,14 @@ org.gradle.jvmargs = -Xmx1G #Fabric properties -minecraft_version = 1.19 -yarn_mappings = 1.19+build.1 -loader_version = 0.14.7 +minecraft_version = 1.20.6 +yarn_mappings = 1.20.6+build.1 +loader_version = 0.15.10 #Mod properties -mod_version = 0.0.1 +mod_version = 0.0.2 maven_group = stackcalc archives_base_name = stackcalc #Dependencies -fabric_api_version = 0.55.3+1.19 \ No newline at end of file +fabric_api_version = 0.97.8+1.20.6 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a33384a..a8382d7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists \ No newline at end of file From 362032c83949cf16f4d7887a36f7c97e6c6b330b Mon Sep 17 00:00:00 2001 From: Asoji Date: Sun, 5 May 2024 12:32:41 -0700 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20comment=20moment=20fro?= =?UTF-8?q?m=20example=20mod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f3c814c..9ad33e3 100644 --- a/build.gradle +++ b/build.gradle @@ -57,6 +57,9 @@ publishing { // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. repositories { - // uncomment to publish to the local maven + // Add repositories to publish to here. + // Notice: This block does NOT have the same function as the block in the top level. + // The repositories here will be used for publishing your artifact, not for + // retrieving dependencies. } } \ No newline at end of file