[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:
committed by
Space Team
parent
c105e63bbb
commit
76ab130011
@@ -58,7 +58,9 @@ dependencies {
|
|||||||
implementation("org.jetbrains.kotlinx:kotlinx-metadata-klib:$metadataVersion")
|
implementation("org.jetbrains.kotlinx:kotlinx-metadata-klib:$metadataVersion")
|
||||||
|
|
||||||
implementation("org.jetbrains.kotlin:kotlin-util-klib:${project.bootstrapKotlinVersion}")
|
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 {
|
java {
|
||||||
|
|||||||
@@ -2,4 +2,5 @@ cacheRedirectorEnabled=true
|
|||||||
bootstrap.kotlin.default.version=1.9.0-dev-877
|
bootstrap.kotlin.default.version=1.9.0-dev-877
|
||||||
kotlin.build.gradlePlugin.version=0.0.39
|
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(":native:kotlin-native-utils").projectDir = File("$rootDir/../../native/kotlin-native-utils")
|
||||||
//project(":kotlin-util-klib").projectDir = File("$rootDir/../../compiler/util-klib")
|
//project(":kotlin-util-klib").projectDir = File("$rootDir/../../compiler/util-klib")
|
||||||
//project(":kotlin-util-io").projectDir = File("$rootDir/../../compiler/util-io")
|
//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.DefaultExecSpec
|
||||||
import org.gradle.process.internal.ExecException
|
import org.gradle.process.internal.ExecException
|
||||||
import org.jetbrains.kotlin.konan.target.*
|
import org.jetbrains.kotlin.konan.target.*
|
||||||
import org.jetbrains.kotlin.executors.*
|
import org.jetbrains.kotlin.native.executors.*
|
||||||
|
|
||||||
import java.io.*
|
import java.io.*
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import org.gradle.api.tasks.TaskAction
|
|||||||
import org.gradle.language.base.plugins.LifecycleBasePlugin
|
import org.gradle.language.base.plugins.LifecycleBasePlugin
|
||||||
|
|
||||||
import org.jetbrains.kotlin.konan.target.*
|
import org.jetbrains.kotlin.konan.target.*
|
||||||
|
import org.jetbrains.kotlin.native.executors.*
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
import java.io.FileWriter
|
import java.io.FileWriter
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import org.gradle.kotlin.dsl.getByType
|
|||||||
import org.gradle.workers.WorkAction
|
import org.gradle.workers.WorkAction
|
||||||
import org.gradle.workers.WorkParameters
|
import org.gradle.workers.WorkParameters
|
||||||
import org.gradle.workers.WorkerExecutor
|
import org.gradle.workers.WorkerExecutor
|
||||||
import org.jetbrains.kotlin.executors.*
|
import org.jetbrains.kotlin.native.executors.*
|
||||||
import org.jetbrains.kotlin.konan.target.*
|
import org.jetbrains.kotlin.konan.target.*
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-2
@@ -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.
|
* 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.Configurables
|
||||||
import org.jetbrains.kotlin.konan.target.ConfigurablesWithEmulator
|
import org.jetbrains.kotlin.konan.target.ConfigurablesWithEmulator
|
||||||
+4
-3
@@ -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.
|
* 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 java.io.*
|
||||||
import kotlin.time.Duration
|
import kotlin.time.Duration
|
||||||
|
import kotlin.time.ExperimentalTime
|
||||||
|
|
||||||
private class CloseProtectedOutputStream(stream : OutputStream) : FilterOutputStream(stream) {
|
private class CloseProtectedOutputStream(stream : OutputStream) : FilterOutputStream(stream) {
|
||||||
override fun close() {
|
override fun close() {
|
||||||
+2
-2
@@ -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.
|
* 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)
|
@file:OptIn(ExperimentalTime::class)
|
||||||
|
|
||||||
package org.jetbrains.kotlin.executors
|
package org.jetbrains.kotlin.native.executors
|
||||||
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
+4
-3
@@ -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.
|
* 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.io.File
|
||||||
import java.util.logging.Logger
|
import java.util.logging.Logger
|
||||||
import kotlin.time.Duration
|
import kotlin.time.Duration
|
||||||
|
import kotlin.time.ExperimentalTime
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [Executor] that does not run the process and immediately returns a successful response.
|
* [Executor] that does not run the process and immediately returns a successful response.
|
||||||
+2
-2
@@ -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.
|
* 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.Configurables
|
||||||
import org.jetbrains.kotlin.konan.target.WasmConfigurables
|
import org.jetbrains.kotlin.konan.target.WasmConfigurables
|
||||||
+10
-1
@@ -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 com.google.gson.annotations.Expose
|
||||||
import org.jetbrains.kotlin.konan.target.Family
|
import org.jetbrains.kotlin.konan.target.Family
|
||||||
import org.jetbrains.kotlin.konan.target.Xcode
|
import org.jetbrains.kotlin.konan.target.Xcode
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
|
internal val gson: Gson by lazy { GsonBuilder().excludeFieldsWithoutExposeAnnotation().create()!! }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares two strings assuming that both are representing numeric version strings.
|
* Compares two strings assuming that both are representing numeric version strings.
|
||||||
* Examples of numeric version strings: "12.4.1.2", "9", "0.5".
|
* Examples of numeric version strings: "12.4.1.2", "9", "0.5".
|
||||||
+2
-2
@@ -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.
|
* 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.konan.target.*
|
||||||
import org.jetbrains.kotlin.*
|
import org.jetbrains.kotlin.*
|
||||||
@@ -101,6 +101,7 @@ include ":benchmarks",
|
|||||||
":native:kotlin-klib-commonizer",
|
":native:kotlin-klib-commonizer",
|
||||||
":native:kotlin-klib-commonizer-api",
|
":native:kotlin-klib-commonizer-api",
|
||||||
":native:kotlin-klib-commonizer-embeddable",
|
":native:kotlin-klib-commonizer-embeddable",
|
||||||
|
":native:executors",
|
||||||
":core:compiler.common",
|
":core:compiler.common",
|
||||||
":core:compiler.common.jvm",
|
":core:compiler.common.jvm",
|
||||||
":core:compiler.common.js",
|
":core:compiler.common.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user