Replicate idea-version from the main plugin.xml to the android-idea-plugin plugin.xml

This commit is contained in:
Yan Zhulanow
2015-03-20 17:22:49 +03:00
parent 3e429c4b00
commit 900c67de4e
6 changed files with 64 additions and 1 deletions
Generated
+1
View File
@@ -12,5 +12,6 @@
</buildFile>
<buildFile url="file://$PROJECT_DIR$/pluginPublisher/TeamCityPluginPublisher.xml" />
<buildFile url="file://$PROJECT_DIR$/idea-runner/runner.xml" />
<buildFile url="file://$PROJECT_DIR$/replicate_versions.xml" />
</component>
</project>
+6
View File
@@ -1,6 +1,12 @@
<component name="ArtifactManager">
<artifact name="KotlinAndroidExtensions">
<output-path>$PROJECT_DIR$/out/artifacts/KotlinAndroidExtensions</output-path>
<properties id="ant-preprocessing">
<options enabled="true">
<file>file://$PROJECT_DIR$/replicate_versions.xml</file>
<target>replicateIdeaVersions</target>
</options>
</properties>
<root id="root">
<element id="directory" name="lib">
<element id="archive" name="kotlin-android-extensions.jar">
+11
View File
@@ -12,6 +12,10 @@
<property name="plugin.xml.bk" value="${version_substitute_dir}/plugin.xml.bk"/>
<property name="plugin.xml.versioned" value="${plugin.xml}.versioned" />
<property name="android-extensions.plugin.xml" value="plugins/android-idea-plugin/src/META-INF/plugin.xml"/>
<property name="android-extensions.plugin.xml.bk" value="${version_substitute_dir}/kotlin-android-extensions.plugin.xml.bk"/>
<property name="android-extensions.plugin.xml.versioned" value="${android-extensions.plugin.xml}.versioned" />
<property name="compiler.version.java" value="compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/KotlinVersion.java"/>
<property name="compiler.version.java.bk" value="${version_substitute_dir}/KotlinVersion.java.bk"/>
<property name="compiler.version.java.versioned" value="${compiler.version.java}.versioned" />
@@ -82,6 +86,12 @@
target.file.versioned="${plugin.xml.versioned}"
test.string="&lt;version&gt;@snapshot@&lt;/version&gt;"/>
<substituteVersionInFile
target.file="${android-extensions.plugin.xml}"
target.file.bk="${android-extensions.plugin.xml.bk}"
target.file.versioned="${android-extensions.plugin.xml.versioned}"
test.string="&lt;version&gt;@snapshot@&lt;/version&gt;"/>
<substituteVersionInFile
target.file="${compiler.version.java}"
target.file.bk="${compiler.version.java.bk}"
@@ -91,6 +101,7 @@
<target name="revertTemplateFiles">
<copy file="${plugin.xml.bk}" tofile="${plugin.xml}" overwrite="true"/>
<copy file="${android-extensions.plugin.xml.bk}" tofile="${android-extensions.plugin.xml}" overwrite="true"/>
<copy file="${compiler.version.java.bk}" tofile="${compiler.version.java}" overwrite="true"/>
<delete dir="${version_substitute_dir}" quiet="true"/>
+1
View File
@@ -6,6 +6,7 @@
<version>@snapshot@</version>
<vendor url="http://www.jetbrains.com">JetBrains s.r.o.</vendor>
<!-- Run replicateIdeaVersions Ant task after changing the versions. -->
<idea-version since-build="141.2" until-build="141.9999"/>
<depends optional="true" config-file="junit.xml">JUnit</depends>
@@ -6,7 +6,7 @@
<version>@snapshot@</version>
<vendor url="http://www.jetbrains.com">JetBrains Inc.</vendor>
<idea-version since-build="138.977" until-build="138.9999"/>
<idea-version since-build="141.2" until-build="141.9999"/>
<depends optional="false">org.jetbrains.kotlin</depends>
<depends optional="false">org.jetbrains.android</depends>
+44
View File
@@ -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="&lt;idea-version since-build=&quot;[0-9.]+&quot; until-build=&quot;[0-9.]+&quot;/&gt;"/>
<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 &quot;main.plugin.version&quot; must be set">
<condition>
<not>
<isset property="main.plugin.version"/>
</not>
</condition>
</fail>
<fail message="Property &quot;main.plugin.version&quot; 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>