aboutsummaryrefslogtreecommitdiff
path: root/runners/maven-plugin/src/main/kotlin
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-07-18 12:18:59 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-14 17:51:11 +0200
commiteae1ce49d18c2978b49166ea502bf2c109a85504 (patch)
tree477f39e33f14c71042f06eecc938d6efaa95e66c /runners/maven-plugin/src/main/kotlin
parent6c635551ed3ea0cfe5f04b54a98cb28225061d26 (diff)
downloaddokka-eae1ce49d18c2978b49166ea502bf2c109a85504.tar.gz
dokka-eae1ce49d18c2978b49166ea502bf2c109a85504.tar.bz2
dokka-eae1ce49d18c2978b49166ea502bf2c109a85504.zip
Simplify Dokka Gradle Plugin
Diffstat (limited to 'runners/maven-plugin/src/main/kotlin')
-rw-r--r--runners/maven-plugin/src/main/kotlin/DokkaMojo.kt21
1 files changed, 12 insertions, 9 deletions
diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
index 514df151..3df2a17e 100644
--- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
+++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
@@ -53,9 +53,12 @@ class ExternalDocumentationLinkBuilder : DokkaConfiguration.ExternalDocumentatio
}
abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependency>) : AbstractMojo() {
- class SourceRoot : DokkaConfiguration.SourceRoot {
+ class SourceRoot : DokkaConfigurationBuilder<DokkaConfiguration.SourceRoot> {
@Parameter(required = true)
- override var path: String = ""
+ var path: String = ""
+ override fun build(): DokkaConfiguration.SourceRoot {
+ return SourceRootImpl(File(path))
+ }
}
@Parameter(defaultValue = "\${project}", readonly = true)
@@ -200,11 +203,11 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc
moduleDisplayName = moduleDisplayName.takeIf(String::isNotBlank) ?: moduleName,
displayName = displayName,
sourceSetID = DokkaSourceSetID(moduleName, sourceSetName),
- classpath = classpath,
- sourceRoots = sourceDirectories.map { SourceRootImpl(it) },
+ classpath = classpath.map(::File),
+ sourceRoots = sourceDirectories.map(::File).map(::SourceRootImpl),
dependentSourceSets = emptySet(),
- samples = samples,
- includes = includes,
+ samples = samples.map(::File),
+ includes = includes.map(::File),
includeNonPublic = includeNonPublic,
includeRootPackage = includeRootPackage,
reportUndocumented = reportUndocumented,
@@ -226,7 +229,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc
apiVersion = apiVersion,
noStdlibLink = noStdlibLink,
noJdkLink = noJdkLink,
- suppressedFiles = suppressedFiles,
+ suppressedFiles = suppressedFiles.map(::File),
analysisPlatform = if (platform.isNotEmpty()) Platform.fromString(platform) else Platform.DEFAULT
).let {
it.copy(
@@ -237,9 +240,9 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc
val logger = MavenDokkaLogger(log)
val configuration = DokkaConfigurationImpl(
- outputDir = getOutDir(),
+ outputDir = File(getOutDir()),
offlineMode = offlineMode,
- cacheRoot = cacheRoot,
+ cacheRoot = cacheRoot?.let(::File),
sourceSets = listOf(sourceSet).also {
if (sourceSet.moduleDisplayName.isEmpty()) logger.warn("Not specified module name. It can result in unexpected behaviour while including documentation for module")
},