diff --git a/build.gradle b/build.gradle index bd26b92df..bdbfc8cbc 100644 --- a/build.gradle +++ b/build.gradle @@ -13,11 +13,13 @@ buildscript { plugins { id 'org.hidetake.ssh' version '2.10.1' + id "com.diffplug.gradle.spotless" version "3.27.2" } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven' +apply plugin: 'pmd' // apply plugin: 'com.matthewprenger.cursegradle' ext.configFile = file('build.properties') @@ -106,6 +108,21 @@ dependencies { runtimeOnly fg.deobf("top.theillusivec4.curios:curios:FORGE-1.15.2-2.0") } +spotless { + java { + target '**/vazkii/botania/**/*.java' + targetExclude '**/buildcraft/*.java', '**/thaumcraft/*.java' + + indentWithTabs() + licenseHeaderFile( 'spotless/license_template.txt') + eclipse().configFile 'spotless/eclipseformat.xml' + importOrderFile 'spotless/eclipse.importorder' + } +} +pmd { + ruleSets = ["java-braces"] +} + if (System.getenv().BUILD_NUMBER != null) { //adds the build number to the end of the version string if on a build server version += ".${System.getenv().BUILD_NUMBER}" diff --git a/spotless/eclipse.importorder b/spotless/eclipse.importorder new file mode 100644 index 000000000..1ef6f8b24 --- /dev/null +++ b/spotless/eclipse.importorder @@ -0,0 +1,12 @@ +#Organize Import Order +#Sat Mar 07 20:20:06 CET 2020 +9=\# +8=java +7=javax +6=vazkii +5=top +4=org +3=net +2=mezz +1=it +0=com diff --git a/spotless/eclipseformat.xml b/spotless/eclipseformat.xml new file mode 100644 index 000000000..9fadb8e5f --- /dev/null +++ b/spotless/eclipseformat.xml @@ -0,0 +1,365 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spotless/license_template.txt b/spotless/license_template.txt new file mode 100644 index 000000000..a8578ccdb --- /dev/null +++ b/spotless/license_template.txt @@ -0,0 +1,8 @@ +/* + * This class is distributed as part of the Botania Mod. + * Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ \ No newline at end of file