diff --git a/kotlin-native/backend.native/build.gradle b/kotlin-native/backend.native/build.gradle index 6c506a2be6c..7c65176df95 100644 --- a/kotlin-native/backend.native/build.gradle +++ b/kotlin-native/backend.native/build.gradle @@ -173,7 +173,6 @@ dependencies { compilerApi project(":compiler:fir:fir-serialization") compilerApi project(":compiler:fir:native") compilerApi project(":compiler:ir.psi2ir") - compilerApi project(":kotlin-native-shared") use(IntellijDependenciesKt) { compilerApi(intellijCore()) compileOnly(jpsModel()) diff --git a/kotlin-native/build-tools/build.gradle.kts b/kotlin-native/build-tools/build.gradle.kts index 10537db74ea..a9da32b8151 100644 --- a/kotlin-native/build-tools/build.gradle.kts +++ b/kotlin-native/build-tools/build.gradle.kts @@ -57,8 +57,6 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-metadata-klib:$metadataVersion") implementation("org.jetbrains.kotlin:kotlin-util-klib:${project.bootstrapKotlinVersion}") - - implementation(project(":kotlin-native-shared")) implementation(project(":kotlin-native-executors")) } diff --git a/kotlin-native/build-tools/gradle.properties b/kotlin-native/build-tools/gradle.properties index 44def09fabe..99ef6275ea6 100644 --- a/kotlin-native/build-tools/gradle.properties +++ b/kotlin-native/build-tools/gradle.properties @@ -2,5 +2,4 @@ cacheRedirectorEnabled=true bootstrap.kotlin.default.version=1.9.0-dev-877 kotlin.build.gradlePlugin.version=0.0.39 -kotlin.native.build.composite-bootstrap=true kotlin.native.enabled=true \ No newline at end of file diff --git a/kotlin-native/build-tools/settings.gradle.kts b/kotlin-native/build-tools/settings.gradle.kts index ac053842130..3dace58b62e 100644 --- a/kotlin-native/build-tools/settings.gradle.kts +++ b/kotlin-native/build-tools/settings.gradle.kts @@ -26,9 +26,6 @@ buildscript { } } -include(":kotlin-native-shared") -project(":kotlin-native-shared").projectDir = File("$rootDir/../shared") - // This code could potentially remove the need of bootstrapping code that use util-klib and util-io // by building them, but it's not possible right now, because they use buildSrc plugins (like JPS) and methods (like commonDependency). // This could be fixed by replacing the buildSrc with the composite build like build-tools, and splitting it to several parts. diff --git a/kotlin-native/shared/build.gradle.kts b/kotlin-native/shared/build.gradle.kts deleted file mode 100644 index 062c41def1e..00000000000 --- a/kotlin-native/shared/build.gradle.kts +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@file:Suppress("UnstableApiUsage") - -import org.jetbrains.kotlin.gradle.plugin.extraProperties -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import java.util.* - -plugins { - id("kotlin") -} - -val rootBuildDirectory by extra(file("..")) -apply(from = "../gradle/loadRootProperties.gradle") - -group = "org.jetbrains.kotlin" - -repositories { - maven("https://cache-redirector.jetbrains.com/maven-central") - mavenCentral() -} - -java { - toolchain { - languageVersion.set(JavaLanguageVersion.of(8)) - } -} - -kotlin { - sourceSets { - main { - // TODO: All code was moved to utils. Bootstrap should be advanced to make these classes appear - // in the bootstrap version of kotlin-native-utils. Only then this project should be removed, all usages - // of `:kotlin-native-shared` should be replaced with `:native:kotlin-native-utils` - kotlin.srcDir("../../native/utils/src") - } - } -} - -tasks.withType().configureEach { - kotlinOptions { - languageVersion = "1.4" - apiVersion = "1.4" - allWarningsAsErrors = false - jvmTarget = "1.8" - freeCompilerArgs += "-Xskip-prerelease-check" - } -} - -val isCompositeBootstrap = project.extraProperties.has("kotlin.native.build.composite-bootstrap") - -/** - * Depending on the `kotlin.native.build.composite-bootstrap` property returns either coordinates or the project dependency. - * - * It to use this project in composite build (build-tools) and as a project itself. - * Project should depend on a current snapshot builds while build-tools use bootstrap dependencies. - * TODO: finalize merge of this project with kotlin-native-utils to get rid of this hack - */ -fun compositeDependency(coordinates: String, subproject: String = ""): Any { - val parts = coordinates.split(':') - check(parts.size == 3) { - "Full dependency coordinates should be specified group:name:version" - } - return if (!isCompositeBootstrap) { - // returns dependency on the project specified with coordinates - dependencies.project("$subproject:${parts[1]}") - } else { - // returns full coordinates - coordinates - } -} - -dependencies { - implementation("org.jetbrains.kotlin:kotlin-stdlib:${project.bootstrapKotlinVersion}") - api(compositeDependency("org.jetbrains.kotlin:kotlin-util-klib:${project.bootstrapKotlinVersion}")) - api(compositeDependency("org.jetbrains.kotlin:kotlin-util-io:${project.bootstrapKotlinVersion}")) - - if (!isCompositeBootstrap) { - val versionProperties = Properties() - project.rootProject.projectDir.resolve("gradle/versions.properties").inputStream().use { propInput -> - versionProperties.load(propInput) - } - val platformVersion = versionProperties["versions.junit-bom"] - testApi(platform("org.junit:junit-bom:$platformVersion")) - testApi("org.junit.jupiter:junit-jupiter") - } -} diff --git a/kotlin-native/utilities/cli-runner/build.gradle b/kotlin-native/utilities/cli-runner/build.gradle index f48c8a8d57f..6c401588bfd 100644 --- a/kotlin-native/utilities/cli-runner/build.gradle +++ b/kotlin-native/utilities/cli-runner/build.gradle @@ -24,5 +24,5 @@ dependencies { implementation project(':kotlin-native:klib') implementation project(":kotlin-native:utilities:basic-utils") implementation project(path: ":kotlin-native:endorsedLibraries:kotlinx.cli", configuration: "jvmRuntimeElements") - implementation project(":kotlin-native-shared") + implementation project(":native:kotlin-native-utils") } diff --git a/native/executors/build.gradle.kts b/native/executors/build.gradle.kts index 18226c1f594..3f992c2bd06 100644 --- a/native/executors/build.gradle.kts +++ b/native/executors/build.gradle.kts @@ -26,11 +26,7 @@ dependencies { } implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0") - if (kotlinBuildProperties.isKotlinNativeEnabled) { - implementation(project(":kotlin-native-shared")) - } else { - implementation(project(":native:kotlin-native-utils")) - } + implementation("org.jetbrains.kotlin:kotlin-native-utils:${project.bootstrapKotlinVersion}") } group = "org.jetbrains.kotlin" diff --git a/prepare/ide-plugin-dependencies/kotlin-backend-native-for-ide/build.gradle.kts b/prepare/ide-plugin-dependencies/kotlin-backend-native-for-ide/build.gradle.kts index d239cec19f6..e4f0aad9bed 100644 --- a/prepare/ide-plugin-dependencies/kotlin-backend-native-for-ide/build.gradle.kts +++ b/prepare/ide-plugin-dependencies/kotlin-backend-native-for-ide/build.gradle.kts @@ -30,7 +30,7 @@ idePluginDependency { dependencies { embedded(project(":kotlin-native:backend.native")) { isTransitive = false } - proguardLibraryJars(project(":kotlin-native-shared")) { isTransitive = false } + proguardLibraryJars(project(":native:kotlin-native-utils")) { isTransitive = false } proguardLibraryJars(project(":kotlin-native:backend.native", "kotlin_stdlib_jar")) proguardLibraryJars(project(":kotlin-native:backend.native", "kotlin_reflect_jar")) proguardLibraryJars(project(":kotlin-native:backend.native", "cli_bcApiElements")) diff --git a/settings.gradle b/settings.gradle index fab3ecf273b..fcb082705e6 100644 --- a/settings.gradle +++ b/settings.gradle @@ -861,6 +861,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-shared' - project(":kotlin-native-shared").projectDir = "$rootDir/kotlin-native/shared" as File }