9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-20 15:29:35 +00:00
Files
LeavesMC/patches/api/0005-Hide-irrelevant-compilation-warnings.patch
2024-10-12 13:23:26 +08:00

36 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Wed, 19 Jul 2023 20:08:16 +0800
Subject: [PATCH] Hide irrelevant compilation warnings
diff --git a/build.gradle.kts b/build.gradle.kts
index ab84a1405acc1f0d5f267892243b82b8dab03e21..beee863333fa8ebb31cd83d6a1451b51c770bf2d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -131,6 +131,15 @@ val generateApiVersioningFile by tasks.registering {
}
}
+// Leaves start - hide irrelevant compilation warnings
+tasks.withType<JavaCompile> {
+ val compilerArgs = options.compilerArgs
+ compilerArgs.add("-Xlint:-module")
+ compilerArgs.add("-Xlint:-removal")
+ compilerArgs.add("-Xlint:-dep-ann")
+}
+// Leaves end - hide irrelevant compilation warnings
+
tasks.jar {
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
into("META-INF/maven/${project.group}/${project.name}")
@@ -190,6 +199,8 @@ tasks.withType<Javadoc> {
into("build/docs/javadoc")
}
}
+
+ options.addStringOption("Xdoclint:none", "-quiet") // Leaves - hide irrelevant compilation warnings
}
tasks.test {