Created
December 7, 2018 12:53
-
-
Save ditn/a5152308e113c7cdbe6221fd030c5060 to your computer and use it in GitHub Desktop.
ktlint with Gradle Kotlin DSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val ktlint by configurations.creating | |
dependencies { | |
ktlint(Libraries.ktlint) | |
} | |
tasks.register<JavaExec>("ktlint") { | |
group = "verification" | |
description = "Check Kotlin code style." | |
classpath = ktlint | |
main = "com.github.shyiko.ktlint.Main" | |
args("--android", "src/**/*.kt") | |
} | |
tasks.named("check") { | |
dependsOn(ktlint) | |
} | |
tasks.register<JavaExec>("ktlintFormat") { | |
group = "formatting" | |
description = "Fix Kotlin code style deviations." | |
classpath = ktlint | |
main = "com.github.shyiko.ktlint.Main" | |
args("--android", "-F", "src/**/*.kt") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awesome, thank you