From 526c85f820a585eb306e5eaf70d7eea1494d214d Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Wed, 24 Nov 2021 18:43:23 +0300 Subject: [PATCH] [KLIB] Add CLI key to provide relative path base --- .../cli/common/arguments/CommonCompilerArguments.kt | 12 ++++++++++++ compiler/testData/cli/js/jsExtraHelp.out | 2 ++ compiler/testData/cli/jvm/extraHelp.out | 2 ++ 3 files changed, 16 insertions(+) diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt index 09fc8d75d1f..2fdb52565a6 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt @@ -382,6 +382,18 @@ abstract class CommonCompilerArguments : CommonToolArguments() { ) var contextReceivers: Boolean by FreezableVar(false) + @Argument( + value = "-Xklib-relative-path-base", + description = "Provide a base paths to compute source's relative paths in klib (default is empty)" + ) + var relativePathBases: Array? by FreezableVar(null) + + @Argument( + value = "-Xklib-normalize-absolute-path", + description = "Normalize absolute paths in klibs" + ) + var normalizeAbsolutePath: Boolean by FreezableVar(false) + open fun configureAnalysisFlags(collector: MessageCollector, languageVersion: LanguageVersion): MutableMap, Any> { return HashMap, Any>().apply { put(AnalysisFlags.skipMetadataVersionCheck, skipMetadataVersionCheck) diff --git a/compiler/testData/cli/js/jsExtraHelp.out b/compiler/testData/cli/js/jsExtraHelp.out index 2e6aa5253a8..37a920dabe8 100644 --- a/compiler/testData/cli/js/jsExtraHelp.out +++ b/compiler/testData/cli/js/jsExtraHelp.out @@ -77,6 +77,7 @@ where advanced options include: -Xnew-inference Enable new experimental generic type inference algorithm -Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects -Xno-inline Disable method inlining + -Xklib-normalize-absolute-path Normalize absolute paths in klibs -Xopt-in= Enable usages of API that requires opt-in with an opt-in requirement marker with the given fully qualified name -Xphases-to-dump Dump backend state both before and after these phases -Xphases-to-dump-after Dump backend state after these phases @@ -88,6 +89,7 @@ where advanced options include: -Xprofile-phases Profile backend phases -Xproper-ieee754-comparisons Generate proper IEEE 754 comparisons in all cases if values are statically known to be of primitive numeric types -Xread-deserialized-contracts Enable reading of contracts from metadata + -Xklib-relative-path-base Provide a base paths to compute source's relative paths in klib (default is empty) -Xreport-output-files Report source to output files mapping -Xreport-perf Report detailed performance statistics -Xself-upper-bound-inference Support inferring type arguments based on only self upper bounds of the corresponding type parameters diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index 4507c2aaa71..bed51d65bb2 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -178,6 +178,7 @@ where advanced options include: -Xnew-inference Enable new experimental generic type inference algorithm -Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects -Xno-inline Disable method inlining + -Xklib-normalize-absolute-path Normalize absolute paths in klibs -Xopt-in= Enable usages of API that requires opt-in with an opt-in requirement marker with the given fully qualified name -Xphases-to-dump Dump backend state both before and after these phases -Xphases-to-dump-after Dump backend state after these phases @@ -189,6 +190,7 @@ where advanced options include: -Xprofile-phases Profile backend phases -Xproper-ieee754-comparisons Generate proper IEEE 754 comparisons in all cases if values are statically known to be of primitive numeric types -Xread-deserialized-contracts Enable reading of contracts from metadata + -Xklib-relative-path-base Provide a base paths to compute source's relative paths in klib (default is empty) -Xreport-output-files Report source to output files mapping -Xreport-perf Report detailed performance statistics -Xself-upper-bound-inference Support inferring type arguments based on only self upper bounds of the corresponding type parameters