aboutsummaryrefslogtreecommitdiff
path: root/testApi/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'testApi/src/main')
-rw-r--r--testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt45
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)
)
}