mrmans0n / compose-rules

Lint rules for ktlint/detekt aimed to contribute to a healthier usage of Compose. Actively maintained and evolved fork of the Twitter Compose rules.
https://mrmans0n.github.io/compose-rules
Other
550 stars 21 forks source link

Kotlin Multiplatform support #301

Closed MessiasLima closed 1 month ago

MessiasLima commented 1 month ago

I'm trying to use it in a Kotlin multiplatform application.

Here is my configuration

// shared.gradle.kts

detekt {
    autoCorrect = true
    parallel = true
    buildUponDefaultConfig = true
    config.setFrom("$rootDir/detekt/detekt.yml")
    baseline = file("$rootDir/detekt/${project.name}/baseline.xml")
}

tasks.register("detektAll") {
    allprojects {
        this@register.dependsOn(tasks.withType<Detekt>())
    }
}

dependencies {
    detektPlugins(libs.detekt.formatting)
    detektPlugins(libs.detekt.composeRules)
}

and here is the error I get

❯ ./gradlew :compose:detektAll
Type-safe project accessors is an incubating feature.
> Task :compose:detektAndroidDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compose:detektAndroidDebug'.
> Could not resolve all files for configuration ':compose:detektPlugins'.
   > Could not find io.nlopez.compose.rules:detekt:0.4.7.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/io/nlopez/compose/rules/detekt/0.4.7/detekt-0.4.7.pom
     Required by:
         project :compose

* Try:
> If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 1s
13 actionable tasks: 1 executed, 12 up-to-date

Is there any workaround on that?

Thank you in advance

mrmans0n commented 1 month ago

Last version in maven central was, as of now, 0.4.6. I just pushed the .7 version now, it should be available in a short bit.