From 71eaa43d95baeb7efb5487613d7be4e7503e1adc Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Wed, 1 Feb 2023 16:24:45 +0100 Subject: [PATCH] [K/N][build] Move Native plugin to build-tools This is K/N only plugin that shouldn't be in the buildSrc of the whole Kotlin project --- buildSrc/build.gradle.kts | 11 +---------- kotlin-native/Interop/Indexer/build.gradle.kts | 6 +++--- kotlin-native/Interop/Runtime/build.gradle.kts | 13 ++++--------- kotlin-native/backend.native/build.gradle | 2 +- .../org/jetbrains/kotlin}/tools/NativePlugin.kt | 4 ++-- kotlin-native/llvmDebugInfoC/build.gradle.kts | 4 ++-- 6 files changed, 13 insertions(+), 27 deletions(-) rename {buildSrc/src/main/kotlin/org/jetbrains/gradle/plugins => kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin}/tools/NativePlugin.kt (98%) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 928f01cfc7d..3c1b0f46dfe 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -140,13 +140,4 @@ tasks.withType().configureEach { allprojects { tasks.register("checkBuild") -} - -gradlePlugin { - plugins { - create("native") { - id = "native" - implementationClass = "org.jetbrains.gradle.plugins.tools.NativePlugin" - } - } -} +} \ No newline at end of file diff --git a/kotlin-native/Interop/Indexer/build.gradle.kts b/kotlin-native/Interop/Indexer/build.gradle.kts index d1d5adb3b14..fbc56cad0c5 100644 --- a/kotlin-native/Interop/Indexer/build.gradle.kts +++ b/kotlin-native/Interop/Indexer/build.gradle.kts @@ -14,8 +14,8 @@ * limitations under the License. */ -import org.jetbrains.gradle.plugins.tools.lib -import org.jetbrains.gradle.plugins.tools.solib +import org.jetbrains.kotlin.tools.lib +import org.jetbrains.kotlin.tools.solib import org.jetbrains.kotlin.* import org.jetbrains.kotlin.konan.target.* import org.jetbrains.kotlin.konan.target.ClangArgs @@ -26,7 +26,7 @@ plugins { `kotlin` id("kotlin.native.build-tools-conventions") id("native-interop-plugin") - `native` + id("native") } diff --git a/kotlin-native/Interop/Runtime/build.gradle.kts b/kotlin-native/Interop/Runtime/build.gradle.kts index 38d799921f9..2009a9df704 100644 --- a/kotlin-native/Interop/Runtime/build.gradle.kts +++ b/kotlin-native/Interop/Runtime/build.gradle.kts @@ -13,19 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import org.jetbrains.gradle.plugins.tools.lib -import org.jetbrains.gradle.plugins.tools.solib +import org.jetbrains.kotlin.tools.lib +import org.jetbrains.kotlin.tools.solib import org.jetbrains.kotlin.* -val kotlinVersion = project.bootstrapKotlinVersion plugins { - `native` - `kotlin` + kotlin + id("native") } -//apply plugin: 'c' - - - native { val isWindows = PlatformInfo.isWindows() diff --git a/kotlin-native/backend.native/build.gradle b/kotlin-native/backend.native/build.gradle index 226df4422b7..f69cd67d5ef 100644 --- a/kotlin-native/backend.native/build.gradle +++ b/kotlin-native/backend.native/build.gradle @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.cpp.CppConsumerPlugin import org.jetbrains.kotlin.cpp.CppUsage import org.jetbrains.kotlin.cpp.DependencyHandlerExKt -import org.jetbrains.gradle.plugins.tools.* +import org.jetbrains.kotlin.tools.NativePluginKt /* * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. diff --git a/buildSrc/src/main/kotlin/org/jetbrains/gradle/plugins/tools/NativePlugin.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/tools/NativePlugin.kt similarity index 98% rename from buildSrc/src/main/kotlin/org/jetbrains/gradle/plugins/tools/NativePlugin.kt rename to kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/tools/NativePlugin.kt index 4d0c0480c2a..6c1efa84a78 100644 --- a/buildSrc/src/main/kotlin/org/jetbrains/gradle/plugins/tools/NativePlugin.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/tools/NativePlugin.kt @@ -1,9 +1,9 @@ /* - * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.gradle.plugins.tools +package org.jetbrains.kotlin.tools import org.gradle.api.DefaultTask import org.gradle.api.Plugin diff --git a/kotlin-native/llvmDebugInfoC/build.gradle.kts b/kotlin-native/llvmDebugInfoC/build.gradle.kts index 093836ca0a3..1458abb3fa0 100644 --- a/kotlin-native/llvmDebugInfoC/build.gradle.kts +++ b/kotlin-native/llvmDebugInfoC/build.gradle.kts @@ -14,14 +14,14 @@ * limitations under the License. */ -import org.jetbrains.gradle.plugins.tools.lib +import org.jetbrains.kotlin.tools.lib import org.jetbrains.kotlin.* import org.jetbrains.kotlin.* import org.jetbrains.kotlin.konan.target.ClangArgs import org.jetbrains.kotlin.konan.target.HostManager plugins { - `native` + id("native") } val llvmDir = project.findProperty("llvmDir")