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

Failure with Application and Gradle 7.3 #69

Closed ccjernigan closed 2 years ago

ccjernigan commented 2 years ago

Steps to reproduce

  1. Create a Kotlin multiplatform project that applies the Java application plugin
    
    plugins {
    kotlin("multiplatform")
    id("application")
    id("app.cash.licensee")
    }

kotlin { jvm() }

2. Build with Gradle 7.3

# Results

Caused by: org.gradle.api.internal.tasks.DefaultTaskContainer$DuplicateTaskException: Cannot add task 'licensee' as a task with that name already exists. at org.gradle.api.internal.tasks.DefaultTaskContainer.failOnDuplicateTask(DefaultTaskContainer.java:257) at org.gradle.api.internal.tasks.DefaultTaskContainer.registerTask(DefaultTaskContainer.java:398) at org.gradle.api.internal.tasks.DefaultTaskContainer.register(DefaultTaskContainer.java:393) at org.gradle.api.internal.tasks.DefaultTaskContainer.register(DefaultTaskContainer.java:381) at org.gradle.api.internal.tasks.DefaultTaskContainer.register(DefaultTaskContainer.java:387) at app.cash.licensee.LicenseePlugin.apply$lambda-8(plugin.kt:97)



# Notes
The symptoms appear similar to #62 but the steps to reproduce are different.  The `withJava` is not necessary to reproduce this time.  This time, the trigger is the combination of Gradle 7.3 and the application plugin.  If I roll back to Gradle 7.2, the issue goes away.  Likewise if I remove the application plugin, the issue goes away.
JakeWharton commented 2 years ago

I will try to build the repro tomorrow during a meeting. Hopefully the fix is equally as simple as the withJava one.

JakeWharton commented 2 years ago

Fixed in 1.3.1 which should be available within the hour on Maven central.