Public: Use a seperate sample.extraclasspath so each sample can specify their own jars.

Review at http://gwt-code-reviews.appspot.com/969801

Review by: bobv@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@8969 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/common.ant.xml b/common.ant.xml
index ea3c56d..a62cce3 100755
--- a/common.ant.xml
+++ b/common.ant.xml
@@ -96,7 +96,16 @@
     <isset property="build.host.iswindows" />
   </condition>
   <fail unless="build.host.platform" message="Building on ${os.name} is not supported" />
+  
+  <!-- JVM -->
+  <condition property="build.jvm.is15">
+     <equals arg1="${ant.java.version}" arg2="1.5"/>
+  </condition>  
 
+  <condition property="build.jvm.is16">
+     <equals arg1="${ant.java.version}" arg2="1.6"/>
+  </condition> 
+  
   <!-- JUnit support -->
   <property name="gwt.dev.staging.jar" location="${gwt.build.staging}/gwt-${gwt.version}/gwt-dev.jar" />
   <property name="gwt.junit.port" value="8888" />
diff --git a/samples/common.ant.xml b/samples/common.ant.xml
index 829e22b..ec5bfe7 100755
--- a/samples/common.ant.xml
+++ b/samples/common.ant.xml
@@ -63,9 +63,7 @@
       <classpath>
         <pathelement location="${gwt.user.jar}" />
         <pathelement location="${gwt.dev.jar}" />
-        <pathelement location="${gwt.tools.lib}/jsr107cache/jsr107cache-1.1.jar"/>
-        <pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar"/>
-        <pathelement location="${gwt.tools.lib}/hibernate/validator/hibernate-validator-4.1.0.Final.jar" />
+        <path refid="sample.extraclasspath" />
         <path refid="gae.extraclasspath" />
       </classpath>
     </gwt.javac>
@@ -78,6 +76,7 @@
         <fileset dir="${sample.build}/war/WEB-INF/classes" />
         <fileset file="${gwt.user.jar}" />
         <fileset file="${gwt.dev.jar}" />
+        <path refid="sample.extraclasspath" />
       </sourcefiles>
       <targetfiles path="${sample.build}/war/${sample.lower}/${sample.lower}.nocache.js" />
       <sequential>
@@ -87,21 +86,10 @@
                 		fork="yes" failonerror="true">
             <classpath>
               <pathelement path="${sample.path}" />
+              <path refid="sample.extraclasspath" />
               <pathelement location="${sample.build}/war/WEB-INF/classes" />
               <pathelement location="${gwt.user.jar}" />
               <pathelement location="${gwt.dev.jar}" />
-              <pathelement location="${gwt.tools.lib}/apache/log4j/log4j-1.2.16.jar" />
-              <pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar" />
-              <pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA-sources.jar" />
-              <pathelement location="${gwt.tools.lib}/hibernate/validator/hibernate-validator-4.1.0.Final.jar" />
-              <pathelement location="${gwt.tools.lib}/hibernate/validator/hibernate-validator-4.1.0.Final-sources.jar" />
-              <pathelement location="${gwt.tools.lib}/slf4j/slf4j-api/slf4j-api-1.6.1.jar" />
-              <pathelement location="${gwt.tools.lib}/slf4j/slf4j-log4j12/slf4j-log4j12-1.6.1.jar" />
-              <!-- Needed for JDK 1.5-->
-              <pathelement location="${gwt.tools.lib}/javax/activation/activation-1.1.jar" />
-              <pathelement location="${gwt.tools.lib}/javax/xml/bind/jaxb-api-2.1.jar" />
-              <pathelement location="${gwt.tools.lib}/sun/jaxb/jaxb-impl.2.1.3.jar" />
-              <pathelement location="${gwt.tools.lib}/javax/xml/stream/staxb-api-1.0-2.jar" />
             </classpath>
             <jvmarg value="-Xmx256M" />
             <arg value="-localWorkers" />
diff --git a/samples/dynatable/build.xml b/samples/dynatable/build.xml
index ddb6b09..d04532e 100755
--- a/samples/dynatable/build.xml
+++ b/samples/dynatable/build.xml
@@ -3,4 +3,8 @@
   <property name="sample.module" value="DynaTable" />
   <property name="sample.path" value="src" />
   <import file="../common.ant.xml" />
+  <!-- these are after the common.ant.xml so they have gwt.tools etc -->
+  <path id="sample.extraclasspath">
+    <pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar" />
+  </path>
 </project>
diff --git a/samples/dynatablerf/build.xml b/samples/dynatablerf/build.xml
index ee78ce3..aa77951 100755
--- a/samples/dynatablerf/build.xml
+++ b/samples/dynatablerf/build.xml
@@ -3,4 +3,9 @@
   <property name="sample.module" value="DynaTableRf" />
   <property name="sample.path" value="src" />
   <import file="../common.ant.xml" />
+  <!-- these are after the common.ant.xml so they have gwt.tools etc -->
+  <path id="sample.extraclasspath">
+    <pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar" />
+    <pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA-sources.jar" />
+  </path>
 </project>
diff --git a/samples/expenses/build.xml b/samples/expenses/build.xml
index 0f624d9..9606721 100755
--- a/samples/expenses/build.xml
+++ b/samples/expenses/build.xml
@@ -3,4 +3,7 @@
   <property name="sample.module" value="Expenses" />
   <property name="sample.path" value="src/main/java" />
   <import file="../common.ant.xml" />
