You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ps...@apache.org on 2006/01/21 06:09:09 UTC

svn commit: r370984 - in /logging/chainsaw/trunk: anttasks-src/org/apache/chainsaw/ant/CreateShellScripts.java build.xml

Author: psmith
Date: Fri Jan 20 21:08:59 2006
New Revision: 370984

URL: http://svn.apache.org/viewcvs?rev=370984&view=rev
Log:
Change to distribution build such that the Webstart distribution
does NOT ship with Comomons VFS because of classloading issues.

Webstart users who wish to use VFS will need to place Commons VFs
jars and all the filestore implementation jars inside the Chainsaw
plugin directory.  Shell script and OSX distro users won't have that
limitation.

Modified:
    logging/chainsaw/trunk/anttasks-src/org/apache/chainsaw/ant/CreateShellScripts.java
    logging/chainsaw/trunk/build.xml

Modified: logging/chainsaw/trunk/anttasks-src/org/apache/chainsaw/ant/CreateShellScripts.java
URL: http://svn.apache.org/viewcvs/logging/chainsaw/trunk/anttasks-src/org/apache/chainsaw/ant/CreateShellScripts.java?rev=370984&r1=370983&r2=370984&view=diff
==============================================================================
--- logging/chainsaw/trunk/anttasks-src/org/apache/chainsaw/ant/CreateShellScripts.java (original)
+++ logging/chainsaw/trunk/anttasks-src/org/apache/chainsaw/ant/CreateShellScripts.java Fri Jan 20 21:08:59 2006
@@ -7,6 +7,7 @@
 import java.io.IOException;
 import java.io.Writer;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
@@ -38,6 +39,9 @@
     private String outputLocation;
 
     private Vector fileSets = new Vector();
+    private String scriptType="";
+    
+    private Collection KNOWN_SCRIPT_TYPES = Arrays.asList(new String[] {"shell", "webstart"});
 
     public String getOutputLocation() {
         return outputLocation;
@@ -49,6 +53,11 @@
 
     public void execute() throws BuildException {
         super.execute();
+        if(getScriptType().length()==0) {
+            throw new BuildException("scriptType property has not been set");
+        }else if (!KNOWN_SCRIPT_TYPES.contains(getScriptType())) {
+            throw new BuildException("scriptType '"+ getScriptType() + "' is not one of then known types: " + KNOWN_SCRIPT_TYPES);
+        }
         File outputLocationDir = new File(getOutputLocation());
         if(!outputLocationDir.exists()) {
             log("Creating director(ies) ->" + getOutputLocation());
@@ -56,9 +65,12 @@
         }
         Collection filenames = getFilenames();
         try {
-            createUnixShellScript(outputLocationDir, filenames);
-            createBatShellScript(outputLocationDir, filenames);
-            createJNLP(outputLocationDir, filenames);
+            if (getScriptType().equals("shell")) {
+                createUnixShellScript(outputLocationDir, filenames);
+                createBatShellScript(outputLocationDir, filenames);
+            }else {
+                createJNLP(outputLocationDir, filenames);
+            }
         } catch (Exception e) {
             e.printStackTrace();
             throw new BuildException("Failed to create Scripts",e);
@@ -175,6 +187,14 @@
             }
         }
         return jars;
+    }
+
+    public String getScriptType() {
+        return scriptType;
+    }
+
+    public void setScriptType(String scriptType) {
+        this.scriptType = scriptType.toLowerCase();
     }
 
 }

Modified: logging/chainsaw/trunk/build.xml
URL: http://svn.apache.org/viewcvs/logging/chainsaw/trunk/build.xml?rev=370984&r1=370983&r2=370984&view=diff
==============================================================================
--- logging/chainsaw/trunk/build.xml (original)
+++ logging/chainsaw/trunk/build.xml Fri Jan 20 21:08:59 2006
@@ -165,7 +165,7 @@
   <!-- ================================================================= -->
   <!-- Create log4j-chainsaw.jar, excluding everything else              -->
   <!-- ================================================================= -->
-  <target name="chainsaw.jar" depends="build.chainsaw">
+  <target name="chainsaw.jar" depends="build.chainsaw, BuildZeroConfJar">
     <delete>
       <fileset dir="${jar.dest}">
         <include name="${log4j-chainsaw.jar}"/>
@@ -213,6 +213,8 @@
              ${stem}/chainsaw/icons/*.jpg, 
              ${stem}/chainsaw/icons/LICENCE"
              excludes="**/UnitTest**">
+    	<!-- VFS stuff goes in it's own Jar -->
+     <exclude name="**/vfs/*" />
       <!-- we need to exclude the JMS + DB Receiver BeanInfo for webstart purposes -->
       <exclude name="**/JMS*BeanInfo.class" if="webstart" />
       <exclude name="**/DB*BeanInfo.class" if="webstart" />
@@ -227,6 +229,19 @@
         <attribute name="Class-Path" value="${log4j.jar}"/>
       </manifest>
     </jar>
+  	
+    <jar jarfile="${jar.dest}/log4j-chainsaw-vfs.jar" basedir="${javac.dest}"
+         includes="${stem}/chainsaw/vfs/*.class" >
+        <manifest>
+          <attribute name="Manifest-version" value="1.0"/>
+          <section name="org/apache/log4j/">
+            <attribute name="Implementation-Title" value="log4j VFS"/>
+            <attribute name="Implementation-Version" value="${version}"/>
+            <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
+          </section>
+        </manifest>
+	</jar>
+  	
   </target>
 
   <!-- ================================================================= -->
@@ -285,15 +300,32 @@
      	<fileset dir="lib" />
      	<fileset dir=".">
      		<include name="log4j-chain*.jar"/>
+     		<include name="log4j-zeroconf*.jar"/>
      		<!--<include name="webstart*.jar"/> -->
      	</fileset>
   	</copy>
+  	<!-- TODO When zeroconf is ready, remove this! -->
+  	<delete>
+  		<fileset  dir="webstart-dist">
+  			<include name="*zeroconf*"/>
+  			<include name="jmdns*"/>
+  		</fileset>
+  	</delete>
+  	
   	
-	<createshellscripts outputLocation="webstart-dist">
+	<createshellscripts outputLocation="webstart-dist" scriptType="shell">
 		<fileset dir="webstart-dist" includes="*.jar"/>
 	</createshellscripts>
-  	
-    <input
+
+  	<!-- Webstart distribution can't have VFS because of stupid classloading rules, so we exclude it-->
+  	<createshellscripts outputLocation="webstart-dist" scriptType="webstart">
+		<fileset dir="webstart-dist" includes="*.jar">
+			<exclude name="commons*.jar"/>
+			<exclude name="*vfs*.jar"/>
+		</fileset>
+	</createshellscripts>	
+    
+  	<input
      message="Please enter key password:"
      addproperty="keypass"
      />



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org