From 1e05796c9ceed01076595af221f82dac7783d3d7 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Thu, 9 Sep 2021 00:47:07 +0200 Subject: Update build env --- build.gradle | 55 +++++++++++++++++++++++++++++++++++-------------------- gradle.properties | 8 +++++--- 2 files changed, 40 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index f593ba6..c5c7aa8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,23 +1,31 @@ plugins { - id 'fabric-loom' version '0.7-SNAPSHOT' + id 'fabric-loom' version '0.9-SNAPSHOT' id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +sourceCompatibility = JavaVersion.VERSION_16 +targetCompatibility = JavaVersion.VERSION_16 archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group +repositories { + // Add repositories to retrieve artifacts from in here. + // You should only use this when depending on other mods because + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. + // See https://docs.gradle.org/current/userguide/declaring_repositories.html + // for more information about repositories. +} + 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_version}" + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. // You may need to force-disable transitiveness on them. @@ -31,23 +39,28 @@ 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 { + // 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 + // If Javadoc is generated, this must be specified in that task too. + it.options.encoding = "UTF-8" + + // Minecraft 1.17 (21w19a) upwards uses Java 16. + it.options.release = 16 } -// 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() } jar { - from "LICENSE" + from("LICENSE") { + rename { "${it}_${project.archivesBaseName}"} + } } // configure the maven publication @@ -64,9 +77,11 @@ publishing { } } - // 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() + // 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. } } diff --git a/gradle.properties b/gradle.properties index abf392e..0f6a926 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,11 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G -minecraft_version=1.16.5 -yarn_mappings=1.16.5+build.3 -loader_version=0.10.8 +minecraft_version=1.17.1 +yarn_mappings=1.17.1+build.59 +loader_version=0.11.6 + +fabric_version=0.40.0+1.17 # Mod Properties mod_version = 1.2.1 -- cgit v1.2.3