You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by hi...@apache.org on 2009/01/30 11:29:22 UTC

svn commit: r739228 - /ant/ivy/updatesite/trunk/build.xml

Author: hibou
Date: Fri Jan 30 10:29:21 2009
New Revision: 739228

URL: http://svn.apache.org/viewvc?rev=739228&view=rev
Log:
IVYDE-156: make the publishing of the release into the updatesite more automatic, so there won't be mess around version numbers

Modified:
    ant/ivy/updatesite/trunk/build.xml

Modified: ant/ivy/updatesite/trunk/build.xml
URL: http://svn.apache.org/viewvc/ant/ivy/updatesite/trunk/build.xml?rev=739228&r1=739227&r2=739228&view=diff
==============================================================================
--- ant/ivy/updatesite/trunk/build.xml (original)
+++ ant/ivy/updatesite/trunk/build.xml Fri Jan 30 10:29:21 2009
@@ -72,11 +72,47 @@
 
     <!-- 
         ===================================================================================================================
-    	Target to generate the Ivy feature and put it in the updatesite
+    	Targets to install the plugins into the updatesite
         ===================================================================================================================    
       -->
-    <target name="generate-ivy-feature" description="Generate the Eclipse feature for Ivy">
-        <fail message="You have to specify the version of the ivy" unless="ivy.version" />
+
+    <macrodef name="osgi-version">
+        <attribute name="jar" />
+        <attribute name="outputproperty" />
+        <sequential>
+            <tstamp>
+                <format property="tstamp.@{jar}" pattern="yyyyMMddhhmmss" locale="en,UK" />
+            </tstamp>
+            <property name="work.dir.@{jar}" value="${work.dir}/${tstamp.@{jar}}" />
+            <mkdir dir="${work.dir.@{jar}}/jar" />
+            <unzip overwrite="true" src="@{jar}" dest="${work.dir.@{jar}}" />
+            <loadfile property="@{outputproperty}" srcFile="${work.dir.@{jar}}/META-INF/MANIFEST.MF">
+                <filterchain>
+                    <linecontains>
+                        <contains value="Bundle-Version:" />
+                    </linecontains>
+                    <tokenfilter>
+                        <replaceregex pattern="Bundle-Version: (.*)" replace="\1" flags="gi" />
+                    </tokenfilter>
+                    <striplinebreaks />
+                </filterchain>
+            </loadfile>
+            <delete dir="${work.dir.@{jar}}" />
+        </sequential>
+    </macrodef>
+
+    <target name="install-ivy" description="Install an Ivy bundle into the updatesite">
+        <fail message="You have to specify the path to the jar via the property ivy.jar" unless="ivy.jar" />
+        <!-- get the real OSGi version of the bundle -->
+        <osgi-version jar="${ivy.jar}" outputproperty="ivy.version" />
+        <!-- delete previously installed ivy bundles -->
+        <delete dir="${updatesite.dir}">
+            <include name="plugins/org.apache.ivy_*" />
+            <include name="features/org.apache.ivy_*" />
+        </delete>
+        <!-- install the plugin -->
+        <copy file="${ivy.jar}" tofile="${updatesite.dir}/plugins/org.apache.ivy_${ivy.version}.jar" overwrite="true" />
+        <!-- now take care of the generation of the Ivy feature -->
         <!-- first generate a feature descriptor with the proper version -->
         <delete file="${work.dir}/feature.xml" />
         <copy file="ivy-feature-template/feature.xml" todir="${work.dir}">
@@ -95,6 +131,41 @@
                 <include name="feature.xml" />
             </fileset>
         </jar>
+        <!-- update the site.xml -->
+        <copy file="${updatesite.dir}/site.xml" tofile="${work.dir}/site.xml" overwrite="true">
+            <filterchain>
+                <replaceregex pattern="org\.apache\.ivy\.feature_(.*)\.jar\&quot; id=\&quot;org\.apache\.ivy\.feature\&quot; version=\&quot;(.*)\&quot;" replace="org.apache.ivy.feature_${ivy.version}.jar&quot; id=&quot;org.apache.ivy.feature&quot; version=&quot;${ivy.version}&quot;" flags="gi" />
+            </filterchain>
+        </copy>
+        <copy file="${work.dir}/site.xml" tofile="${updatesite.dir}/site.xml" overwrite="true" />
+    </target>
+
+    <target name="install-ivyde" description="Install IvyDE into the updatesite">
+        <fail message="You have to specify the path to the zip of the IvyDE distribution via the property ivyde.zip" unless="ivyde.zip" />
+        <!-- delete previously installed ivy bundles -->
+        <delete dir="${updatesite.dir}">
+            <include name="plugins/org.apache.ivyde*" />
+            <include name="features/org.apache.ivyde*" />
+        </delete>
+        <!-- install the plugin -->
+        <unzip src="${ivyde.zip}" dest="${updatesite.dir}" />
+        <!-- get the path to the ivyde plugin -->
+        <path id="ivyde.plugin.path.id">
+            <first count="1">
+                <fileset dir="${updatesite.dir}/plugins" includes="org.apache.ivyde*.jar" />
+            </first>
+        </path>
+        <!-- turn the path into a property -->
+        <property name="ivyde.plugin.path" refid="ivyde.plugin.path.id" />
+        <!-- get the real OSGi version of the bundle -->
+        <osgi-version jar="${ivyde.plugin.path}" outputproperty="ivyde.version" />
+        <!-- update the site.xml -->
+        <copy file="${updatesite.dir}/site.xml" tofile="${work.dir}/site.xml" overwrite="true">
+            <filterchain>
+                <replaceregex pattern="org\.apache\.ivyde\.feature_(.*)\.jar\&quot; id=\&quot;org\.apache\.ivyde\.feature\&quot; version=\&quot;(.*)\&quot;" replace="org.apache.ivyde.feature_${ivyde.version}.jar&quot; id=&quot;org.apache.ivyde.feature&quot; version=&quot;${ivyde.version}&quot;" flags="gi" />
+            </filterchain>
+        </copy>
+        <copy file="${work.dir}/site.xml" tofile="${updatesite.dir}/site.xml" overwrite="true" />
     </target>
 
     <!--