Skip to content
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

7.0.0.BETA1: Multiple steps with name 'google-java-format' for spotless format 'java' #2159

Closed
Goooler opened this issue Jun 4, 2024 · 4 comments · Fixed by #2328
Closed
Labels

Comments

@Goooler
Copy link
Member

Goooler commented Jun 4, 2024

plugins {
    id 'com.diffplug.spotless' version '7.0.0.BETA1'
}

spotless {
    java {
        target("compatLib/**/src/**/*.java")
        googleJavaFormat().aosp()
        removeUnusedImports()
    }
    kotlin {
        target("lawnchair/src/**/*.kt")
        ktlint().customRuleSets([
            "io.nlopez.compose.rules:ktlint:0.4.3",
        ]).editorConfigOverride([
            "ktlint_compose_compositionlocal-allowlist": "disabled",
        ])
    }
}
Could not determine the dependencies of task ':spotlessApply'.
> Could not create task ':spotlessJavaApply'.
   > Could not create task ':spotlessJava'.
      > Multiple steps with name 'google-java-format' for spotless format 'java'

Reproducer: LawnchairLauncher/lawnchair#4450

@Goooler
Copy link
Member Author

Goooler commented Jun 5, 2024

removeUnusedImports() is conflicted with googleJavaFormat().

@namero999
Copy link

Facing this as well. Any workaround so far?

@Goooler
Copy link
Member Author

Goooler commented Jun 6, 2024

Workaround: remove removeUnusedImports().

@nedtwigg
Copy link
Member

It's because the removeUnusedImports step is naming itself google-java-format. Easy to fix with a bit of plumbing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants