From 33db75da80e82003df44e20b64ee078682dd7e9b Mon Sep 17 00:00:00 2001 From: Manuel Zedel Date: Tue, 14 Aug 2018 20:45:57 +0200 Subject: [PATCH] add mandatory style checks to gradle build --- build.gradle | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index f0aa31c123a..ec35d37bd8f 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,9 @@ buildscript { classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.3' } } +plugins { + id 'com.diffplug.gradle.spotless' version '3.14.0' +} allprojects { repositories { @@ -31,12 +34,14 @@ ext { // regular buildTools = "27.0.3" compileSdk = 27 - minSdk = 14 + minSdk = 16 targetSdk = 27 sourceCompatibilityVersion = JavaVersion.VERSION_1_8 targetCompatibilityVersion = JavaVersion.VERSION_1_8 + appOutputFolder = "../../java/com.sap.sailing.www/apps/" + support = "27.1.1" play_services = "15.0.1" @@ -49,4 +54,38 @@ ext { // testing - ui test = "0.2" espresso = "2.1" -} \ No newline at end of file +} targetSdk = 27 + + isXmakeBuild = project.hasProperty('xmake') + isReleaseBuild = Boolean.parseBoolean(System.env.XMAKE_RELEASE_BUILD) + + sourceCompatibilityVersion = JavaVersion.VERSION_1_8 + targetCompatibilityVersion = JavaVersion.VERSION_1_8 + + appOutputFolder = "../../java/com.sap.sailing.www/apps/" + + support = "27.1.1" + play_services = "15.0.1" + + license_dialog = "1.8.0" + + // testing - jvm + junit = "4.12" + mockito = "1.9.5" + + // testing - ui + test = "0.2" + espresso = "2.1" +} + +spotless { + java { + importOrder 'java', 'javax', 'org', 'com', '' + removeUnusedImports() + eclipse().configFile('java/CodeFormatter.xml') + target project.fileTree(project.rootDir) { + include 'mobile/com.sap.*/**/*.java' + exclude '**/generated*/**/*.*', '**/gen/**/*' + } + } +}