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

(cherry picked from commit fcee4eb)

(cherry picked from commit 14f7731)
This commit is contained in:
Pavel V. Talanov
2016-06-07 14:16:26 +02:00
committed by Dmitry Jemerov
parent 4fc9b44f75
commit ee0cff3426
2 changed files with 27 additions and 1 deletions

View File

@@ -154,7 +154,7 @@
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="${compiled.stdlib.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"/>
@@ -192,4 +192,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

@@ -22,6 +22,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>