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

Warning allowed dependency is unused in KMP Project #64

Closed
vanniktech opened this issue Oct 27, 2021 · 6 comments
Closed

Warning allowed dependency is unused in KMP Project #64

vanniktech opened this issue Oct 27, 2021 · 6 comments

Comments

@vanniktech
Copy link
Contributor

When I run the aggregation task licensee all of the tasks for each applicable plugin are ran. Since the configuration is shared there are some warnings:

> Task :core:licenseeJvm
WARNING: Allowed dependency 'org.jetbrains.kotlinx:kotlinx-serialization-core-iosx64:1.3.0' is unused
WARNING: Allowed dependency 'org.jetbrains.kotlinx:kotlinx-serialization-core-iosarm64:1.3.0' is unused
WARNING: Allowed dependency 'org.jetbrains.kotlinx:kotlinx-serialization-json-iosx64:1.3.0' is unused
WARNING: Allowed dependency 'org.jetbrains.kotlinx:kotlinx-serialization-json-iosarm64:1.3.0' is unused

Obviously, jvm does not need ios targeted dependencies.

In my project where I have a common module that's being used on Android, iOS & Server I get 96 of those warnings.

Not only is that a lot, actually removing a custom URL / license becomes impossible since I'd need to try it out, rerun everything.


Since the warnings come from the fine grained task, I guess the one solution would be to have custom logic inside licensee which does it's own validation without delegating to other tasks.

Another solution would be to have different configurations for each target.

@JakeWharton
Copy link
Collaborator

I'm out the rest of the year. This will have to be tackled next year at some point.

@JakeWharton
Copy link
Collaborator

Probably covered by #48, too.

@vdshb
Copy link

vdshb commented Oct 15, 2023

Another solution proposal to mention is adding warning suppression options. Something like this:

licensee {
    allow("Apache-2.0")
    warnings {
        unusedAllowedIdentifiers = false
        unusedAllowedUrls = false
        unusedAllowedCoordinates = false
    }
}

@vdshb
Copy link

vdshb commented Oct 15, 2023

I've made a proof of concept of such API: vdshb@304f273

Works perfect for me. It is for 1.7.0, because I need it for projects with previous AGP.

@JakeWharton Let me know if you interested in this peace of functionality. I'll try to make a proper PR(s) for 1.8.x/1.7.x.
An advise with project's test policies and how to avoid signing plugin during tests might be required, though.

@JakeWharton
Copy link
Collaborator

You can hide warnings now with #285. To be released next week.

@vanniktech
Copy link
Contributor Author

Works for me; hence closing this.

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

No branches or pull requests

3 participants