diff options
Diffstat (limited to 'examples/gradle/dokka-multiplatform-example/src')
22 files changed, 119 insertions, 83 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> diff --git a/examples/gradle/dokka-multiplatform-example/src/customJdk9/kotlin/demo/CustomSourceSetFile.kt b/examples/gradle/dokka-multiplatform-example/src/customJdk9/kotlin/org/kotlintest/jdk9/CustomSourceSetFile.kt index 5b642416..d77b959b 100644 --- a/examples/gradle/dokka-multiplatform-example/src/customJdk9/kotlin/demo/CustomSourceSetFile.kt +++ b/examples/gradle/dokka-multiplatform-example/src/customJdk9/kotlin/org/kotlintest/jdk9/CustomSourceSetFile.kt @@ -1,4 +1,4 @@ -package demo +package org.kotlintest.jdk9 /** * This class demonstrates custom dokka source sets diff --git a/examples/gradle/dokka-multiplatform-example/src/linuxMain/kotlin/org/kotlintestmpp/asyncWithDealy.kt b/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/org/kotlintestmpp/JsCoroutineExtensions.kt index 7b5fe652..85d6beb0 100644 --- a/examples/gradle/dokka-multiplatform-example/src/linuxMain/kotlin/org/kotlintestmpp/asyncWithDealy.kt +++ b/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/org/kotlintestmpp/JsCoroutineExtensions.kt @@ -1,8 +1,11 @@ -package org.kotlintestmpp +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/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/org/kotlintestmpp/JsDateUtils.kt b/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/org/kotlintestmpp/JsDateUtils.kt new file mode 100644 index 00000000..2f4f3c45 --- /dev/null +++ b/examples/gradle/dokka-multiplatform-example/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/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/org/kotlintestmpp/JsFunctions.kt b/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/org/kotlintestmpp/JsFunctions.kt new file mode 100644 index 00000000..76757359 --- /dev/null +++ b/examples/gradle/dokka-multiplatform-example/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/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/org/kotlintestmpp/main.kt b/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/org/kotlintestmpp/main.kt deleted file mode 100644 index 8cb66e6d..00000000 --- a/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/org/kotlintestmpp/main.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.kotlintestmpp - -fun main(args : Array<String>) { - console.log("Hello, world!") -} - -fun js(){} -fun shared(){} - -/** - * Actual function for js - */ -actual fun getCurrentDate(): String { - return "test" -} - -fun String.myExtension() = println("test")
\ No newline at end of file diff --git a/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/shouldbesuppressed/supp.kt b/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/shouldbesuppressed/supp.kt deleted file mode 100644 index 21dca566..00000000 --- a/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/shouldbesuppressed/supp.kt +++ /dev/null @@ -1,11 +0,0 @@ -package shouldbesuppressed - -/** - * This function should not be visible - */ -fun thatShouldNotBeVisible(): String = "oops" - -/** - * This class should not be visible - */ -class DontLookAtMe(val stealth: Int = 9001)
\ No newline at end of file diff --git a/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/MainCommand.java b/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/JavaAnnotation.java index 16de8ef3..8b11ca09 100644 --- a/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/MainCommand.java +++ b/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/JavaAnnotation.java @@ -5,12 +5,15 @@ 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 MainCommand { - String command(); +public @interface JavaAnnotation { + String usage(); String[] aliases(); String description(); -}
\ No newline at end of file +} diff --git a/examples/gradle/dokka-multiplatform-example/src/macosMain/kotlin/org/kotlintestmpp/asyncWithDealy.kt b/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/JvmCoroutineExtensions.kt index 7b5fe652..8f7fda49 100644 --- a/examples/gradle/dokka-multiplatform-example/src/macosMain/kotlin/org/kotlintestmpp/asyncWithDealy.kt +++ b/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/JvmCoroutineExtensions.kt @@ -1,8 +1,11 @@ -package org.kotlintestmpp +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/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/JvmDateUtils.kt b/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/JvmDateUtils.kt new file mode 100644 index 00000000..db7f2d74 --- /dev/null +++ b/examples/gradle/dokka-multiplatform-example/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/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/main.kt b/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/JvmFunctions.kt index bc5b53de..0ef8a99d 100644 --- a/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/main.kt +++ b/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/JvmFunctions.kt @@ -1,30 +1,35 @@ package org.kotlintestmpp + import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job import kotlinx.coroutines.launch import org.kotlintestmpp.common.Foo -fun main(args : Array<String>) { - println("Hello, world!") -} - /** + * Function declared in JVM source set + * * also see the [Foo] class * @see org.kotlintestmpp.common.Foo */ -fun jvm(){} -fun shared(){} +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 () } +): Job = launch { TODO() } /** - * Actual function for jvm + * Extension declared in JVM source set */ -actual fun getCurrentDate(): String { - return "test" -} - fun String.myExtension() = println("test2") diff --git a/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/shouldbesuppressed/supp.kt b/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/shouldbesuppressed/supp.kt deleted file mode 100644 index 21dca566..00000000 --- a/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/shouldbesuppressed/supp.kt +++ /dev/null @@ -1,11 +0,0 @@ -package shouldbesuppressed - -/** - * This function should not be visible - */ -fun thatShouldNotBeVisible(): String = "oops" - -/** - * This class should not be visible - */ -class DontLookAtMe(val stealth: Int = 9001)
\ No newline at end of file diff --git a/examples/gradle/dokka-multiplatform-example/src/linuxMain/kotlin/org/kotlintestmpp/cinterop.kt b/examples/gradle/dokka-multiplatform-example/src/linuxMain/kotlin/org/kotlintestmpp/CInterop.kt index efc60f23..c42cfea1 100644 --- a/examples/gradle/dokka-multiplatform-example/src/linuxMain/kotlin/org/kotlintestmpp/cinterop.kt +++ b/examples/gradle/dokka-multiplatform-example/src/linuxMain/kotlin/org/kotlintestmpp/CInterop.kt @@ -5,6 +5,9 @@ package org.kotlintestmpp import kotlinx.cinterop.CPointed import kotlinx.cinterop.CPointer -fun<T: CPointed> printPointerRawValue(pointer: CPointer<T>) { +/** + * Low-level Linux function + */ +fun <T : CPointed> printPointerRawValue(pointer: CPointer<T>) { println(pointer.rawValue) } diff --git a/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/asyncWithDealy.kt b/examples/gradle/dokka-multiplatform-example/src/linuxMain/kotlin/org/kotlintestmpp/LinuxCoroutineExtensions.kt index 7b5fe652..b561272d 100644 --- a/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/asyncWithDealy.kt +++ b/examples/gradle/dokka-multiplatform-example/src/linuxMain/kotlin/org/kotlintestmpp/LinuxCoroutineExtensions.kt @@ -1,8 +1,11 @@ -package org.kotlintestmpp +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/examples/gradle/dokka-multiplatform-example/src/linuxMain/kotlin/org/kotlintestmpp/LinuxDateUtils.kt b/examples/gradle/dokka-multiplatform-example/src/linuxMain/kotlin/org/kotlintestmpp/LinuxDateUtils.kt new file mode 100644 index 00000000..8900f87b --- /dev/null +++ b/examples/gradle/dokka-multiplatform-example/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/examples/gradle/dokka-multiplatform-example/src/linuxMain/kotlin/org/kotlintestmpp/getCurrentDate.kt b/examples/gradle/dokka-multiplatform-example/src/linuxMain/kotlin/org/kotlintestmpp/getCurrentDate.kt deleted file mode 100644 index 86f27c15..00000000 --- a/examples/gradle/dokka-multiplatform-example/src/linuxMain/kotlin/org/kotlintestmpp/getCurrentDate.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.kotlintestmpp - -/** - * Actual function for linux - */ -actual fun getCurrentDate(): String { - TODO("Not yet implemented") -}
\ No newline at end of file diff --git a/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/org/kotlintestmpp/asyncWithDealy.kt b/examples/gradle/dokka-multiplatform-example/src/macosMain/kotlin/org/kotlintestmpp/MacOsCoroutineExtensions.kt index 7b5fe652..8576982c 100644 --- a/examples/gradle/dokka-multiplatform-example/src/jsMain/kotlin/org/kotlintestmpp/asyncWithDealy.kt +++ b/examples/gradle/dokka-multiplatform-example/src/macosMain/kotlin/org/kotlintestmpp/MacOsCoroutineExtensions.kt @@ -1,8 +1,11 @@ -package org.kotlintestmpp +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/examples/gradle/dokka-multiplatform-example/src/macosMain/kotlin/org/kotlintestmpp/MacOsDateUtils.kt b/examples/gradle/dokka-multiplatform-example/src/macosMain/kotlin/org/kotlintestmpp/MacOsDateUtils.kt new file mode 100644 index 00000000..accf98a9 --- /dev/null +++ b/examples/gradle/dokka-multiplatform-example/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") +} diff --git a/examples/gradle/dokka-multiplatform-example/src/macosMain/kotlin/org/kotlintestmpp/getCurrentDate.kt b/examples/gradle/dokka-multiplatform-example/src/macosMain/kotlin/org/kotlintestmpp/getCurrentDate.kt deleted file mode 100644 index 3e7849b6..00000000 --- a/examples/gradle/dokka-multiplatform-example/src/macosMain/kotlin/org/kotlintestmpp/getCurrentDate.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.kotlintestmpp - -/** - * Actual function for mac os - */ -actual fun getCurrentDate(): String { - TODO("Not yet implemented") -}
\ No newline at end of file |