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 PMaddamsson
11/06/2018, 9:40 PMaddamsson
11/06/2018, 9:40 PMaddamsson
11/06/2018, 9:40 PMaddamsson
11/06/2018, 9:40 PMjava
addamsson
11/06/2018, 9:41 PMpublishing
partaddamsson
11/06/2018, 9:43 PMmavenPublication
method at the end: https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-a-multiplatform-projectaddamsson
11/06/2018, 9:43 PMmavenPublication
and publishing
?addamsson
11/06/2018, 9:44 PMh0tk3y
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 { ... } } }
.h0tk3y
11/07/2018, 1:04 PMaddamsson
11/07/2018, 1:23 PMaddamsson
11/07/2018, 1:23 PMaddamsson
11/07/2018, 1:23 PMaddamsson
11/07/2018, 1:26 PMbuild.gradle.kts
so then I could navigate the source code and see what's thereaddamsson
11/07/2018, 1:26 PMaddamsson
11/07/2018, 1:26 PMaddamsson
11/07/2018, 1:30 PMkotlin {
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 defaultaddamsson
11/07/2018, 1:30 PMBy 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.
addamsson
11/07/2018, 1:32 PMmavenPublication {
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?addamsson
11/07/2018, 1:33 PMbuild/libs
directory