Hi, is there a way to disable the `metadata`/`kotl...
# multiplatform
l
Hi, is there a way to disable the `metadata`/`kotlinMultiplatform` maven publication for a module in a project where gradle metadata is enabled otherwise?
s
The
metadata
publication has nothing to do with gradle metadata. It’s actually the “common” publication, but with a different name to reflect its actual contents
☝️ 1
l
I didn't find a way to prevent its generation, but I could exclude it from publications uploaded to bintray, which is my ultimate goal (although I'd prefer to avoid generating something I don't need)
s
Why do you not want your common artifact uploaded to Bintray?
That’s what the metadata artifact is, it’s the common source set’s artifact
l
Because I just want to publish an android library (aar)
That's the case for some modules of the project. Some are multiplatform, some are Android only.
s
Why not just use the jvm plugin for that module?
l
Because jvm is not android, and multiplatform plugin makes publishing android library (aar, not jar) easier.
d
I'm also interested in this @louiscad; did you ever find a solution? In my case, the fact
coroutines
is using Gradle 4.10 (and it's year-old metadata version) is causing a build failure at the point of republishing meta-data for any modules that depend on
coroutines
- not clear why that is, but I'm having to use Grade
4.8
due to use of Java 12. So moving towards switching
METADATA_PREVIEW
off altogether, for now.
l
@darkmoon_uk Gradle 4.8 is older than 4.10 FYI. Update to Gradle 5.3+ and your problems will be solved as Gradle metadata is now stable (and consuming projects no longer need to enable the feature preview, as it's now only required for publishing it).
✔️ 1
And yes, I found a solution: I need to get the task and use
onlyIf { someBooleanExpression }
or
enable = false
to disable it.