diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2019-04-10 16:55:17 +0200 |
---|---|---|
committer | Kamil Doległo <kamilok1965@interia.pl> | 2019-04-10 16:55:17 +0200 |
commit | 34e4d760d4928a9d97179652764b8d74f99436d3 (patch) | |
tree | bc56afbec395a9c40fb4d3d968eeea0954120ab6 /runners/gradle-plugin/src/main/kotlin | |
parent | 7c56f29fcf550faaf22b81bed4afed8e2f803be1 (diff) | |
download | dokka-34e4d760d4928a9d97179652764b8d74f99436d3.tar.gz dokka-34e4d760d4928a9d97179652764b8d74f99436d3.tar.bz2 dokka-34e4d760d4928a9d97179652764b8d74f99436d3.zip |
Add extension for configuring dokka with one block less when not using multiplatform
Diffstat (limited to 'runners/gradle-plugin/src/main/kotlin')
3 files changed, 9 insertions, 5 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/configurationImplementations.kt b/runners/gradle-plugin/src/main/kotlin/configurationImplementations.kt index ccfa0b12..3e9db147 100644 --- a/runners/gradle-plugin/src/main/kotlin/configurationImplementations.kt +++ b/runners/gradle-plugin/src/main/kotlin/configurationImplementations.kt @@ -19,7 +19,7 @@ class GradleSourceRootImpl: DokkaConfiguration.SourceRoot, Serializable{ override fun toString(): String = path } -class GradlePassConfigurationImpl(@Transient val name: String = ""): DokkaConfiguration.PassConfiguration { +open class GradlePassConfigurationImpl(@Transient val name: String = ""): DokkaConfiguration.PassConfiguration { override var classpath: List<String> = emptyList() override var moduleName: String = "" override var sourceRoots: MutableList<DokkaConfiguration.SourceRoot> = mutableListOf() diff --git a/runners/gradle-plugin/src/main/kotlin/dokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/dokkaTask.kt index 9abd22ed..ed16a909 100644 --- a/runners/gradle-plugin/src/main/kotlin/dokkaTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/dokkaTask.kt @@ -199,16 +199,19 @@ open class DokkaTask : DefaultTask() { val gson = GsonBuilder().setPrettyPrinting().create() + val passConfigurationList = + ((this.extensions.getByName("passConfigurations") as Iterable<GradlePassConfigurationImpl>) + + (this.extensions.getByName("passConfiguration") as GradlePassConfigurationImpl)) + .toList() + .map { defaultPassConfiguration(it) } + val configuration = GradleDokkaConfigurationImpl() configuration.outputDir = outputDirectory configuration.format = outputFormat configuration.generateIndexPages = true configuration.cacheRoot = cacheRoot configuration.impliedPlatforms = impliedPlatforms - configuration.passesConfigurations = - (this.extensions.getByName("passConfigurations") as Iterable<GradlePassConfigurationImpl>) - .toList() - .map { defaultPassConfiguration(it) } + configuration.passesConfigurations = passConfigurationList bootstrapProxy.configure( BiConsumer { level, message -> diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index bde6458a..a5918b0b 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -19,6 +19,7 @@ open class DokkaPlugin : Plugin<Project> { project.tasks.withType(DokkaTask::class.java) { task -> val passConfiguration = project.container(GradlePassConfigurationImpl::class.java) task.extensions.add("passConfigurations", passConfiguration) + task.extensions.create("passConfiguration", GradlePassConfigurationImpl::class.java, "") } } } |