addamsson
11/06/2018, 9:14 AMkotlin-multiplatform
this is not an option because they are not separate projects in Gradle.h0tk3y
11/06/2018, 8:36 PMpublishing { ... }
DSL of the maven-publish
plugin, basically adding another artifact to all of the publications the kotlin-multiplatform
plugin creates.addamsson
11/06/2018, 9:39 PMjava
publishing
partmavenPublication
method at the end: https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-a-multiplatform-projectmavenPublication
and publishing
?h0tk3y
11/07/2018, 1:02 PMpublishing { ... }
is the DSL provided by the Gradle maven-publish
plugin. It contains the publications under the publications
named domain object collection. The MPP docs describe the names of the publications that the kotlin-multiplatform
plugin creates by default here: https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#publishing-a-multiplatform-library. The mavenPublication { ... }
is a shorthand for configuring a publication for a specific target, it is equivalent to configuring publishing { publications { myTargetName { ... } } }
.addamsson
11/07/2018, 1:23 PMbuild.gradle.kts
so then I could navigate the source code and see what's therekotlin {
targets {
fromPreset(presets.jvm, 'jvm') {
tasks.getByName(compilations.main.compileKotlinTaskName).kotlinOptions {
jvmTarget = '1.8'
}
tasks.getByName(compilations.test.compileKotlinTaskName).kotlinOptions {
jvmTarget = '1.8'
}
}
fromPreset(presets.js, 'web') {
tasks.getByName(compilations.main.compileKotlinTaskName).kotlinOptions {
sourceMap = true
}
}
}
}
and no sources.jar gets generated, yet the docs state that it will be generated by defaultBy default, a sources JAR is added to each publication in addition to its main artifact. The sources JAR contains the sources used by the main compilation of the target.
mavenPublication {
artifactId = 'sample-lib-jvm'
artifact(jvmJavadocJar)
}
but what's jvmJavadocJar
? is this some magic variable? Where does it come from? How do I add javadoc for common projects?build/libs
directory