From f03083d7534209ad94dc3c4d7afd17f58e58127d Mon Sep 17 00:00:00 2001 From: vmishenev Date: Wed, 28 Jul 2021 14:57:38 +0300 Subject: Migrate Dokka examples to Dokka repo (KT-47798) (#2030) * Migrate Dokka examples to Dokka repo (KT-47798) * Configure workflow of examples checking * Add workflow to deploy examples --- .../kotlin/org/kotlintestmpp/MainCommand.java | 16 ++++++++++++ .../kotlin/org/kotlintestmpp/asyncWithDealy.kt | 8 ++++++ .../src/jvmMain/kotlin/org/kotlintestmpp/main.kt | 30 ++++++++++++++++++++++ .../src/jvmMain/kotlin/shouldbesuppressed/supp.kt | 11 ++++++++ 4 files changed, 65 insertions(+) create mode 100644 examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/MainCommand.java create mode 100644 examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/asyncWithDealy.kt create mode 100644 examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/main.kt create mode 100644 examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/shouldbesuppressed/supp.kt (limited to 'examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin') 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/MainCommand.java new file mode 100644 index 00000000..16de8ef3 --- /dev/null +++ b/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/MainCommand.java @@ -0,0 +1,16 @@ +package org.kotlintestmpp; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MainCommand { + String command(); + + String[] aliases(); + + String description(); +} \ No newline at end of file diff --git a/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/asyncWithDealy.kt b/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/asyncWithDealy.kt new file mode 100644 index 00000000..7b5fe652 --- /dev/null +++ b/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/asyncWithDealy.kt @@ -0,0 +1,8 @@ +package org.kotlintestmpp + +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Deferred + +actual fun CoroutineScope.asyncWithDealy(delay: Long, block: suspend () -> T): Deferred { + TODO("Not yet implemented") +} 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/main.kt new file mode 100644 index 00000000..bc5b53de --- /dev/null +++ b/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/org/kotlintestmpp/main.kt @@ -0,0 +1,30 @@ +package org.kotlintestmpp +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Job +import kotlinx.coroutines.launch +import org.kotlintestmpp.common.Foo + +fun main(args : Array) { + println("Hello, world!") +} + +/** + * also see the [Foo] class + * @see org.kotlintestmpp.common.Foo + */ +fun jvm(){} +fun shared(){} +fun CoroutineScope.startConnectionPipeline( + input: String +): Job = launch { TODO () } + +/** + * Actual function for jvm + */ +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 new file mode 100644 index 00000000..21dca566 --- /dev/null +++ b/examples/gradle/dokka-multiplatform-example/src/jvmMain/kotlin/shouldbesuppressed/supp.kt @@ -0,0 +1,11 @@ +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 -- cgit