[jboss-svn-commits] JBL Code SVN: r14985 - in labs/jbossesb/trunk/product/rosetta: src/org/jboss/soa/esb and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Sep 10 03:53:26 EDT 2007


Author: beve
Date: 2007-09-10 03:53:25 -0400 (Mon, 10 Sep 2007)
New Revision: 14985

Added:
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/Version.java
Modified:
   labs/jbossesb/trunk/product/rosetta/build.xml
Log:
Added a version file to the jbossesb-rosetta.jar, plus a Version.class which will be used in one invokes the jbossesb-rosetta.jar.


Modified: labs/jbossesb/trunk/product/rosetta/build.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/build.xml	2007-09-10 05:14:55 UTC (rev 14984)
+++ labs/jbossesb/trunk/product/rosetta/build.xml	2007-09-10 07:53:25 UTC (rev 14985)
@@ -58,10 +58,29 @@
 
     <target name="jar" depends="org.jboss.esb.rosetta.compile" description="Assemble jar files">
     	<delete file="${org.jboss.esb.rosetta.distrib.dir}/lib/${org.jboss.esb.rosetta.jar.name}.jar" />
+    	
+    	<delete file="${org.jboss.esb.rosetta.classes.dir}/VERSION"/>
+    	<propertyfile file="${org.jboss.esb.rosetta.classes.dir}/VERSION" comment="JBoss ESB Product Information">
+			<entry key="Version" value="${version}"/>			
+			<entry key="Product" value="${esb.server.name}"/>			
+		</propertyfile>
+    	
+		<manifest file="${org.jboss.esb.rosetta.classes.dir}/MANIFEST.MF">
+			<attribute name="Built-By" value="${user.name}"/>
+			<attribute name="Main-Class" value="org.jboss.soa.esb.Version"/>
+			<section name="JBoss ESB">
+				<attribute name="Specification-Title" value="${esb.server.name}"/>
+				<attribute name="Specification-Version" value="${version}"/>
+				<attribute name="Specification-Vendor" value="JBoss"/>
+				<attribute name="Implementation-Version" value="${version} ${TODAY}"/> 
+			</section>
+		</manifest>
+    	
         <jar    destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/${org.jboss.esb.rosetta.jar.name}.jar" 
                 basedir="${org.jboss.esb.rosetta.classes.dir}" 
-                includes="**/*.class"
-		excludes="test/**"
+                includes="**/*.class,VERSION"
+	        	manifest="${org.jboss.esb.rosetta.classes.dir}/MANIFEST.MF"
+				excludes="test/**"
                 >
         	<fileset dir="${org.jboss.esb.rosetta.src.dir}" includes="**/*.groovy"/>
             <fileset dir="${org.jboss.esb.rosetta.src.dir}" includes="**/*.properties"/>

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/Version.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/Version.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/Version.java	2007-09-10 07:53:25 UTC (rev 14985)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of individual
+ * contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+/**
+ * Just prints the contents of the VERSION file to standard out.
+ * 
+ * @author <a href="mailto:daniel.bevenius at gmail.com">Daniel Bevenius</a>				
+ *
+ */
+public class Version
+{
+	private static final String VERSION_FILENAME = "/VERSION";
+	
+	public static void main( String[] args )
+	{
+		BufferedReader br = null;
+		InputStream is = Version.class.getResourceAsStream( VERSION_FILENAME );
+		if ( is != null )
+		{
+			br = new BufferedReader( new InputStreamReader( is ) );
+			String line = null;
+			try
+			{
+				while ( ( line = br.readLine() ) != null) 
+					System.out.println(line);
+			} 
+			catch (IOException e)
+			{
+				e.printStackTrace();
+			}
+			finally
+			{
+				if ( br != null ) try { br.close(); } catch (IOException e) { e.printStackTrace(); }
+			}
+		}
+	}
+}




More information about the jboss-svn-commits mailing list