mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-01-23 13:40:30 +01:00
Add ktlint check.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
parent
343d6fc4d7
commit
2d3316964a
@ -1,15 +1,17 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
apply from: 'dependencies.gradle'
|
||||
|
||||
buildscript {
|
||||
apply from: 'dependencies.gradle'
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath gradlePlugins.androidTools
|
||||
classpath gradlePlugins.kotlin
|
||||
classpath gradlePlugins.ktlintGradle
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,8 @@ ext.versions = [
|
||||
|
||||
buildTools : "25.0.3",
|
||||
androidTools : "2.3.3",
|
||||
ktlint : "0.9.0",
|
||||
ktlintGradle : "2.1.0",
|
||||
|
||||
androidSupport : "22.2.1",
|
||||
|
||||
@ -23,6 +25,7 @@ ext.versions = [
|
||||
ext.gradlePlugins = [
|
||||
androidTools : "com.android.tools.build:gradle:$versions.androidTools",
|
||||
kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin",
|
||||
ktlintGradle : "gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:$versions.ktlintGradle",
|
||||
]
|
||||
|
||||
ext.androidSupport = [
|
||||
|
10
gradle_scripts/code_quality.gradle
Normal file
10
gradle_scripts/code_quality.gradle
Normal file
@ -0,0 +1,10 @@
|
||||
// Applies code quality plugins when -Pqc is passed to the gradle
|
||||
def isCodeQualityEnabled = project.hasProperty('qc')
|
||||
|
||||
if (isCodeQualityEnabled) {
|
||||
apply plugin: "org.jlleitschuh.gradle.ktlint"
|
||||
|
||||
ktlint {
|
||||
version = versions.ktlint
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
apply plugin: 'kotlin'
|
||||
apply from: '../gradle_scripts/code_quality.gradle'
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
|
@ -1,5 +1,6 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "../gradle_scripts/code_quality.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion versions.compileSdk
|
||||
|
Loading…
Reference in New Issue
Block a user