[K/N] Extract :native:cli-native from kotlin-native/backend.native/cli.bc

This commit is contained in:
Alexander Shabalin
2024-03-02 01:51:44 +01:00
committed by Space Team
parent bce550dce4
commit 0542b62430
11 changed files with 29 additions and 42 deletions
+5 -19
View File
@@ -22,9 +22,6 @@ sourceSets {
} }
resources.srcDir 'compiler/ir/backend.native/resources/' resources.srcDir 'compiler/ir/backend.native/resources/'
} }
cli_bc {
kotlin.srcDir 'cli.bc/src'
}
} }
compileCompilerKotlin { compileCompilerKotlin {
@@ -42,10 +39,6 @@ tasks.withType(KotlinCompilationTask.class).configureEach {
compilerOptions.optIn.add("org.jetbrains.kotlin.ir.symbols.UnsafeDuringIrConstructionAPI") compilerOptions.optIn.add("org.jetbrains.kotlin.ir.symbols.UnsafeDuringIrConstructionAPI")
} }
compileCli_bcKotlin {
compilerOptions.freeCompilerArgs.add('-Xskip-prerelease-check')
}
configurations { configurations {
kotlin_compiler_jar kotlin_compiler_jar
kotlin_stdlib_jar kotlin_stdlib_jar
@@ -53,11 +46,10 @@ configurations {
kotlin_script_runtime_jar kotlin_script_runtime_jar
trove4j_jar trove4j_jar
cli_bcApiElements { compilerApiElements {
extendsFrom cli_bcApi extendsFrom apiElements
extendsFrom compilerApi
} }
cli_bcApi.extendsFrom compilerApi
} }
dependencies { dependencies {
@@ -102,17 +94,12 @@ dependencies {
compilerApi(intellijCore()) compilerApi(intellijCore())
compileOnly(jpsModel()) compileOnly(jpsModel())
} }
cli_bcApi sourceSets.compiler.output
cli_bcApiElements sourceSets.cli_bc.output
} }
classes.dependsOn 'compilerClasses', 'cli_bcClasses' classes.dependsOn 'compilerClasses'
tasks.named("jar") { tasks.named("jar") {
from sourceSets.cli_bc.output, from sourceSets.compiler.output
sourceSets.compiler.output
dependsOn 'external_jars' dependsOn 'external_jars'
} }
@@ -158,7 +145,6 @@ tasks.register("debugCompiler", JavaExec) {
} }
RepoArtifacts.sourcesJar(project) { RepoArtifacts.sourcesJar(project) {
it.from(sourceSets["cli_bc"].allSource)
it.from(sourceSets["compiler"].allSource) it.from(sourceSets["compiler"].allSource)
} }
@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="Kotlin" />
<orderEntry type="module" module-name="cli" />
<orderEntry type="module" module-name="frontend" />
<orderEntry type="module" module-name="util" />
<orderEntry type="module" module-name="ir.psi2ir" />
<orderEntry type="module" module-name="ir.tree" />
<orderEntry type="module" module-name="frontend.java" />
</component>
</module>
@@ -26,7 +26,6 @@ apply plugin: 'kotlin.native.build-tools-conventions'
apply plugin: 'native-dependencies' apply plugin: 'native-dependencies'
configurations { configurations {
cli_bc
update_tests update_tests
nopPluginApi nopPluginApi
@@ -1443,7 +1442,7 @@ dependencies {
nopPluginApi project(":kotlin-util-klib-metadata") nopPluginApi project(":kotlin-util-klib-metadata")
nopPluginApi project(":compiler:ir.serialization.common") nopPluginApi project(":compiler:ir.serialization.common")
api project(path: ':kotlin-native:backend.native', configuration: 'cli_bcApiElements') api project(':native:cli-native')
api libs.junit4 api libs.junit4
} }
+1 -1
View File
@@ -184,7 +184,7 @@ dependencies {
distPack project(':native:base') distPack project(':native:base')
distPack project(':kotlin-native:utilities:cli-runner') distPack project(':kotlin-native:utilities:cli-runner')
distPack project(':kotlin-native:klib') distPack project(':kotlin-native:klib')
distPack project(path: ':kotlin-native:backend.native', configuration: 'cli_bcApiElements') distPack project(':native:cli-native')
distPack project(path: ':kotlin-native:endorsedLibraries:kotlinx.cli', configuration: "jvmRuntimeElements") distPack project(path: ':kotlin-native:endorsedLibraries:kotlinx.cli', configuration: "jvmRuntimeElements")
commonSources project(path: ':kotlin-stdlib', configuration: 'metadataSourcesElements') commonSources project(path: ':kotlin-stdlib', configuration: 'metadataSourcesElements')
commonSources project(path: ':kotlin-test', configuration: 'metadataSourcesElements') commonSources project(path: ':kotlin-test', configuration: 'metadataSourcesElements')
@@ -48,12 +48,14 @@ dependencies {
kotlinNativeEmbedded(project(":kotlin-native:backend.native")) kotlinNativeEmbedded(project(":kotlin-native:backend.native"))
kotlinNativeEmbedded(project(":kotlin-native:utilities:cli-runner")) kotlinNativeEmbedded(project(":kotlin-native:utilities:cli-runner"))
kotlinNativeEmbedded(project(":kotlin-native:klib")) kotlinNativeEmbedded(project(":kotlin-native:klib"))
kotlinNativeEmbedded(project(":kotlin-native:backend.native", "cli_bcApiElements")) kotlinNativeEmbedded(project(":native:cli-native"))
kotlinNativeEmbedded(project(":kotlin-native:endorsedLibraries:kotlinx.cli", "jvmRuntimeElements")) kotlinNativeEmbedded(project(":kotlin-native:endorsedLibraries:kotlinx.cli", "jvmRuntimeElements"))
kotlinNativeEmbedded(project(":kotlin-compiler")) { isTransitive = false } kotlinNativeEmbedded(project(":kotlin-compiler")) { isTransitive = false }
kotlinNativeSources(project(":kotlin-native:backend.native")) kotlinNativeSources(project(":kotlin-native:backend.native"))
kotlinNativeSources(project(":native:cli-native"))
kotlinNativeJavadoc(project(":kotlin-native:backend.native")) kotlinNativeJavadoc(project(":kotlin-native:backend.native"))
kotlinNativeJavadoc(project(":native:cli-native"))
testImplementation(libs.junit4) testImplementation(libs.junit4)
testImplementation(kotlinTest("junit")) testImplementation(kotlinTest("junit"))
@@ -7,6 +7,7 @@ plugins {
dependencies { dependencies {
implementation(kotlinStdlib()) implementation(kotlinStdlib())
implementation(project(":kotlin-native:backend.native")) implementation(project(":kotlin-native:backend.native"))
implementation(project(":native:cli-native"))
implementation(project(":compiler:cli-common")) implementation(project(":compiler:cli-common"))
implementation(project(":kotlin-native:Interop:StubGenerator")) implementation(project(":kotlin-native:Interop:StubGenerator"))
implementation(project(":kotlin-native:klib")) implementation(project(":kotlin-native:klib"))
+15
View File
@@ -0,0 +1,15 @@
plugins {
kotlin("jvm")
}
dependencies {
api(project(":kotlin-native:backend.native", "compilerApiElements"))
}
sourceSets {
"main" { projectDefault() }
"test" { none() }
}
sourcesJar()
javadocJar()
@@ -35,8 +35,9 @@ idePluginDependency {
proguardLibraryJars(project(":native:kotlin-native-utils")) { 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_stdlib_jar"))
proguardLibraryJars(project(":kotlin-native:backend.native", "kotlin_reflect_jar")) proguardLibraryJars(project(":kotlin-native:backend.native", "kotlin_reflect_jar"))
proguardLibraryJars(project(":kotlin-native:backend.native", "cli_bcApiElements")) proguardLibraryJars(project(":native:cli-native"))
backendNativeSourcesConfiguration(project(":kotlin-native:backend.native")) backendNativeSourcesConfiguration(project(":kotlin-native:backend.native"))
backendNativeSourcesConfiguration(project(":native:cli-native"))
} }
noDefaultJar() noDefaultJar()
+1
View File
@@ -899,4 +899,5 @@ if (buildProperties.isKotlinNativeEnabled) {
include ':kotlin-native:backend.native:tests' include ':kotlin-native:backend.native:tests'
include ':kotlin-native:prepare:kotlin-native-compiler-embeddable' include ':kotlin-native:prepare:kotlin-native-compiler-embeddable'
include ':native:kotlin-test-native-xctest' include ':native:kotlin-test-native-xctest'
include ':native:cli-native'
} }