You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by wg...@apache.org on 2005/01/05 16:10:07 UTC

svn commit: r124218 - /jakarta/velocity/trunk/build/testcases.xml /jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/AnakiaTask.java /jakarta/velocity/trunk/test/anakia/velocity.properties

Author: wglass
Date: Wed Jan  5 07:10:01 2005
New Revision: 124218

URL: http://svn.apache.org/viewcvs?view=rev&rev=124218
Log:
Bug fixed: AnakiaTask does not store templatePath if props file found.
http://issues.apache.org/bugzilla/show_bug.cgi?id=21173
Added:
   jakarta/velocity/trunk/test/anakia/velocity.properties
Modified:
   jakarta/velocity/trunk/build/testcases.xml
   jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/AnakiaTask.java

Modified: jakarta/velocity/trunk/build/testcases.xml
Url: http://svn.apache.org/viewcvs/jakarta/velocity/trunk/build/testcases.xml?view=diff&rev=124218&p1=jakarta/velocity/trunk/build/testcases.xml&r1=124217&p2=jakarta/velocity/trunk/build/testcases.xml&r2=124218
==============================================================================
--- jakarta/velocity/trunk/build/testcases.xml	(original)
+++ jakarta/velocity/trunk/build/testcases.xml	Wed Jan  5 07:10:01 2005
@@ -210,6 +210,7 @@
             excludes="**/stylesheets/**"
             includes="**/*.xml"
             templatePath="../test/anakia/xdocs/stylesheets"
+            velocityPropertiesFile="../test/anakia/velocity.properties"
             lastModifiedCheck="false">
     </anakia>
 

Modified: jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/AnakiaTask.java
Url: http://svn.apache.org/viewcvs/jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/AnakiaTask.java?view=diff&rev=124218&p1=jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/AnakiaTask.java&r1=124217&p2=jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/AnakiaTask.java&r2=124218
==============================================================================
--- jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/AnakiaTask.java	(original)
+++ jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/AnakiaTask.java	Wed Jan  5 07:10:01 2005
@@ -24,6 +24,8 @@
 
 import java.util.StringTokenizer;
 
+import org.apache.commons.collections.ExtendedProperties;
+
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.DirectoryScanner;
 import org.apache.tools.ant.Project;
@@ -56,7 +58,7 @@
  *   
  * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
  * @author <a href="mailto:szegedia@freemail.hu">Attila Szegedi</a>
- * @version $Id: AnakiaTask.java,v 1.38 2004/03/20 03:35:50 dlr Exp $
+ * @version $Id$
  */
 public class AnakiaTask extends MatchingTask
 {
@@ -261,14 +263,19 @@
         {
             if ( velocityPropertiesFile.exists() )
             {
-                ve.init(velocityPropertiesFile.getAbsolutePath());
+                String file = velocityPropertiesFile.getAbsolutePath();
+                ExtendedProperties config = new ExtendedProperties(file);
+                ve.setExtendedProperties(config);
             }
-            else if (templatePath != null && templatePath.length() > 0)
+
+            // override the templatePath if it exists
+            if (templatePath != null && templatePath.length() > 0)
             {
                 ve.setProperty( RuntimeConstants.FILE_RESOURCE_LOADER_PATH,
                     templatePath);
-                ve.init();
             }
+
+            ve.init();
 
             // get the last modification of the VSL stylesheet
             styleSheetLastModified = ve.getTemplate( style ).getLastModified();

Added: jakarta/velocity/trunk/test/anakia/velocity.properties
Url: http://svn.apache.org/viewcvs/jakarta/velocity/trunk/test/anakia/velocity.properties?view=auto&rev=124218
==============================================================================
--- (empty file)
+++ jakarta/velocity/trunk/test/anakia/velocity.properties	Wed Jan  5 07:10:01 2005
@@ -0,0 +1,2 @@
+# This is an empty velocity.properties file.
+# It is only used to trigger bug #21173 if present.

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