summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-03-12 14:13:38 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-03-12 15:07:19 +0000
commitc30ddd88df96a4d80eb12203682665c13dd452e5 (patch)
tree21c308ba617d38bd64f0a4fe8d54cf825e674472 /android
parent2bf55fd253abf427ed725d6722349a43d9c14eea (diff)
downloadmullvadvpn-c30ddd88df96a4d80eb12203682665c13dd452e5.tar.xz
mullvadvpn-c30ddd88df96a4d80eb12203682665c13dd452e5.zip
Add Kotlin linter and formatter
Diffstat (limited to 'android')
-rw-r--r--android/build.gradle22
1 files changed, 22 insertions, 0 deletions
diff --git a/android/build.gradle b/android/build.gradle
index 5fd0470c67..b01d3b1f98 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -1,3 +1,6 @@
+import org.jmailen.gradle.kotlinter.tasks.FormatTask
+import org.jmailen.gradle.kotlinter.tasks.LintTask
+
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
@@ -34,10 +37,29 @@ buildscript {
repositories {
jcenter()
google()
+
+ maven {
+ url = uri("https://plugins.gradle.org/m2/")
+ }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71'
+ classpath 'org.jmailen.gradle:kotlinter-gradle:1.22.0'
}
}
+
+task lintKotlin(type: LintTask, group: 'verification') {
+ source files('src/main/kotlin')
+ reports = [
+ 'plain': file('build/reports/kotlin-lint-report.txt'),
+ ]
+}
+
+task format(type: FormatTask, group: 'formatting') {
+ source files('src/main/kotlin')
+ report file('build/reports/kotlin-format-report.txt')
+}
+
+lint.dependsOn lintKotlin