I tried providing an explicit `extendsFrom` value ...
# multiplatform
e
I tried providing an explicit
extendsFrom
value to the custom configuration, but it didn’t seem to work for
implementation
or
compile
d
You need to publish separate artifacts. If you can use
project
notation, you can do
project(":name", "jvmMainApiElements")
e
I don’t think that
project
notation works for Maven artifacts
t
I would suppose you should use either jvm specific library artifact (if there is one) or use Gradle metadata variants: https://docs.gradle.org/current/userguide/feature_variants.html#sec::consuming_feature_variants I haven't tried to use Gradle variants myself, so further is just my assumptions. For example you want to consume jvm variant of sqldelight runtime (for whatever reason). It has following gradle metadata: https://oss.sonatype.org/content/repositories/snapshots/com/squareup/sqldelight/runtime-jvm/1.2.0-SNAPSHOT/runtime-jvm-1.2.0-20190425.151844-34.module So requesting it as a dependency may look following:
Copy code
cli("com.squareup:sqldelight-runtime:1.2.0") {
   capabilities {
       requireCapability "com.squareup:sqldelight-runtime-jvm-runtime"
    }
}
e
Looks like this could work! I'll give it a go and report back. Thanks!
tried your suggestion, the problem is that the metadata for the JVM artifact declares 3 variant, which Gradle then can’t choose from:
Copy code
Cannot choose between the following variants of com.squareup.sqldelight:runtime-jvm:1.2.0-SNAPSHOT:
          - jvm-api
          - jvm-runtime
          - metadata-api
they all declare the same capability
Copy code
All of them match the consumer attributes:
          - Variant 'jvm-api' capability com.squareup.sqldelight:runtime-jvm:1.2.0-SNAPSHOT:
              - Unmatched attributes:
                  - Found org.gradle.status 'integration' but wasn't required.
                  - Found org.gradle.usage 'java-api-jars' but wasn't required.
                  - Found org.jetbrains.kotlin.platform.type 'jvm' but wasn't required.
          - Variant 'jvm-runtime' capability com.squareup.sqldelight:runtime-jvm:1.2.0-SNAPSHOT:
              - Unmatched attributes:
                  - Found org.gradle.status 'integration' but wasn't required.
                  - Found org.gradle.usage 'java-runtime-jars' but wasn't required.
                  - Found org.jetbrains.kotlin.platform.type 'jvm' but wasn't required.
          - Variant 'metadata-api' capability com.squareup.sqldelight:runtime-jvm:1.2.0-SNAPSHOT:
              - Unmatched attributes:
                  - Found org.gradle.status 'integration' but wasn't required.
                  - Found org.gradle.usage 'kotlin-api' but wasn't required.
                  - Found org.jetbrains.kotlin.platform.type 'common' but wasn't required.
what does look different is the value for
org.gradle.usage
, but I couldn’t find a way to filter by this attribute
t
At Gradle slack I was advised to try following notation of capability:
Copy code
requireCapability "com.squareup.sqldelight:runtime-jvm"
e
yeah, I pinged Gradle Slack too, feel like I have enough to work with
I think
requireCapability
won’t work since all JVM variants declare the same capability
k
@egorand were you able to solve this?
e
I have! DM if you still need help
❤️ 1