Fix compilation for maven build
This commit is contained in:
@@ -120,9 +120,10 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments, K2JSCompile
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private static Config getConfig(@NotNull K2JSCompilerArguments arguments, @NotNull Project project) {
|
private static Config getConfig(@NotNull K2JSCompilerArguments arguments, @NotNull Project project) {
|
||||||
|
EcmaVersion ecmaVersion = EcmaVersion.fromString(arguments.target);
|
||||||
if (arguments.libzip == null) {
|
if (arguments.libzip == null) {
|
||||||
return Config.getEmptyConfig(project, arguments.target);
|
return Config.getEmptyConfig(project, ecmaVersion);
|
||||||
}
|
}
|
||||||
return new ZippedLibrarySourcesConfig(project, arguments.libzip, EcmaVersion.fromString(arguments.target));
|
return new ZippedLibrarySourcesConfig(project, arguments.libzip, ecmaVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ import java.util.List;
|
|||||||
public abstract class Config {
|
public abstract class Config {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static Config getEmptyConfig(@NotNull Project project, @Nullable String target) {
|
public static Config getEmptyConfig(@NotNull Project project, @NotNull EcmaVersion ecmaVersion) {
|
||||||
return new Config(project, EcmaVersion.fromString(target)) {
|
return new Config(project, ecmaVersion) {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
protected List<JetFile> generateLibFiles() {
|
protected List<JetFile> generateLibFiles() {
|
||||||
@@ -43,6 +43,13 @@ public abstract class Config {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//NOTE: used by mvn build
|
||||||
|
@SuppressWarnings("UnusedDeclaration")
|
||||||
|
@NotNull
|
||||||
|
public static Config getEmptyConfig(@NotNull Project project) {
|
||||||
|
return getEmptyConfig(project, EcmaVersion.defaultVersion());
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
protected static final List<String> LIB_FILE_NAMES = Arrays.asList(
|
protected static final List<String> LIB_FILE_NAMES = Arrays.asList(
|
||||||
"/core/annotations.kt",
|
"/core/annotations.kt",
|
||||||
|
|||||||
+1
-7
@@ -45,13 +45,7 @@ public class K2JSCompilerPlugin implements CompilerPlugin {
|
|||||||
List<JetFile> sources = context.getFiles();
|
List<JetFile> sources = context.getFiles();
|
||||||
|
|
||||||
if (bindingContext != null && sources != null && project != null) {
|
if (bindingContext != null && sources != null && project != null) {
|
||||||
Config config = new Config(project) {
|
Config config = Config.getEmptyConfig(project);
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
protected List<JetFile> generateLibFiles() {
|
|
||||||
return new ArrayList<JetFile>();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user