-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gradle: how to run lint automatically with check
?
#55
Comments
We should support this. For now the solution is to do the following: afterEvaluate {
test.dependsOn ktlintCheck
} |
Thanks for the answer! I'm afraid it still doesn't work. I can use the task directly, but putting the suggested code in the top-level build.gradle (near the bottom) still gives the same error. (Using a string ':topproject:ktlintCheck' moves the error to runtime but doesn't work) |
@mverleg note, that if you have multimodule project, root project will not have test or check tasks. You can archive it with following: subprojects {
afterEvaluate {
if (it.plugins.findPlugin("org.jlleitschuh.gradle.ktlint") != null) {
check.dependsOn("ktlintCheck")
}
}
} |
Though I agree in general that |
Actually plugin already set For example: $ ./gradlew -m :samples:kotlin-ks:check
:samples:kotlin-ks:ktlintMainCheck SKIPPED
:samples:kotlin-ks:ktlintTestCheck SKIPPED
:samples:kotlin-ks:compileKotlin SKIPPED
:samples:kotlin-ks:compileJava SKIPPED
:samples:kotlin-ks:processResources SKIPPED
:samples:kotlin-ks:classes SKIPPED
:samples:kotlin-ks:compileTestKotlin SKIPPED
:samples:kotlin-ks:compileTestJava SKIPPED
:samples:kotlin-ks:processTestResources SKIPPED
:samples:kotlin-ks:testClasses SKIPPED
:samples:kotlin-ks:test SKIPPED
:samples:kotlin-ks:check SKIPPED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 0s @mverleg can you check it for your project setup? |
Yeah I made a sample and it does have the dependency by default for JVM project, so I think this will mostly be fixed by #58 . Though it's worth noting that
still gives the error from the first post, even for JVM. It's not really a problem since it already happens by default, but it's a little weird. This does work for JVM, but not for other platforms:
|
@mverleg feel free to reopen if it will not work for you. |
I don't know if this is a bug or just my ignorance regarding Gradle, but I can't seem to do:
I get this message:
I created an otherwise clean project, which has a
build.gradle
like this:The text was updated successfully, but these errors were encountered: