added a (currently disabled) test case for compiling the JS code from the kotlin-js-library maven build
This commit is contained in:
@@ -148,10 +148,13 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments, K2JSCompile
|
||||
private static Config getConfig(@NotNull K2JSCompilerArguments arguments, @NotNull Project project) {
|
||||
EcmaVersion ecmaVersion = EcmaVersion.fromString(arguments.target);
|
||||
String moduleId = FileUtil.getNameWithoutExtension(new File(arguments.outputFile));
|
||||
if (arguments.libraryFiles == null) {
|
||||
if (arguments.libraryFiles != null) {
|
||||
return new LibrarySourcesConfig(project, moduleId, Arrays.asList(arguments.libraryFiles), ecmaVersion);
|
||||
} if (arguments.libraryDirectories != null) {
|
||||
return new LibrarySourceDirectoriesConfig(project, moduleId, arguments.libraryDirectories, ecmaVersion);
|
||||
} else {
|
||||
// lets discover the JS library definitions on the classpath
|
||||
return new ClassPathLibraryDefintionsConfig(project, moduleId, ecmaVersion);
|
||||
}
|
||||
return new LibrarySourcesConfig(project, moduleId, Arrays.asList(arguments.libraryFiles), ecmaVersion);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,9 @@ public class K2JSCompilerArguments extends CompilerArguments {
|
||||
@Argument(value = "libraryFiles", description = "Path to zipped lib sources or kotlin files")
|
||||
public String[] libraryFiles;
|
||||
|
||||
@Argument(value = "libraryDirectories", description = "Path to directory containing source kotlin files")
|
||||
public String[] libraryDirectories;
|
||||
|
||||
@Argument(value = "sourceFiles", description = "Source files (dir or file)")
|
||||
public String[] sourceFiles;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user