aboutsummaryrefslogtreecommitdiff
path: root/testApi/src/main/kotlin
diff options
context:
space:
mode:
authorSzymon Świstun <sswistun@virtuslab.com>2020-03-05 11:40:22 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-03-17 12:36:45 +0100
commit8658fd40e3674e29ef10e1fc4289d26caea1e762 (patch)
treedbde63dcb27449907f256b77e7aad437ef697c7c /testApi/src/main/kotlin
parent4002c4e91cb42ef77e93cac57ac49823629d33da (diff)
downloaddokka-8658fd40e3674e29ef10e1fc4289d26caea1e762.tar.gz
dokka-8658fd40e3674e29ef10e1fc4289d26caea1e762.tar.bz2
dokka-8658fd40e3674e29ef10e1fc4289d26caea1e762.zip
Add warning when unused extension points are found
Diffstat (limited to 'testApi/src/main/kotlin')
-rw-r--r--testApi/src/main/kotlin/testApi/context/MockContext.kt6
1 files changed, 5 insertions, 1 deletions
diff --git a/testApi/src/main/kotlin/testApi/context/MockContext.kt b/testApi/src/main/kotlin/testApi/context/MockContext.kt
index 758a4311..d3def4dc 100644
--- a/testApi/src/main/kotlin/testApi/context/MockContext.kt
+++ b/testApi/src/main/kotlin/testApi/context/MockContext.kt
@@ -15,7 +15,8 @@ import kotlin.reflect.full.memberProperties
class MockContext(
vararg extensions: Pair<ExtensionPoint<*>, (DokkaContext) -> Any>,
private val testConfiguration: DokkaConfiguration? = null,
- private val testPlatforms: Map<PlatformData, EnvironmentAndFacade>? = null
+ private val testPlatforms: Map<PlatformData, EnvironmentAndFacade>? = null,
+ private val unusedExtensionPoints: List<ExtensionPoint<*>>? = null
) : DokkaContext {
private val extensionMap by lazy {
extensions.groupBy(Pair<ExtensionPoint<*>, (DokkaContext) -> Any>::first) {
@@ -40,6 +41,9 @@ class MockContext(
override val platforms: Map<PlatformData, EnvironmentAndFacade>
get() = testPlatforms ?: throw IllegalStateException("This mock context doesn't provide platforms data")
+ override val unusedPoints: Collection<ExtensionPoint<*>>
+ get() = unusedExtensionPoints
+ ?: throw IllegalStateException("This mock context doesn't provide unused extension points")
}
private fun DokkaPlugin.injectContext(context: DokkaContext) {