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