diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-07-18 12:18:59 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-14 17:51:11 +0200 |
commit | eae1ce49d18c2978b49166ea502bf2c109a85504 (patch) | |
tree | 477f39e33f14c71042f06eecc938d6efaa95e66c /testApi/src/main | |
parent | 6c635551ed3ea0cfe5f04b54a98cb28225061d26 (diff) | |
download | dokka-eae1ce49d18c2978b49166ea502bf2c109a85504.tar.gz dokka-eae1ce49d18c2978b49166ea502bf2c109a85504.tar.bz2 dokka-eae1ce49d18c2978b49166ea502bf2c109a85504.zip |
Simplify Dokka Gradle Plugin
Diffstat (limited to 'testApi/src/main')
-rw-r--r-- | testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt index 457325cf..6d80d15a 100644 --- a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt +++ b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt @@ -38,7 +38,7 @@ abstract class AbstractCoreTest( logger.info("Output generated under: ${tempDir.root.absolutePath}") val newConfiguration = configuration.copy( - outputDir = tempDir.root.toPath().toAbsolutePath().toString() + outputDir = tempDir.root ) DokkaTestGenerator( newConfiguration, @@ -62,20 +62,21 @@ abstract class AbstractCoreTest( fileMap.materializeFiles(testDirPath.toAbsolutePath()) if (!cleanupOutput) loggerForTest.info("Output generated under: ${testDirPath.toAbsolutePath()}") - val newConfiguration = - configuration.copy( - outputDir = testDirPath.toAbsolutePath().toString(), - sourceSets = configuration.sourceSets.map { sourceSet -> - sourceSet.copy( - sourceRoots = sourceSet.sourceRoots.map { sourceRoot -> - sourceRoot.copy(path = "${testDirPath.toAbsolutePath()}/${sourceRoot.path}") - }, - suppressedFiles = sourceSet.suppressedFiles.map { suppressedFile -> - testDirPath.toAbsolutePath().toFile().resolve(suppressedFile).absolutePath - } - ) - }, - ) + val newConfiguration = configuration.copy( + outputDir = testDirPath.toFile(), + sourceSets = configuration.sourceSets.map { sourceSet -> + sourceSet.copy( + sourceRoots = sourceSet.sourceRoots.map { sourceRoot -> + sourceRoot.copy( + directory = testDirPath.toFile().resolve(sourceRoot.directory) + ) + }, + suppressedFiles = sourceSet.suppressedFiles.map { file -> + testDirPath.toFile().resolve(file) + } + ) + } + ) DokkaTestGenerator( newConfiguration, loggerForTest, @@ -172,8 +173,8 @@ abstract class AbstractCoreTest( var failOnWarning: Boolean = false private val sourceSets = mutableListOf<DokkaSourceSetImpl>() fun build() = DokkaConfigurationImpl( - outputDir = outputDir, - cacheRoot = cacheRoot, + outputDir = File(outputDir), + cacheRoot = cacheRoot?.let(::File), offlineMode = offlineMode, sourceSets = sourceSets, pluginsClasspath = pluginsClasspath, @@ -224,11 +225,11 @@ abstract class AbstractCoreTest( moduleDisplayName = moduleDisplayName ?: moduleName, displayName = displayName, sourceSetID = DokkaSourceSetID(moduleName, name), - classpath = classpath, - sourceRoots = sourceRoots.map { SourceRootImpl(it) }, + classpath = classpath.map(::File), + sourceRoots = sourceRoots.map(::File).map(::SourceRootImpl), dependentSourceSets = dependentSourceSets, - samples = samples, - includes = includes, + samples = samples.map(::File), + includes = includes.map(::File), includeNonPublic = includeNonPublic, includeRootPackage = includeRootPackage, reportUndocumented = reportUndocumented, @@ -242,7 +243,7 @@ abstract class AbstractCoreTest( apiVersion = apiVersion, noStdlibLink = noStdlibLink, noJdkLink = noJdkLink, - suppressedFiles = suppressedFiles, + suppressedFiles = suppressedFiles.map(::File), analysisPlatform = Platform.fromString(analysisPlatform) ) } |