diff --git a/build.gradle.kts b/build.gradle.kts index 19d6819..724b3c5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,8 @@ -import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +@file:OptIn(ExperimentalWasmDsl::class) + +import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import java.net.URI plugins { alias(libs.plugins.kotlin.multiplatform) @@ -24,12 +27,16 @@ kotlin { // We set up custom targets rather than use Arrow Gradle Config for Kotlin, // Since we don't support all targets but only subset where having this behavior makes sense. jvm { - compilations.all { - kotlinOptions.jvmTarget = "1.8" + compilerOptions { + jvmTarget = JvmTarget.JVM_1_8 } } - js(IR) { + js { + nodejs() + } + wasmJs { nodejs() + d8() } linuxArm64() @@ -39,56 +46,39 @@ kotlin { macosX64() sourceSets { - val commonMain by getting { + applyDefaultHierarchyTemplate() + + commonMain { dependencies { api(libs.coroutines) } } - - val jvmMain by getting - val jsMain by getting - val mingwX64Main by getting - val linuxX64Main by getting - val macosArm64Main by getting - val macosX64Main by getting - val linuxArm64Main by getting - - create("nativeMain") { - dependsOn(commonMain) - linuxX64Main.dependsOn(this) - macosArm64Main.dependsOn(this) - macosX64Main.dependsOn(this) - mingwX64Main.dependsOn(this) - linuxArm64Main.dependsOn(this) - } } } -tasks { - withType().configureEach { +dokka { + dokkaPublications.html { outputDirectory.set(rootDir.resolve("docs")) - moduleName.set("suspendapp") - dokkaSourceSets { - named("commonMain") { - includes.from("README.md") - perPackageOption { - matchingRegex.set(".*\\.unsafe.*") - suppress.set(true) - } - externalDocumentationLink("https://kotlinlang.org/api/kotlinx.coroutines/") - sourceLink { - localDirectory.set(file("src/commonMain/kotlin")) - remoteUrl.set(uri("https://github.com/arrow-kt/suspendapp/tree/main/src/commonMain/kotlin").toURL()) - remoteLineSuffix.set("#L") - } + } + moduleName.set("suspendapp") + dokkaSourceSets { + named("commonMain") { + includes.from("README.md") + perPackageOption { + matchingRegex.set(".*\\.unsafe.*") + suppress.set(true) + } + // externalDocumentationLink("https://kotlinlang.org/api/kotlinx.coroutines/") + sourceLink { + localDirectory.set(file("src/commonMain/kotlin")) + remoteUrl.set(URI("https://github.com/arrow-kt/suspendapp/tree/main/src/commonMain/kotlin")) + remoteLineSuffix.set("#L") } } } +} - withType().configureEach { - kotlinOptions.jvmTarget = "1.8" - } - +tasks { register("cleanDocs") { val folder = file("docs").also { it.mkdir() } val docsContent = folder.listFiles().filter { it != folder } diff --git a/docs/images/anchor-copy-button.svg b/docs/images/anchor-copy-button.svg index bab9d74..34eb5b2 100644 --- a/docs/images/anchor-copy-button.svg +++ b/docs/images/anchor-copy-button.svg @@ -1,4 +1,4 @@ - \ No newline at end of file + diff --git a/docs/images/arrow_down.svg b/docs/images/arrow_down.svg deleted file mode 100644 index c0388de..0000000 --- a/docs/images/arrow_down.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/docs/images/copy-icon.svg b/docs/images/copy-icon.svg index 61440f0..abeb27e 100644 --- a/docs/images/copy-icon.svg +++ b/docs/images/copy-icon.svg @@ -1,3 +1,3 @@ - \ No newline at end of file + diff --git a/docs/images/copy-successful-icon.svg b/docs/images/copy-successful-icon.svg index 1865f73..1b0ca52 100644 --- a/docs/images/copy-successful-icon.svg +++ b/docs/images/copy-successful-icon.svg @@ -1,3 +1,3 @@ - \ No newline at end of file + diff --git a/docs/images/footer-go-to-link.svg b/docs/images/footer-go-to-link.svg index 0137e22..c319953 100644 --- a/docs/images/footer-go-to-link.svg +++ b/docs/images/footer-go-to-link.svg @@ -1,3 +1,3 @@ - \ No newline at end of file + diff --git a/docs/images/go-to-top-icon.svg b/docs/images/go-to-top-icon.svg index d987f3e..2341ef2 100644 --- a/docs/images/go-to-top-icon.svg +++ b/docs/images/go-to-top-icon.svg @@ -1,4 +1,4 @@ - \ No newline at end of file + diff --git a/docs/images/logo-icon.svg b/docs/images/logo-icon.svg index 1fea087..ea6f37e 100644 --- a/docs/images/logo-icon.svg +++ b/docs/images/logo-icon.svg @@ -1,3 +1,7 @@ + + @@ -7,4 +11,4 @@ - \ No newline at end of file + diff --git a/docs/images/theme-toggle.svg b/docs/images/theme-toggle.svg deleted file mode 100644 index 2a8d750..0000000 --- a/docs/images/theme-toggle.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index d1f3c8a..6810d64 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,10 +1,11 @@ - + suspendapp + + - + + + -