aboutsummaryrefslogtreecommitdiff
path: root/runners
diff options
context:
space:
mode:
authoraSemy <897017+aSemy@users.noreply.github.com>2023-02-21 17:50:02 +0100
committerGitHub <noreply@github.com>2023-02-21 17:50:02 +0100
commit0a09318eae5b21194507708af51a4469ec5d57aa (patch)
tree2567462cbcc1d936ecc8791c68438e6069eab03f /runners
parentf4a6a6a2d62174989e1106f279a6d578d90c22c1 (diff)
downloaddokka-0a09318eae5b21194507708af51a4469ec5d57aa.tar.gz
dokka-0a09318eae5b21194507708af51a4469ec5d57aa.tar.bz2
dokka-0a09318eae5b21194507708af51a4469ec5d57aa.zip
Apply kotlin-dsl plugin (#2702)
Update code to use idiomatic Gradle API
Diffstat (limited to 'runners')
-rw-r--r--runners/gradle-plugin/build.gradle.kts2
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaLeafTask.kt20
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/gradleConfigurations.kt13
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt6
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaParentTaskTest.kt4
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/ConfigureWithKotlinSourceSetGistTest.kt6
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTaskTest.kt32
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationJsonTest.kt26
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationSerializableTest.kt26
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt16
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTaskTest.kt6
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt10
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt8
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt4
14 files changed, 91 insertions, 88 deletions
diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts
index 2a61294f..2d4f510f 100644
--- a/runners/gradle-plugin/build.gradle.kts
+++ b/runners/gradle-plugin/build.gradle.kts
@@ -2,7 +2,7 @@ import org.gradle.configurationcache.extensions.serviceOf
import org.jetbrains.*
plugins {
- `java-gradle-plugin`
+ `kotlin-dsl`
id("com.gradle.plugin-publish") version "0.20.0"
}
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaLeafTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaLeafTask.kt
index 412695ec..6e34676c 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaLeafTask.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaLeafTask.kt
@@ -4,6 +4,7 @@ import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.internal.plugins.DslObject
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.Nested
+import org.gradle.kotlin.dsl.container
import org.gradle.work.DisableCachingByDefault
@DisableCachingByDefault(because = "Abstract super-class, not to be instantiated directly")
@@ -11,15 +12,14 @@ abstract class AbstractDokkaLeafTask : AbstractDokkaTask() {
@get:Internal
val dokkaSourceSets: NamedDomainObjectContainer<GradleDokkaSourceSetBuilder> =
- project.container(GradleDokkaSourceSetBuilder::class.java, gradleDokkaSourceSetBuilderFactory())
- .also { container ->
- DslObject(this).extensions.add("dokkaSourceSets", container)
- project.kotlinOrNull?.sourceSets?.all { kotlinSourceSet ->
- container.register(kotlinSourceSet.name) { dokkaSourceSet ->
- dokkaSourceSet.configureWithKotlinSourceSet(kotlinSourceSet)
- }
+ project.container(GradleDokkaSourceSetBuilder::class, gradleDokkaSourceSetBuilderFactory()).also { container ->
+ DslObject(this).extensions.add("dokkaSourceSets", container)
+ project.kotlinOrNull?.sourceSets?.all sourceSet@{
+ container.register(name) {
+ configureWithKotlinSourceSet(this@sourceSet)
}
}
+ }
/**
* Only contains source sets that are marked with `isDocumented`.
@@ -29,7 +29,7 @@ abstract class AbstractDokkaLeafTask : AbstractDokkaTask() {
@get:Nested
protected val unsuppressedSourceSets: List<GradleDokkaSourceSetBuilder>
get() = dokkaSourceSets
- .toList()
- .also(::checkSourceSetDependencies)
- .filterNot { it.suppress.getSafe() }
+ .toList()
+ .also(::checkSourceSetDependencies)
+ .filterNot { it.suppress.getSafe() }
}
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/gradleConfigurations.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/gradleConfigurations.kt
index 7b924b75..86dd3716 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/gradleConfigurations.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/gradleConfigurations.kt
@@ -4,17 +4,18 @@ import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.Dependency
import org.gradle.api.attributes.Usage
+import org.gradle.kotlin.dsl.named
internal fun Project.maybeCreateDokkaDefaultPluginConfiguration(): Configuration {
return configurations.maybeCreate("dokkaPlugin") {
- attributes.attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage::class.java, "java-runtime"))
+ attributes.attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage.JAVA_RUNTIME))
isCanBeConsumed = false
}
}
internal fun Project.maybeCreateDokkaDefaultRuntimeConfiguration(): Configuration {
return configurations.maybeCreate("dokkaRuntime") {
- attributes.attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage::class.java, "java-runtime"))
+ attributes.attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage.JAVA_RUNTIME))
isCanBeConsumed = false
}
}
@@ -22,7 +23,7 @@ internal fun Project.maybeCreateDokkaDefaultRuntimeConfiguration(): Configuratio
internal fun Project.maybeCreateDokkaPluginConfiguration(dokkaTaskName: String, additionalDependencies: Collection<Dependency> = emptySet()): Configuration {
return project.configurations.maybeCreate("${dokkaTaskName}Plugin") {
extendsFrom(maybeCreateDokkaDefaultPluginConfiguration())
- attributes.attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage::class.java, "java-runtime"))
+ attributes.attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage.JAVA_RUNTIME))
isCanBeConsumed = false
dependencies.add(project.dokkaArtifacts.dokkaAnalysis) // compileOnly in base plugin
dependencies.add(project.dokkaArtifacts.dokkaBase)
@@ -33,10 +34,10 @@ internal fun Project.maybeCreateDokkaPluginConfiguration(dokkaTaskName: String,
internal fun Project.maybeCreateDokkaRuntimeConfiguration(dokkaTaskName: String): Configuration {
return project.configurations.maybeCreate("${dokkaTaskName}Runtime") {
extendsFrom(maybeCreateDokkaDefaultRuntimeConfiguration())
- attributes.attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage::class.java, "java-runtime"))
+ attributes.attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage.JAVA_RUNTIME))
isCanBeConsumed = false
- defaultDependencies { dependencies ->
- dependencies.add(project.dokkaArtifacts.dokkaCore)
+ defaultDependencies {
+ add(project.dokkaArtifacts.dokkaCore)
}
}
}
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt
index 9fcb8e3b..37ec66c1 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt
@@ -4,6 +4,8 @@ import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Project
import org.gradle.api.UnknownDomainObjectException
import org.gradle.util.Path
+import org.gradle.kotlin.dsl.findByType
+import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
@@ -14,13 +16,13 @@ internal fun parsePath(path: String): Path = Path.path(path)
internal val Project.kotlinOrNull: KotlinProjectExtension?
get() = try {
- project.extensions.findByType(KotlinProjectExtension::class.java)
+ project.extensions.findByType()
} catch (e: NoClassDefFoundError) {
null
}
internal val Project.kotlin: KotlinProjectExtension
- get() = project.extensions.getByType(KotlinProjectExtension::class.java)
+ get() = project.extensions.getByType()
internal fun Project.isAndroidProject() = try {
project.extensions.getByName("android")
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaParentTaskTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaParentTaskTest.kt
index 173c0b53..2cac940f 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaParentTaskTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaParentTaskTest.kt
@@ -19,8 +19,8 @@ class AbstractDokkaParentTaskTest {
private val subSubproject0 = ProjectBuilder.builder().withName("subSubproject0").withParent(subproject0).build()
init {
- rootProject.subprojects { project ->
- project.tasks.create<DokkaTask>("dokkaTask")
+ rootProject.subprojects {
+ tasks.create<DokkaTask>("dokkaTask")
}
}
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/ConfigureWithKotlinSourceSetGistTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/ConfigureWithKotlinSourceSetGistTest.kt
index c06a3992..c1e0c85b 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/ConfigureWithKotlinSourceSetGistTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/ConfigureWithKotlinSourceSetGistTest.kt
@@ -95,9 +95,9 @@ class ConfigureWithKotlinSourceSetGistTest {
mainSourceSet.kotlin.sourceDirectories.elements.get().map { it.asFile }.forEach { it.mkdirs() }
/* Make sure to remove dependencies that cannot be resolved during test */
- project.configurations.configureEach { configuration ->
- configuration.withDependencies { dependencies ->
- dependencies.removeIf { dependency -> dependency !is FileCollectionDependency }
+ project.configurations.configureEach {
+ withDependencies {
+ removeIf { dependency -> dependency !is FileCollectionDependency }
}
}
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 bb2b5c1f..d22dac90 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
@@ -4,6 +4,10 @@ import org.gradle.kotlin.dsl.create
import org.gradle.kotlin.dsl.withType
import org.gradle.testfixtures.ProjectBuilder
import org.jetbrains.dokka.DokkaConfigurationImpl
+import org.jetbrains.dokka.DokkaDefaults.cacheRoot
+import org.jetbrains.dokka.DokkaDefaults.failOnWarning
+import org.jetbrains.dokka.DokkaDefaults.moduleName
+import org.jetbrains.dokka.DokkaDefaults.offlineMode
import org.jetbrains.dokka.DokkaException
import java.io.File
import kotlin.test.Test
@@ -19,25 +23,25 @@ class DokkaCollectorTaskTest {
val childProject = ProjectBuilder.builder().withParent(rootProject).build()
childProject.plugins.apply("org.jetbrains.kotlin.jvm")
- rootProject.allprojects { project ->
- project.plugins.apply("org.jetbrains.dokka")
- project.tasks.withType<AbstractDokkaTask>().configureEach { task ->
- task.plugins.withDependencies { dependencies -> dependencies.clear() }
+ rootProject.allprojects {
+ plugins.apply("org.jetbrains.dokka")
+ tasks.withType<AbstractDokkaTask>().configureEach {
+ plugins.withDependencies { clear() }
}
- project.tasks.withType<DokkaTask>().configureEach { task ->
- task.dokkaSourceSets.configureEach { sourceSet ->
- sourceSet.classpath.setFrom(emptyList<Any>())
+ tasks.withType<DokkaTask>().configureEach {
+ dokkaSourceSets.configureEach {
+ classpath.setFrom(emptyList<Any>())
}
}
}
val collectorTasks = rootProject.tasks.withType<DokkaCollectorTask>()
- collectorTasks.configureEach { task ->
- task.moduleName.set("custom Module Name")
- task.outputDirectory.set(File("customOutputDirectory"))
- task.cacheRoot.set(File("customCacheRoot"))
- task.failOnWarning.set(true)
- task.offlineMode.set(true)
+ collectorTasks.configureEach {
+ moduleName.set("custom Module Name")
+ outputDirectory.set(File("customOutputDirectory"))
+ cacheRoot.set(File("customCacheRoot"))
+ failOnWarning.set(true)
+ offlineMode.set(true)
}
assertTrue(collectorTasks.isNotEmpty(), "Expected at least one collector task")
@@ -68,7 +72,7 @@ class DokkaCollectorTaskTest {
fun `with no child tasks throws DokkaException`() {
val project = ProjectBuilder.builder().build()
val collectorTask = project.tasks.create<DokkaCollectorTask>("collector")
- project.configurations.all { configuration -> configuration.withDependencies { it.clear() } }
+ project.configurations.all { withDependencies { clear() } }
assertFailsWith<DokkaException> { collectorTask.generateDocumentation() }
}
}
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 64aa1334..108c7fe0 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
@@ -15,9 +15,7 @@ class DokkaConfigurationJsonTest {
val project = ProjectBuilder.builder().build()
project.plugins.apply("org.jetbrains.dokka")
val dokkaTask = project.tasks.withType<DokkaTask>().first()
- dokkaTask.plugins.withDependencies { dependencies ->
- dependencies.clear()
- }
+ dokkaTask.plugins.withDependencies { clear() }
dokkaTask.apply {
this.failOnWarning.set(true)
this.offlineMode.set(true)
@@ -29,19 +27,19 @@ class DokkaConfigurationJsonTest {
this.pluginsConfiguration.add(
PluginConfigurationImpl("B", DokkaConfiguration.SerializationFormat.JSON, """ { "key" : "value2" } """)
)
- this.dokkaSourceSets.create("main") { sourceSet ->
- sourceSet.displayName.set("customSourceSetDisplayName")
- sourceSet.reportUndocumented.set(true)
+ this.dokkaSourceSets.create("main") {
+ displayName.set("customSourceSetDisplayName")
+ reportUndocumented.set(true)
- sourceSet.externalDocumentationLink { link ->
- link.packageListUrl.set(URL("http://some.url"))
- link.url.set(URL("http://some.other.url"))
+ externalDocumentationLink {
+ packageListUrl.set(URL("http://some.url"))
+ url.set(URL("http://some.other.url"))
}
- sourceSet.perPackageOption { packageOption ->
- packageOption.includeNonPublic.set(true)
- packageOption.reportUndocumented.set(true)
- packageOption.skipDeprecated.set(true)
- packageOption.documentedVisibilities.set(setOf(DokkaConfiguration.Visibility.PRIVATE))
+ perPackageOption {
+ includeNonPublic.set(true)
+ reportUndocumented.set(true)
+ skipDeprecated.set(true)
+ documentedVisibilities.set(setOf(DokkaConfiguration.Visibility.PRIVATE))
}
}
}
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 ac8f040e..75e2b63e 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
@@ -24,9 +24,7 @@ class DokkaConfigurationSerializableTest {
val project = ProjectBuilder.builder().build()
project.plugins.apply("org.jetbrains.dokka")
val dokkaTask = project.tasks.withType<DokkaTask>().first()
- dokkaTask.plugins.withDependencies { dependencies ->
- dependencies.clear()
- }
+ dokkaTask.plugins.withDependencies { clear() }
dokkaTask.apply {
this.failOnWarning.set(true)
this.offlineMode.set(true)
@@ -34,20 +32,20 @@ class DokkaConfigurationSerializableTest {
this.cacheRoot.set(File("customCacheRoot"))
this.pluginsConfiguration.add(PluginConfigurationImpl("A", DokkaConfiguration.SerializationFormat.JSON, """ { "key" : "value1" } """))
this.pluginsConfiguration.add(PluginConfigurationImpl("B", DokkaConfiguration.SerializationFormat.JSON, """ { "key" : "value2" } """))
- this.dokkaSourceSets.create("main") { sourceSet ->
- sourceSet.displayName.set("customSourceSetDisplayName")
- sourceSet.reportUndocumented.set(true)
+ this.dokkaSourceSets.create("main") {
+ displayName.set("customSourceSetDisplayName")
+ reportUndocumented.set(true)
- sourceSet.externalDocumentationLink { link ->
- link.packageListUrl.set(URL("http://some.url"))
- link.url.set(URL("http://some.other.url"))
+ externalDocumentationLink {
+ packageListUrl.set(URL("http://some.url"))
+ url.set(URL("http://some.other.url"))
}
- sourceSet.perPackageOption { packageOption ->
- packageOption.includeNonPublic.set(true)
- packageOption.reportUndocumented.set(true)
- packageOption.skipDeprecated.set(true)
- packageOption.documentedVisibilities.set(setOf(DokkaConfiguration.Visibility.PRIVATE))
+ perPackageOption {
+ includeNonPublic.set(true)
+ reportUndocumented.set(true)
+ skipDeprecated.set(true)
+ documentedVisibilities.set(setOf(DokkaConfiguration.Visibility.PRIVATE))
}
}
}
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt
index 4bace6d0..c45d5da8 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt
@@ -27,9 +27,9 @@ class DokkaMultiModuleTaskTest {
}
init {
- rootProject.allprojects { project ->
- project.tasks.withType<AbstractDokkaTask>().configureEach { task ->
- task.plugins.withDependencies { dependencies -> dependencies.clear() }
+ rootProject.allprojects {
+ tasks.withType<AbstractDokkaTask>().configureEach {
+ plugins.withDependencies { clear() }
}
}
}
@@ -57,7 +57,7 @@ class DokkaMultiModuleTaskTest {
dokkaSourceSets.create("main")
dokkaSourceSets.create("test")
dokkaSourceSets.configureEach {
- it.includes.from(include1, include2)
+ includes.from(include1, include2)
}
}
@@ -151,7 +151,7 @@ class DokkaMultiModuleTaskTest {
fun `multimodule task with no child tasks throws DokkaException`() {
val project = ProjectBuilder.builder().build()
val multimodule = project.tasks.create<DokkaMultiModuleTask>("multimodule")
- project.configurations.configureEach { it.withDependencies { it.clear() } }
+ project.configurations.configureEach { withDependencies { clear() } }
assertFailsWith<DokkaException> { multimodule.generateDocumentation() }
}
@@ -163,17 +163,17 @@ class DokkaMultiModuleTaskTest {
childDokkaTask.apply {
dokkaSourceSets.create("main") {
- it.includes.from(childDokkaTaskInclude1, childDokkaTaskInclude2)
+ includes.from(childDokkaTaskInclude1, childDokkaTaskInclude2)
}
dokkaSourceSets.create("main2") {
- it.includes.from(childDokkaTaskInclude3)
+ includes.from(childDokkaTaskInclude3)
}
}
val secondChildDokkaTaskInclude = childProject.file("include4")
val secondChildDokkaTask = childProject.tasks.create<DokkaTaskPartial>("secondChildDokkaTask") {
dokkaSourceSets.create("main") {
- it.includes.from(secondChildDokkaTaskInclude)
+ includes.from(secondChildDokkaTaskInclude)
}
}
multiModuleTask.addChildTask(secondChildDokkaTask)
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTaskTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTaskTest.kt
index 85a320a8..31d14544 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTaskTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTaskTest.kt
@@ -11,12 +11,12 @@ class DokkaTaskTest {
fun `no suppressed source sets are present after in built configuration`() {
val project = ProjectBuilder.builder().build()
val task = project.tasks.create<DokkaTask>("dokkaTask")
- project.configurations.all { configuration -> configuration.withDependencies { it.clear() } }
+ project.configurations.all { withDependencies { clear() } }
task.dokkaSourceSets.register("main")
task.dokkaSourceSets.register("jvm")
task.dokkaSourceSets.register("test") {
- it.suppress.set(true)
+ suppress.set(true)
}
assertEquals(
@@ -30,7 +30,7 @@ class DokkaTaskTest {
fun `module version is not present if not specified`(){
val project = ProjectBuilder.builder().build()
val task = project.tasks.create<DokkaTask>("dokkaTask")
- project.configurations.all { configuration -> configuration.withDependencies { it.clear() } }
+ project.configurations.all { withDependencies { clear() } }
task.dokkaSourceSets.register("main")
assertNull(task.buildDokkaConfiguration().moduleVersion)
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt
index e0476c1f..fb834ff8 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt
@@ -225,9 +225,9 @@ class GradleDokkaSourceSetBuilderTest {
})
sourceSet.sourceLink {
- it.remoteLineSuffix.set("ls2")
- it.localDirectory.set(project.file("p2"))
- it.remoteUrl.set(URL("https://u2"))
+ remoteLineSuffix.set("ls2")
+ localDirectory.set(project.file("p2"))
+ remoteUrl.set(URL("https://u2"))
}
sourceSet.sourceLink(project.closureOf<GradleSourceLinkBuilder> {
@@ -269,7 +269,7 @@ class GradleDokkaSourceSetBuilderTest {
})
sourceSet.perPackageOption {
- it.matchingRegex.set("p2.*")
+ matchingRegex.set("p2.*")
}
sourceSet.perPackageOption(project.closureOf<GradlePackageOptionsBuilder> {
@@ -311,7 +311,7 @@ class GradleDokkaSourceSetBuilderTest {
)
sourceSet.externalDocumentationLink {
- it.url.set(URL("https://u2"))
+ url.set(URL("https://u2"))
}
sourceSet.externalDocumentationLink(project.closureOf<GradleExternalDocumentationLinkBuilder> {
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 58b86495..e5b8d091 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
@@ -14,7 +14,7 @@ class KotlinDslDokkaTaskConfigurationTest {
val project = ProjectBuilder.builder().build()
project.plugins.apply("org.jetbrains.dokka")
project.tasks.withType<DokkaTask>().configureEach {
- it.outputDirectory.set(File("test"))
+ outputDirectory.set(File("test"))
}
project.tasks.withType(DokkaTask::class.java).forEach { dokkaTask ->
@@ -31,7 +31,7 @@ class KotlinDslDokkaTaskConfigurationTest {
dokkaTask.dokkaSourceSets.run {
val commonMain = create("commonMain")
val jvmMain = create("jvmMain") {
- it.dependsOn("commonMain")
+ dependsOn("commonMain")
}
assertEquals(
@@ -65,7 +65,7 @@ class KotlinDslDokkaTaskConfigurationTest {
dokkaSourceSets.run {
val commonMain = create("commonMain")
val jvmMain = create("jvmMain") {
- it.dependsOn(commonMain)
+ dependsOn(commonMain)
}
assertEquals(
@@ -86,7 +86,7 @@ class KotlinDslDokkaTaskConfigurationTest {
project.tasks.withType(DokkaTask::class.java).first().apply {
dokkaSourceSets.run {
val special = create("special") {
- it.dependsOn(kotlin.sourceSets.getByName("main"))
+ dependsOn(kotlin.sourceSets.getByName("main"))
}
assertEquals(
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt
index bf3da6ef..dcb537dd 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt
@@ -117,8 +117,8 @@ class KotlinSourceSetGistTest {
/* Only work with file dependencies */
project.configurations.forEach { configuration ->
- configuration.withDependencies { dependencies ->
- dependencies.removeIf { dependency ->
+ configuration.withDependencies {
+ removeIf { dependency ->
dependency !is FileCollectionDependency
}
}