JS backend: started to implement source maps
#KT-927 in progress (cherry picked from commits 5543cda, 6ed296b, 11186f9, 5b84d0b)
This commit is contained in:
@@ -153,11 +153,11 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
|
||||
EcmaVersion ecmaVersion = EcmaVersion.fromString(arguments.target);
|
||||
String moduleId = FileUtil.getNameWithoutExtension(new File(arguments.outputFile));
|
||||
if (arguments.libraryFiles != null) {
|
||||
return new LibrarySourcesConfig(project, moduleId, Arrays.asList(arguments.libraryFiles), ecmaVersion);
|
||||
return new LibrarySourcesConfig(project, moduleId, Arrays.asList(arguments.libraryFiles), ecmaVersion, arguments.sourcemap);
|
||||
}
|
||||
else {
|
||||
// lets discover the JS library definitions on the classpath
|
||||
return new ClassPathLibraryDefintionsConfig(project, moduleId, ecmaVersion);
|
||||
return new ClassPathLibraryDefintionsConfig(project, moduleId, ecmaVersion, arguments.sourcemap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,9 @@ public class K2JSCompilerArguments extends CompilerArguments {
|
||||
@Argument(value = "sourceFiles", description = "Source files (dir or file)")
|
||||
public String[] sourceFiles;
|
||||
|
||||
@Argument(value = "sourcemap", description = "Generate SourceMap")
|
||||
public boolean sourcemap;
|
||||
|
||||
@Argument(value = "target", description = "Generate js files for specific ECMA version (3 or 5, default ECMA 3)")
|
||||
public String target;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user