From 151944295d2824b6137cc12c230c290263be0c5f Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Tue, 2 Aug 2022 18:04:04 +0200 Subject: [PATCH] Minor: minor code cleanup in build.gradle.kts --- build.gradle.kts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index ac96d4e2e36..6fb47808a1c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -69,9 +69,9 @@ val isTeamcityBuild = project.kotlinBuildProperties.isTeamcityBuild val defaultSnapshotVersion: String by extra val buildNumber by extra(findProperty("build.number")?.toString() ?: defaultSnapshotVersion) val kotlinVersion by extra( - findProperty("deployVersion")?.toString()?.let { deploySnapshotStr -> - if (deploySnapshotStr != "default.snapshot") deploySnapshotStr else defaultSnapshotVersion - } ?: buildNumber + findProperty("deployVersion")?.toString()?.let { deploySnapshotStr -> + if (deploySnapshotStr != "default.snapshot") deploySnapshotStr else defaultSnapshotVersion + } ?: buildNumber ) val kotlinLanguageVersion by extra("1.8") @@ -391,11 +391,12 @@ allprojects { val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString() repositories { - when(kotlinBuildProperties.getOrNull("attachedIntellijVersion")) { - null -> {} + when (kotlinBuildProperties.getOrNull("attachedIntellijVersion")) { + null -> {} "master" -> { maven { setUrl("https://www.jetbrains.com/intellij-repository/snapshots") } } + else -> { kotlinBuildLocalRepo(project) } @@ -437,9 +438,7 @@ allprojects { apply { from("libraries/commonConfiguration.gradle") - if (extra.has("isDeployStagingRepoGenerationRequired") && - project.extra["isDeployStagingRepoGenerationRequired"] as Boolean == true - ) { + if (extra.has("isDeployStagingRepoGenerationRequired") && project.extra["isDeployStagingRepoGenerationRequired"] as Boolean) { logger.info("Applying configuration for sonatype release") from("libraries/prepareSonatypeStaging.gradle") } @@ -727,12 +726,14 @@ tasks { register("publishIdeArtifacts") { idePluginDependency { + @Suppress("UNCHECKED_CAST") dependsOn((rootProject.extra["compilerArtifactsForIde"] as List).map { "$it:publish" }) } } register("installIdeArtifacts") { idePluginDependency { + @Suppress("UNCHECKED_CAST") dependsOn((rootProject.extra["compilerArtifactsForIde"] as List).map { "$it:install" }) } }