aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src/main
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-12 14:41:10 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-14 17:51:11 +0200
commit03ea4d233b51cf90b5028586355e0311151b6780 (patch)
tree53b8d9b909613bfc24107c7f96acd5fd989b14f4 /runners/gradle-plugin/src/main
parent334619d42d3c26379429ea8cdab13b28c87c159e (diff)
downloaddokka-03ea4d233b51cf90b5028586355e0311151b6780.tar.gz
dokka-03ea4d233b51cf90b5028586355e0311151b6780.tar.bz2
dokka-03ea4d233b51cf90b5028586355e0311151b6780.zip
DokkaMultiModuleTask: Use Property/Provider API
Diffstat (limited to 'runners/gradle-plugin/src/main')
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout.kt4
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt11
2 files changed, 9 insertions, 6 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout.kt
index e3b82e7c..9da9352c 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout.kt
@@ -47,7 +47,7 @@ interface DokkaMultiModuleFileLayout {
internal fun DokkaMultiModuleTask.targetChildOutputDirectory(
child: AbstractDokkaTask
): File {
- return fileLayout.targetChildOutputDirectory(this, child)
+ return fileLayout.get().targetChildOutputDirectory(this, child)
}
internal fun DokkaMultiModuleTask.copyChildOutputDirectories() {
@@ -57,7 +57,7 @@ internal fun DokkaMultiModuleTask.copyChildOutputDirectories() {
}
internal fun DokkaMultiModuleTask.copyChildOutputDirectory(child: AbstractDokkaTask) {
- val targetChildOutputDirectory = project.file(fileLayout.targetChildOutputDirectory(this, child))
+ val targetChildOutputDirectory = project.file(fileLayout.get().targetChildOutputDirectory(this, child))
val sourceChildOutputDirectory = child.outputDirectory.getSafe()
/* Pointing to the same directory -> No copy necessary */
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt
index 29e0d76e..f6690c3b 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt
@@ -1,6 +1,7 @@
package org.jetbrains.dokka.gradle
import org.gradle.api.internal.tasks.TaskDependencyInternal
+import org.gradle.api.provider.Property
import org.gradle.api.tasks.*
import org.jetbrains.dokka.DokkaConfigurationImpl
import org.jetbrains.dokka.DokkaModuleDescriptionImpl
@@ -19,14 +20,16 @@ open class DokkaMultiModuleTask : AbstractDokkaParentTask(DokkaMultimoduleBootst
* This file has to be placed inside the subproject root directory.
*/
@Internal
- var documentationFileName: String = "README.md"
+ val documentationFileName: Property<String> = project.objects.safeProperty<String>()
+ .safeConvention("README.md")
@Internal
- var fileLayout: DokkaMultiModuleFileLayout = DokkaMultiModuleFileLayout.CompactInParent
+ var fileLayout: Property<DokkaMultiModuleFileLayout> = project.objects.safeProperty<DokkaMultiModuleFileLayout>()
+ .safeConvention(DokkaMultiModuleFileLayout.CompactInParent)
@get:InputFiles
internal val childDocumentationFiles: Iterable<File>
- get() = childDokkaTasks.map { task -> task.project.projectDir.resolve(documentationFileName) }
+ get() = childDokkaTasks.map { task -> task.project.projectDir.resolve(documentationFileName.getSafe()) }
@get:InputFiles
internal val sourceChildOutputDirectories: Iterable<File>
@@ -59,7 +62,7 @@ open class DokkaMultiModuleTask : AbstractDokkaParentTask(DokkaMultimoduleBootst
DokkaModuleDescriptionImpl(
name = dokkaTask.project.name,
path = targetChildOutputDirectory(dokkaTask).relativeTo(outputDirectory.getSafe()),
- docFile = dokkaTask.project.projectDir.resolve(documentationFileName).absoluteFile
+ docFile = dokkaTask.project.projectDir.resolve(documentationFileName.get()).absoluteFile
)
}
)