aboutsummaryrefslogtreecommitdiff
path: root/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src
diff options
context:
space:
mode:
authorAdam <897017+aSemy@users.noreply.github.com>2023-10-20 00:39:12 +1300
committerGitHub <noreply@github.com>2023-10-19 13:39:12 +0200
commit35d15601f2d129a7d3db67dd9e2f4c41c87ef083 (patch)
treef9098cb5b79fc31b4a393347f5cebcf9d87dd139 /dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src
parent8016c1face1283952e228aee348487bf0421ab90 (diff)
downloaddokka-35d15601f2d129a7d3db67dd9e2f4c41c87ef083.tar.gz
dokka-35d15601f2d129a7d3db67dd9e2f4c41c87ef083.tar.bz2
dokka-35d15601f2d129a7d3db67dd9e2f4c41c87ef083.zip
Contribute Dokkatoo (#3188)
Diffstat (limited to 'dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src')
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/commonMain/kotlin/org/kotlintestmpp/CommonCoroutineExtensions.kt15
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/commonMain/kotlin/org/kotlintestmpp/CommonDateUtils.kt14
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/commonMain/kotlin/org/kotlintestmpp/common/Foo.kt7
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/customJdk9/kotlin/org/kotlintest/jdk9/CustomSourceSetFile.kt11
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jsMain/kotlin/org/kotlintestmpp/JsCoroutineExtensions.kt11
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jsMain/kotlin/org/kotlintestmpp/JsDateUtils.kt8
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jsMain/kotlin/org/kotlintestmpp/JsFunctions.kt18
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JavaAnnotation.java19
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JvmCoroutineExtensions.kt11
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JvmDateUtils.kt8
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JvmFunctions.kt35
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/linuxMain/kotlin/org/kotlintestmpp/CInterop.kt15
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/linuxMain/kotlin/org/kotlintestmpp/LinuxCoroutineExtensions.kt11
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/linuxMain/kotlin/org/kotlintestmpp/LinuxDateUtils.kt8
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/macosMain/kotlin/org/kotlintestmpp/MacOsCoroutineExtensions.kt11
-rw-r--r--dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/macosMain/kotlin/org/kotlintestmpp/MacOsDateUtils.kt8
16 files changed, 210 insertions, 0 deletions
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/commonMain/kotlin/org/kotlintestmpp/CommonCoroutineExtensions.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/commonMain/kotlin/org/kotlintestmpp/CommonCoroutineExtensions.kt
new file mode 100644
index 00000000..30bea657
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/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/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/commonMain/kotlin/org/kotlintestmpp/CommonDateUtils.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/commonMain/kotlin/org/kotlintestmpp/CommonDateUtils.kt
new file mode 100644
index 00000000..b241f5ea
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/commonMain/kotlin/org/kotlintestmpp/CommonDateUtils.kt
@@ -0,0 +1,14 @@
+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/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/commonMain/kotlin/org/kotlintestmpp/common/Foo.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/commonMain/kotlin/org/kotlintestmpp/common/Foo.kt
new file mode 100644
index 00000000..96c825c5
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/commonMain/kotlin/org/kotlintestmpp/common/Foo.kt
@@ -0,0 +1,7 @@
+package org.kotlintestmpp.common
+
+/**
+ * Common Foo class
+ */
+class Foo {}
+
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/customJdk9/kotlin/org/kotlintest/jdk9/CustomSourceSetFile.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/customJdk9/kotlin/org/kotlintest/jdk9/CustomSourceSetFile.kt
new file mode 100644
index 00000000..d77b959b
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/customJdk9/kotlin/org/kotlintest/jdk9/CustomSourceSetFile.kt
@@ -0,0 +1,11 @@
+package org.kotlintest.jdk9
+
+/**
+ * This class demonstrates custom dokka source sets
+ */
+class CustomSourceSetFile {
+ /**
+ * This function will not do anything
+ */
+ fun thisIsAFunction() {}
+}
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jsMain/kotlin/org/kotlintestmpp/JsCoroutineExtensions.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jsMain/kotlin/org/kotlintestmpp/JsCoroutineExtensions.kt
new file mode 100644
index 00000000..85d6beb0
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jsMain/kotlin/org/kotlintestmpp/JsCoroutineExtensions.kt
@@ -0,0 +1,11 @@
+package org.kotlintestmpp.coroutines
+
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Deferred
+
+/**
+ * JS actual implementation for `asyncWithDelay`
+ */
+actual fun <T> CoroutineScope.asyncWithDealy(delay: Long, block: suspend () -> T): Deferred<T> {
+ TODO("Not yet implemented")
+}
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jsMain/kotlin/org/kotlintestmpp/JsDateUtils.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jsMain/kotlin/org/kotlintestmpp/JsDateUtils.kt
new file mode 100644
index 00000000..2f4f3c45
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jsMain/kotlin/org/kotlintestmpp/JsDateUtils.kt
@@ -0,0 +1,8 @@
+package org.kotlintestmpp.date
+
+/**
+ * JS actual implementation for `getCurrentDate`
+ */
+actual fun getCurrentDate(): String {
+ return "test"
+}
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jsMain/kotlin/org/kotlintestmpp/JsFunctions.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jsMain/kotlin/org/kotlintestmpp/JsFunctions.kt
new file mode 100644
index 00000000..76757359
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jsMain/kotlin/org/kotlintestmpp/JsFunctions.kt
@@ -0,0 +1,18 @@
+package org.kotlintestmpp
+
+/**
+ * Function declares in JS source set
+ */
+fun js() {}
+
+/**
+ * Function declared in JS source set.
+ *
+ * Function with the same name exists in another source set as well.
+ */
+fun shared() {}
+
+/**
+ * Extension declared in JS source set
+ */
+fun String.myExtension() = println("test")
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JavaAnnotation.java b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JavaAnnotation.java
new file mode 100644
index 00000000..8b11ca09
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JavaAnnotation.java
@@ -0,0 +1,19 @@
+package org.kotlintestmpp;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * This is a Java annotation
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface JavaAnnotation {
+ String usage();
+
+ String[] aliases();
+
+ String description();
+}
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JvmCoroutineExtensions.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JvmCoroutineExtensions.kt
new file mode 100644
index 00000000..8f7fda49
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JvmCoroutineExtensions.kt
@@ -0,0 +1,11 @@
+package org.kotlintestmpp.coroutines
+
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Deferred
+
+/**
+ * JVM actual implementation for `asyncWithDelay`
+ */
+actual fun <T> CoroutineScope.asyncWithDealy(delay: Long, block: suspend () -> T): Deferred<T> {
+ TODO("Not yet implemented")
+}
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JvmDateUtils.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JvmDateUtils.kt
new file mode 100644
index 00000000..db7f2d74
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JvmDateUtils.kt
@@ -0,0 +1,8 @@
+package org.kotlintestmpp.date
+
+/**
+ * JVM actual implementation for `getCurrentDate`
+ */
+actual fun getCurrentDate(): String {
+ return "test"
+}
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JvmFunctions.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JvmFunctions.kt
new file mode 100644
index 00000000..0ef8a99d
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/jvmMain/kotlin/org/kotlintestmpp/JvmFunctions.kt
@@ -0,0 +1,35 @@
+package org.kotlintestmpp
+
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Job
+import kotlinx.coroutines.launch
+import org.kotlintestmpp.common.Foo
+
+/**
+ * Function declared in JVM source set
+ *
+ * also see the [Foo] class
+ * @see org.kotlintestmpp.common.Foo
+ */
+fun jvm() {}
+
+/**
+ * Function declared in JVM source set
+ *
+ * Function with the same name exists in another source set as well.
+ */
+fun shared() {}
+
+/**
+ * Extension declared in JVM source set
+ */
+fun CoroutineScope.startConnectionPipeline(
+ input: String
+): Job = launch { TODO() }
+
+/**
+ * Extension declared in JVM source set
+ */
+fun String.myExtension() = println("test2")
+
+
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/linuxMain/kotlin/org/kotlintestmpp/CInterop.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/linuxMain/kotlin/org/kotlintestmpp/CInterop.kt
new file mode 100644
index 00000000..5c84780b
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/linuxMain/kotlin/org/kotlintestmpp/CInterop.kt
@@ -0,0 +1,15 @@
+@file:Suppress("unused")
+
+package org.kotlintestmpp
+
+import kotlinx.cinterop.CPointed
+import kotlinx.cinterop.CPointer
+import kotlinx.cinterop.ExperimentalForeignApi
+
+/**
+ * Low-level Linux function
+ */
+@OptIn(ExperimentalForeignApi::class)
+fun <T : CPointed> printPointerRawValue(pointer: CPointer<T>) {
+ println(pointer.rawValue)
+}
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/linuxMain/kotlin/org/kotlintestmpp/LinuxCoroutineExtensions.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/linuxMain/kotlin/org/kotlintestmpp/LinuxCoroutineExtensions.kt
new file mode 100644
index 00000000..b561272d
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/linuxMain/kotlin/org/kotlintestmpp/LinuxCoroutineExtensions.kt
@@ -0,0 +1,11 @@
+package org.kotlintestmpp.coroutines
+
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Deferred
+
+/**
+ * Linux actual implementation for `asyncWithDelay`
+ */
+actual fun <T> CoroutineScope.asyncWithDealy(delay: Long, block: suspend () -> T): Deferred<T> {
+ TODO("Not yet implemented")
+}
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/linuxMain/kotlin/org/kotlintestmpp/LinuxDateUtils.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/linuxMain/kotlin/org/kotlintestmpp/LinuxDateUtils.kt
new file mode 100644
index 00000000..8900f87b
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/linuxMain/kotlin/org/kotlintestmpp/LinuxDateUtils.kt
@@ -0,0 +1,8 @@
+package org.kotlintestmpp.date
+
+/**
+ * Linux actual implementation for `getCurrentDate`
+ */
+actual fun getCurrentDate(): String {
+ TODO("Not yet implemented")
+}
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/macosMain/kotlin/org/kotlintestmpp/MacOsCoroutineExtensions.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/macosMain/kotlin/org/kotlintestmpp/MacOsCoroutineExtensions.kt
new file mode 100644
index 00000000..8576982c
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/macosMain/kotlin/org/kotlintestmpp/MacOsCoroutineExtensions.kt
@@ -0,0 +1,11 @@
+package org.kotlintestmpp.coroutines
+
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Deferred
+
+/**
+ * MacOS actual implementation for `asyncWithDelay`
+ */
+actual fun <T> CoroutineScope.asyncWithDealy(delay: Long, block: suspend () -> T): Deferred<T> {
+ TODO("Not yet implemented")
+}
diff --git a/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/macosMain/kotlin/org/kotlintestmpp/MacOsDateUtils.kt b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/macosMain/kotlin/org/kotlintestmpp/MacOsDateUtils.kt
new file mode 100644
index 00000000..accf98a9
--- /dev/null
+++ b/dokka-runners/dokkatoo/examples/multiplatform-example/dokka/src/macosMain/kotlin/org/kotlintestmpp/MacOsDateUtils.kt
@@ -0,0 +1,8 @@
+package org.kotlintestmpp.date
+
+/**
+ * MacOS actual implementation for `getCurrentDate`
+ */
+actual fun getCurrentDate(): String {
+ TODO("Not yet implemented")
+}