aboutsummaryrefslogtreecommitdiff
path: root/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-01-19 04:10:57 +0100
committerGitHub <noreply@github.com>2023-01-19 04:10:57 +0100
commit5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1 (patch)
treebb62ab50a59cbeca06de6fd1eb5c75ff27bc5bd0 /examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin
parent1fa8552994fb292729eca8c0de6a1561380b008c (diff)
downloaddokka-5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1.tar.gz
dokka-5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1.tar.bz2
dokka-5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1.zip
Revise README documentation for examples and plugins (#2736)
Diffstat (limited to 'examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin')
-rw-r--r--examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/CommonCoroutineExtensions.kt15
-rw-r--r--examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/CommonDateUtils.kt (renamed from examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/getCurrentDate.kt)8
-rw-r--r--examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/common/Foo.kt (renamed from examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org.kotlintestmpp.common/main.kt)3
-rw-r--r--examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/coroutines.kt6
4 files changed, 25 insertions, 7 deletions
diff --git a/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/CommonCoroutineExtensions.kt b/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/CommonCoroutineExtensions.kt
new file mode 100644
index 00000000..30bea657
--- /dev/null
+++ b/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/CommonCoroutineExtensions.kt
@@ -0,0 +1,15 @@
+package org.kotlintestmpp.coroutines
+
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.CoroutineDispatcher
+import kotlinx.coroutines.Deferred
+
+/**
+ * Common `expect` declaration
+ */
+expect fun <T> CoroutineScope.asyncWithDealy(delay: Long, block: suspend () -> T): Deferred<T>
+
+/**
+ * Common coroutine extension
+ */
+fun CoroutineDispatcher.name(): String = TODO("Not implemented")
diff --git a/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/getCurrentDate.kt b/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/CommonDateUtils.kt
index 46a1dd23..b241f5ea 100644
--- a/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/getCurrentDate.kt
+++ b/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/CommonDateUtils.kt
@@ -1,7 +1,13 @@
-package org.kotlintestmpp
+package org.kotlintestmpp.date
+/**
+ * Common `expect` declaration
+ */
expect fun getCurrentDate(): String
+/**
+ * Common date util function
+ */
fun getDate(): String {
return "Today's Date is ${getCurrentDate()}"
}
diff --git a/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org.kotlintestmpp.common/main.kt b/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/common/Foo.kt
index 1746d513..96c825c5 100644
--- a/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org.kotlintestmpp.common/main.kt
+++ b/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/common/Foo.kt
@@ -1,4 +1,7 @@
package org.kotlintestmpp.common
+/**
+ * Common Foo class
+ */
class Foo {}
diff --git a/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/coroutines.kt b/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/coroutines.kt
deleted file mode 100644
index 330cd83a..00000000
--- a/examples/gradle/dokka-multiplatform-example/src/commonMain/kotlin/org/kotlintestmpp/coroutines.kt
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.kotlintestmpp
-
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.Deferred
-
-expect fun <T> CoroutineScope.asyncWithDealy(delay: Long, block: suspend () -> T): Deferred<T>