palantir / gradle-configuration-resolver-plugin

Apache License 2.0
11 stars 10 forks source link

Gradle 3.3 compatibility #27

Open henryptung opened 7 years ago

henryptung commented 7 years ago

Gradle 3.3 introduced the notion of (directly) unresolvable configurations, as indicated [here](https://docs.gradle.org/3.3/javadoc/org/gradle/api/artifacts/Configuration.html#isCanBeResolved(). In my opinion, one of two things should occur:

1) The plugin detects and blacklists such configurations from direct resolution, in a backwards-compatible way 2) The plugin extension has a configurable Collection<Configuration> configurations member. By default, it is set to project.configurations, but can be modified e.g. to configurations = project.configurations.matching { it.canBeResolved } for projects using Gradle 3.3+.

@jmcampanini Let me know which you prefer, and I can put up a PR. Thanks in advance!

henryptung commented 7 years ago

Example error with Gradle 3.4:

:resolveConfigurations FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':resolveConfigurations'.
> Resolving configuration 'apiElements' directly is not allowed

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

BUILD FAILED

Total time: 1 mins 56.827 secs
jmcampanini commented 7 years ago

I believe this was fixed (issue #25). Are you on the latest version of this plugin?