From 501a878b93299adc17e601b33368b4899d2c0d2a Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Fri, 19 Aug 2022 16:50:05 +0800 Subject: [PATCH] allow opt out spotless (#53) Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- build.gradle | 10 ++++++++-- gradle.properties | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 046db33..a378f46 100644 --- a/build.gradle +++ b/build.gradle @@ -57,7 +57,7 @@ plugins { id 'com.palantir.git-version' version '0.13.0' apply false id 'de.undercouch.download' version '5.0.1' id 'com.github.gmazzo.buildconfig' version '3.0.3' apply false - id "com.diffplug.spotless" version "6.7.2" + id 'com.diffplug.spotless' version '6.7.2' apply false } verifySettingsGradle() @@ -90,7 +90,13 @@ idea { downloadSources = true } } -apply from: Blowdryer.file('spotless.gradle') + +boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false + +if (!disableSpotless) { + apply plugin: 'com.diffplug.spotless' + apply from: Blowdryer.file('spotless.gradle') +} if(JavaVersion.current() != JavaVersion.VERSION_1_8) { throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current()) diff --git a/gradle.properties b/gradle.properties index efbd94b..c2e3750 100644 --- a/gradle.properties +++ b/gradle.properties @@ -77,3 +77,8 @@ usesShadowedDependencies = false # Optional parameter to prevent the source code from being published # noPublishedSources = + +# Uncomment this to disable spotless checks +# This should only be uncommented to keep it easier to sync with upstream/other forks. +# That is, if there is no other active fork/upstream, NEVER change this. +# disableSpotless = true \ No newline at end of file