Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build script tweaks #3485

Merged
merged 5 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ plugins {
// because `kotlin-dsl plugin` declares them on task level, and so top-level config is overridden
tasks.withType<KotlinCompile>().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
Expand All @@ -31,5 +31,5 @@ tasks.withType<KotlinCompile>().configureEach {
}

tasks.validatePlugins {
enableStricterValidation.set(true)
enableStricterValidation = true
}
8 changes: 4 additions & 4 deletions build-logic/src/main/kotlin/dokkabuild.java.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {

java {
toolchain {
languageVersion.set(dokkaBuild.mainJavaVersion)
languageVersion = dokkaBuild.mainJavaVersion
}
}

Expand All @@ -26,9 +26,9 @@ tasks.withType<Test>().configureEach {
(Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1
3flex marked this conversation as resolved.
Show resolved Hide resolved
}

javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(dokkaBuild.testJavaLauncherVersion)
})
javaLauncher = javaToolchains.launcherFor {
languageVersion = dokkaBuild.testJavaLauncherVersion
}
}

dependencies {
Expand Down
6 changes: 3 additions & 3 deletions build-logic/src/main/kotlin/dokkabuild.kotlin-jvm.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<MavenPublication>(PublicationName.JVM) {
Expand Down
2 changes: 1 addition & 1 deletion build-settings-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pluginManagement {

@Suppress("UnstableApiUsage")
dependencyResolutionManagement {
repositoriesMode.set(PREFER_SETTINGS)
repositoriesMode = PREFER_SETTINGS
repositories {
mavenCentral()
gradlePluginPortal()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions dokka-integration-tests/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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")
Expand Down
3 changes: 1 addition & 2 deletions dokka-runners/runner-cli/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -22,6 +20,7 @@ plugins {
}

dependencyResolutionManagement {
@Suppress("UnstableApiUsage")
repositories {
mavenCentral()
google()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ dependencies {
testImplementation(libs.gradlePlugin.android)
}

@Suppress("UnstableApiUsage")
gradlePlugin {
plugins {
create("dokka") {
Expand All @@ -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")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -22,6 +20,7 @@ plugins {
}

dependencyResolutionManagement {
@Suppress("UnstableApiUsage")
repositories {
mavenCentral()
google()
Expand Down
3 changes: 1 addition & 2 deletions dokka-runners/runner-maven-plugin/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -22,6 +20,7 @@ plugins {
}

dependencyResolutionManagement {
@Suppress("UnstableApiUsage")
repositories {
mavenCentral()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions dokka-subprojects/analysis-kotlin-symbols/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions dokka-subprojects/plugin-base-frontend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down
7 changes: 4 additions & 3 deletions examples/plugin/hide-internal-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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<KotlinCompile>().configureEach {
compilerOptions.jvmTarget.set(JvmTarget.JVM_1_8)
}
dokkaHtml {
outputDirectory.set(file(dokkaOutputDir))
}
Expand Down
3 changes: 1 addition & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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")
Expand Down