[K/N] Make executors be separate included project

This change will make possible use Executors in old, gtest and new
test infrastructures.

Merge-request: KT-MR-8964
This commit is contained in:
Pavel Punegov
2023-02-07 19:49:11 +01:00
committed by Space Team
parent c105e63bbb
commit 76ab130011
15 changed files with 91 additions and 20 deletions
+3 -1
View File
@@ -58,7 +58,9 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-metadata-klib:$metadataVersion")
implementation("org.jetbrains.kotlin:kotlin-util-klib:${project.bootstrapKotlinVersion}")
api(project(":kotlin-native-shared"))
implementation(project(":kotlin-native-shared"))
implementation(project(":kotlin-native-executors"))
}
java {
+2 -1
View File
@@ -2,4 +2,5 @@ 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.build.composite-bootstrap=true
kotlin.native.enabled=true
@@ -39,3 +39,6 @@ project(":kotlin-native-shared").projectDir = File("$rootDir/../shared")
//project(":native:kotlin-native-utils").projectDir = File("$rootDir/../../native/kotlin-native-utils")
//project(":kotlin-util-klib").projectDir = File("$rootDir/../../compiler/util-klib")
//project(":kotlin-util-io").projectDir = File("$rootDir/../../compiler/util-io")
include(":kotlin-native-executors")
project(":kotlin-native-executors").projectDir = File("$rootDir/../../native/executors")
@@ -25,7 +25,7 @@ import org.gradle.process.*
import org.gradle.process.internal.DefaultExecSpec
import org.gradle.process.internal.ExecException
import org.jetbrains.kotlin.konan.target.*
import org.jetbrains.kotlin.executors.*
import org.jetbrains.kotlin.native.executors.*
import java.io.*
@@ -12,8 +12,8 @@ import org.gradle.api.tasks.TaskAction
import org.gradle.language.base.plugins.LifecycleBasePlugin
import org.jetbrains.kotlin.konan.target.*
import org.jetbrains.kotlin.native.executors.*
import java.io.File
import java.io.FileWriter
import java.io.Serializable
import java.nio.file.Files
@@ -13,7 +13,7 @@ import org.gradle.kotlin.dsl.getByType
import org.gradle.workers.WorkAction
import org.gradle.workers.WorkParameters
import org.gradle.workers.WorkerExecutor
import org.jetbrains.kotlin.executors.*
import org.jetbrains.kotlin.native.executors.*
import org.jetbrains.kotlin.konan.target.*
import javax.inject.Inject
+53
View File
@@ -0,0 +1,53 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
dependencies {
classpath("com.google.code.gson:gson:2.8.9")
}
}
plugins {
kotlin("jvm")
}
repositories {
mavenCentral()
}
dependencies {
implementation("com.google.code.gson:gson:2.8.9")
configurations.all {
resolutionStrategy.eachDependency {
if (requested.group == "com.google.code.gson" && requested.name == "gson") {
useVersion("2.8.9")
because("Force using same gson version because of https://github.com/google/gson/pull/1991")
}
}
}
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"))
}
}
group = "org.jetbrains.kotlin"
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += listOf(
"-Xskip-prerelease-check",
"-Xsuppress-version-warnings",
"-opt-in=kotlin.ExperimentalStdlibApi",
"-opt-in=kotlin.RequiresOptIn"
)
}
}
@@ -1,9 +1,9 @@
/*
* Copyright 2010-2022 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.kotlin.executors
package org.jetbrains.kotlin.native.executors
import org.jetbrains.kotlin.konan.target.Configurables
import org.jetbrains.kotlin.konan.target.ConfigurablesWithEmulator
@@ -1,14 +1,15 @@
/*
* Copyright 2010-2022 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.
*/
@file:OptIn(kotlin.time.ExperimentalTime::class)
@file:OptIn(ExperimentalTime::class)
package org.jetbrains.kotlin.executors
package org.jetbrains.kotlin.native.executors
import java.io.*
import kotlin.time.Duration
import kotlin.time.ExperimentalTime
private class CloseProtectedOutputStream(stream : OutputStream) : FilterOutputStream(stream) {
override fun close() {
@@ -1,11 +1,11 @@
/*
* Copyright 2010-2022 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.
*/
@file:OptIn(ExperimentalTime::class)
package org.jetbrains.kotlin.executors
package org.jetbrains.kotlin.native.executors
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
@@ -1,15 +1,16 @@
/*
* Copyright 2010-2022 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.
*/
@file:OptIn(kotlin.time.ExperimentalTime::class)
@file:OptIn(ExperimentalTime::class)
package org.jetbrains.kotlin.executors
package org.jetbrains.kotlin.native.executors
import java.io.File
import java.util.logging.Logger
import kotlin.time.Duration
import kotlin.time.ExperimentalTime
/**
* [Executor] that does not run the process and immediately returns a successful response.
@@ -1,9 +1,9 @@
/*
* Copyright 2010-2022 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.kotlin.executors
package org.jetbrains.kotlin.native.executors
import org.jetbrains.kotlin.konan.target.Configurables
import org.jetbrains.kotlin.konan.target.WasmConfigurables
@@ -1,10 +1,19 @@
package org.jetbrains.kotlin
/*
* 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.kotlin.native.executors
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.annotations.Expose
import org.jetbrains.kotlin.konan.target.Family
import org.jetbrains.kotlin.konan.target.Xcode
import kotlin.math.min
internal val gson: Gson by lazy { GsonBuilder().excludeFieldsWithoutExposeAnnotation().create()!! }
/**
* Compares two strings assuming that both are representing numeric version strings.
* Examples of numeric version strings: "12.4.1.2", "9", "0.5".
@@ -1,9 +1,9 @@
/*
* Copyright 2010-2022 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.kotlin.executors
package org.jetbrains.kotlin.native.executors
import org.jetbrains.kotlin.konan.target.*
import org.jetbrains.kotlin.*
+1
View File
@@ -101,6 +101,7 @@ include ":benchmarks",
":native:kotlin-klib-commonizer",
":native:kotlin-klib-commonizer-api",
":native:kotlin-klib-commonizer-embeddable",
":native:executors",
":core:compiler.common",
":core:compiler.common.jvm",
":core:compiler.common.js",