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

Fails to find license with Kotlin Multiplatform Javascript Target #67

Closed ccjernigan closed 2 years ago

ccjernigan commented 2 years ago

STEPS TO REPRODUCE

  1. Create a gradle module with multiplatform libraries like com.benasher44:uuid:0.3.1, a javascript target, and applying version 1.3.0 of the licensee plugin. E.g.
    plugins {
    kotlin("multiplatform")
    id("app.cash.licensee")
    }
    kotlin {
    jvm()
    js(IR)
    sourceSets {
        val commonMain by getting {
            dependencies {
                api("com.benasher44:uuid:0.3.1")
            }
        }
    }

RESULTS Actual:

com.benasher44:uuid-js:0.3.1
 - ERROR: Artifact declares no licenses!

Expected: It finds the license for the JVM target, so it should also succeed with the Javascript target.

NOTES I don't know if there's a limitation in the Kotlin Multiplatform Gradle plugin where we need to file an issue with JetBrains, but I thought I'd start here.

JakeWharton commented 2 years ago

Probably some form of #30

vanniktech commented 2 years ago

I've also gotten this now with ktor 1.6.7:

io.ktor:ktor-client-core-iosarm64:1.6.7
 - ERROR: Artifact declares no licenses!
io.ktor:ktor-http-cio-iosarm64:1.6.7
 - ERROR: Artifact declares no licenses!
io.ktor:ktor-http-iosarm64:1.6.7
 - ERROR: Artifact declares no licenses!
io.ktor:ktor-io-iosarm64:1.6.7
 - ERROR: Artifact declares no licenses!
io.ktor:ktor-utils-iosarm64:1.6.7
 - ERROR: Artifact declares no licenses!
hfhbd commented 2 years ago

Interessting, at least sometime it is able to find the license:

app.softwork:routing-compose:0.1.9-dev670
 - SPDX identifier 'Apache-2.0' allowed
app.softwork:routing-compose-js:0.1.9-dev670
 - SPDX identifier 'Apache-2.0' allowed                   <- Why? :D
com.squareup.sqldelight:coroutines-extensions:1.5.3
 - SPDX identifier 'Apache-2.0' allowed
com.squareup.sqldelight:coroutines-extensions-js:1.5.3
 - ERROR: Artifact declares no licenses!
org.jetbrains.kotlin:kotlin-stdlib-js:1.6.21
 - SPDX identifier 'Apache-2.0' allowed

I will take a look later this week and compare my POM (app.softwork:routing-compose-js) with the sqldelight one

vanniktech commented 2 years ago

I've got another POM: https://repo1.maven.org/maven2/com/vanniktech/lint-rules-rxjava2/0.21.0/lint-rules-rxjava2-0.21.0.pom

License is there but licensee can't seem to find it:

com.vanniktech:lint-rules-rxjava2:0.21.0
 - ERROR: Artifact declares no licenses!

Gradle's consuming side looks like this:

api "com.vanniktech:lint-rules-rxjava2:0.21.0"
hfhbd commented 2 years ago

This also affects all darwin targets (macOS, iOS, watchOS and tvOS).

JakeWharton commented 2 years ago

Going to close as a duplicate of #30 which is fixed in 1.5.0. Please try and let me know if it resolves this. Otherwise we'll have to get a failing test case integrated.

ccjernigan commented 2 years ago

I just tested this out and can confirm that it resolves the issues I saw with multiplatform/JS dependencies.