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

Allow for group and module regex matching #49

Open PaulWoitaschek opened 3 years ago

PaulWoitaschek commented 3 years ago

Due to weirdnesses with the maven publish plugin and same module names within nested gradle middle-modules, for our internal library the group name often times has a suffix:

I.e with a module structure like this:

featureA:presentation
featureA:data
featureB:presentation
featureB:data

We publish artifacts like:

my.company.library.featureA:presentation
my.company.library.featureA:data
my.company.library.featureB:presentation
my.company.library.featureB:data

It would be great if licensee allowed a regex matching so we can specify sth like:

ignoreDependenciesByRegex(my.company.*)

This could work similar to gradles exclusiveContent matching:

dependencyResolutionManagement {

  repositories {

    exclusiveContent {
      forRepository {
        maven {
          url 'https://maven.google.com'
        }
      }
      filter {
        includeGroupByRegex("androidx.*")
        includeGroupByRegex("com.android.tools.build.*")
        includeGroupByRegex("com.android.*")
        includeGroup("com.google.firebase")
JakeWharton commented 3 years ago

Makes sense to me!

consp1racy commented 2 years ago

I believe

ignoreDependenciesByRegex("my.company.*")

should actually read

ignoreDependenciesByRegex("my\\.company(\\..*)?")