diff --git a/app/build.gradle b/app/build.gradle index 30fad370a..607b28f35 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -121,4 +121,14 @@ dependencies { } if (firebaseEnabled()) { apply plugin: 'com.google.gms.google-services' -} \ No newline at end of file +} + +apply plugin: "com.diffplug.gradle.spotless" +spotless { + java { + target '**/*.java' + googleJavaFormat('1.6').aosp() + removeUnusedImports() + } +} +project.tasks['preBuild'].dependsOn 'spotlessApply' diff --git a/build.gradle b/build.gradle index dcc56c2aa..adbee5951 100644 --- a/build.gradle +++ b/build.gradle @@ -5,10 +5,14 @@ buildscript { google() jcenter() mavenCentral() + maven { + url "https://plugins.gradle.org/m2/" + } } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com.google.gms:google-services:3.2.0' + classpath "com.diffplug.spotless:spotless-plugin-gradle:3.16.0" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files