aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2023-09-23 13:39:10 +0900
committerGitHub <noreply@github.com>2023-09-23 06:39:10 +0200
commitc95fa97ac498cca815396a98cbd49b4ec1628cc7 (patch)
treeee93c80a3eaf487cd504e71f6a9c562e4aa06af9 /build.gradle
parent61824219ade6834a43d51446a4b09ad91792ba62 (diff)
downloadGT5-Unofficial-c95fa97ac498cca815396a98cbd49b4ec1628cc7.tar.gz
GT5-Unofficial-c95fa97ac498cca815396a98cbd49b4ec1628cc7.tar.bz2
GT5-Unofficial-c95fa97ac498cca815396a98cbd49b4ec1628cc7.zip
Cleanup basic machines (#755)
* updateBuildScript * Update dependencies * Cleanup basic machines * Fix wildcard import
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle30
1 files changed, 29 insertions, 1 deletions
diff --git a/build.gradle b/build.gradle
index ac9652d0a3..7ff83a31bc 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,4 +1,4 @@
-//version: 1695323114
+//version: 1695409603
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -89,6 +89,23 @@ def out = services.get(StyledTextOutputFactory).create('an-output')
def projectJavaVersion = JavaLanguageVersion.of(8)
boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false
+boolean disableCheckstyle = project.hasProperty("disableCheckstyle") ? project.disableCheckstyle.toBoolean() : false
+
+final String CHECKSTYLE_CONFIG = """
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
+ "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+<module name="Checker">
+ <module name="TreeWalker">
+ <!-- Use CHECKSTYLE:OFF and CHECKSTYLE:ON comments to suppress checkstyle lints in a block -->
+ <module name="SuppressionCommentFilter"/>
+ <module name="AvoidStarImport">
+ <!-- Allow static wildcard imports for cases like Opcodes and LWJGL classes, these don't get created accidentally by the IDE -->
+ <property name="allowStaticMemberImports" value="true"/>
+ </module>
+ </module>
+</module>
+"""
checkPropertyExists("modName")
checkPropertyExists("modId")
@@ -140,6 +157,17 @@ if (!disableSpotless) {
apply from: Blowdryer.file('spotless.gradle')
}
+if (!disableCheckstyle) {
+ apply plugin: 'checkstyle'
+ tasks.named("checkstylePatchedMc") { enabled = false }
+ tasks.named("checkstyleMcLauncher") { enabled = false }
+ tasks.named("checkstyleIdeVirtualMain") { enabled = false }
+ tasks.named("checkstyleInjectedTags") { enabled = false }
+ checkstyle {
+ config = resources.text.fromString(CHECKSTYLE_CONFIG)
+ }
+}
+
String javaSourceDir = "src/main/java/"
String scalaSourceDir = "src/main/scala/"
String kotlinSourceDir = "src/main/kotlin/"