From 9c96e84a58ae269d1b94726e29864b40614bc348 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Wed, 13 Nov 2024 16:43:34 +0100 Subject: [PATCH] Fix local execution of gradle tasks and line ending issues --- .gitattributes | 4 ++-- gradle/java-module.gradle | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.gitattributes b/.gitattributes index ed25c885dd..8400dd4b2b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,8 +1,8 @@ # By default, detect text files automatically, and use whatever line terminators make sense for the OS -* text=auto +* text=auto eol=lf # Java files are text, and we want Java-friendly readable hunk headers for diff -*.java text diff=java +*.java text diff=java eol=lf # Force LF/CRLF format for files that are known to require it. *.sh text eol=lf diff --git a/gradle/java-module.gradle b/gradle/java-module.gradle index cacd9ef43f..ea70109de0 100644 --- a/gradle/java-module.gradle +++ b/gradle/java-module.gradle @@ -519,16 +519,14 @@ tasks.register( "ciCheck" ) { group "verification" description "Checks for CI environments" dependsOn tasks.check +} - // These are already enforced by the formatChecks task - spotlessApply { - enabled = false - } - spotlessJavaApply { - enabled = false - } - enforceRules { - enabled = false +gradle.taskGraph.whenReady { + if ( it.hasTask( tasks.ciCheck ) ) { + // These are already enforced by the formatChecks task + tasks.spotlessApply.enabled = false + tasks.spotlessJavaApply.enabled = false + tasks.enforceRules.enabled = false } }