forked from JetBrains/kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
replicate_versions.xml
41 lines (35 loc) · 1.72 KB
/
replicate_versions.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<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.]+"/>"/>
<attribute name="replace-pattern" default="<!-- IDEA VERSION -->"/>
<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="@{replace-pattern}" replace="${main.plugin.version}" />
</sequential>
</macrodef>
</project>