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

Rohan Maity

06/05/2019, 4:56 PM
How Could I produce sources.jar for JVM target in multiplatform project? sourceSet for kotlin is different from normal Java
Copy code
task sourcesJar(type: Jar) {
    from kotlin.sourceSets.jvmMain.allJava
    archiveClassifier = 'sources'
}
I tried this following original java projects. but this didn't work
@russhwolf coud you help ?
r

russhwolf

06/05/2019, 5:09 PM
The multiplatform gradle plugin should be doing that automatically
r

Rohan Maity

06/05/2019, 5:10 PM
No sources.jar is not produced
or may be I wasn't able to find under
build
folder
r

russhwolf

06/05/2019, 5:11 PM
It won't show up in build. It will get included when you run a publish task
r

Rohan Maity

06/05/2019, 5:12 PM
./gradlew publish ?
r

russhwolf

06/05/2019, 5:12 PM
Try running
publishToMavenLocal
and you should see it show up in your local repository which usually lives somewhere like
~/.m2/repository
r

Rohan Maity

06/05/2019, 5:13 PM
I also need to upload these
souces.jar
Oh it did create
soucres.jar
thank you 🙂
👍 1
@russhwolf How do I publish generated
aar
file using bintray? For android
aar
file is generated under
build/outputs/aar
.
publish.gradle
uploads
jar
and dont know how but
klib
file too.
r

russhwolf

06/05/2019, 6:27 PM
(NB I'm not the only person who knows these answers :))
👍 1
For Android you need to manually enable publishing
r

Rohan Maity

06/05/2019, 6:45 PM
Thank you I will take care of this. It created jar file for my android