Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running multiple build variant license tasks crashes build #55

Closed
egargan opened this issue Dec 5, 2018 · 4 comments · Fixed by #81
Closed

Running multiple build variant license tasks crashes build #55

egargan opened this issue Dec 5, 2018 · 4 comments · Fixed by #81

Comments

@egargan
Copy link

egargan commented Dec 5, 2018

In a project with a few different build variants, running a full gradle build results in a crash.

The crash seems to be caused by each variant's license task conflicting with one another. When the first license task runs, it creates a configuration called 'poms'. Then when the second variant's license task runs, it attempts to create the same configuration, which crashes since it already exists.

Here's a small example app that demos this issue: https://github.com/egargan/license-plugin-issue-demo.

The error output can be viewed in the /gradle-build-error-output file. The /app/build.gradle file sets up the calls to each task.

@jaredsburrows
Copy link
Owner

jaredsburrows commented Dec 19, 2018

I get this error:

$ gradlew build

> Task :app:licenseDebugReport 
Wrote HTML report to file:///Users/<>/repo/license-plugin-issue-demo/app/build/reports/licenses/licenseDebugReport.html.
Wrote JSON report to file:///Users/<>/repo/license-plugin-issue-demo/app/build/reports/licenses/licenseDebugReport.json.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:licenseReleaseReport'.
> Cannot add a configuration with name 'poms' as a configuration with that name already exists.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 12s
30 actionable tasks: 30 executed

@egargan
Copy link
Author

egargan commented Dec 19, 2018

Yep that's the issue we're getting too, is this expected behaviour? We're currently just deleting the 'poms' configuration after each task which seems to work fine - we get good output from the license task for each build variant. I'm thinking maybe this is something that should be done by the task itself?

@jaredsburrows
Copy link
Owner

Maybe we should create a separate configuration per variant?

@egargan
Copy link
Author

egargan commented Apr 23, 2019

Thanks for addressing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants