Commit 219ebad9 authored by zhen.jiang's avatar zhen.jiang

修改gc-compress配置项名称

parent 4a1a4b90
...@@ -10925,11 +10925,11 @@ ...@@ -10925,11 +10925,11 @@
} }
}, },
{ {
"name": "Xnative-debuginfo-gc-compress", "name": "Xnative-ohos-debuginfo-gc-compress",
"shortName": null, "shortName": null,
"deprecatedName": null, "deprecatedName": null,
"description": { "description": {
"current": "Value of kotlin.native.debuginfo.gc-compress from gradle.properties (single option, no per-target).", "current": "Value of kotlin.native.ohos.debuginfo.gc-compress from gradle.properties (single option, no per-target).",
"valueInVersions": [] "valueInVersions": []
}, },
"delimiter": null, "delimiter": null,
......
...@@ -1066,9 +1066,9 @@ The default value is 1.""".asReleaseDependent() ...@@ -1066,9 +1066,9 @@ The default value is 1.""".asReleaseDependent()
} }
compilerArgument { compilerArgument {
name = "Xnative-debuginfo-gc-compress" name = "Xnative-ohos-debuginfo-gc-compress"
compilerName = "nativeDebuginfoGcCompress" compilerName = "nativeOhosDebuginfoGcCompress"
description = "Value of kotlin.native.debuginfo.gc-compress from gradle.properties (single option, no per-target).".asReleaseDependent() description = "Value of kotlin.native.ohos.debuginfo.gc-compress from gradle.properties (single option, no per-target).".asReleaseDependent()
valueType = StringType.defaultNull valueType = StringType.defaultNull
valueDescription = "<value>".asReleaseDependent() valueDescription = "<value>".asReleaseDependent()
......
...@@ -984,11 +984,11 @@ The default value is 1.""", ...@@ -984,11 +984,11 @@ The default value is 1.""",
} }
@Argument( @Argument(
value = "-Xnative-debuginfo-gc-compress", value = "-Xnative-ohos-debuginfo-gc-compress",
valueDescription = "<value>", valueDescription = "<value>",
description = "Value of kotlin.native.debuginfo.gc-compress from gradle.properties (single option, no per-target).", description = "Value of kotlin.native.ohos.debuginfo.gc-compress from gradle.properties (single option, no per-target).",
) )
var nativeDebuginfoGcCompress: String? = null var nativeOhosDebuginfoGcCompress: String? = null
set(value) { set(value) {
checkFrozen() checkFrozen()
field = if (value.isNullOrEmpty()) null else value field = if (value.isNullOrEmpty()) null else value
......
...@@ -62,7 +62,7 @@ fun copyK2NativeCompilerArguments(from: K2NativeCompilerArguments, to: K2NativeC ...@@ -62,7 +62,7 @@ fun copyK2NativeCompilerArguments(from: K2NativeCompilerArguments, to: K2NativeC
to.manifestNativeTargets = from.manifestNativeTargets?.copyOf() to.manifestNativeTargets = from.manifestNativeTargets?.copyOf()
to.memoryModel = from.memoryModel to.memoryModel = from.memoryModel
to.moduleName = from.moduleName to.moduleName = from.moduleName
to.nativeDebuginfoGcCompress = from.nativeDebuginfoGcCompress to.nativeOhosDebuginfoGcCompress = from.nativeOhosDebuginfoGcCompress
to.nativeLibraries = from.nativeLibraries?.copyOf() to.nativeLibraries = from.nativeLibraries?.copyOf()
to.noObjcGenerics = from.noObjcGenerics to.noObjcGenerics = from.noObjcGenerics
to.nodefaultlibs = from.nodefaultlibs to.nodefaultlibs = from.nodefaultlibs
......
...@@ -153,7 +153,7 @@ class KonanConfigKeys { ...@@ -153,7 +153,7 @@ class KonanConfigKeys {
val MANIFEST_NATIVE_TARGETS: CompilerConfigurationKey<Collection<KonanTarget>?> = CompilerConfigurationKey.create("value of native_targets property to write in manifest") val MANIFEST_NATIVE_TARGETS: CompilerConfigurationKey<Collection<KonanTarget>?> = CompilerConfigurationKey.create("value of native_targets property to write in manifest")
val LLVM_MODULE_PASSES: CompilerConfigurationKey<String?> = CompilerConfigurationKey.create("llvm passes to run instead of module optimization pipeline") val LLVM_MODULE_PASSES: CompilerConfigurationKey<String?> = CompilerConfigurationKey.create("llvm passes to run instead of module optimization pipeline")
val LLVM_LTO_PASSES: CompilerConfigurationKey<String?> = CompilerConfigurationKey.create("llvm passes to run instead of LTO optimization pipeline") val LLVM_LTO_PASSES: CompilerConfigurationKey<String?> = CompilerConfigurationKey.create("llvm passes to run instead of LTO optimization pipeline")
/** Value of kotlin.native.debuginfo.gc-compress from gradle.properties (boolean), passed via -Xnative-debuginfo-gc-compress. No per-target. */ /** Value of kotlin.native.ohos.debuginfo.gc-compress from gradle.properties (boolean), passed via -Xnative-ohos-debuginfo-gc-compress. No per-target. */
val NATIVE_DEBUGINFO_GC_COMPRESS: CompilerConfigurationKey<Boolean?> = CompilerConfigurationKey.create("native debuginfo gc-compress option") val NATIVE_OHOS_DEBUGINFO_GC_COMPRESS: CompilerConfigurationKey<Boolean?> = CompilerConfigurationKey.create("native ohos debuginfo gc-compress option")
} }
} }
...@@ -215,7 +215,7 @@ fun CompilerConfiguration.setupFromArguments(arguments: K2NativeCompilerArgument ...@@ -215,7 +215,7 @@ fun CompilerConfiguration.setupFromArguments(arguments: K2NativeCompilerArgument
put(FAKE_OVERRIDE_VALIDATOR, arguments.fakeOverrideValidator) put(FAKE_OVERRIDE_VALIDATOR, arguments.fakeOverrideValidator)
putIfNotNull(PRE_LINK_CACHES, parsePreLinkCachesValue(this@setupFromArguments, arguments.preLinkCaches)) putIfNotNull(PRE_LINK_CACHES, parsePreLinkCachesValue(this@setupFromArguments, arguments.preLinkCaches))
putIfNotNull(OVERRIDE_KONAN_PROPERTIES, parseOverrideKonanProperties(arguments, this@setupFromArguments)) putIfNotNull(OVERRIDE_KONAN_PROPERTIES, parseOverrideKonanProperties(arguments, this@setupFromArguments))
putIfNotNull(NATIVE_DEBUGINFO_GC_COMPRESS, arguments.nativeDebuginfoGcCompress?.toBooleanStrictOrNull()) putIfNotNull(NATIVE_OHOS_DEBUGINFO_GC_COMPRESS, arguments.nativeOhosDebuginfoGcCompress?.toBooleanStrictOrNull())
when (arguments.destroyRuntimeMode) { when (arguments.destroyRuntimeMode) {
null -> {} null -> {}
"legacy" -> { "legacy" -> {
......
...@@ -440,14 +440,14 @@ internal fun <C : PhaseContext> PhaseEngine<C>.compileAndLink( ...@@ -440,14 +440,14 @@ internal fun <C : PhaseContext> PhaseEngine<C>.compileAndLink(
} }
/** /**
* 在 compileAndLink 中可通过 context 获取 kotlin.native.debuginfo.gc-compress 的取值。 * 在 compileAndLink 中可通过 context 获取 kotlin.native.ohos.debuginfo.gc-compress 的取值。
* gradle.properties 为 kotlin.native.debuginfo.gc-compress=<value>(无 per-target), * gradle.properties 为 kotlin.native.ohos.debuginfo.gc-compress=<value>(无 per-target),
* Gradle 传 -Xnative-debuginfo-gc-compress=<value>,此处用 NATIVE_DEBUGINFO_GC_COMPRESS 读取。 * Gradle 传 -Xnative-ohos-debuginfo-gc-compress=<value>,此处用 NATIVE_OHOS_DEBUGINFO_GC_COMPRESS 读取。
*/ */
internal fun <C : PhaseContext> PhaseEngine<C>.handleDebugInfo() { internal fun <C : PhaseContext> PhaseEngine<C>.handleDebugInfo() {
val nativeDebuginfoGcCompress: Boolean? = context.config.configuration.get(KonanConfigKeys.NATIVE_DEBUGINFO_GC_COMPRESS) val nativeOhosDebuginfoGcCompress: Boolean? = context.config.configuration.get(KonanConfigKeys.NATIVE_OHOS_DEBUGINFO_GC_COMPRESS)
if (nativeDebuginfoGcCompress == true) { if (nativeOhosDebuginfoGcCompress == true) {
// TODO: 使用 nativeDebuginfoGcCompress 控制 debug info 行为 // TODO: 使用 nativeOhosDebuginfoGcCompress 控制 debug info 行为
} }
} }
......
...@@ -38,6 +38,6 @@ internal fun Project.getKonanParallelThreads(): Int { ...@@ -38,6 +38,6 @@ internal fun Project.getKonanParallelThreads(): Int {
return PropertiesProvider(this).nativeParallelThreads ?: 4 return PropertiesProvider(this).nativeParallelThreads ?: 4
} }
internal fun Project.getNativeDebuginfoGcCompress(): Boolean? { internal fun Project.getNativeOhosDebuginfoGcCompress(): Boolean? {
return PropertiesProvider(this).nativeDebuginfoGcCompress return PropertiesProvider(this).nativeOhosDebuginfoGcCompress
} }
...@@ -317,10 +317,10 @@ internal class PropertiesProvider private constructor(private val project: Proje ...@@ -317,10 +317,10 @@ internal class PropertiesProvider private constructor(private val project: Proje
} }
/** /**
* gradle.properties 中 kotlin.native.debuginfo.gc-compress=true/false,传入 -Xnative-debuginfo-gc-compress(无 per-target)。与 [incrementalNative] 同为 Boolean?。 * gradle.properties 中 kotlin.native.ohos.debuginfo.gc-compress=true/false,传入 -Xnative-ohos-debuginfo-gc-compress(无 per-target)。与 [incrementalNative] 同为 Boolean?。
*/ */
val nativeDebuginfoGcCompress: Boolean? val nativeOhosDebuginfoGcCompress: Boolean?
get() = booleanProperty(PropertyNames.KOTLIN_NATIVE_DEBUGINFO_GC_COMPRESS) get() = booleanProperty(PropertyNames.KOTLIN_NATIVE_OHOS_DEBUGINFO_GC_COMPRESS)
/** /**
...@@ -750,7 +750,7 @@ internal class PropertiesProvider private constructor(private val project: Proje ...@@ -750,7 +750,7 @@ internal class PropertiesProvider private constructor(private val project: Proje
val KOTLIN_NATIVE_DEPENDENCY_PROPAGATION = property("kotlin.native.enableDependencyPropagation") val KOTLIN_NATIVE_DEPENDENCY_PROPAGATION = property("kotlin.native.enableDependencyPropagation")
val KOTLIN_NATIVE_CACHE_ORCHESTRATION = property("kotlin.native.cacheOrchestration") val KOTLIN_NATIVE_CACHE_ORCHESTRATION = property("kotlin.native.cacheOrchestration")
val KOTLIN_NATIVE_PARALLEL_THREADS = property("kotlin.native.parallelThreads") val KOTLIN_NATIVE_PARALLEL_THREADS = property("kotlin.native.parallelThreads")
val KOTLIN_NATIVE_DEBUGINFO_GC_COMPRESS = property("kotlin.native.debuginfo.gc-compress") val KOTLIN_NATIVE_OHOS_DEBUGINFO_GC_COMPRESS = property("kotlin.native.ohos.debuginfo.gc-compress")
val KOTLIN_NATIVE_INCREMENTAL_COMPILATION = property("kotlin.incremental.native") val KOTLIN_NATIVE_INCREMENTAL_COMPILATION = property("kotlin.incremental.native")
val KOTLIN_MPP_ENABLE_OPTIMISTIC_NUMBER_COMMONIZATION = property("kotlin.mpp.enableOptimisticNumberCommonization") val KOTLIN_MPP_ENABLE_OPTIMISTIC_NUMBER_COMMONIZATION = property("kotlin.mpp.enableOptimisticNumberCommonization")
val KOTLIN_MPP_ENABLE_PLATFORM_INTEGER_COMMONIZATION = property("kotlin.mpp.enablePlatformIntegerCommonization") val KOTLIN_MPP_ENABLE_PLATFORM_INTEGER_COMMONIZATION = property("kotlin.mpp.enablePlatformIntegerCommonization")
......
...@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.compilerRunner.addBuildMetricsForTaskAction ...@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.compilerRunner.addBuildMetricsForTaskAction
import org.jetbrains.kotlin.compilerRunner.getKonanCacheKind import org.jetbrains.kotlin.compilerRunner.getKonanCacheKind
import org.jetbrains.kotlin.compilerRunner.getKonanCacheOrchestration import org.jetbrains.kotlin.compilerRunner.getKonanCacheOrchestration
import org.jetbrains.kotlin.compilerRunner.getKonanParallelThreads import org.jetbrains.kotlin.compilerRunner.getKonanParallelThreads
import org.jetbrains.kotlin.compilerRunner.getNativeDebuginfoGcCompress import org.jetbrains.kotlin.compilerRunner.getNativeOhosDebuginfoGcCompress
import org.jetbrains.kotlin.compilerRunner.isKonanIncrementalCompilationEnabled import org.jetbrains.kotlin.compilerRunner.isKonanIncrementalCompilationEnabled
import org.jetbrains.kotlin.gradle.InternalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.InternalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.* import org.jetbrains.kotlin.gradle.dsl.*
...@@ -294,7 +294,7 @@ constructor( ...@@ -294,7 +294,7 @@ constructor(
args.mainPackage = entryPoint args.mainPackage = entryPoint
args.singleLinkerArguments = (linkerOpts + additionalLinkerOpts).toTypedArray() args.singleLinkerArguments = (linkerOpts + additionalLinkerOpts).toTypedArray()
args.binaryOptions = binaryOptions.map { (key, value) -> "$key=$value" }.toTypedArray() args.binaryOptions = binaryOptions.map { (key, value) -> "$key=$value" }.toTypedArray()
args.nativeDebuginfoGcCompress = project.getNativeDebuginfoGcCompress()?.toString() args.nativeOhosDebuginfoGcCompress = project.getNativeOhosDebuginfoGcCompress()?.toString()
args.staticFramework = isStaticFramework args.staticFramework = isStaticFramework
args.konanDataDir = kotlinNativeProvider.get().konanDataDir.orNull args.konanDataDir = kotlinNativeProvider.get().konanDataDir.orNull
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment