From 7bd7c09c4a1c5add9ab6288249ddfc0464187bfa Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Wed, 18 May 2022 10:58:29 +0300 Subject: [PATCH] Revert "[K/N] Add build-tools as a module for IDEA" This reverts commit c545fd5ef8858c566141a40714f06d0502a1d61d. --- kotlin-native/build-tools/build.gradle.kts | 63 ++++++++++++---------- settings.gradle | 1 - 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/kotlin-native/build-tools/build.gradle.kts b/kotlin-native/build-tools/build.gradle.kts index ece68def300..c0b8713c08f 100644 --- a/kotlin-native/build-tools/build.gradle.kts +++ b/kotlin-native/build-tools/build.gradle.kts @@ -16,19 +16,16 @@ plugins { } buildscript { - val rootBuildDirectory by extra(project.file("../..")) - - apply(from = rootBuildDirectory.resolve("kotlin-native/gradle/loadRootProperties.gradle")) dependencies { - classpath(commonDependency("com.google.code.gson:gson")) + classpath("com.google.code.gson:gson:2.8.6") } } val rootProperties = Properties().apply { - project(":kotlin-native").projectDir.resolve("gradle.properties").reader().use(::load) + rootDir.resolve("../gradle.properties").reader().use(::load) } -val kotlinVersion = project.bootstrapKotlinVersion +val kotlinVersion: String by rootProperties val konanVersion: String by rootProperties val slackApiVersion: String by rootProperties val ktorVersion: String by rootProperties @@ -49,40 +46,50 @@ dependencies { implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion") implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") - implementation("com.ullink.slack:simpleslackapi:$slackApiVersion") { - exclude(group = "com.google.code.gson", module = "gson") // Workaround for Gradle dependency resolution error - } - val versionPropertiesFile = project.rootProject.projectDir.resolve("gradle/versions.properties") - val versionProperties = Properties() - versionPropertiesFile.inputStream().use { propInput -> - versionProperties.load(propInput) - } - configurations.all { - resolutionStrategy.eachDependency { - if (requested.group == "com.google.code.gson" && requested.name == "gson") { - useVersion(versionProperties["versions.gson"] as String) - because("Force using same gson version because of https://github.com/google/gson/pull/1991") - } - } - } + implementation("com.ullink.slack:simpleslackapi:$slackApiVersion") implementation("io.ktor:ktor-client-auth:$ktorVersion") implementation("io.ktor:ktor-client-core:$ktorVersion") implementation("io.ktor:ktor-client-cio:$ktorVersion") - api(project(":native:kotlin-native-utils")) + api("org.jetbrains.kotlin:kotlin-native-utils:$kotlinVersion") // Located in /shared and always provided by the composite build. -// api("org.jetbrains.kotlin:kotlin-native-shared:$kotlinVersion") -// implementation("gradle.plugin.com.github.johnrengelman:shadow:$shadowVersion") -// -// implementation("org.jetbrains.kotlinx:kotlinx-metadata-klib:$metadataVersion") + api("org.jetbrains.kotlin:kotlin-native-shared:$konanVersion") + implementation("gradle.plugin.com.github.johnrengelman:shadow:$shadowVersion") + + implementation("org.jetbrains.kotlinx:kotlinx-metadata-klib:$metadataVersion") } sourceSets["main"].withConvention(KotlinSourceSet::class) { kotlin.srcDir("$projectDir/../tools/benchmarks/shared/src/main/kotlin/report") } +gradlePlugin { + plugins { + create("benchmarkPlugin") { + id = "benchmarking" + implementationClass = "org.jetbrains.kotlin.benchmark.KotlinNativeBenchmarkingPlugin" + } + create("compileBenchmarking") { + id = "compile-benchmarking" + implementationClass = "org.jetbrains.kotlin.benchmark.CompileBenchmarkingPlugin" + } + create("swiftBenchmarking") { + id = "swift-benchmarking" + implementationClass = "org.jetbrains.kotlin.benchmark.SwiftBenchmarkingPlugin" + } + create("compileToBitcode") { + id = "compile-to-bitcode" + implementationClass = "org.jetbrains.kotlin.bitcode.CompileToBitcodePlugin" + } + create("runtimeTesting") { + id = "runtime-testing" + implementationClass = "org.jetbrains.kotlin.testing.native.RuntimeTestingPlugin" + } + } +} + val compileKotlin: KotlinCompile by tasks val compileGroovy: GroovyCompile by tasks @@ -93,6 +100,6 @@ compileKotlin.apply { // Add Kotlin classes to a classpath for the Groovy compiler compileGroovy.apply { - classpath += project.files(compileKotlin.destinationDirectory) + classpath += project.files(compileKotlin.destinationDir) dependsOn(compileKotlin) } diff --git a/settings.gradle b/settings.gradle index 084434809fd..bc38e1a09ac 100644 --- a/settings.gradle +++ b/settings.gradle @@ -805,5 +805,4 @@ if (buildProperties.isKotlinNativeEnabled) { include ':kotlin-native:backend.native:tests' include ":kotlin-native-compiler-embeddable" project(":kotlin-native-compiler-embeddable").projectDir = "$rootDir/kotlin-native/prepare/kotlin-native-embeddable-compiler" as File - include ':kotlin-native:build-tools' }