Skip to content

false positive for must-be-api if a dependency is declared as both api and implementation #662

@RBusarow

Description

@RBusarow

This relates to #534, since the implementation declaration should be automatically removed if that rule is enabled.

Given a build file like this:

plugins {
  `some-convention-plugin` // adds `implementation(project(":foo")) as a dependency
}

dependencies {
  api(project(":foo"))
}

If :foo should be an api dependency, then ModuleCheck will complain that the implementation declaration should be api. In this case, it will fail the task even with auto-correct, since it can't fix the declaration in the convention plugin.

With regards to must-be-api specifically, this finding should not be reported since there's already an api version.

With regards to redeclared-dependency (#534), the implementation version should be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions