diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts index 424e840355..738f84251c 100644 --- a/build-logic/settings.gradle.kts +++ b/build-logic/settings.gradle.kts @@ -6,14 +6,14 @@ rootProject.name = "build-logic" pluginManagement { repositories { - gradlePluginPortal() mavenCentral() + gradlePluginPortal() } includeBuild("../build-settings-logic") } -@Suppress("UnstableApiUsage") dependencyResolutionManagement { + @Suppress("UnstableApiUsage") repositories { mavenCentral() google() diff --git a/build-logic/src/main/kotlin/dokkabuild.gradle-plugin.gradle.kts b/build-logic/src/main/kotlin/dokkabuild.gradle-plugin.gradle.kts index dd8c516ce2..e1ae28705b 100644 --- a/build-logic/src/main/kotlin/dokkabuild.gradle-plugin.gradle.kts +++ b/build-logic/src/main/kotlin/dokkabuild.gradle-plugin.gradle.kts @@ -17,8 +17,8 @@ plugins { // because `kotlin-dsl plugin` declares them on task level, and so top-level config is overridden tasks.withType().configureEach { compilerOptions { - languageVersion.set(dokkaBuild.kotlinLanguageLevel) - apiVersion.set(dokkaBuild.kotlinLanguageLevel) + languageVersion = dokkaBuild.kotlinLanguageLevel + apiVersion = dokkaBuild.kotlinLanguageLevel freeCompilerArgs.addAll( // need 1.4 support, otherwise there might be problems @@ -31,5 +31,5 @@ tasks.withType().configureEach { } tasks.validatePlugins { - enableStricterValidation.set(true) + enableStricterValidation = true } diff --git a/build-logic/src/main/kotlin/dokkabuild.java.gradle.kts b/build-logic/src/main/kotlin/dokkabuild.java.gradle.kts index 68a75181a7..821b313a68 100644 --- a/build-logic/src/main/kotlin/dokkabuild.java.gradle.kts +++ b/build-logic/src/main/kotlin/dokkabuild.java.gradle.kts @@ -13,7 +13,7 @@ plugins { java { toolchain { - languageVersion.set(dokkaBuild.mainJavaVersion) + languageVersion = dokkaBuild.mainJavaVersion } } @@ -26,9 +26,9 @@ tasks.withType().configureEach { (Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1 } - javaLauncher.set(javaToolchains.launcherFor { - languageVersion.set(dokkaBuild.testJavaLauncherVersion) - }) + javaLauncher = javaToolchains.launcherFor { + languageVersion = dokkaBuild.testJavaLauncherVersion + } } dependencies { diff --git a/build-logic/src/main/kotlin/dokkabuild.kotlin-jvm.gradle.kts b/build-logic/src/main/kotlin/dokkabuild.kotlin-jvm.gradle.kts index 782faf320d..1aacaac522 100644 --- a/build-logic/src/main/kotlin/dokkabuild.kotlin-jvm.gradle.kts +++ b/build-logic/src/main/kotlin/dokkabuild.kotlin-jvm.gradle.kts @@ -12,9 +12,9 @@ val rootProjectsWithoutDependencyOnDokkaCore = listOf("dokka-integration-tests") kotlin { explicitApi() compilerOptions { - allWarningsAsErrors.set(true) - languageVersion.set(dokkaBuild.kotlinLanguageLevel) - apiVersion.set(dokkaBuild.kotlinLanguageLevel) + allWarningsAsErrors = true + languageVersion = dokkaBuild.kotlinLanguageLevel + apiVersion = dokkaBuild.kotlinLanguageLevel // These projects know nothing about the `@InternalDokkaApi` annotation, so the Kotlin compiler // will complain about an unresolved opt-in requirement marker and fail the build if it's not excluded. diff --git a/build-logic/src/main/kotlin/dokkabuild.publish-gradle-plugin.gradle.kts b/build-logic/src/main/kotlin/dokkabuild.publish-gradle-plugin.gradle.kts index 454f2a081e..d499dd440b 100644 --- a/build-logic/src/main/kotlin/dokkabuild.publish-gradle-plugin.gradle.kts +++ b/build-logic/src/main/kotlin/dokkabuild.publish-gradle-plugin.gradle.kts @@ -11,8 +11,8 @@ plugins { @Suppress("UnstableApiUsage") gradlePlugin { - website.set("https://kotl.in/dokka") - vcsUrl.set("https://github.com/kotlin/dokka.git") + website = "https://kotl.in/dokka" + vcsUrl = "https://github.com/kotlin/dokka.git" } // com.gradle.plugin-publish configures publication in afterEvaluate block diff --git a/build-logic/src/main/kotlin/dokkabuild.publish-shadow.gradle.kts b/build-logic/src/main/kotlin/dokkabuild.publish-shadow.gradle.kts index bc4986d61b..0386d27658 100644 --- a/build-logic/src/main/kotlin/dokkabuild.publish-shadow.gradle.kts +++ b/build-logic/src/main/kotlin/dokkabuild.publish-shadow.gradle.kts @@ -17,9 +17,9 @@ java { tasks.shadowJar { // separate directory because otherwise Gradle complains about multiple tasks writing into the same file - destinationDirectory.set(project.layout.buildDirectory.dir("shadowLibs")) + destinationDirectory = project.layout.buildDirectory.dir("shadowLibs") // removes the `-all` classifier from the artifact name - archiveClassifier.set("") + archiveClassifier = "" } publishing.publications.register(PublicationName.JVM) { diff --git a/build-settings-logic/settings.gradle.kts b/build-settings-logic/settings.gradle.kts index f8b15b0496..34383096ae 100644 --- a/build-settings-logic/settings.gradle.kts +++ b/build-settings-logic/settings.gradle.kts @@ -15,7 +15,7 @@ pluginManagement { @Suppress("UnstableApiUsage") dependencyResolutionManagement { - repositoriesMode.set(PREFER_SETTINGS) + repositoriesMode = PREFER_SETTINGS repositories { mavenCentral() gradlePluginPortal() diff --git a/dokka-integration-tests/gradle/projects/it-android-0/settings.gradle.kts b/dokka-integration-tests/gradle/projects/it-android-0/settings.gradle.kts index 90eb34d52b..dfb9559358 100644 --- a/dokka-integration-tests/gradle/projects/it-android-0/settings.gradle.kts +++ b/dokka-integration-tests/gradle/projects/it-android-0/settings.gradle.kts @@ -2,7 +2,5 @@ * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -@file:Suppress("LocalVariableName", "UnstableApiUsage") - apply(from = "template.settings.gradle.kts") rootProject.name = "it-android-0" diff --git a/dokka-integration-tests/gradle/projects/it-basic-groovy/settings.gradle.kts b/dokka-integration-tests/gradle/projects/it-basic-groovy/settings.gradle.kts index aae085b4bb..2d388a51d5 100644 --- a/dokka-integration-tests/gradle/projects/it-basic-groovy/settings.gradle.kts +++ b/dokka-integration-tests/gradle/projects/it-basic-groovy/settings.gradle.kts @@ -2,7 +2,5 @@ * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -@file:Suppress("LocalVariableName", "UnstableApiUsage") - apply(from = "template.settings.gradle.kts") rootProject.name = "it-basic-groovy" diff --git a/dokka-integration-tests/gradle/projects/it-basic/settings.gradle.kts b/dokka-integration-tests/gradle/projects/it-basic/settings.gradle.kts index fc41b3f23e..ccfb4d8968 100644 --- a/dokka-integration-tests/gradle/projects/it-basic/settings.gradle.kts +++ b/dokka-integration-tests/gradle/projects/it-basic/settings.gradle.kts @@ -2,7 +2,5 @@ * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -@file:Suppress("LocalVariableName", "UnstableApiUsage") - apply(from = "template.settings.gradle.kts") rootProject.name = "it-basic" diff --git a/dokka-integration-tests/gradle/projects/it-js-ir-0/settings.gradle.kts b/dokka-integration-tests/gradle/projects/it-js-ir-0/settings.gradle.kts index d463d7603b..138ff08e32 100644 --- a/dokka-integration-tests/gradle/projects/it-js-ir-0/settings.gradle.kts +++ b/dokka-integration-tests/gradle/projects/it-js-ir-0/settings.gradle.kts @@ -2,7 +2,5 @@ * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -@file:Suppress("LocalVariableName", "UnstableApiUsage") - apply(from = "template.settings.gradle.kts") rootProject.name = "it-js-ir-0" diff --git a/dokka-integration-tests/gradle/projects/it-sequential-tasks-execution-stress/settings.gradle.kts b/dokka-integration-tests/gradle/projects/it-sequential-tasks-execution-stress/settings.gradle.kts index 3d8805d2ed..4fbd05f6d9 100644 --- a/dokka-integration-tests/gradle/projects/it-sequential-tasks-execution-stress/settings.gradle.kts +++ b/dokka-integration-tests/gradle/projects/it-sequential-tasks-execution-stress/settings.gradle.kts @@ -2,7 +2,5 @@ * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -@file:Suppress("LocalVariableName", "UnstableApiUsage") - apply(from = "template.settings.gradle.kts") rootProject.name = "it-sequential-tasks-execution-stress" diff --git a/dokka-integration-tests/gradle/projects/template.settings.gradle.kts b/dokka-integration-tests/gradle/projects/template.settings.gradle.kts index d6d397df1f..a0133676d0 100644 --- a/dokka-integration-tests/gradle/projects/template.settings.gradle.kts +++ b/dokka-integration-tests/gradle/projects/template.settings.gradle.kts @@ -2,8 +2,6 @@ * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -@file:Suppress("LocalVariableName", "UnstableApiUsage") - pluginManagement { val dokka_it_kotlin_version: String by settings val dokka_it_dokka_version: String by settings diff --git a/dokka-integration-tests/settings.gradle.kts b/dokka-integration-tests/settings.gradle.kts index 7d824a9c26..a490c21857 100644 --- a/dokka-integration-tests/settings.gradle.kts +++ b/dokka-integration-tests/settings.gradle.kts @@ -2,8 +2,6 @@ * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -@file:Suppress("UnstableApiUsage") - rootProject.name = "dokka-integration-tests" pluginManagement { @@ -22,6 +20,7 @@ plugins { } dependencyResolutionManagement { + @Suppress("UnstableApiUsage") repositories { maven("https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide") maven("https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide-plugin-dependencies") diff --git a/dokka-runners/runner-cli/settings.gradle.kts b/dokka-runners/runner-cli/settings.gradle.kts index 9f5f484c28..83f87117ca 100644 --- a/dokka-runners/runner-cli/settings.gradle.kts +++ b/dokka-runners/runner-cli/settings.gradle.kts @@ -2,8 +2,6 @@ * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -@file:Suppress("UnstableApiUsage") - rootProject.name = "runner-cli" pluginManagement { @@ -22,6 +20,7 @@ plugins { } dependencyResolutionManagement { + @Suppress("UnstableApiUsage") repositories { mavenCentral() google() diff --git a/dokka-runners/runner-gradle-plugin-classic/build.gradle.kts b/dokka-runners/runner-gradle-plugin-classic/build.gradle.kts index e7bd60fc14..247b933881 100644 --- a/dokka-runners/runner-gradle-plugin-classic/build.gradle.kts +++ b/dokka-runners/runner-gradle-plugin-classic/build.gradle.kts @@ -27,7 +27,6 @@ dependencies { testImplementation(libs.gradlePlugin.android) } -@Suppress("UnstableApiUsage") gradlePlugin { plugins { create("dokka") { @@ -36,6 +35,7 @@ gradlePlugin { displayName = "Dokka plugin" description = "Dokka is an API documentation engine for Kotlin" + @Suppress("UnstableApiUsage") tags.addAll("dokka", "kotlin", "kdoc", "android", "documentation", "api") } } diff --git a/dokka-runners/runner-gradle-plugin-classic/settings.gradle.kts b/dokka-runners/runner-gradle-plugin-classic/settings.gradle.kts index c607d588b5..59793077c1 100644 --- a/dokka-runners/runner-gradle-plugin-classic/settings.gradle.kts +++ b/dokka-runners/runner-gradle-plugin-classic/settings.gradle.kts @@ -2,8 +2,6 @@ * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -@file:Suppress("UnstableApiUsage") - rootProject.name = "runner-gradle-plugin-classic" pluginManagement { @@ -22,6 +20,7 @@ plugins { } dependencyResolutionManagement { + @Suppress("UnstableApiUsage") repositories { mavenCentral() google() diff --git a/dokka-runners/runner-maven-plugin/settings.gradle.kts b/dokka-runners/runner-maven-plugin/settings.gradle.kts index 5820fba0f8..e88d695ed9 100644 --- a/dokka-runners/runner-maven-plugin/settings.gradle.kts +++ b/dokka-runners/runner-maven-plugin/settings.gradle.kts @@ -2,8 +2,6 @@ * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -@file:Suppress("UnstableApiUsage") - rootProject.name = "runner-maven-plugin" pluginManagement { @@ -22,6 +20,7 @@ plugins { } dependencyResolutionManagement { + @Suppress("UnstableApiUsage") repositories { mavenCentral() } diff --git a/dokka-subprojects/analysis-kotlin-descriptors/build.gradle.kts b/dokka-subprojects/analysis-kotlin-descriptors/build.gradle.kts index 48c5ce51c7..3727755d2b 100644 --- a/dokka-subprojects/analysis-kotlin-descriptors/build.gradle.kts +++ b/dokka-subprojects/analysis-kotlin-descriptors/build.gradle.kts @@ -63,8 +63,8 @@ val shadowDependenciesJar by tasks.registering(ShadowJar::class) { group = "shadow" description = "Create a shadow jar from dependencies without fastutil" - archiveClassifier.set("dependencies") - destinationDirectory.set(project.layout.buildDirectory.dir("shadowDependenciesLibs")) + archiveClassifier = "dependencies" + destinationDirectory = project.layout.buildDirectory.dir("shadowDependenciesLibs") // we need to create JAR with dependencies, but without fastutil, // so we include `runtimeClasspath` configuration (the same configuration which is used by default `shadowJar` task) diff --git a/dokka-subprojects/analysis-kotlin-symbols/build.gradle.kts b/dokka-subprojects/analysis-kotlin-symbols/build.gradle.kts index 3d71a92cd1..5f966523a6 100644 --- a/dokka-subprojects/analysis-kotlin-symbols/build.gradle.kts +++ b/dokka-subprojects/analysis-kotlin-symbols/build.gradle.kts @@ -125,8 +125,8 @@ val shadowDependenciesJar by tasks.registering(ShadowJar::class) { group = "shadow" description = "Create a shadow jar from dependencies without fastutil" - archiveClassifier.set("dependencies") - destinationDirectory.set(project.layout.buildDirectory.dir("shadowDependenciesLibs")) + archiveClassifier = "dependencies" + destinationDirectory = project.layout.buildDirectory.dir("shadowDependenciesLibs") // we need to create JAR with dependencies, but without fastutil, // so we include `runtimeClasspath` configuration (the same configuration which is used by default `shadowJar` task) diff --git a/dokka-subprojects/plugin-base-frontend/build.gradle.kts b/dokka-subprojects/plugin-base-frontend/build.gradle.kts index 28ffc9577b..b29bb1e495 100644 --- a/dokka-subprojects/plugin-base-frontend/build.gradle.kts +++ b/dokka-subprojects/plugin-base-frontend/build.gradle.kts @@ -12,11 +12,11 @@ plugins { } node { - version.set(libs.versions.node) + version = libs.versions.node // https://github.com/node-gradle/gradle-node-plugin/blob/3.5.1/docs/faq.md#is-this-plugin-compatible-with-centralized-repositories-declaration - download.set(true) - distBaseUrl.set(null as String?) // Strange cast to avoid overload ambiguity + download = true + distBaseUrl = null as String? // Strange cast to avoid overload ambiguity // Stop Gradle from monitoring node_modules dir; it will be managed by NPM. This helps performance and task-avoidance. fastNpmInstall = true @@ -27,7 +27,7 @@ val distributionDirectory = layout.projectDirectory.dir("dist") val npmRunBuild by tasks.registering(NpmTask::class) { dependsOn(tasks.npmInstall) - npmCommand.set(parseSpaceSeparatedArgs("run build")) + npmCommand = parseSpaceSeparatedArgs("run build") inputs.dir("src/main") .withPropertyName("mainSources") diff --git a/examples/plugin/hide-internal-api/build.gradle.kts b/examples/plugin/hide-internal-api/build.gradle.kts index 3db275839e..2e09936196 100644 --- a/examples/plugin/hide-internal-api/build.gradle.kts +++ b/examples/plugin/hide-internal-api/build.gradle.kts @@ -31,12 +31,13 @@ dependencies { testImplementation("org.jetbrains.dokka:dokka-base-test-utils:$dokkaVersion") } +kotlin { + compilerOptions.jvmTarget.set(JvmTarget.JVM_1_8) +} + val dokkaOutputDir = "$buildDir/dokka" tasks { - withType().configureEach { - compilerOptions.jvmTarget.set(JvmTarget.JVM_1_8) - } dokkaHtml { outputDirectory.set(file(dokkaOutputDir)) } diff --git a/settings.gradle.kts b/settings.gradle.kts index 9da9e287d3..df248a37eb 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -2,8 +2,6 @@ * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -@file:Suppress("UnstableApiUsage") - rootProject.name = "dokka" pluginManagement { @@ -17,6 +15,7 @@ pluginManagement { } dependencyResolutionManagement { + @Suppress("UnstableApiUsage") repositories { maven("https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide") maven("https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide-plugin-dependencies")