add plugin version patching
authorEugene.Petrenko <eugene.petrenko@gmail.com>
Sat, 9 Jul 2011 11:39:24 +0000 (15:39 +0400)
committerEugene.Petrenko <eugene.petrenko@gmail.com>
Sat, 9 Jul 2011 11:39:24 +0000 (15:39 +0400)
.idea/ant.xml
.idea/artifacts/plugin.xml
build/ant.build.xml [new file with mode: 0644]

index db0112b758336688c1af7b3a9b7fd7e0b3c0e3a7..d63ca65025724c9175421571d35d2d833ea0d9fc 100644 (file)
@@ -2,6 +2,14 @@
 <project version="4">\r
   <component name="AntConfiguration">\r
     <defaultAnt bundledAnt="true" />\r
+    <buildFile url="file://$PROJECT_DIR$/build/ant.build.xml">\r
+      <additionalClassPath />\r
+      <antReference projectDefault="true" />\r
+      <customJdkName value="" />\r
+      <maximumHeapSize value="128" />\r
+      <maximumStackSize value="2" />\r
+      <properties />\r
+    </buildFile>\r
   </component>\r
 </project>\r
 \r
index a10ea8ceb7736df79a00819b546ed6bab68af89a..069c831413a40cb0e4544b2b8ea13570afb5e444 100644 (file)
@@ -1,6 +1,12 @@
 <component name="ArtifactManager">\r
   <artifact name="plugin">\r
     <output-path>$PROJECT_DIR$/out/artifacts/plugin</output-path>\r
+    <properties id="ant-postprocessing">\r
+      <options enabled="true">\r
+        <file>file://$PROJECT_DIR$/build/ant.build.xml</file>\r
+        <target>replace-tokens-in-teamcity-plugin-xml</target>\r
+      </options>\r
+    </properties>\r
     <root id="root">\r
       <element id="directory" name="agent">\r
         <element id="archive" name="nuget-agent.zip">\r
diff --git a/build/ant.build.xml b/build/ant.build.xml
new file mode 100644 (file)
index 0000000..978ebbe
--- /dev/null
@@ -0,0 +1,25 @@
+<project name="build hooks" default="replace-tokens-in-teamcity-plugin-xml" basedir=".">\r
+\r
+\r
+  <target name="replace-tokens-in-teamcity-plugin-xml">\r
+    <property name="home" value="${artifact.output.path}"/>\r
+\r
+    <echo message="replacing tokens in teamcity-plugin.xml file under ${home}"/>\r
+\r
+    <condition property="build.numner" value="snapshot">\r
+      <not>\r
+        <isset property="build.number"/>\r
+      </not>\r
+    </condition>\r
+\r
+    <!-- update all references in teamcity-plugin.xml files -->\r
+    <replace dir="${home}" summary="true">\r
+      <include name="**/teamcity-plugin.xml"/>\r
+\r
+      <replacefilter token="@Plugin_Version@" value="${build.numner}"/>\r
+      <replacefilter token="@Plugin_Vendor@" value="JetBrains, s.r.o."/>\r
+      <replacefilter token="@Plugin_Vendor_Url@" value="http://www.jetbrains.com"/>\r
+    </replace>\r
+  </target>\r
+\r
+</project>
\ No newline at end of file