[build] joint (step 2)
- dist: - compiler - tools(cinterop,klib) - stdlib - cache
This commit is contained in:
@@ -106,6 +106,10 @@ sourceSets["main"].withConvention(org.jetbrains.kotlin.gradle.plugin.KotlinSourc
|
|||||||
kotlin.srcDir("../kotlin-native/build-tools/src/main/kotlin")
|
kotlin.srcDir("../kotlin-native/build-tools/src/main/kotlin")
|
||||||
kotlin.srcDir("../kotlin-native/build-tools/src/tmp/kotlin")
|
kotlin.srcDir("../kotlin-native/build-tools/src/tmp/kotlin")
|
||||||
kotlin.srcDir("../kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin")
|
kotlin.srcDir("../kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin")
|
||||||
|
kotlin.srcDir("../compiler/util-klib/src")
|
||||||
|
kotlin.srcDir(project.kotlinNativeVersionSrc())
|
||||||
|
kotlin.srcDir("../native/utils/src")
|
||||||
|
kotlin.exclude("**/benchmark/SwiftBenchmarkingPlugin.kt")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.validatePlugins.configure {
|
tasks.validatePlugins.configure {
|
||||||
@@ -148,8 +152,6 @@ dependencies {
|
|||||||
implementation("io.ktor:ktor-client-core:$ktorVersion")
|
implementation("io.ktor:ktor-client-core:$ktorVersion")
|
||||||
implementation("io.ktor:ktor-client-cio:$ktorVersion")
|
implementation("io.ktor:ktor-client-cio:$ktorVersion")
|
||||||
|
|
||||||
api("org.jetbrains.kotlin:kotlin-native-utils:$kotlinVersion")
|
|
||||||
|
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-metadata-klib:$metadataVersion")
|
implementation("org.jetbrains.kotlinx:kotlinx-metadata-klib:$metadataVersion")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +169,10 @@ java {
|
|||||||
|
|
||||||
tasks.withType<KotlinCompile>().configureEach {
|
tasks.withType<KotlinCompile>().configureEach {
|
||||||
kotlinOptions.freeCompilerArgs += listOf(
|
kotlinOptions.freeCompilerArgs += listOf(
|
||||||
"-Xopt-in=kotlin.RequiresOptIn", "-Xskip-runtime-version-check", "-Xsuppress-version-warnings"
|
"-Xopt-in=kotlin.RequiresOptIn",
|
||||||
|
"-Xskip-runtime-version-check",
|
||||||
|
"-Xsuppress-version-warnings",
|
||||||
|
"-Xopt-in=kotlin.ExperimentalStdlibApi"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,11 @@ dependencies {
|
|||||||
api project(path: ":kotlin-native:endorsedLibraries:kotlinx.cli", configuration: "jvmRuntimeElements")
|
api project(path: ":kotlin-native:endorsedLibraries:kotlinx.cli", configuration: "jvmRuntimeElements")
|
||||||
|
|
||||||
api project(":kotlin-stdlib")
|
api project(":kotlin-stdlib")
|
||||||
api project(":kotlin-compiler")
|
api project(kotlinCompilerModule)
|
||||||
api project(":kotlinx-metadata-klib")
|
api project(":kotlinx-metadata-klib")
|
||||||
|
api project(":native:kotlin-native-utils")
|
||||||
|
implementation(project(":compiler:util"))
|
||||||
|
implementation(project(":compiler:ir.serialization.common"))
|
||||||
|
|
||||||
testImplementation "junit:junit:4.12"
|
testImplementation "junit:junit:4.12"
|
||||||
testImplementation project(":kotlin-test:kotlin-test-junit")
|
testImplementation project(":kotlin-test:kotlin-test-junit")
|
||||||
@@ -44,3 +47,13 @@ compileKotlin {
|
|||||||
allWarningsAsErrors=true
|
allWarningsAsErrors=true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets{
|
||||||
|
main {
|
||||||
|
kotlin {
|
||||||
|
srcDir("../../shared/src/library/kotlin")
|
||||||
|
srcDir("../../shared/src/main/kotlin")
|
||||||
|
srcDir("../../../buildSrc/src/generated/kotlin")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,13 +21,6 @@ apply plugin: 'kotlin'
|
|||||||
apply plugin: org.jetbrains.kotlin.NativeInteropPlugin
|
apply plugin: org.jetbrains.kotlin.NativeInteropPlugin
|
||||||
apply plugin: "maven-publish"
|
apply plugin: "maven-publish"
|
||||||
|
|
||||||
// (gets applied to this project and all its subprojects)
|
|
||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
maven { url project.bootstrapKotlinRepo }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
compiler {
|
compiler {
|
||||||
proto.srcDir 'compiler/ir/backend.native/src/'
|
proto.srcDir 'compiler/ir/backend.native/src/'
|
||||||
@@ -37,6 +30,9 @@ sourceSets {
|
|||||||
}
|
}
|
||||||
kotlin {
|
kotlin {
|
||||||
srcDir 'compiler/ir/backend.native/src/'
|
srcDir 'compiler/ir/backend.native/src/'
|
||||||
|
srcDir '../shared/src/main/kotlin'
|
||||||
|
srcDir '../shared/src/library/kotlin'
|
||||||
|
srcDir '../../buildSrc/src/generated/kotlin'
|
||||||
}
|
}
|
||||||
resources.srcDir 'compiler/ir/backend.native/resources/'
|
resources.srcDir 'compiler/ir/backend.native/resources/'
|
||||||
}
|
}
|
||||||
@@ -114,7 +110,7 @@ kotlinNativeInterop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
files {
|
files {
|
||||||
if (!project.parent.convention.plugins.platformInfo.isWindows()) {
|
if (!project.project(":kotlin-native").convention.plugins.platformInfo.isWindows()) {
|
||||||
compilerOpts '-fPIC'
|
compilerOpts '-fPIC'
|
||||||
linkerOpts '-fPIC'
|
linkerOpts '-fPIC'
|
||||||
}
|
}
|
||||||
@@ -147,13 +143,14 @@ configurations {
|
|||||||
cli_bc {
|
cli_bc {
|
||||||
extendsFrom cli_bcRuntime
|
extendsFrom cli_bcRuntime
|
||||||
}
|
}
|
||||||
|
cli_bcCompile.extendsFrom compilerCompile
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
trove4j_jar "org.jetbrains.intellij.deps:trove4j:1.0.20181211@jar"
|
trove4j_jar "org.jetbrains.intellij.deps:trove4j:1.0.20181211@jar"
|
||||||
kotlin_compiler_jar project(":kotlin-compiler")
|
kotlin_compiler_jar project(kotlinCompilerModule)
|
||||||
kotlin_stdlib_jar project(":kotlin-stdlib")
|
kotlin_stdlib_jar kotlinStdLibModule
|
||||||
kotlin_reflect_jar project(":kotlin-reflect")
|
kotlin_reflect_jar kotlinReflectModule
|
||||||
kotlin_script_runtime_jar project(":kotlin-script-runtime")
|
kotlin_script_runtime_jar project(":kotlin-script-runtime")
|
||||||
|
|
||||||
[kotlinCommonStdlibModule, kotlinTestCommonModule, kotlinTestAnnotationsCommonModule].each {
|
[kotlinCommonStdlibModule, kotlinTestCommonModule, kotlinTestAnnotationsCommonModule].each {
|
||||||
@@ -164,15 +161,44 @@ dependencies {
|
|||||||
|
|
||||||
compilerCompile "com.google.protobuf:protobuf-java:${protobufVersion}"
|
compilerCompile "com.google.protobuf:protobuf-java:${protobufVersion}"
|
||||||
|
|
||||||
compilerCompile project(":kotlin-compiler")
|
compilerCompile project(kotlinCompilerModule)
|
||||||
|
compilerCompile project(":native:kotlin-native-utils")
|
||||||
|
compilerCompile project(":core:descriptors")
|
||||||
|
compilerCompile project(":compiler:ir.tree")
|
||||||
|
compilerCompile project(":compiler:ir.tree.impl")
|
||||||
|
compilerCompile project(":compiler:ir.backend.common")
|
||||||
|
compilerCompile project(":compiler:util")
|
||||||
|
compilerCompile project(":native:frontend.native")
|
||||||
|
compilerCompile project(":compiler:cli-common")
|
||||||
|
compilerCompile project(":compiler:cli")
|
||||||
|
compilerCompile project(":kotlin-util-klib")
|
||||||
|
compilerCompile project(":kotlin-util-klib-metadata")
|
||||||
|
compilerCompile project(":compiler:ir.serialization.common")
|
||||||
|
use(LocalDependenciesKt) {
|
||||||
|
compilerCompile(intellijCoreDep()){
|
||||||
|
artifact {
|
||||||
|
name = "intellij-core"
|
||||||
|
type = "jar"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compilerCompile(intellijDep()){
|
||||||
|
artifact {
|
||||||
|
name = "util"
|
||||||
|
type = "jar"
|
||||||
|
//extention = "jar"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileOnly(jpsStandalone())
|
||||||
|
}
|
||||||
|
|
||||||
compilerCompile kotlinNativeInterop['llvm'].configuration
|
compilerCompile kotlinNativeInterop['llvm'].configuration
|
||||||
compilerCompile kotlinNativeInterop['hash'].configuration
|
compilerCompile kotlinNativeInterop['hash'].configuration
|
||||||
compilerCompile kotlinNativeInterop['files'].configuration
|
compilerCompile kotlinNativeInterop['files'].configuration
|
||||||
|
|
||||||
cli_bcCompile project(":kotlin-compiler")
|
|
||||||
cli_bcCompile sourceSets.compiler.output
|
cli_bcCompile sourceSets.compiler.output
|
||||||
|
|
||||||
bc_frontendCompile kotlinCompilerModule
|
bc_frontendCompile project(kotlinCompilerModule)
|
||||||
|
|
||||||
cli_bc sourceSets.cli_bc.output
|
cli_bc sourceSets.cli_bc.output
|
||||||
}
|
}
|
||||||
@@ -184,12 +210,7 @@ classes.dependsOn 'compilerClasses', 'cli_bcClasses', 'bc_frontendClasses'
|
|||||||
// These are just a couple of aliases
|
// These are just a couple of aliases
|
||||||
task stdlib(dependsOn: "${hostName}Stdlib")
|
task stdlib(dependsOn: "${hostName}Stdlib")
|
||||||
|
|
||||||
def commonSrc = file('build/stdlib')
|
def commonSrc = project(":kotlin-stdlib-common").files("src/kotlin", "src/generated", "../unsigned/src", "../src").files
|
||||||
|
|
||||||
task unzipStdlibSources(type: CopyCommonSources) {
|
|
||||||
outputDir commonSrc
|
|
||||||
sourcePaths configurations.kotlinCommonSources
|
|
||||||
}
|
|
||||||
|
|
||||||
final List<File> stdLibSrc = [
|
final List<File> stdLibSrc = [
|
||||||
project(':kotlin-native:Interop:Runtime').file('src/main/kotlin'),
|
project(':kotlin-native:Interop:Runtime').file('src/main/kotlin'),
|
||||||
@@ -220,6 +241,8 @@ targetList.each { target ->
|
|||||||
include "*.jar"
|
include "*.jar"
|
||||||
}
|
}
|
||||||
jvmArgs = konanJvmArgs
|
jvmArgs = konanJvmArgs
|
||||||
|
def testAnnotationCommon = project(":kotlin-test:kotlin-test-annotations-common").files("src/main/kotlin").files
|
||||||
|
def testCommon = project(":kotlin-test:kotlin-test-common").files("src/main/kotlin").files
|
||||||
args = [*konanArgs,
|
args = [*konanArgs,
|
||||||
'-output', project(':kotlin-native:runtime').file("build/${target}Stdlib"),
|
'-output', project(':kotlin-native:runtime').file("build/${target}Stdlib"),
|
||||||
'-produce', 'library', '-module-name', 'stdlib', '-XXLanguage:+AllowContractsForCustomFunctions',
|
'-produce', 'library', '-module-name', 'stdlib', '-XXLanguage:+AllowContractsForCustomFunctions',
|
||||||
@@ -227,14 +250,19 @@ targetList.each { target ->
|
|||||||
'-Xopt-in=kotlin.contracts.ExperimentalContracts',
|
'-Xopt-in=kotlin.contracts.ExperimentalContracts',
|
||||||
'-Xopt-in=kotlin.ExperimentalMultiplatform',
|
'-Xopt-in=kotlin.ExperimentalMultiplatform',
|
||||||
'-Xallow-result-return-type',
|
'-Xallow-result-return-type',
|
||||||
commonSrc.absolutePath,
|
*commonSrc.toList(),
|
||||||
"-Xcommon-sources=${commonSrc.absolutePath}",
|
*testAnnotationCommon.toList(),
|
||||||
|
*testCommon.toList(),
|
||||||
|
"-Xcommon-sources=${commonSrc.join(',')}",
|
||||||
|
"-Xcommon-sources=${testAnnotationCommon.join(',')}",
|
||||||
|
"-Xcommon-sources=${testCommon.join(',')}",
|
||||||
*stdLibSrc]
|
*stdLibSrc]
|
||||||
stdLibSrc.forEach { inputs.dir(it) }
|
stdLibSrc.forEach { inputs.dir(it) }
|
||||||
inputs.dir(commonSrc)
|
commonSrc.forEach{
|
||||||
|
inputs.dir(it)
|
||||||
|
}
|
||||||
outputs.dir(project(':kotlin-native:runtime').file("build/${target}Stdlib"))
|
outputs.dir(project(':kotlin-native:runtime').file("build/${target}Stdlib"))
|
||||||
|
|
||||||
dependsOn 'unzipStdlibSources'
|
|
||||||
dependsOn ":kotlin-native:runtime:${target}Runtime"
|
dependsOn ":kotlin-native:runtime:${target}Runtime"
|
||||||
dependsOn ":kotlin-native:distCompiler"
|
dependsOn ":kotlin-native:distCompiler"
|
||||||
}
|
}
|
||||||
@@ -253,7 +281,7 @@ jar {
|
|||||||
sourceSets.filesInteropStubs.output,
|
sourceSets.filesInteropStubs.output,
|
||||||
sourceSets.llvmInteropStubs.output
|
sourceSets.llvmInteropStubs.output
|
||||||
|
|
||||||
dependsOn ':runtime:hostRuntime', 'external_jars'
|
dependsOn ':kotlin-native:runtime:hostRuntime', 'external_jars'
|
||||||
}
|
}
|
||||||
|
|
||||||
def externalJars = ['compiler', 'stdlib', 'reflect', 'script_runtime']
|
def externalJars = ['compiler', 'stdlib', 'reflect', 'script_runtime']
|
||||||
|
|||||||
+1
-1
@@ -207,7 +207,7 @@ class NamedNativeInteropConfig implements Named {
|
|||||||
).asPath
|
).asPath
|
||||||
// Set the konan.home property because we run the cinterop tool not from a distribution jar
|
// Set the konan.home property because we run the cinterop tool not from a distribution jar
|
||||||
// so it will not be able to determine this path by itself.
|
// so it will not be able to determine this path by itself.
|
||||||
systemProperties "konan.home": project.rootProject.projectDir
|
systemProperties "konan.home": project.project(":kotlin-native").projectDir
|
||||||
environment "LIBCLANG_DISABLE_CRASH_RECOVERY": "1"
|
environment "LIBCLANG_DISABLE_CRASH_RECOVERY": "1"
|
||||||
|
|
||||||
outputs.dir generatedSrcDir
|
outputs.dir generatedSrcDir
|
||||||
|
|||||||
@@ -466,7 +466,7 @@ open class KonanDynamicTest : KonanStandaloneTest() {
|
|||||||
|
|
||||||
val execResult = plugin.execKonanClang(project.testTarget, Action<ExecSpec> {
|
val execResult = plugin.execKonanClang(project.testTarget, Action<ExecSpec> {
|
||||||
workingDir = File(outputDirectory)
|
workingDir = File(outputDirectory)
|
||||||
executable = clangTool
|
this@Action.executable = clangTool
|
||||||
args = listOf(processCSource(),
|
args = listOf(processCSource(),
|
||||||
"-c",
|
"-c",
|
||||||
"-o", "${this@KonanDynamicTest.executable}.o",
|
"-o", "${this@KonanDynamicTest.executable}.o",
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ object PlatformInfo {
|
|||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun getTarget(project: Project): KonanTarget {
|
fun getTarget(project: Project): KonanTarget {
|
||||||
val platformManager = project.rootProject.platformManager
|
val platformManager = project.project(":kotlin-native").platformManager
|
||||||
val targetName = project.project.testTarget.name
|
val targetName = project.project.testTarget.name
|
||||||
return platformManager.targetManager(targetName).target
|
return platformManager.targetManager(targetName).target
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ if (isMac()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
distDir = file('dist')
|
distDir = rootProject.file('dist')
|
||||||
dependenciesDir = DependencyProcessor.defaultDependenciesRoot
|
dependenciesDir = DependencyProcessor.defaultDependenciesRoot
|
||||||
experimentalEnabled = project.hasProperty("org.jetbrains.kotlin.native.experimentalTargets")
|
experimentalEnabled = project.hasProperty("org.jetbrains.kotlin.native.experimentalTargets")
|
||||||
platformManager = new PlatformManager(DistributionKt.buildDistribution(projectDir.absolutePath),
|
platformManager = new PlatformManager(DistributionKt.buildDistribution(projectDir.absolutePath),
|
||||||
@@ -82,7 +82,7 @@ ext {
|
|||||||
KonanTarget.LINUX_MIPSEL32.INSTANCE
|
KonanTarget.LINUX_MIPSEL32.INSTANCE
|
||||||
]
|
]
|
||||||
|
|
||||||
kotlinCompilerModule= project(":kotlin-compiler")
|
kotlinCompilerModule= [path: ":kotlin-compiler", configuration: "runtimeElements"]
|
||||||
kotlinStdLibModule= project(":kotlin-stdlib")
|
kotlinStdLibModule= project(":kotlin-stdlib")
|
||||||
kotlinCommonStdlibModule= project(":kotlin-stdlib-common")
|
kotlinCommonStdlibModule= project(":kotlin-stdlib-common")
|
||||||
kotlinTestCommonModule= project(":kotlin-test:kotlin-test-common")
|
kotlinTestCommonModule= project(":kotlin-test:kotlin-test-common")
|
||||||
@@ -220,7 +220,7 @@ dependencies {
|
|||||||
distPack project(':kotlin-native:Interop:Runtime')
|
distPack project(':kotlin-native:Interop:Runtime')
|
||||||
distPack project(':kotlin-native:Interop:Indexer')
|
distPack project(':kotlin-native:Interop:Indexer')
|
||||||
distPack project(':kotlin-native:Interop:StubGenerator')
|
distPack project(':kotlin-native:Interop:StubGenerator')
|
||||||
//distPack project(':kotlin-native:backend.native')
|
distPack project(':kotlin-native:backend.native')
|
||||||
distPack project(':kotlin-native:utilities:cli-runner')
|
distPack project(':kotlin-native:utilities:cli-runner')
|
||||||
distPack project(':kotlin-native:utilities:basic-utils')
|
distPack project(':kotlin-native:utilities:basic-utils')
|
||||||
distPack project(':kotlin-native:klib')
|
distPack project(':kotlin-native:klib')
|
||||||
@@ -341,7 +341,7 @@ task detectJarCollision(type: CollisionDetector) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task shadowJar(type: ShadowJar) {
|
task shadowJar(type: ShadowJar) {
|
||||||
dependsOn ':detectJarCollision'
|
//dependsOn ':kotlin-native:detectJarCollision'
|
||||||
mergeServiceFiles()
|
mergeServiceFiles()
|
||||||
destinationDirectory.set(file("$distDir/konan/lib"))
|
destinationDirectory.set(file("$distDir/konan/lib"))
|
||||||
archiveBaseName.set("kotlin-native")
|
archiveBaseName.set("kotlin-native")
|
||||||
@@ -356,7 +356,7 @@ task shadowJar(type: ShadowJar) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task distCompiler(type: Copy) {
|
task distCompiler(type: Copy) {
|
||||||
dependsOn ':shadowJar'
|
dependsOn ':kotlin-native:shadowJar'
|
||||||
|
|
||||||
destinationDir distDir
|
destinationDir distDir
|
||||||
|
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ targetList.each { target ->
|
|||||||
compilerDistributionPath.set(distDir)
|
compilerDistributionPath.set(distDir)
|
||||||
|
|
||||||
dependsOn "${target}EndorsedLibraries"
|
dependsOn "${target}EndorsedLibraries"
|
||||||
dependsOn ":${target}CrossDistRuntime"
|
dependsOn ":kotlin-native:${target}CrossDistRuntime"
|
||||||
dependsOn ":${target}StdlibCache"
|
dependsOn ":kotlin-native:${target}StdlibCache"
|
||||||
|
|
||||||
cacheTask.dependsOn it
|
cacheTask.dependsOn it
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,5 +16,5 @@ configurations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
project.dependencies {
|
project.dependencies {
|
||||||
kotlinCompilerClasspath(project(":kotlin-compiler-embeddable"))
|
kotlinCompilerClasspath(project(path: ":kotlin-compiler-embeddable", configuration: "runtimeJar"))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ rootProject.project("kotlin-native").ext.platformManager.enabled.each { target -
|
|||||||
it.originalKlib = file("$konanHome/klib/common/stdlib")
|
it.originalKlib = file("$konanHome/klib/common/stdlib")
|
||||||
it.cacheRoot = file("$konanHome/klib/cache")
|
it.cacheRoot = file("$konanHome/klib/cache")
|
||||||
|
|
||||||
it.dependsOn ":${targetName}CrossDistRuntime"
|
it.dependsOn ":kotlin-native:${targetName}CrossDistRuntime"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ rootProject.project("kotlin-native").ext.platformManager.enabled.each { target -
|
|||||||
def libTask = konanArtifacts."$libName"."$targetName"
|
def libTask = konanArtifacts."$libName"."$targetName"
|
||||||
libTask.configure {
|
libTask.configure {
|
||||||
it.dependsOn df.config.depends.collect { defFileToLibName(targetName, it) }
|
it.dependsOn df.config.depends.collect { defFileToLibName(targetName, it) }
|
||||||
it.dependsOn ":${targetName}CrossDist"
|
it.dependsOn ":kotlin-native:${targetName}CrossDist"
|
||||||
it.enableParallel = true
|
it.enableParallel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ rootProject.project("kotlin-native").ext.platformManager.enabled.each { target -
|
|||||||
it.originalKlib = tasks[libName].installDir.get()
|
it.originalKlib = tasks[libName].installDir.get()
|
||||||
it.cacheRoot = file("$konanHome/klib/cache")
|
it.cacheRoot = file("$konanHome/klib/cache")
|
||||||
|
|
||||||
it.dependsOn ":${targetName}StdlibCache"
|
it.dependsOn ":kotlin-native:${targetName}StdlibCache"
|
||||||
it.dependsOn tasks[libName]
|
it.dependsOn tasks[libName]
|
||||||
it.dependsOn df.config.depends.collect {
|
it.dependsOn df.config.depends.collect {
|
||||||
def depName = defFileToLibName(targetName, it)
|
def depName = defFileToLibName(targetName, it)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ val targetList: List<String> by project
|
|||||||
bitcode {
|
bitcode {
|
||||||
create("runtime", file("src/main")) {
|
create("runtime", file("src/main")) {
|
||||||
dependsOn(
|
dependsOn(
|
||||||
":common:${target}Hash",
|
":kotlin-native:common:${target}Hash",
|
||||||
"${target}StdAlloc",
|
"${target}StdAlloc",
|
||||||
"${target}OptAlloc",
|
"${target}OptAlloc",
|
||||||
"${target}Mimalloc",
|
"${target}Mimalloc",
|
||||||
|
|||||||
+19
-15
@@ -19,6 +19,8 @@ package org.jetbrains.kotlin.gradle.plugin.konan
|
|||||||
import org.gradle.api.Named
|
import org.gradle.api.Named
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.file.FileCollection
|
import org.gradle.api.file.FileCollection
|
||||||
|
import org.gradle.api.Action
|
||||||
|
import org.gradle.process.JavaExecSpec
|
||||||
import org.jetbrains.kotlin.gradle.plugin.konan.KonanPlugin.ProjectProperty.KONAN_HOME
|
import org.jetbrains.kotlin.gradle.plugin.konan.KonanPlugin.ProjectProperty.KONAN_HOME
|
||||||
import org.jetbrains.kotlin.konan.target.Family
|
import org.jetbrains.kotlin.konan.target.Family
|
||||||
import org.jetbrains.kotlin.konan.target.HostManager
|
import org.jetbrains.kotlin.konan.target.HostManager
|
||||||
@@ -91,21 +93,23 @@ internal abstract class KonanCliRunner(
|
|||||||
"Please change it to the compiler root directory and rerun the build.")
|
"Please change it to the compiler root directory and rerun the build.")
|
||||||
}
|
}
|
||||||
|
|
||||||
project.javaexec {
|
project.javaexec(object :Action<JavaExecSpec> {
|
||||||
main = this@KonanCliRunner.mainClass
|
override fun execute(exec: JavaExecSpec) {
|
||||||
classpath = classpath
|
exec.main = mainClass
|
||||||
jvmArgs(jvmArgs)
|
exec.classpath = classpath
|
||||||
systemProperties(
|
exec.jvmArgs(jvmArgs)
|
||||||
System.getProperties().asSequence()
|
exec.systemProperties(
|
||||||
.map { (k, v) -> k.toString() to v.toString() }
|
System.getProperties().asSequence()
|
||||||
.filter { (k, _) -> k !in blacklistProperties }
|
.map { (k, v) -> k.toString() to v.toString() }
|
||||||
.escapeQuotesForWindows()
|
.filter { (k, _) -> k !in this@KonanCliRunner.blacklistProperties }
|
||||||
.toMap()
|
.escapeQuotesForWindows()
|
||||||
)
|
.toMap()
|
||||||
args(listOf(toolName) + transformArgs(args))
|
)
|
||||||
blacklistEnvironment.forEach { environment.remove(it) }
|
exec.args(listOf(toolName) + transformArgs(args))
|
||||||
environment(environment)
|
this@KonanCliRunner.blacklistEnvironment.forEach { environment.remove(it) }
|
||||||
}
|
exec.environment(environment)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,5 +21,6 @@ tasks.named<KotlinCompile>("compileKotlin") {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api(project(":kotlin-stdlib"))
|
api(project(":kotlin-stdlib"))
|
||||||
implementation(project(":kotlin-compiler"))
|
implementation(project(project.project(":kotlin-native").extra["kotlinCompilerModule"] as Map<String, *>))
|
||||||
|
implementation(project(":compiler:util"))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ open class HostManager(
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
distribution: Distribution,
|
distribution: Distribution,
|
||||||
experimental: Boolean = false,
|
experimental: Boolean = false
|
||||||
) : this(distribution.subTargetProvider, experimental || distribution.experimentalEnabled)
|
) : this(distribution.subTargetProvider, experimental || distribution.experimentalEnabled)
|
||||||
|
|
||||||
fun targetManager(userRequest: String? = null): TargetManager = TargetManagerImpl(userRequest, this)
|
fun targetManager(userRequest: String? = null): TargetManager = TargetManagerImpl(userRequest, this)
|
||||||
|
|||||||
Reference in New Issue
Block a user