Add support for sourceMapPrefix option (JS) in IDEA
This commit is contained in:
@@ -133,6 +133,7 @@ class KotlinMavenImporter : MavenImporter(KOTLIN_PLUGIN_GROUP_ID, KOTLIN_PLUGIN_
|
|||||||
}
|
}
|
||||||
is K2JSCompilerArguments -> {
|
is K2JSCompilerArguments -> {
|
||||||
arguments.sourceMap = configuration?.getChild("sourceMap")?.text?.trim()?.toBoolean() ?: false
|
arguments.sourceMap = configuration?.getChild("sourceMap")?.text?.trim()?.toBoolean() ?: false
|
||||||
|
arguments.sourceMapPrefix = configuration?.getChild("sourceMapPrefix")?.text?.trim() ?: ""
|
||||||
arguments.outputFile = configuration?.getChild("outputFile")?.text
|
arguments.outputFile = configuration?.getChild("outputFile")?.text
|
||||||
arguments.metaInfo = configuration?.getChild("metaInfo")?.text?.trim()?.toBoolean() ?: false
|
arguments.metaInfo = configuration?.getChild("metaInfo")?.text?.trim()?.toBoolean() ?: false
|
||||||
arguments.moduleKind = configuration?.getChild("moduleKind")?.text
|
arguments.moduleKind = configuration?.getChild("moduleKind")?.text
|
||||||
|
|||||||
+28
-11
@@ -3,7 +3,7 @@
|
|||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="12" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="12" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<xy x="350" y="20" width="920" height="823"/>
|
<xy x="350" y="20" width="920" height="1119"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
<border type="empty">
|
<border type="empty">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<grid row="11" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
<grid row="11" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</vspacer>
|
</vspacer>
|
||||||
<grid id="98e8a" binding="k2jsPanel" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="98e8a" binding="k2jsPanel" layout-manager="GridLayoutManager" row-count="7" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="8" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="true"/>
|
<grid row="8" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="true"/>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<children>
|
<children>
|
||||||
<component id="3ac8f" class="javax.swing.JLabel" binding="labelForOutputPrefixFile">
|
<component id="3ac8f" class="javax.swing.JLabel" binding="labelForOutputPrefixFile">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text resource-bundle="org/jetbrains/kotlin/idea/KotlinBundle" key="kotlin.compiler.js.option.output.prefix"/>
|
<text resource-bundle="org/jetbrains/kotlin/idea/KotlinBundle" key="kotlin.compiler.js.option.output.prefix"/>
|
||||||
@@ -38,13 +38,13 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="dd0c2" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="outputPrefixFile">
|
<component id="dd0c2" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="outputPrefixFile">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
</component>
|
</component>
|
||||||
<component id="70326" class="javax.swing.JLabel" binding="labelForOutputPostfixFile">
|
<component id="70326" class="javax.swing.JLabel" binding="labelForOutputPostfixFile">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text resource-bundle="org/jetbrains/kotlin/idea/KotlinBundle" key="kotlin.compiler.js.option.output.postfix"/>
|
<text resource-bundle="org/jetbrains/kotlin/idea/KotlinBundle" key="kotlin.compiler.js.option.output.postfix"/>
|
||||||
@@ -52,13 +52,13 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="1bdb7" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="outputPostfixFile">
|
<component id="1bdb7" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="outputPostfixFile">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
</component>
|
</component>
|
||||||
<component id="b93a8" class="javax.swing.JLabel" binding="labelForOutputDirectory">
|
<component id="b93a8" class="javax.swing.JLabel" binding="labelForOutputDirectory">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="&Destination directory"/>
|
<text value="&Destination directory"/>
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="7c11a" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="outputDirectory">
|
<component id="7c11a" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="outputDirectory">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
<preferred-size width="150" height="-1"/>
|
<preferred-size width="150" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="97317" class="com.intellij.util.ui.ThreeStateCheckBox" binding="copyRuntimeFilesCheckBox" custom-create="true">
|
<component id="97317" class="com.intellij.util.ui.ThreeStateCheckBox" binding="copyRuntimeFilesCheckBox" custom-create="true">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<state value="NOT_SELECTED"/>
|
<state value="NOT_SELECTED"/>
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="915d" class="javax.swing.JLabel">
|
<component id="915d" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<labelFor value="ca29c"/>
|
<labelFor value="ca29c"/>
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="ca29c" class="javax.swing.JComboBox" binding="moduleKindComboBox">
|
<component id="ca29c" class="javax.swing.JComboBox" binding="moduleKindComboBox">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<model/>
|
<model/>
|
||||||
@@ -109,6 +109,23 @@
|
|||||||
<text resource-bundle="org/jetbrains/kotlin/idea/KotlinBundle" key="kotlin.compiler.js.option.generate.sourcemaps"/>
|
<text resource-bundle="org/jetbrains/kotlin/idea/KotlinBundle" key="kotlin.compiler.js.option.generate.sourcemaps"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
|
<component id="6484c" class="javax.swing.JLabel" binding="labelForSourceMapPrefix">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<labelFor value="e65e6"/>
|
||||||
|
<text value="Add prefix to paths in source map:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="e65e6" class="javax.swing.JTextField" binding="sourceMapPrefix">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
</children>
|
</children>
|
||||||
</grid>
|
</grid>
|
||||||
<grid id="483d4" binding="scriptPanel" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="483d4" binding="scriptPanel" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
|||||||
+9
@@ -112,6 +112,8 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
private JLabel labelForOutputPrefixFile;
|
private JLabel labelForOutputPrefixFile;
|
||||||
private JLabel labelForOutputPostfixFile;
|
private JLabel labelForOutputPostfixFile;
|
||||||
private JLabel warningLabel;
|
private JLabel warningLabel;
|
||||||
|
private JTextField sourceMapPrefix;
|
||||||
|
private JLabel labelForSourceMapPrefix;
|
||||||
private boolean isEnabled = true;
|
private boolean isEnabled = true;
|
||||||
|
|
||||||
public KotlinCompilerConfigurableTab(
|
public KotlinCompilerConfigurableTab(
|
||||||
@@ -190,6 +192,8 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generateSourceMapsCheckBox.addActionListener(event -> sourceMapPrefix.setEnabled(generateSourceMapsCheckBox.isSelected()));
|
||||||
|
|
||||||
updateOutputDirEnabled();
|
updateOutputDirEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,6 +408,7 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
ComparingUtils.isModified(outputPrefixFile, k2jsCompilerArguments.outputPrefix) ||
|
ComparingUtils.isModified(outputPrefixFile, k2jsCompilerArguments.outputPrefix) ||
|
||||||
ComparingUtils.isModified(outputPostfixFile, k2jsCompilerArguments.outputPostfix) ||
|
ComparingUtils.isModified(outputPostfixFile, k2jsCompilerArguments.outputPostfix) ||
|
||||||
!getSelectedModuleKind().equals(getModuleKindOrDefault(k2jsCompilerArguments.moduleKind)) ||
|
!getSelectedModuleKind().equals(getModuleKindOrDefault(k2jsCompilerArguments.moduleKind)) ||
|
||||||
|
ComparingUtils.isModified(sourceMapPrefix, k2jsCompilerArguments.sourceMapPrefix) ||
|
||||||
|
|
||||||
!getSelectedJvmVersion().equals(getJvmVersionOrDefault(k2jvmCompilerArguments.jvmTarget));
|
!getSelectedJvmVersion().equals(getJvmVersionOrDefault(k2jvmCompilerArguments.jvmTarget));
|
||||||
}
|
}
|
||||||
@@ -493,6 +498,8 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
k2jsCompilerArguments.outputPostfix = StringUtil.nullize(outputPostfixFile.getText(), true);
|
k2jsCompilerArguments.outputPostfix = StringUtil.nullize(outputPostfixFile.getText(), true);
|
||||||
k2jsCompilerArguments.moduleKind = getSelectedModuleKind();
|
k2jsCompilerArguments.moduleKind = getSelectedModuleKind();
|
||||||
|
|
||||||
|
k2jsCompilerArguments.sourceMapPrefix = sourceMapPrefix.getText();
|
||||||
|
|
||||||
k2jvmCompilerArguments.jvmTarget = getSelectedJvmVersion();
|
k2jvmCompilerArguments.jvmTarget = getSelectedJvmVersion();
|
||||||
|
|
||||||
if (isProjectSettings) {
|
if (isProjectSettings) {
|
||||||
@@ -533,6 +540,8 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
|||||||
outputPostfixFile.setText(k2jsCompilerArguments.outputPostfix);
|
outputPostfixFile.setText(k2jsCompilerArguments.outputPostfix);
|
||||||
|
|
||||||
moduleKindComboBox.setSelectedItem(getModuleKindOrDefault(k2jsCompilerArguments.moduleKind));
|
moduleKindComboBox.setSelectedItem(getModuleKindOrDefault(k2jsCompilerArguments.moduleKind));
|
||||||
|
sourceMapPrefix.setText(k2jsCompilerArguments.sourceMapPrefix);
|
||||||
|
sourceMapPrefix.setEnabled(k2jsCompilerArguments.sourceMap);
|
||||||
|
|
||||||
jvmVersionComboBox.setSelectedItem(getJvmVersionOrDefault(k2jvmCompilerArguments.jvmTarget));
|
jvmVersionComboBox.setSelectedItem(getJvmVersionOrDefault(k2jvmCompilerArguments.jvmTarget));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ val jvmUIExposedFields = commonUIExposedFields + jvmSpecificUIExposedFields
|
|||||||
private val jvmPrimaryFields = commonPrimaryFields + jvmSpecificUIExposedFields
|
private val jvmPrimaryFields = commonPrimaryFields + jvmSpecificUIExposedFields
|
||||||
|
|
||||||
private val jsSpecificUIExposedFields = listOf(K2JSCompilerArguments::sourceMap.name,
|
private val jsSpecificUIExposedFields = listOf(K2JSCompilerArguments::sourceMap.name,
|
||||||
|
K2JSCompilerArguments::sourceMapPrefix.name,
|
||||||
K2JSCompilerArguments::outputPrefix.name,
|
K2JSCompilerArguments::outputPrefix.name,
|
||||||
K2JSCompilerArguments::outputPostfix.name,
|
K2JSCompilerArguments::outputPostfix.name,
|
||||||
K2JSCompilerArguments::moduleKind.name)
|
K2JSCompilerArguments::moduleKind.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user