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