summary refs log tree commit diff stats
path: root/build.gradle
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2022-07-09 02:41:14 -0300
committerSoniEx2 <endermoneymod@gmail.com>2022-07-09 02:41:14 -0300
commit36f45c9ec3d63c656e87c7cdfcc08bc1ac59a806 (patch)
tree7bc1f88dcf26b080317b6e4e97c9fd9ebf5e25b7 /build.gradle
parent0e752a6e215aee21dc73da097c3225495d54a5b6 (diff)
[Project] Chat Privacy
A Minecraft mod which partially fixes Microsoft's danger to Minecraft
players.
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle56
1 files changed, 28 insertions, 28 deletions
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"