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

Plugin suggests that ABI dependencies are unused while they are needed for both compile #501

Closed
mvegter opened this issue Oct 11, 2021 · 1 comment · Fixed by #520
Closed
Labels
bug Something isn't working
Milestone

Comments

@mvegter
Copy link
Contributor

mvegter commented Oct 11, 2021

Plugin version
main@ccaadc5fc86155f57650325784d6f105afe1be9b / 0.78.1-snapshot

Gradle version
7.2

Describe the bug

> Task :impl:projectHealth
Unused dependencies which should be removed:
  api(project(":abstract"))

To Reproduce
abstract/src/main/java/IPermission.java

public interface IPermission {
    String name();
    boolean isAdmin();
    default Object getLogging() {
        return name();
    }
}

impl/src/main/java/WebPermission.java

public enum WebPermission implements IPermission {

    ViewData(false),
    EditData(true),
    ;

    private final boolean superRole;

    WebPermission(boolean superRole) {
        this.superRole = superRole;
    }

    @Override
    public boolean isAdmin() {
        return superRole;
    }

}

Expected behavior
Do not suggest changing the dependency api project(':abstract') for the :impl project to unused. As removing this dependency won't compile the project.

Additional context
Changing the dependency from api to implementation will cause upstream issue, e.g. Cannot access IPermission

@autonomousapps
Copy link
Owner

I know I've been sitting on this one for a while, but it's because I find it terribly confusing. This issue suggests a really crazy bug that multiple regression tests ought to prevent. I appreciate the issue and the PR, and will take a look when I can.

@autonomousapps autonomousapps added the bug Something isn't working label Oct 24, 2021
@autonomousapps autonomousapps added this to the 1.0 milestone Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants