diff --git a/build.gradle b/build.gradle index 5d805e6..411430d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'net.fabricmc.fabric-loom' version '1.16-SNAPSHOT' - id 'maven-publish' + id "net.fabricmc.fabric-loom" version "1.16-SNAPSHOT" + id "maven-publish" } version = project.mod_version @@ -10,17 +10,7 @@ base { archivesName = project.archives_base_name } - -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 minecraft "com.mojang:minecraft:${project.minecraft_version}" implementation "net.fabricmc:fabric-loader:${project.loader_version}" @@ -42,11 +32,8 @@ processResources { def targetJavaVersion = 25 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" + if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { it.options.release.set(targetJavaVersion) } @@ -54,35 +41,16 @@ tasks.withType(JavaCompile).configureEach { java { def javaVersion = JavaVersion.toVersion(targetJavaVersion) + if (JavaVersion.current() < javaVersion) { toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) } - // 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.md") { rename { "${it}_${project.archives_base_name}" } } } - -// configure the maven publication -publishing { - publications { - create("mavenJava", MavenPublication) { - artifactId = project.archives_base_name - from components.java - } - } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - // 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 9a05610..01c8be3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,11 @@ -# Done to increase the memory available to gradle. +# Done to increase the memory available to Gradle. org.gradle.jvmargs=-Xmx1G -# Fabric Properties -# check these on https://modmuss50.me/fabric.html -minecraft_version=26.1 -loader_version=0.19.2 # Mod Properties mod_version=1.0.0-SNAPSHOT maven_group=dev.encode42 archives_base_name=meows # Dependencies # check this on https://modmuss50.me/fabric.html +minecraft_version=26.1 +loader_version=0.19.2 fabric_version=0.147.0+26.1.2 diff --git a/settings.gradle b/settings.gradle index 027b233..ed3a8df 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,9 +1,10 @@ pluginManagement { repositories { maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net/' + name = "Fabric" + url = "https://maven.fabricmc.net/" } + gradlePluginPortal() } }