mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Use ktlint plugin instead of manual ktlint tasks
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
d1d6898ffb
commit
eb67a31bd1
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
task: [ detekt, ktlint ]
|
task: [ detekt, ktlintCheck ]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Set up JDK 8
|
- name: Set up JDK 8
|
||||||
|
@ -31,10 +31,7 @@ apply plugin: 'kotlin-kapt'
|
|||||||
apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-android-extensions'
|
||||||
apply plugin: 'com.github.spotbugs'
|
apply plugin: 'com.github.spotbugs'
|
||||||
apply plugin: 'io.gitlab.arturbosch.detekt'
|
apply plugin: 'io.gitlab.arturbosch.detekt'
|
||||||
|
apply plugin: "org.jlleitschuh.gradle.ktlint"
|
||||||
configurations {
|
|
||||||
ktlint
|
|
||||||
}
|
|
||||||
|
|
||||||
def urlFile = { url, fileName ->
|
def urlFile = { url, fileName ->
|
||||||
File file = new File("$buildDir/download/${fileName}")
|
File file = new File("$buildDir/download/${fileName}")
|
||||||
@ -149,7 +146,7 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
check.dependsOn 'spotbugsGplayDebugReport', 'lint', 'ktlint', 'detekt'
|
check.dependsOn 'spotbugsGplayDebug', 'lint', 'ktlintCheck', 'detekt'
|
||||||
lint.dependsOn 'preBuild'
|
lint.dependsOn 'preBuild'
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
@ -206,7 +203,6 @@ dependencies {
|
|||||||
implementation ('com.gitlab.bitfireAT:dav4jvm:2.1.3', {
|
implementation ('com.gitlab.bitfireAT:dav4jvm:2.1.3', {
|
||||||
exclude group: 'org.ogce', module: 'xpp3' // Android comes with its own XmlPullParser
|
exclude group: 'org.ogce', module: 'xpp3' // Android comes with its own XmlPullParser
|
||||||
})
|
})
|
||||||
ktlint "com.pinterest:ktlint:0.44.0"
|
|
||||||
implementation 'org.conscrypt:conscrypt-android:2.5.2'
|
implementation 'org.conscrypt:conscrypt-android:2.5.2'
|
||||||
|
|
||||||
implementation 'androidx.camera:camera-core:1.0.2'
|
implementation 'androidx.camera:camera-core:1.0.2'
|
||||||
@ -338,20 +334,6 @@ dependencies {
|
|||||||
gplayImplementation "com.google.firebase:firebase-messaging:23.0.0"
|
gplayImplementation "com.google.firebase:firebase-messaging:23.0.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
task ktlint(type: JavaExec, group: "verification") {
|
|
||||||
description = "Check Kotlin code style."
|
|
||||||
main = "com.pinterest.ktlint.Main"
|
|
||||||
classpath = configurations.ktlint
|
|
||||||
args "--reporter=plain", "--reporter=plain,output=${buildDir}/ktlint.txt,src/**/*.kt"
|
|
||||||
}
|
|
||||||
|
|
||||||
task ktlintFormat(type: JavaExec, group: "formatting") {
|
|
||||||
description = "Fix Kotlin code style deviations."
|
|
||||||
main = "com.pinterest.ktlint.Main"
|
|
||||||
classpath = configurations.ktlint
|
|
||||||
args "-F", "src/**/*.kt"
|
|
||||||
}
|
|
||||||
|
|
||||||
detekt {
|
detekt {
|
||||||
reports {
|
reports {
|
||||||
xml {
|
xml {
|
||||||
|
@ -40,6 +40,7 @@ buildscript {
|
|||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
|
||||||
classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.7.5'
|
classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.7.5'
|
||||||
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.19.0"
|
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.19.0"
|
||||||
|
classpath "org.jlleitschuh.gradle:ktlint-gradle:10.2.1"
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
Loading…
Reference in New Issue
Block a user