# How to configure Dokka for kotlin-multiplatform

**URL:** <https://discuss.kotlinlang.org/t/how-to-configure-dokka-for-kotlin-multiplatform/9834>\
**Category:** Support\
**Created:** [October 14, 2018, 11:03am UTC](https://discuss.kotlinlang.org/t/how-to-configure-dokka-for-kotlin-multiplatform/9834 "2018-10-14T11:03:32Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![knolle](https://avatars.discourse-cdn.com/v4/letter/k/a9adbd/32.png) [@knolle](https://discuss.kotlinlang.org/u/knolle)\
**Post date:** [October 18, 2018, 7:14am UTC](https://discuss.kotlinlang.org/t/how-to-configure-dokka-for-kotlin-multiplatform/9834/2 "2018-10-18T07:14:03Z")

</div>

Dokka does not yet really work with new MPP but I figured out a solution that works for me:

```
dokka {
    impliedPlatforms = ["Common"] // This will force platform tags for all non-common sources e.g. "JVM"
    kotlinTasks {
        // dokka fails to retrieve sources from MPP-tasks so they must be set empty to avoid exception
        // use sourceRoot instead (see below)
        []
    }
    sourceRoot {
        // assuming there is only a single source dir...
        path = kotlin.sourceSets.commonMain.kotlin.srcDirs[0]
        platforms = ["Common"]
    }
    sourceRoot {
        // assuming there is only a single source dir...
        path = kotlin.sourceSets.jvmMain.kotlin.srcDirs[0]
        platforms = ["JVM"]
    }
}

```

Good luck!

---

_[View the full topic](https://discuss.kotlinlang.org/t/how-to-configure-dokka-for-kotlin-multiplatform/9834)._
