From 36f45c9ec3d63c656e87c7cdfcc08bc1ac59a806 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sat, 9 Jul 2022 02:41:14 -0300 Subject: [Project] Chat Privacy A Minecraft mod which partially fixes Microsoft's danger to Minecraft players. --- build.gradle | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'build.gradle') diff --git a/build.gradle b/build.gradle index c0682ed..4a0f807 100644 --- a/build.gradle +++ b/build.gradle @@ -4,19 +4,19 @@ plugins { id "org.jetbrains.kotlin.jvm" } -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +sourceCompatibility = JavaVersion.VERSION_17 +targetCompatibility = JavaVersion.VERSION_17 archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group -minecraft { -} - - repositories { - maven { url = "http://maven.fabricmc.net/" } + // 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 { @@ -37,46 +37,46 @@ dependencies { processResources { inputs.property "version", project.version - from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" + filesMatching("fabric.mod.json") { expand "version": project.version } - - from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" - } } // 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" + it.options.encoding = "UTF-8" + + // Minecraft 1.18.1 upwards uses Java 17. + it.options.release = 17 } -// 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 publishing { publications { mavenJava(MavenPublication) { + from components.java // add all the jars that should be included when publishing to maven - artifact(remapJar) { - builtBy remapJar - } - artifact(sourcesJar) { - builtBy remapSourcesJar - } +// artifact(remapJar) { +// builtBy remapJar +// } +// artifact(sourcesJar) { +// builtBy remapSourcesJar +// } } } @@ -87,4 +87,4 @@ publishing { } } -compileKotlin.kotlinOptions.jvmTarget = "1.8" \ No newline at end of file +compileKotlin.kotlinOptions.jvmTarget = "17" -- cgit 1.4.1