velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbris...@apache.org
Subject svn commit: r958528 - in /velocity/tools/trunk: ./ src/main/java/org/apache/velocity/tools/view/
Date Mon, 28 Jun 2010 10:00:41 GMT
Author: cbrisson
Date: Mon Jun 28 10:00:41 2010
New Revision: 958528

URL: http://svn.apache.org/viewvc?rev=958528&view=rev
Log:
adaptations to support velocity engine 2.x

Added:
    velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java.velocity-1.x
      - copied unchanged from r958498, velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java
    velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java.velocity-2.x
      - copied, changed from r958498, velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java
Removed:
    velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java
Modified:
    velocity/tools/trunk/build.xml

Modified: velocity/tools/trunk/build.xml
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/build.xml?rev=958528&r1=958527&r2=958528&view=diff
==============================================================================
--- velocity/tools/trunk/build.xml (original)
+++ velocity/tools/trunk/build.xml Mon Jun 28 10:00:41 2010
@@ -32,7 +32,13 @@
   <!-- This file contains all the defaults for building VelocityTools -->
   <property file="build.properties"/>                <!-- Component local   -->
 
-
+  <condition property="use.velocity-1.x">
+    <contains string="velocity-${jar.velocity.version}" substring="velocity-1."/>
+  </condition>
+
+  <condition property="use.velocity-2.x">
+    <contains string="velocity-${jar.velocity.version}" substring="velocity-2."/>
+  </condition>
 
 <!-- ========== Targets ======================================== -->
 
@@ -92,6 +98,15 @@
     <echo message="-------- ${project.name} ${project.version} --------"/>
   </target>
 
+  <!-- declare Velocity 1.x/2.x tweaks -->
+  <target name="-prepare.compile.velocity-1.x" if="use.velocity-1.x">
+    <copy file="${classes.src}/org/apache/velocity/tools/view/WebappUberspector.java.velocity-1.x"
tofile="${classes.src}/org/apache/velocity/tools/view/WebappUberspector.java" overwrite="true"/>
+  </target>
+
+  <target name="-prepare.compile.velocity-2.x" if="use.velocity-2.x">
+    <copy file="${classes.src}/org/apache/velocity/tools/view/WebappUberspector.java.velocity-2.x"
tofile="${classes.src}/org/apache/velocity/tools/view/WebappUberspector.java" overwrite="true"/>
+  </target>
+
   <!-- Prepare Compilation Environment -->
   <target name="prepare.compile">
     <!-- make necessary directories -->
@@ -109,6 +124,18 @@
         <include name="**/*.jar"/>
       </fileset>
     </path>
+
+    <!-- prepare Velocity 1.x/2.x tweaks -->
+    <antcall target="-prepare.compile.velocity-1.x"/>
+    <antcall target="-prepare.compile.velocity-2.x"/>
+
+    <!-- construct patternset of source files -->
+    <patternset id="source.files">
+      <include name="org/**/*.java"/>
+      <exclude name="org/apache/velocity/tools/generic/log/CommonsLogLogSystem.java" unless="use.velocity-1.x"/>
+      <exclude name="org/apache/velocity/tools/view/servlet/ServletLogger.java" unless="use.velocity-1.x"/>
+    </patternset>
+
   </target>
 
   <!-- Prepare Documentation Environment -->
@@ -150,7 +177,7 @@
            encoding="${compile.encoding}"
            destdir="${classes.dir}">
       <classpath refid="compile.classpath" />
-      <include name="org/**"/>
+      <patternset refid="source.files"/>
     </javac>
 
     <copy todir="${classes.dir}" filtering="yes">
@@ -174,7 +201,7 @@
            encoding="${compile.encoding}"
            destdir="${classes.dir}">
       <classpath refid="compile.classpath" />
-      <include name="org/**"/>
+      <patternset refid="source.files"/>
       <exclude name="**/struts/**"/>
     </javac>
 
@@ -201,7 +228,7 @@
            encoding="${compile.encoding}"
            destdir="${classes.dir}">
       <classpath refid="compile.classpath" />
-      <include name="org/**"/>
+      <patternset refid="source.files"/>
       <exclude name="**/struts/**"/>
       <exclude name="**/view/**"/>
     </javac>

Copied: velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java.velocity-2.x
(from r958498, velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java)
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java.velocity-2.x?p2=velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java.velocity-2.x&p1=velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java&r1=958498&r2=958528&rev=958528&view=diff
==============================================================================
--- velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java
(original)
+++ velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java.velocity-2.x
Mon Jun 28 10:00:41 2010
@@ -65,7 +65,6 @@ public class WebappUberspector extends A
      * @throws Exception
      */
     public VelPropertyGet getPropertyGet(Object obj, String identifier, Info i)
-            throws Exception
     {
         VelPropertyGet ret = super.getPropertyGet(obj,identifier,i);
         if(ret == null)
@@ -116,7 +115,6 @@ public class WebappUberspector extends A
      */
     public VelPropertySet getPropertySet(Object obj, String identifier,
                                          Object arg, Info i)
-            throws Exception
     {
         VelPropertySet ret = super.getPropertySet(obj,identifier,arg,i);
         if(ret == null) {



Mime
View raw message