Replicate idea-version from the main plugin.xml to the android-idea-plugin plugin.xml
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<project name="ReplicateIdeaVersions" default="replicateIdeaVersions">
|
||||
<property name="plugin.xml" value="idea/src/META-INF/plugin.xml"/>
|
||||
<property name="android-extensions.plugin.xml" value="plugins/android-idea-plugin/src/META-INF/plugin.xml"/>
|
||||
|
||||
<macrodef name="replicateIdeaVersion">
|
||||
<attribute name="target.file"/>
|
||||
<attribute name="idea-version-pattern" default="<idea-version since-build="[0-9.]+" until-build="[0-9.]+"/>"/>
|
||||
|
||||
<sequential>
|
||||
<loadfile srcfile="${plugin.xml}" property="main.plugin.version">
|
||||
<filterchain>
|
||||
<linecontainsregexp>
|
||||
<regexp pattern="@{idea-version-pattern}"/>
|
||||
</linecontainsregexp>
|
||||
<trim/>
|
||||
<headfilter lines="1" />
|
||||
<striplinebreaks />
|
||||
</filterchain>
|
||||
</loadfile>
|
||||
|
||||
<echo message="${main.plugin.version}" />
|
||||
|
||||
<fail message="Property "main.plugin.version" must be set">
|
||||
<condition>
|
||||
<not>
|
||||
<isset property="main.plugin.version"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
|
||||
<fail message="Property "main.plugin.version" must not be empty">
|
||||
<condition>
|
||||
<equals arg1="${main.plugin.version}" arg2=""/>
|
||||
</condition>
|
||||
</fail>
|
||||
|
||||
<replaceregexp file="@{target.file}" byline="true" match="@{idea-version-pattern}" replace="${main.plugin.version}" />
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<target name="replicateIdeaVersions">
|
||||
<replicateIdeaVersion target.file="${android-extensions.plugin.xml}" />
|
||||
</target>
|
||||
</project>
|
||||
Reference in New Issue
Block a user