From 281030a94c5a019bca5d052d8d5d7c7406e81088 Mon Sep 17 00:00:00 2001 From: "Frank.R.Wu" Date: Mon, 12 Jun 2023 23:09:34 +0800 Subject: [PATCH] build: config spotless plugin --- build.gradle | 20 ++ shardingsphere_eclipse_formatter.xml | 431 +++++++++++++++++++++++++++ 2 files changed, 451 insertions(+) create mode 100644 shardingsphere_eclipse_formatter.xml diff --git a/build.gradle b/build.gradle index fc9ee59..e8af3d5 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,9 @@ +buildscript { + dependencies { + classpath "com.diffplug.spotless:spotless-plugin-gradle:4.5.1" + } +} + plugins { id 'java' id 'java-library' @@ -6,6 +12,19 @@ plugins { id 'com.github.johnrengelman.shadow' version '4.0.2' } +apply plugin: "com.diffplug.gradle.spotless" + +spotless { + java { + removeUnusedImports() + eclipse().configFile('shardingsphere_eclipse_formatter.xml') + target fileTree('.') { + include '**/*.java' + } + } +} +//tasks.compileJava.dependsOn(spotlessJavaApply) + shadowJar { classifier = "jar" dependencies { @@ -14,6 +33,7 @@ shadowJar { // relocate 'com.google.code.gson', 'irs.com.google.code.gson' } } + sourceSets { main { java { diff --git a/shardingsphere_eclipse_formatter.xml b/shardingsphere_eclipse_formatter.xml new file mode 100644 index 0000000..675ae1f --- /dev/null +++ b/shardingsphere_eclipse_formatter.xml @@ -0,0 +1,431 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file