JS: add metaInfo attribute to Config
This commit is contained in:
@@ -52,6 +52,8 @@ public abstract class Config {
|
||||
private final String moduleId;
|
||||
|
||||
private final boolean sourcemap;
|
||||
@Nullable
|
||||
private final String metaInfo;
|
||||
|
||||
@NotNull
|
||||
protected final List<KotlinJavascriptMetadata> metadata = new SmartList<KotlinJavascriptMetadata>();
|
||||
@@ -66,19 +68,26 @@ public abstract class Config {
|
||||
@NotNull String moduleId,
|
||||
@NotNull EcmaVersion ecmaVersion,
|
||||
boolean sourcemap,
|
||||
boolean inlineEnabled
|
||||
boolean inlineEnabled,
|
||||
@Nullable String metaInfo
|
||||
) {
|
||||
this.project = project;
|
||||
this.target = ecmaVersion;
|
||||
this.moduleId = moduleId;
|
||||
this.sourcemap = sourcemap;
|
||||
this.inlineEnabled = inlineEnabled;
|
||||
this.metaInfo = metaInfo;
|
||||
}
|
||||
|
||||
public boolean isSourcemap() {
|
||||
return sourcemap;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getMetaInfo() {
|
||||
return metaInfo;
|
||||
}
|
||||
|
||||
public boolean isInlineEnabled() {
|
||||
return inlineEnabled;
|
||||
}
|
||||
|
||||
@@ -61,9 +61,10 @@ public class LibrarySourcesConfig extends Config {
|
||||
@NotNull List<String> files,
|
||||
@NotNull EcmaVersion ecmaVersion,
|
||||
boolean sourcemap,
|
||||
boolean inlineEnabled
|
||||
boolean inlineEnabled,
|
||||
@Nullable String metaInfo
|
||||
) {
|
||||
super(project, moduleId, ecmaVersion, sourcemap, inlineEnabled);
|
||||
super(project, moduleId, ecmaVersion, sourcemap, inlineEnabled, metaInfo);
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
+15
-2
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.js.config;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.util.SmartList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.psi.JetFile;
|
||||
import org.jetbrains.kotlin.utils.KotlinJavascriptMetadata;
|
||||
import org.jetbrains.kotlin.utils.PathUtil;
|
||||
@@ -34,6 +35,19 @@ public class LibrarySourcesConfigWithCaching extends LibrarySourcesConfig {
|
||||
|
||||
private final boolean isUnitTestConfig;
|
||||
|
||||
public LibrarySourcesConfigWithCaching(
|
||||
@NotNull Project project,
|
||||
@NotNull String moduleId,
|
||||
@NotNull EcmaVersion ecmaVersion,
|
||||
boolean sourcemap,
|
||||
boolean inlineEnabled,
|
||||
boolean isUnitTestConfig,
|
||||
@Nullable String metaInfo
|
||||
) {
|
||||
super(project, moduleId, JS_STDLIB, ecmaVersion, sourcemap, inlineEnabled, metaInfo);
|
||||
this.isUnitTestConfig = isUnitTestConfig;
|
||||
}
|
||||
|
||||
public LibrarySourcesConfigWithCaching(
|
||||
@NotNull Project project,
|
||||
@NotNull String moduleId,
|
||||
@@ -42,8 +56,7 @@ public class LibrarySourcesConfigWithCaching extends LibrarySourcesConfig {
|
||||
boolean inlineEnabled,
|
||||
boolean isUnitTestConfig
|
||||
) {
|
||||
super(project, moduleId, JS_STDLIB, ecmaVersion, sourcemap, inlineEnabled);
|
||||
this.isUnitTestConfig = isUnitTestConfig;
|
||||
this(project, moduleId, ecmaVersion, sourcemap, inlineEnabled, isUnitTestConfig, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user