aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src/test/kotlin/org
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-07-22 14:31:11 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-14 17:51:11 +0200
commitaa21ab173d60bb69e50e7fc321e8b94c2815b6e8 (patch)
tree049c293b502b32130f8ff8b0ab1a90620cea46c1 /runners/gradle-plugin/src/test/kotlin/org
parent9ab5b60c257507ba2159be8b4a8d73f4ac43d9e9 (diff)
downloaddokka-aa21ab173d60bb69e50e7fc321e8b94c2815b6e8.tar.gz
dokka-aa21ab173d60bb69e50e7fc321e8b94c2815b6e8.tar.bz2
dokka-aa21ab173d60bb69e50e7fc321e8b94c2815b6e8.zip
Use Gradle's new Property/Provider APIs
Diffstat (limited to 'runners/gradle-plugin/src/test/kotlin/org')
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTaskTest.kt5
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationJsonTest.kt16
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationSerializableTest.kt16
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt10
4 files changed, 26 insertions, 21 deletions
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTaskTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTaskTest.kt
index 58a44a5c..18128e34 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTaskTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTaskTest.kt
@@ -23,6 +23,11 @@ class DokkaCollectorTaskTest {
project.tasks.withType<AbstractDokkaTask>().configureEach { task ->
task.plugins.withDependencies { dependencies -> dependencies.clear() }
}
+ project.tasks.withType<DokkaTask>().configureEach { task ->
+ task.dokkaSourceSets.configureEach { sourceSet ->
+ sourceSet.classpath.setFrom()
+ }
+ }
}
val collectorTasks = rootProject.tasks.withType<DokkaCollectorTask>()
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationJsonTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationJsonTest.kt
index f6a9c909..7a3bc2bd 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationJsonTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationJsonTest.kt
@@ -26,18 +26,18 @@ class DokkaConfigurationJsonTest {
this.pluginsConfiguration["0"] = "a"
this.pluginsConfiguration["1"] = "b"
this.dokkaSourceSets.create("main") { sourceSet ->
- sourceSet.moduleDisplayName = "moduleDisplayName"
- sourceSet.displayName = "customSourceSetDisplayName"
- sourceSet.reportUndocumented = true
+ sourceSet.moduleDisplayName by "moduleDisplayName"
+ sourceSet.displayName by "customSourceSetDisplayName"
+ sourceSet.reportUndocumented by true
sourceSet.externalDocumentationLink { link ->
- link.packageListUrl = URL("http://some.url")
- link.url = URL("http://some.other.url")
+ link.packageListUrl by URL("http://some.url")
+ link.url by URL("http://some.other.url")
}
sourceSet.perPackageOption { packageOption ->
- packageOption.includeNonPublic = true
- packageOption.reportUndocumented = true
- packageOption.skipDeprecated = true
+ packageOption.includeNonPublic by true
+ packageOption.reportUndocumented by true
+ packageOption.skipDeprecated by true
}
}
}
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationSerializableTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationSerializableTest.kt
index e4fd0676..e4dc5afc 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationSerializableTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationSerializableTest.kt
@@ -34,19 +34,19 @@ class DokkaConfigurationSerializableTest {
this.pluginsConfiguration["0"] = "a"
this.pluginsConfiguration["1"] = "b"
this.dokkaSourceSets.create("main") { sourceSet ->
- sourceSet.moduleDisplayName = "moduleDisplayName"
- sourceSet.displayName = "customSourceSetDisplayName"
- sourceSet.reportUndocumented = true
+ sourceSet.moduleDisplayName by "moduleDisplayName"
+ sourceSet.displayName by "customSourceSetDisplayName"
+ sourceSet.reportUndocumented by true
sourceSet.externalDocumentationLink { link ->
- link.packageListUrl = URL("http://some.url")
- link.url = URL("http://some.other.url")
+ link.packageListUrl by URL("http://some.url")
+ link.url by URL("http://some.other.url")
}
sourceSet.perPackageOption { packageOption ->
- packageOption.includeNonPublic = true
- packageOption.reportUndocumented = true
- packageOption.skipDeprecated = true
+ packageOption.includeNonPublic by true
+ packageOption.reportUndocumented by true
+ packageOption.skipDeprecated by true
}
}
}
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt
index 45551c26..013ad3f2 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt
@@ -36,17 +36,17 @@ class KotlinDslDokkaTaskConfigurationTest {
}
assertEquals(
- 0, commonMain.dependentSourceSets.size,
+ 0, commonMain.dependentSourceSets.get().size,
"Expected no dependent source set in commonMain"
)
assertEquals(
- 1, jvmMain.dependentSourceSets.size,
+ 1, jvmMain.dependentSourceSets.get().size,
"Expected only one dependent source set in jvmMain"
)
assertEquals(
- commonMain.sourceSetID, jvmMain.dependentSourceSets.single(),
+ commonMain.sourceSetID, jvmMain.dependentSourceSets.get().single(),
"Expected jvmMain to depend on commonMain"
)
@@ -70,7 +70,7 @@ class KotlinDslDokkaTaskConfigurationTest {
}
assertEquals(
- commonMain.sourceSetID, jvmMain.dependentSourceSets.single()
+ commonMain.sourceSetID, jvmMain.dependentSourceSets.get().single()
)
}
}
@@ -91,7 +91,7 @@ class KotlinDslDokkaTaskConfigurationTest {
}
assertEquals(
- DokkaSourceSetID(project, "main"), special.dependentSourceSets.single()
+ DokkaSourceSetID(project, "main"), special.dependentSourceSets.get().single()
)
}
}