JS: rename -source-map-source-roots to -source-map-base-dirs

See KT-19906
This commit is contained in:
Alexey Andreev
2017-09-27 15:43:04 +03:00
parent b3fe572447
commit 21e91c4052
8 changed files with 12 additions and 12 deletions
@@ -48,11 +48,12 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
var sourceMapPrefix: String? by FreezableVar(null)
@Argument(
value = "-source-map-source-roots",
value = "-source-map-base-dirs",
deprecatedName = "-source-map-source-roots",
valueDescription = "<path>",
description = "Base directories which are used to calculate relative paths to source files in source map"
)
var sourceMapSourceRoots: String? by FreezableVar(null)
var sourceMapBaseDirs: String? by FreezableVar(null)
@GradleOption(DefaultValues.JsSourceMapContentModes::class)
@Argument(
@@ -357,8 +357,8 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
configuration.put(JSConfigurationKeys.SOURCE_MAP_PREFIX, arguments.getSourceMapPrefix());
}
String sourceMapSourceRoots = arguments.getSourceMapSourceRoots() != null ?
arguments.getSourceMapSourceRoots() :
String sourceMapSourceRoots = arguments.getSourceMapBaseDirs() != null ?
arguments.getSourceMapBaseDirs() :
calculateSourceMapSourceRoot(messageCollector, arguments);
List<String> sourceMapSourceRootList = StringUtil.split(sourceMapSourceRoots, File.pathSeparator);
configuration.put(JSConfigurationKeys.SOURCE_MAP_SOURCE_ROOTS, sourceMapSourceRootList);
@@ -367,7 +367,7 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
if (arguments.getSourceMapPrefix() != null) {
messageCollector.report(WARNING, "source-map-prefix argument has no effect without source map", null);
}
if (arguments.getSourceMapSourceRoots() != null) {
if (arguments.getSourceMapBaseDirs() != null) {
messageCollector.report(WARNING, "source-map-source-root argument has no effect without source map", null);
}
}
+1 -2
View File
@@ -10,11 +10,10 @@ where possible options include:
-output-postfix <path> Path to file which will be added to the end of output file
-output-prefix <path> Path to file which will be added to the beginning of output file
-source-map Generate source map
-source-map-base-dirs <path> Base directories which are used to calculate relative paths to source files in source map
-source-map-embed-sources { always, never, inlining }
Embed source files into source map
-source-map-prefix Prefix for paths in a source map
-source-map-source-roots <path>
Base directories which are used to calculate relative paths to source files in source map
-target { v5 } Generate JS files for specific ECMA version
-api-version <version> Allow to use declarations only from the specified version of bundled libraries
-X Print a synopsis of advanced options
@@ -1,7 +1,7 @@
$TESTDATA_DIR$/sourceMapDuplicatePath/
-no-stdlib
-source-map
-source-map-source-roots
-source-map-base-dirs
$TESTDATA_DIR$/sourceMapDuplicatePath/foo:$TESTDATA_DIR$/sourceMapDuplicatePath/bar
-output
$TEMP_DIR$/out.js
+1 -1
View File
@@ -2,7 +2,7 @@ $TESTDATA_DIR$/sourceMapRoot/foo/file1.kt
$TESTDATA_DIR$/sourceMapRoot/bar/file2.kt
-no-stdlib
-source-map
-source-map-source-roots
-source-map-base-dirs
$TESTDATA_DIR$/
-output
$TEMP_DIR$/out.js
+1 -1
View File
@@ -4,7 +4,7 @@ $TESTDATA_DIR$/sourceMapRoot/bar/baz/file3.kt
$TESTDATA_DIR$/sourceMapRoot/foo/baz/file4.kt
-no-stdlib
-source-map
-source-map-source-roots
-source-map-base-dirs
$TESTDATA_DIR$/sourceMapRoot/foo
-output
$TEMP_DIR$/out.js
+1 -1
View File
@@ -2,7 +2,7 @@ $TESTDATA_DIR$/sourceMapRoot/foo/file1.kt
$TESTDATA_DIR$/sourceMapRoot/bar/file2.kt
-no-stdlib
-source-map
-source-map-source-roots
-source-map-base-dirs
$TESTDATA_DIR$/foo:$TESTDATA_DIR$/bar
-output
$TEMP_DIR$/out.js
@@ -97,7 +97,7 @@ class JpsKotlinCompilerRunner : KotlinCompilerRunner<JpsCompilerEnvironment>() {
setupK2JsArguments(outputFile, sourceFiles, libraries, friendModules, arguments)
if (arguments.sourceMap) {
arguments.sourceMapSourceRoots = sourceRoots.joinToString(File.pathSeparator) { it.path }
arguments.sourceMapBaseDirs = sourceRoots.joinToString(File.pathSeparator) { it.path }
}
log.debug("K2JS: arguments after setup" + ArgumentUtils.convertArgumentsToStringList(arguments))