Add step to patch plugin xml so that it only works in Android Studio

This commit is contained in:
Pavel V. Talanov
2016-06-07 15:16:26 +03:00
committed by Yan Zhulanow
parent c7117d8e16
commit fcee4eb53a
2 changed files with 27 additions and 1 deletions

View File

@@ -160,7 +160,7 @@
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="stdlib.meta.js"/>
</target>
<target name="post_build" depends="zipArtifacts, revertTemplateFiles, printStatistics, remove_internal_artifacts, dont_remove_internal_artifacts"/>
<target name="post_build" depends="patchXmlForAndroidStudio, zipArtifacts, revertTemplateFiles, printStatistics, remove_internal_artifacts, dont_remove_internal_artifacts"/>
<target name="none">
<fail message="Either specify pre_build or post_build"/>
@@ -196,4 +196,28 @@
<target name="dont_remove_internal_artifacts" unless="need.remove.artifacts">
<echo message="Internal artifacts left untouched"/>
</target>
<macrodef name="patch_plugin_xml">
<attribute name="plugin.xml" />
<sequential>
<replace file="@{plugin.xml}" token="&lt;!-- DEPENDS-ON-AS-PLACEHOLDER --&gt;" value="&lt;depends&gt;com.intellij.modules.androidstudio&lt;/depends&gt;"/>
</sequential>
</macrodef>
<target name="patchXmlForAndroidStudio">
<unzip src="${artifact.output.path}/Kotlin/lib/kotlin-plugin.jar" dest="tmpAndroidStudio">
<patternset>
<include name="META-INF/plugin.xml"/>
</patternset>
</unzip>
<patch_plugin_xml plugin.xml="tmpAndroidStudio/META-INF/plugin.xml"/>
<jar destfile="${artifact.output.path}/Kotlin/lib/kotlin-plugin.jar" update="true">
<fileset dir="tmpAndroidStudio"/>
<file file="META-INF/plugin.xml"/>
</jar>
<delete file="tmpAndroidStudio"/>
</target>
</project>

View File

@@ -20,6 +20,8 @@
<depends optional="true" config-file="injection.xml">org.intellij.intelliLang</depends>
<depends optional="true" config-file="decompiler.xml">org.jetbrains.java.decompiler</depends>
<!-- DEPENDS-ON-AS-PLACEHOLDER -->
<!-- ULTIMATE-PLUGIN-PLACEHOLDER -->
<project-components>