diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2019-08-05 18:08:53 +0300 |
---|---|---|
committer | Kamil Doległo <kamilok1965@interia.pl> | 2019-08-05 18:08:53 +0300 |
commit | e9c62838d5bbf3e2ac62c2f3046b6147ce1c0743 (patch) | |
tree | 32331850046f0a533b15ada6772114d930566e55 /runners/android-gradle-plugin/src/main/kotlin | |
parent | b02a6c8cfbc3b425c3a75b3cffaa073e6527c8cc (diff) | |
download | dokka-e9c62838d5bbf3e2ac62c2f3046b6147ce1c0743.tar.gz dokka-e9c62838d5bbf3e2ac62c2f3046b6147ce1c0743.tar.bz2 dokka-e9c62838d5bbf3e2ac62c2f3046b6147ce1c0743.zip |
Move kotlinTasks, update README, minor refactoring
Diffstat (limited to 'runners/android-gradle-plugin/src/main/kotlin')
-rw-r--r-- | runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt b/runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt index 1daa1035..8aa76ef8 100644 --- a/runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt +++ b/runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt @@ -2,37 +2,16 @@ package org.jetbrains.dokka.gradle import org.gradle.api.Project import org.gradle.api.tasks.Input -import org.gradle.util.GradleVersion import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink.Builder import org.jetbrains.dokka.DokkaConfiguration.SourceRoot import java.io.File open class DokkaAndroidPlugin : DokkaPlugin() { - override fun apply(project: Project) { - DokkaVersion.loadFrom(javaClass.getResourceAsStream("/META-INF/gradle-plugins/org.jetbrains.dokka.properties")) - - val dokkaRuntimeConfiguration = project.configurations.create("dokkaRuntime") - val defaultDokkaRuntimeConfiguration = project.configurations.create("defaultDokkaRuntime") - val taskName = "dokka" - - defaultDokkaRuntimeConfiguration.defaultDependencies{ dependencies -> dependencies.add(project.dependencies.create("org.jetbrains.dokka:dokka-fatjar:${DokkaVersion.version}")) } - - if(GradleVersion.current() >= GradleVersion.version("4.10")) { - project.tasks.register(taskName, DokkaAndroidTask::class.java).configure { - it.outputDirectory = File(project.buildDir, taskName).absolutePath - } - } else { - project.tasks.create(taskName, DokkaAndroidTask::class.java).apply { - outputDirectory = File(project.buildDir, taskName).absolutePath - } - } - project.tasks.withType(DokkaAndroidTask::class.java) { task -> - task.multiplatform = project.container(GradlePassConfigurationImpl::class.java) - task.configuration = GradlePassConfigurationImpl() - task.dokkaRuntime = dokkaRuntimeConfiguration - task.defaultDokkaRuntime = defaultDokkaRuntimeConfiguration - } + override fun apply(project: Project) { + loadDokkaVersion() + val dokkaRuntimeConfiguration = addConfiguration(project) + addTasks(project, dokkaRuntimeConfiguration, DokkaAndroidTask::class.java) } } |