4

I don't know how to watch the generated kdoc in my Browser.

I'm developing for Android with Kotlin and added dokka as dependency in gradle.
The new dokka Task runs without Errors.

I added dokka as dependency in my Projects build.gradle

dependencies {
...
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.13"
}

and applied the plugin in my apps build.gradle

apply 'kotlin-android'
apply 'kotlin-android-extensions'
apply 'org.jetbrains.dokka'

But I can't find the Output in the Project Folder. How can I watch the Output in my browser or where is it?

Thanks

Edit 1: IDE: Intellij; Kotlin Version: 1.1.1

Edit 2 (11.04.2017):

build.Gradle:

dokka {
    outputDirectory = "$buildDir/docs"
}
lampenlampen
  • 947
  • 6
  • 21

2 Answers2

1

You can control the output directory via the dokka task:

dokka {
    outputDirectory = "$buildDir/docs"
}

To generate the docs, run ./gradlew dokka

I've only done this for non-Android projects, but I believe the process is the same.

hudsonb
  • 2,214
  • 19
  • 20
  • Error: `Cannot assign 'GString' to 'Class'`. It do not create the docs, if I run the task. – lampenlampen Apr 07 '17 at 11:13
  • What does your dokka config block look like? – hudsonb Apr 07 '17 at 14:58
  • The same like yours. But I read in the documentation at Github, that I have to apply `apply plugin: com.android.library`. But I already applied `com.android.application` and both doesn't work at the same time and replacing one with the other doesn't work either. – lampenlampen Apr 11 '17 at 13:59
1

I got it to work.

This post solved the problem.

Apparently dokka is not able to pick up the sourceSets {...} defined in the android {...}-block.

Workaround: duplicate the sourceSets{...} outside the android{...}-block

Community
  • 1
  • 1
lampenlampen
  • 947
  • 6
  • 21