https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
l

louiscad

02/23/2019, 1:24 PM
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

serebit

02/23/2019, 4:30 PM
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

louiscad

02/23/2019, 11:00 PM
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

serebit

02/23/2019, 11:00 PM
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

louiscad

02/23/2019, 11:01 PM
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

serebit

02/23/2019, 11:02 PM
Why not just use the jvm plugin for that module?
l

louiscad

02/23/2019, 11:03 PM
Because jvm is not android, and multiplatform plugin makes publishing android library (aar, not jar) easier.
d

darkmoon_uk

08/11/2019, 10:06 PM
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

louiscad

08/11/2019, 10:19 PM
@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.
4 Views