-
Notifications
You must be signed in to change notification settings - Fork 468
Can't setup ktfmt via gradle according to docs #858
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
Comments
These are both behaviours of Spotless that I've seen before. My understanding is Spotless wasn't fully coded with Android in mind, so as a workaround, try adjusting your tasks.named("clean", Delete::class) {
delete(rootProject.buildDir)
} ...so that it refers to the And then, if it still reports that last error message, you'll need to tell Spotless where your Kotlin source files actually live with a "target". For example, if you have an configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
target("app/src/**/*.kt")
ktfmt("0.24").dropboxStyle()
}
} I'm assuming that your I hope this helps! Having said all this, this does sound like a bug, so @nedtwigg do you have any other thoughts? |
@ColtonIdle I should add that this is all going from memory, so if it doesn't work as expected, please let us know! |
@jbduncan AHHH It worked! Thank you so much! Quick questions if you don't mind.
Edit regarding question #2. I think I got it working with just |
Good questions!
Regardless, in most Android projects, Feel free to raise a bug report about having
|
I'm closing this as it looks like everything is resolved now. If not, please let us know and we'll reopen. |
And of course I promptly forgot that I said this is likely a Spotless bug. Oops! Reopening. |
@jbduncan thanks for the advice. Filed a bug here: https://issuetracker.google.com/issues/186924459 In regards to your advice of |
#1014 fixes the conflict with the |
Fixed in |
@nedtwigg after all these years... the android studio team (because of a bug I filed) is going to get rid of the clean task in the template. https://issuetracker.google.com/issues/186924459 Just posting this as a heads up. I'm not sure if it backfires with that latest PR you made to address this. |
Thanks for the heads up! No backfire, Spotless is strictly more resilient now than it was before, so all good. |
I have an android project.
In my root build.gradle.kts I added the spotless plugin to my plugin block
then
If I run ./gradlew build I get an error of
Android projects by default come with this
so I removed that, and then I get a different error
The text was updated successfully, but these errors were encountered: