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

Replace buildscript with plugins #91

Open syslogic opened 2 years ago

syslogic commented 2 years ago

https://github.com/cashapp/licensee/blob/7b8b13978aba36faf157bc42404b139057bb7b99/README.md?plain=1#L81-L91

Using the plugins API, this is how it would look alike:

plugins {
    id 'app.cash.licensee' version '1.5.0-SNAPSHOT' apply false
}
plugins {
    id 'app.cash.licensee'
}

Repositories can be set up in settings.gradle:

import org.gradle.api.initialization.resolve.RepositoriesMode

pluginManagement {
    repositories {
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
        mavenCentral()
    }
}

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
    repositories {
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
        mavenCentral()
    }
}

rootProject.name = "Licensee"
JakeWharton commented 2 years ago

We can provide both forms, but note that for both the non-snapshot plugin and the snapshot plugin you will still need to specify a maven repository because we do not publish to Gradle's plugin portal (and have no plans to).

syslogic commented 2 years ago

I've updated that with Sonatype & MavenCentral.