ajalt / clikt

Multiplatform command line interface parsing for Kotlin
https://ajalt.github.io/clikt/
Apache License 2.0
2.57k stars 124 forks source link

Improve compatibility with gradle-versions-plugin #174

Closed hollyroberts closed 4 years ago

hollyroberts commented 4 years ago

I've been using gradle to manage my dependencies and https://github.com/ben-manes/gradle-versions-plugin to check for new versions. This works fine for all the other libraries I have, but has issues with Clikt. The output it provides without the stacktrace using --info is:

Failed to determine the latest version for the following dependencies (use --info for details):
 - com.github.ajalt:clikt
     2.6.0
The exception that is the cause of unresolved state: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.github.ajalt:clikt:+.
Required by:
    project :
Caused by: org.gradle.internal.component.AmbiguousConfigurationSelectionException: Cannot choose between the following variants of com.github.ajalt:clikt:2.6.0:
  - jvm-api
  - jvm-runtime
  - metadata-api
All of them match the consumer attributes:
  - Variant 'jvm-api' capability com.github.ajalt:clikt:2.6.0:
      - Unmatched attributes:
          - Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
          - Provides org.gradle.status 'release' but the consumer didn't ask for it
          - Provides org.gradle.usage 'java-api' but the consumer didn't ask for it
          - Provides org.jetbrains.kotlin.platform.type 'jvm' but the consumer didn't ask for it
  - Variant 'jvm-runtime' capability com.github.ajalt:clikt:2.6.0:
      - Unmatched attributes:
          - Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
          - Provides org.gradle.status 'release' but the consumer didn't ask for it
          - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
          - Provides org.jetbrains.kotlin.platform.type 'jvm' but the consumer didn't ask for it
  - Variant 'metadata-api' capability com.github.ajalt:clikt:2.6.0:
      - Unmatched attributes:
          - Provides org.gradle.status 'release' but the consumer didn't ask for it
          - Provides org.gradle.usage 'kotlin-api' but the consumer didn't ask for it
          - Provides org.jetbrains.kotlin.platform.type 'common' but the consumer didn't ask for it

Obviously this could be an issue with the plugin, but it seems more likely to be down to how Clikt is configured.

ajalt commented 4 years ago

This seems to be an issue with the gradle-versions-plugin when resolving any Kotlin MPP dependency.

https://github.com/ben-manes/gradle-versions-plugin/issues/334

If you know of a change I could make that would help, I'd be happy to implement it, but it looks like they're going to have to fix it on their end.