GarouDan
06/16/2020, 12:56 PMjs
, jvm
, macosX64
, etc.).
But when our client is consuming the library with:
implementation("com.company:project:1.0.0")
It cannot be automatically choose the correct one, for example, a jvm gradle kts project does not work with this from my tests.
Can we still use this way or need we publish everything separately? If we can use together, how can we do it?
implementation("com.company:project-jvm:1.0.0")
implementation("com.company:project-js:1.0.0")
implementation("com.company:project-macos_x64:1.0.0")
araqnid
06/16/2020, 1:10 PM:project:
version should be fine with a recent-enough version of Gradle, provided that the Gradle module metadata file has been published too — which should be happening automatically.configurations {
val platformAttr = Attribute.of("org.jetbrains.kotlin.platform.type", org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType::class.java)
all {
attributes.attribute(platformAttr, org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.jvm)
}
}
GarouDan
06/16/2020, 2:28 PM:project
will not be available there, do you know if the metadata will also work in this case?
Also, I don’t know how yet, I’d like to distribute the library in a way that people from NodeJS and C/C++ could consume it too. I’m already using the related targets and source sets, but I don’t know how to distribute in a way it will be good for them to consumelouiscad
06/16/2020, 4:22 PMrusshwolf
06/16/2020, 4:48 PMenableFeaturePreview("GRADLE_METADATA")
in settings.gradle(.kts), which is on by default in Gradle 6+GarouDan
06/16/2020, 4:53 PMrusshwolf
06/16/2020, 4:55 PMGarouDan
06/16/2020, 4:57 PMrusshwolf
06/16/2020, 4:59 PMGarouDan
06/16/2020, 5:00 PMandylamax
06/17/2020, 12:26 AMGarouDan
06/17/2020, 12:45 AMlibrary-jvm
instead of library
seems to work, but no automatically resolution seems to workrusshwolf
06/17/2020, 12:46 AMGarouDan
06/17/2020, 12:50 AMaraqnid
06/17/2020, 12:51 AMrusshwolf
06/17/2020, 12:51 AMGarouDan
06/17/2020, 1:14 AM.module
file is already there now, using the workaround.
Locally (from my local maven repo), I’ve confirmed that it can be automatically resolved, but when using bintray seems not to work, even when having the .module
there.russhwolf
06/17/2020, 3:10 AMenableFeaturePreview("GRADLE_METADATA")
in your settings.gradlelouiscad
06/17/2020, 7:12 AM