diff --git a/library/build.gradle.kts b/library/build.gradle.kts index 009490f..895ef32 100644 --- a/library/build.gradle.kts +++ b/library/build.gradle.kts @@ -2,7 +2,7 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.getCurr import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.DokkaBaseConfiguration import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl +import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl import java.io.File import java.util.* @@ -30,6 +30,9 @@ version = "2.0.0-alpha" // See https://central.sonatype.com/namespace/org.jetbrains.compose.material // for the targets that Compose Multiplatform supports kotlin { + // Publishes source files; for javadoc/kdoc/dokka see the publications block + withSourcesJar(publish = true) + androidTarget { publishLibraryVariants("release") } // Windows, Linux, macOS (with Java runtime) jvm(name = "desktop") @@ -213,6 +216,7 @@ publishing { } } publications.withType { + // Publishes javadoc/kdoc/dokka; for sources see the kotlin block artifact(javadocJar) // Required a workaround. See below pom { url = "https://mahozad.ir/${project.name}" diff --git a/settings.gradle.kts b/settings.gradle.kts index a99c01d..42a96bf 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,6 +3,9 @@ rootProject.name = "wavy-slider-project" enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") include(":library") +// We want the project name to be "wavy-slider" (suffixed with proper platform type) but its directory/folder name to be "library". +// If the project name were not set here, it would be published with its directory/folder name ("library") +// suffixed with the type of platform added by Kotlin Multiplatform. project(":library").name = "wavy-slider" include(":showcase:shared") include(":showcase:androidApp") diff --git a/showcase/wasmApp/build.gradle.kts b/showcase/wasmApp/build.gradle.kts index 8bdbc96..aa50eb4 100644 --- a/showcase/wasmApp/build.gradle.kts +++ b/showcase/wasmApp/build.gradle.kts @@ -1,4 +1,4 @@ -import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl +import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl plugins { alias(libs.plugins.kotlin.multiplatform)