diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2019-04-11 14:46:58 +0200 |
---|---|---|
committer | Kamil Doległo <kamilok1965@interia.pl> | 2019-04-11 14:46:58 +0200 |
commit | 5de1d68ca8510f7bc3601c3516ecb111f7abe44b (patch) | |
tree | 771180ca3b7f284291c9a0c2f49e162a21a103ac | |
parent | c59e7aade5a8ad1f0f93fa6650d39d3ec2fd2bfa (diff) | |
download | dokka-5de1d68ca8510f7bc3601c3516ecb111f7abe44b.tar.gz dokka-5de1d68ca8510f7bc3601c3516ecb111f7abe44b.tar.bz2 dokka-5de1d68ca8510f7bc3601c3516ecb111f7abe44b.zip |
Extract extension names to consts
-rw-r--r-- | runners/gradle-plugin/src/main/kotlin/dokkaTask.kt | 5 | ||||
-rw-r--r-- | runners/gradle-plugin/src/main/kotlin/main.kt | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/dokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/dokkaTask.kt index c95d1039..825830c5 100644 --- a/runners/gradle-plugin/src/main/kotlin/dokkaTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/dokkaTask.kt @@ -183,9 +183,10 @@ open class DokkaTask : DefaultTask() { val gson = GsonBuilder().setPrettyPrinting().create() - val passConfigurationExtension: GradlePassConfigurationImpl? = this.extensions.findByName("passConfiguration") as GradlePassConfigurationImpl + val passConfigurationExtension: GradlePassConfigurationImpl? = this.extensions.findByName( + CONFIGURATION_EXTENSION_NAME) as GradlePassConfigurationImpl? val passConfigurationsContainer by lazy { - (this.extensions.getByName("passConfigurations") as Iterable<GradlePassConfigurationImpl>).toList() + (this.extensions.getByName(MULTIPLATFORM_EXTENSION_NAME) as Iterable<GradlePassConfigurationImpl>).toList() } passConfigurationExtension?.sourceRoots?.addAll(sourceRoots) diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index 865cba2f..dd216f89 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -6,6 +6,9 @@ import java.io.File import java.io.InputStream import java.util.* +internal const val CONFIGURATION_EXTENSION_NAME = "configuration" +internal const val MULTIPLATFORM_EXTENSION_NAME = "multiplatform" + open class DokkaPlugin : Plugin<Project> { override fun apply(project: Project) { @@ -18,8 +21,8 @@ open class DokkaPlugin : Plugin<Project> { } project.tasks.withType(DokkaTask::class.java) { task -> val passConfiguration = project.container(GradlePassConfigurationImpl::class.java) - task.extensions.add("multiplatform", passConfiguration) - task.extensions.create("configuration", GradlePassConfigurationImpl::class.java, "") + task.extensions.add(MULTIPLATFORM_EXTENSION_NAME, passConfiguration) + task.extensions.create(CONFIGURATION_EXTENSION_NAME, GradlePassConfigurationImpl::class.java, "") } } } |