build: config spotless plugin

This commit is contained in:
Frank.R.Wu
2023-06-12 23:09:34 +08:00
parent 32536e2c80
commit 281030a94c
2 changed files with 451 additions and 0 deletions

View File

@@ -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 {