mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-09 00:08:43 +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.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
apply from: 'dependencies.gradle'
|
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
apply from: 'dependencies.gradle'
|
apply from: 'dependencies.gradle'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
|
maven {
|
||||||
|
url "https://plugins.gradle.org/m2/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath gradlePlugins.androidTools
|
classpath gradlePlugins.androidTools
|
||||||
classpath gradlePlugins.kotlin
|
classpath gradlePlugins.kotlin
|
||||||
|
classpath gradlePlugins.ktlintGradle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@ ext.versions = [
|
|||||||
|
|
||||||
buildTools : "25.0.3",
|
buildTools : "25.0.3",
|
||||||
androidTools : "2.3.3",
|
androidTools : "2.3.3",
|
||||||
|
ktlint : "0.9.0",
|
||||||
|
ktlintGradle : "2.1.0",
|
||||||
|
|
||||||
androidSupport : "22.2.1",
|
androidSupport : "22.2.1",
|
||||||
|
|
||||||
@ -23,6 +25,7 @@ ext.versions = [
|
|||||||
ext.gradlePlugins = [
|
ext.gradlePlugins = [
|
||||||
androidTools : "com.android.tools.build:gradle:$versions.androidTools",
|
androidTools : "com.android.tools.build:gradle:$versions.androidTools",
|
||||||
kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin",
|
kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin",
|
||||||
|
ktlintGradle : "gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:$versions.ktlintGradle",
|
||||||
]
|
]
|
||||||
|
|
||||||
ext.androidSupport = [
|
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 plugin: 'kotlin'
|
||||||
|
apply from: '../gradle_scripts/code_quality.gradle'
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main.java.srcDirs += 'src/main/kotlin'
|
main.java.srcDirs += 'src/main/kotlin'
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
|
apply from: "../gradle_scripts/code_quality.gradle"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion versions.compileSdk
|
compileSdkVersion versions.compileSdk
|
||||||
|
Loading…
x
Reference in New Issue
Block a user