gradle-dependencies-sorter
gradle-dependencies-sorter copied to clipboard
Support variantOf in add calls
It's used to achieve artifact type selection together with version catalogs, e.g.:
dependencies {
add("myconfig", variantOf(libs.foo) {
artifactType("tar")
})
}
currently fails with:
1: extraneous input 'libs.foo' expecting ')', 2: extraneous input ')' expecting {'}', ID}
Thanks for the issue. Could you provide a minimal reproducer?
The bit I had was:
add("orchestratorApks", variantOf(libs.apks.orchestrator) {
artifactType("apk")
})
and libs.apks.orchestrator
was this in libs.versions.toml
:
apks-orchestrator = "androidx.test:orchestrator:1.4.2"
On my side turns out I didn't need the artifactType
at all, it resolved to the correct packaging as it was the default but for some libraries you may have multiple artifact types and may want to select a specific one.