Skip to content

Commit 726588b

Browse files
added spotless plugin & dependency
1 parent 17675b0 commit 726588b

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
31
buildscript {
42
ext {
53
kotlin_version = '1.2.71'
@@ -20,6 +18,7 @@ buildscript {
2018
dependencies {
2119
classpath "com.android.tools.build:gradle:3.2.1"
2220
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
21+
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.16.0"
2322
classpath "com.novoda:bintray-release:0.9"
2423
}
2524
}

spotless.gradle

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apply plugin: "com.diffplug.gradle.spotless"
2+
spotless {
3+
java {
4+
target "**/*.java"
5+
trimTrailingWhitespace()
6+
removeUnusedImports()
7+
googleJavaFormat('1.6').aosp()
8+
endWithNewline()
9+
}
10+
kotlin {
11+
target "**/*.kt"
12+
ktlint().userData(['indent_size': '4', 'continuation_indent_size': '4'])
13+
licenseHeaderFile '../spotless.license.kt'
14+
trimTrailingWhitespace()
15+
endWithNewline()
16+
}
17+
}

spotless.license.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (C) 2018 skydoves
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+

0 commit comments

Comments
 (0)