Skip to content

Commit

Permalink
Add DGPv2 example projects (#3820)
Browse files Browse the repository at this point in the history
* Add DGPv2 examples

- Convert the existing DGPv1 examples to demonstrate DGPv2.
- Import [Dokkatoo examples](https://github.com/adamko-dev/dokkatoo/tree/v2.4.0/examples).

Part of KT-71346

To keep the PR smaller, tests to ensure these projects work as expected will be added in a following PR.

* add gradle.properties files

* update readme

* fix composite-build-example, and update its README

* Update version-multimodule example readme

* fix typo 2 -> v2

Co-authored-by: Oleg Yukhnevich <[email protected]>

* rename 'custom format' example to 'custom styling', because 'format' is easy to confuse with the Dokka HTML/Javadoc output formats.

* fix typo in 'asyncWithDealy'

* bump kotlinx-coroutines-core in example

* add more KMP examples

* update DGPv2 opt-in flags

* remove custom source set in v2 kmp example

---------

Co-authored-by: Oleg Yukhnevich <[email protected]>
  • Loading branch information
adam-enko and whyoleg authored Sep 24, 2024
1 parent 361f074 commit 2c2db32
Show file tree
Hide file tree
Showing 181 changed files with 4,255 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import kotlinx.coroutines.Deferred
/**
* Common `expect` declaration
*/
expect fun <T> CoroutineScope.asyncWithDealy(delay: Long, block: suspend () -> T): Deferred<T>
expect fun <T> CoroutineScope.asyncWithDelay(delay: Long, block: suspend () -> T): Deferred<T>

/**
* Common coroutine extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import kotlinx.coroutines.Deferred
/**
* JS actual implementation for `asyncWithDelay`
*/
actual fun <T> CoroutineScope.asyncWithDealy(delay: Long, block: suspend () -> T): Deferred<T> {
actual fun <T> CoroutineScope.asyncWithDelay(delay: Long, block: suspend () -> T): Deferred<T> {
TODO("Not yet implemented")
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import kotlinx.coroutines.Deferred
/**
* JVM actual implementation for `asyncWithDelay`
*/
actual fun <T> CoroutineScope.asyncWithDealy(delay: Long, block: suspend () -> T): Deferred<T> {
actual fun <T> CoroutineScope.asyncWithDelay(delay: Long, block: suspend () -> T): Deferred<T> {
TODO("Not yet implemented")
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import kotlinx.coroutines.Deferred
/**
* Linux actual implementation for `asyncWithDelay`
*/
actual fun <T> CoroutineScope.asyncWithDealy(delay: Long, block: suspend () -> T): Deferred<T> {
actual fun <T> CoroutineScope.asyncWithDelay(delay: Long, block: suspend () -> T): Deferred<T> {
TODO("Not yet implemented")
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import kotlinx.coroutines.Deferred
/**
* MacOS actual implementation for `asyncWithDelay`
*/
actual fun <T> CoroutineScope.asyncWithDealy(delay: Long, block: suspend () -> T): Deferred<T> {
actual fun <T> CoroutineScope.asyncWithDelay(delay: Long, block: suspend () -> T): Deferred<T> {
TODO("Not yet implemented")
}
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
<div class="overview">
<span class="navButton" onclick="document.getElementById(&quot;kmp-nav-submenu-2&quot;).classList.toggle(&quot;hidden&quot;);"><span class="navButtonContent"></span></span><a href="../kmp/org.jetbrains.dokka.uitest.kmp.coroutines/index.html"><span>org.</span><wbr><span>jetbrains.</span><wbr><span>dokka.</span><wbr><span>uitest.</span><wbr><span>kmp.</span><wbr><span>coroutines</span></a>
</div>
<div class="sideMenuPart" id="kmp-nav-submenu-2-0" pageid="kmp::org.jetbrains.dokka.uitest.kmp.coroutines//asyncWithDealy/kotlinx.coroutines.CoroutineScope#kotlin.Long#kotlin.coroutines.SuspendFunction0[TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration//1562624156">
<div class="sideMenuPart" id="kmp-nav-submenu-2-0" pageid="kmp::org.jetbrains.dokka.uitest.kmp.coroutines//asyncWithDelay/kotlinx.coroutines.CoroutineScope#kotlin.Long#kotlin.coroutines.SuspendFunction0[TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration//1562624156">
<div class="overview">
<a href="../kmp/org.jetbrains.dokka.uitest.kmp.coroutines/async-with-dealy.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon function"></span><span class="nav-link-child"><span>async</span><wbr><span>With</span><wbr><span><span>Dealy()</span></span></span></span></a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
<div class="overview">
<span class="navButton" onclick="document.getElementById(&quot;kmp-nav-submenu-2&quot;).classList.toggle(&quot;hidden&quot;);"><span class="navButtonContent"></span></span><a href="../kmp/org.jetbrains.dokka.uitest.kmp.coroutines/index.html"><span>org.</span><wbr><span>jetbrains.</span><wbr><span>dokka.</span><wbr><span>uitest.</span><wbr><span>kmp.</span><wbr><span>coroutines</span></a>
</div>
<div class="sideMenuPart" id="kmp-nav-submenu-2-0" pageid="kmp::org.jetbrains.dokka.uitest.kmp.coroutines//asyncWithDealy/kotlinx.coroutines.CoroutineScope#kotlin.Long#kotlin.coroutines.SuspendFunction0[TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration//1562624156">
<div class="sideMenuPart" id="kmp-nav-submenu-2-0" pageid="kmp::org.jetbrains.dokka.uitest.kmp.coroutines//asyncWithDelay/kotlinx.coroutines.CoroutineScope#kotlin.Long#kotlin.coroutines.SuspendFunction0[TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration//1562624156">
<div class="overview">
<a href="../kmp/org.jetbrains.dokka.uitest.kmp.coroutines/async-with-dealy.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon function"></span><span class="nav-link-child"><span>async</span><wbr><span>With</span><wbr><span><span>Dealy()</span></span></span></span></a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html class="no-js">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<title>asyncWithDealy</title>
<title>asyncWithDelay</title>
<link href="../../images/logo-icon.svg" rel="icon" type="image/svg"> <script>var pathToRoot = "../../";</script>
<script>document.documentElement.classList.replace("no-js","js");</script>
<script>const storage = localStorage.getItem("dokka-dark-mode")
Expand Down Expand Up @@ -63,14 +63,14 @@
<div class="sidebar--inner" id="sideMenu"></div>
</div>
<div id="main">
<div class="main-content" data-page-type="member" id="content" pageids="kmp::org.jetbrains.dokka.uitest.kmp.coroutines//asyncWithDealy/kotlinx.coroutines.CoroutineScope#kotlin.Long#kotlin.coroutines.SuspendFunction0[TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration//1562624156">
<div class="breadcrumbs"><a href="../index.html">kmp</a><span class="delimiter">/</span><a href="index.html">org.jetbrains.dokka.uitest.kmp.coroutines</a><span class="delimiter">/</span><span class="current">asyncWithDealy</span></div>
<div class="main-content" data-page-type="member" id="content" pageids="kmp::org.jetbrains.dokka.uitest.kmp.coroutines//asyncWithDelay/kotlinx.coroutines.CoroutineScope#kotlin.Long#kotlin.coroutines.SuspendFunction0[TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration//1562624156">
<div class="breadcrumbs"><a href="../index.html">kmp</a><span class="delimiter">/</span><a href="index.html">org.jetbrains.dokka.uitest.kmp.coroutines</a><span class="delimiter">/</span><span class="current">asyncWithDelay</span></div>
<div class="cover ">
<h1 class="cover"><span>async</span><wbr><span>With</span><wbr><span><span>Dealy</span></span></h1>
</div>
<div class="platform-hinted with-platform-tabs" data-platform-hinted="data-platform-hinted">
<div class="platform-bookmarks-row" data-toggle-list="data-toggle-list"><button class="platform-bookmark" data-filterable-current=":kmp:dokkaHtmlPartial/commonMain" data-filterable-set=":kmp:dokkaHtmlPartial/commonMain" data-active="" data-toggle=":kmp:dokkaHtmlPartial/commonMain">common</button><button class="platform-bookmark" data-filterable-current=":kmp:dokkaHtmlPartial/jsMain" data-filterable-set=":kmp:dokkaHtmlPartial/jsMain" data-toggle=":kmp:dokkaHtmlPartial/jsMain">js</button><button class="platform-bookmark" data-filterable-current=":kmp:dokkaHtmlPartial/jvmMain" data-filterable-set=":kmp:dokkaHtmlPartial/jvmMain" data-toggle=":kmp:dokkaHtmlPartial/jvmMain">jvm</button><button class="platform-bookmark" data-filterable-current=":kmp:dokkaHtmlPartial/linuxMain" data-filterable-set=":kmp:dokkaHtmlPartial/linuxMain" data-toggle=":kmp:dokkaHtmlPartial/linuxMain">linux</button></div>
<div class="content sourceset-dependent-content" data-active="" data-togglable=":kmp:dokkaHtmlPartial/commonMain"><div class="symbol monospace"><span class="token keyword">expect </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt; </span><span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span><span class="token punctuation">.</span><a href="async-with-dealy.html"><span class="token function">asyncWithDealy</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">delay<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html">Long</a><span class="token punctuation">, </span></span><span class="parameter ">block<span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="async-with-dealy.html">T</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><span data-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt;</span></div><p class="paragraph">Common <code class="lang-kotlin">expect</code> declaration</p></div><div class="content sourceset-dependent-content" data-togglable=":kmp:dokkaHtmlPartial/jsMain"><div class="symbol monospace"><span class="token keyword">actual </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt; </span><span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span><span class="token punctuation">.</span><a href="async-with-dealy.html"><span class="token function">asyncWithDealy</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">delay<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html">Long</a><span class="token punctuation">, </span></span><span class="parameter ">block<span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="async-with-dealy.html">T</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><span data-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt;</span></div><p class="paragraph">JS actual implementation for <code class="lang-kotlin">asyncWithDelay</code></p></div><div class="content sourceset-dependent-content" data-togglable=":kmp:dokkaHtmlPartial/jvmMain"><div class="symbol monospace"><span class="token keyword">actual </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt; </span><span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span><span class="token punctuation">.</span><a href="async-with-dealy.html"><span class="token function">asyncWithDealy</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">delay<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html">Long</a><span class="token punctuation">, </span></span><span class="parameter ">block<span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="async-with-dealy.html">T</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><span data-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt;</span></div><p class="paragraph">JVM actual implementation for <code class="lang-kotlin">asyncWithDelay</code></p></div><div class="content sourceset-dependent-content" data-togglable=":kmp:dokkaHtmlPartial/linuxMain"><div class="symbol monospace"><span class="token keyword">actual </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt; </span><span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span><span class="token punctuation">.</span><a href="async-with-dealy.html"><span class="token function">asyncWithDealy</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">delay<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html">Long</a><span class="token punctuation">, </span></span><span class="parameter ">block<span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="async-with-dealy.html">T</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><span data-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt;</span></div><p class="paragraph">Linux actual implementation for <code class="lang-kotlin">asyncWithDelay</code></p></div> </div>
<div class="content sourceset-dependent-content" data-active="" data-togglable=":kmp:dokkaHtmlPartial/commonMain"><div class="symbol monospace"><span class="token keyword">expect </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt; </span><span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span><span class="token punctuation">.</span><a href="async-with-dealy.html"><span class="token function">asyncWithDelay</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">delay<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html">Long</a><span class="token punctuation">, </span></span><span class="parameter ">block<span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="async-with-dealy.html">T</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><span data-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt;</span></div><p class="paragraph">Common <code class="lang-kotlin">expect</code> declaration</p></div><div class="content sourceset-dependent-content" data-togglable=":kmp:dokkaHtmlPartial/jsMain"><div class="symbol monospace"><span class="token keyword">actual </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt; </span><span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span><span class="token punctuation">.</span><a href="async-with-dealy.html"><span class="token function">asyncWithDelay</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">delay<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html">Long</a><span class="token punctuation">, </span></span><span class="parameter ">block<span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="async-with-dealy.html">T</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><span data-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt;</span></div><p class="paragraph">JS actual implementation for <code class="lang-kotlin">asyncWithDelay</code></p></div><div class="content sourceset-dependent-content" data-togglable=":kmp:dokkaHtmlPartial/jvmMain"><div class="symbol monospace"><span class="token keyword">actual </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt; </span><span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span><span class="token punctuation">.</span><a href="async-with-dealy.html"><span class="token function">asyncWithDelay</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">delay<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html">Long</a><span class="token punctuation">, </span></span><span class="parameter ">block<span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="async-with-dealy.html">T</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><span data-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt;</span></div><p class="paragraph">JVM actual implementation for <code class="lang-kotlin">asyncWithDelay</code></p></div><div class="content sourceset-dependent-content" data-togglable=":kmp:dokkaHtmlPartial/linuxMain"><div class="symbol monospace"><span class="token keyword">actual </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt; </span><span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span><span class="token punctuation">.</span><a href="async-with-dealy.html"><span class="token function">asyncWithDelay</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">delay<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html">Long</a><span class="token punctuation">, </span></span><span class="parameter ">block<span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="async-with-dealy.html">T</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><span data-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span><span class="token operator">&lt;</span><a href="async-with-dealy.html">T</a><span class="token operator">&gt;</span></div><p class="paragraph">Linux actual implementation for <code class="lang-kotlin">asyncWithDelay</code></p></div> </div>
</div>
<div class="footer">
<a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a>
Expand All @@ -87,4 +87,3 @@ <h1 class="cover"><span>async</span><wbr><span>With</span><wbr><span><span>Dealy
</div>
</body>
</html>

Loading

0 comments on commit 2c2db32

Please sign in to comment.