harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r429702 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/build.xml
Date Tue, 08 Aug 2006 15:58:47 GMT
Author: tellison
Date: Tue Aug  8 08:58:47 2006
New Revision: 429702

URL: http://svn.apache.org/viewvc?rev=429702&view=rev
Log:
Storing build revision info in the JAR file.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/build.xml

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/build.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/build.xml?rev=429702&r1=429701&r2=429702&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/build.xml (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/build.xml Tue Aug  8 08:58:47 2006
@@ -267,10 +267,39 @@
         </javac>
     </target>
 
-    <target name="build.jar">
+    <target name="-svn-detect">
+      <available file=".svn" type="dir" property="svn.available"/>
+    </target>
+
+    <target name="-svn-prop" depends="-svn-detect" if="svn.available">
+        <exec executable="svn">
+            <arg value="info" />
+            <redirector outputproperty="svn.info">
+                <outputfilterchain>
+                    <linecontainsregexp>
+                        <regexp pattern="Repository Root:|Revision:" />
+                    </linecontainsregexp>
+                    <tokenfilter>
+                        <replacestring from="Repository Root: " to=""/>
+                        <replacestring from="Revision: " to=" "/>
+                    </tokenfilter>
+                    <striplinebreaks/>
+                </outputfilterchain>
+            </redirector>
+        </exec>
+    </target>
+
+    <target name="-nosvn-prop" depends="-svn-detect" unless="svn.available">
+        <property name="svn.info" value ="Unknown"/>
+    </target>
+
+    <target name="build.jar" depends="-svn-prop, -nosvn-prop">
         <jar destfile="${hy.jdk}/jre/lib/boot/luni.jar"
              manifest="${hy.luni}/META-INF/MANIFEST.MF">
             <fileset refid="classes" />
+            <manifest>
+                <attribute name="Implementation-Version" value="${svn.info}"/> 
+            </manifest>
         </jar>
     </target>
 



Mime
View raw message