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
637 stars 30 forks source link

Feature request: Ability to disable license validation and only generate artifacts.json #45

Closed gchristov closed 3 years ago

gchristov commented 3 years ago

First off, thanks for the great plugin! We recently integrated it into our app and it's working well.

I was wondering if it would be possible to have an option to disable license validation and only generate artifacts.json for the project dependencies? Main reasoning is that we already have a tool that does license validation so we are having to update the plugin manually quite frequently.

Perhaps, something similar to how we have allow() or ignoreDependencies but allowAll() or equivalent?

JakeWharton commented 3 years ago

Sure. Should be easy enough to support.

JakeWharton commented 3 years ago

I'm thinking this should be an enum which dictates the behavior on violation. The default is 'error' but 'warn' and 'ignore' would also be supported. And it would be exposed on the DSL as a violation reporting level.

gchristov commented 3 years ago

I can see that this is now available in version 1.3.0! 🥳 I was wondering what is the correct way to use it? I have tried this in my build.gradle

licensee {
    violationAction(LOG)
}

but it seems to be throwing an error

Could not get unknown property 'LOG' for object of type app.cash.licensee.MutableLicenseeExtension.
JakeWharton commented 3 years ago

You need to import app.cash.licensee.ViolationAction.LOG.