cashapp / licensee

Gradle plugin which validates the licenses of your dependency graph match what you expect
https://cashapp.github.io/licensee/docs/1.x/
Apache License 2.0
626 stars 29 forks source link

Support for applying plugin to root project #41

Open charleskorn opened 3 years ago

charleskorn commented 3 years ago

I have a project made up of many subprojects, and I'd like to apply Licensee to all of them.

At the moment, if I apply Licensee to the root project, I get an error like this:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project '<project name redacted>'.
> 'app.cash.licensee' requires compatible language/platform plugin to be applied (root project)

I expected this to work and automatically apply the plugin to all subprojects.

On a related note, it would be great if Licensee supported configuring allow, allowUrl etc. at the root project level, rather than requiring these to be configured on each subproject. At the moment, I have one central set of allows that I apply to all subprojects. However, this then triggers a bunch of warnings that some of them are unused (not every project has every dependency), so it would be great if applying and configuring Licensee at the root project level then considered the usage of every project and only emitted warnings for allows that aren't used anywhere in any subproject.

mervyn-mccreight commented 1 year ago

I opened a separate issue for the warnings when using a general allow-list, if you are still interested: https://github.com/cashapp/licensee/issues/134

I already filed a PR for being able to configure the behavior when encountering unused configuration: https://github.com/cashapp/licensee/pull/136

JakeWharton commented 1 year ago

Just a note that the forthcoming project isolation in Gradle will discourage plugins from doing things at the root level like this. It's possible we could be a settings plugin which would allow applying the plugin to every subproject, but I'm really not sure. I believe in general they want people to use convention plugins for cross-cutting plugins and their configuration.