+  <!-- these are after the common.ant.xml so they have gwt.tools... -->
+  <path id="sample.extraclasspath">
+  </path>
 </project>
diff --git a/samples/hello/build.xml b/samples/hello/build.xml
index ff34e18..c9ee01f 100755
--- a/samples/hello/build.xml
+++ b/samples/hello/build.xml
@@ -3,4 +3,7 @@
   <property name="sample.module" value="Hello" />
   <property name="sample.path" value="src" />
   <import file="../common.ant.xml" />
+  <!-- these are after the common.ant.xml so they have gwt.tools... -->
+  <path id="sample.extraclasspath">
+  </path>
 </project>
diff --git a/samples/json/build.xml b/samples/json/build.xml
index 1b9100f..a4e384a 100755
--- a/samples/json/build.xml
+++ b/samples/json/build.xml
@@ -3,4 +3,7 @@
   <property name="sample.module" value="JSON" />
   <property name="sample.path" value="src" />
   <import file="../common.ant.xml" />
+  <!-- these are after the common.ant.xml so they have gwt.tools... -->
+  <path id="sample.extraclasspath">
+  </path>
 </project>
diff --git a/samples/logexample/build.xml b/samples/logexample/build.xml
index 2437018..070a1de 100755
--- a/samples/logexample/build.xml
+++ b/samples/logexample/build.xml
@@ -3,4 +3,7 @@
   <property name="sample.module" value="LogExample" />
   <property name="sample.path" value="src" />
   <import file="../common.ant.xml" />
+  <!-- these are after the common.ant.xml so they have gwt.tools... -->
+  <path id="sample.extraclasspath">
+  </path>
 </project>
diff --git a/samples/mail/build.xml b/samples/mail/build.xml
index a211cb8..6c5e8da 100755
--- a/samples/mail/build.xml
+++ b/samples/mail/build.xml
@@ -3,4 +3,7 @@
   <property name="sample.module" value="Mail" />
   <property name="sample.path" value="src" />
   <import file="../common.ant.xml" />
+  <!-- these are after the common.ant.xml so they have gwt.tools... -->
+  <path id="sample.extraclasspath">
+  </path>
 </project>
diff --git a/samples/showcase/build.xml b/samples/showcase/build.xml
index 60cb9b4..fde94a5 100755
--- a/samples/showcase/build.xml
+++ b/samples/showcase/build.xml
@@ -3,4 +3,7 @@
   <property name="sample.module" value="Showcase" />
   <property name="sample.path" value="src" />
   <import file="../common.ant.xml" />
+  <!-- these are after the common.ant.xml so they have gwt.tools... -->
+  <path id="sample.extraclasspath">
+  </path>
 </project>
diff --git a/samples/simplerpc/build.xml b/samples/simplerpc/build.xml
index 8dd550e..798f3cc 100644
--- a/samples/simplerpc/build.xml
+++ b/samples/simplerpc/build.xml
@@ -3,4 +3,7 @@
   <property name="sample.module" value="SimpleRPC" />
   <property name="sample.path" value="src" />
   <import file="../common.ant.xml" />
+  <!-- these are after the common.ant.xml so they have gwt.tools... -->
+  <path id="sample.extraclasspath">
+  </path>
 </project>
diff --git a/samples/simplexml/build.xml b/samples/simplexml/build.xml
index 3c0b995..b1ae6b0 100755
--- a/samples/simplexml/build.xml
+++ b/samples/simplexml/build.xml
@@ -3,4 +3,7 @@
   <property name="sample.module" value="SimpleXML" />
   <property name="sample.path" value="src" />
   <import file="../common.ant.xml" />
+  <!-- these are after the common.ant.xml so they have gwt.tools... -->
+  <path id="sample.extraclasspath">
+  </path>
 </project>
diff --git a/samples/validation/build.xml b/samples/validation/build.xml
index 0c75492..03466f4 100755
--- a/samples/validation/build.xml
+++ b/samples/validation/build.xml
@@ -3,4 +3,20 @@
   <property name="sample.module" value="Validation" />
   <property name="sample.path" value="src" />
   <import file="../common.ant.xml" />
+
+  <!-- these are after the common.ant.xml so they have gwt.tools etc. -->
+  <path id="sample.extraclasspath">
+    <pathelement location="${gwt.tools.lib}/apache/log4j/log4j-1.2.16.jar" />
+    <pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar" />
+    <pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA-sources.jar" />
+    <pathelement location="${gwt.tools.lib}/hibernate/validator/hibernate-validator-4.1.0.Final.jar" />
+    <pathelement location="${gwt.tools.lib}/hibernate/validator/hibernate-validator-4.1.0.Final-sources.jar" />
+    <pathelement location="${gwt.tools.lib}/slf4j/slf4j-api/slf4j-api-1.6.1.jar" />
+    <pathelement location="${gwt.tools.lib}/slf4j/slf4j-log4j12/slf4j-log4j12-1.6.1.jar" />
+    <!-- Needed for JDK 1.5-->
+    <pathelement location="${gwt.tools.lib}/javax/activation/activation-1.1.jar" />
+    <pathelement location="${gwt.tools.lib}/javax/xml/bind/jaxb-api-2.1.jar" />
+    <pathelement location="${gwt.tools.lib}/sun/jaxb/jaxb-impl-2.1.3.jar" />
+    <pathelement location="${gwt.tools.lib}/javax/xml/stream/stax-api-1.0-2.jar" />
+  </path>
 </project>