Skip to content

Commit b4182ba

Browse files
committed
Improve build script code
1 parent f50bc87 commit b4182ba

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

library/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.getCurr
22
import org.jetbrains.dokka.base.DokkaBase
33
import org.jetbrains.dokka.base.DokkaBaseConfiguration
44
import org.jetbrains.dokka.gradle.DokkaTask
5-
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
5+
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
66
import java.io.File
77
import java.util.*
88

@@ -30,6 +30,9 @@ version = "2.0.0-alpha"
3030
// See https://central.sonatype.com/namespace/org.jetbrains.compose.material
3131
// for the targets that Compose Multiplatform supports
3232
kotlin {
33+
// Publishes source files; for javadoc/kdoc/dokka see the publications block
34+
withSourcesJar(publish = true)
35+
3336
androidTarget { publishLibraryVariants("release") }
3437
// Windows, Linux, macOS (with Java runtime)
3538
jvm(name = "desktop")
@@ -213,6 +216,7 @@ publishing {
213216
}
214217
}
215218
publications.withType<MavenPublication> {
219+
// Publishes javadoc/kdoc/dokka; for sources see the kotlin block
216220
artifact(javadocJar) // Required a workaround. See below
217221
pom {
218222
url = "https://mahozad.ir/${project.name}"

settings.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ rootProject.name = "wavy-slider-project"
33
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
44

55
include(":library")
6+
// We want the project name to be "wavy-slider" (suffixed with proper platform type) but its directory/folder name to be "library".
7+
// If the project name were not set here, it would be published with its directory/folder name ("library")
8+
// (suffixed with proper platform type added by Kotlin Multiplatform).
69
project(":library").name = "wavy-slider"
710
include(":showcase:shared")
811
include(":showcase:androidApp")

showcase/wasmApp/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
1+
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
22

33
plugins {
44
alias(libs.plugins.kotlin.multiplatform)

0 commit comments

Comments
 (0)