geirm       01/03/14 19:12:34

  Modified:    src/java/org/apache/velocity/anakia AnakiaTask.java
  Log:
  Small fix for the templatepath vs velprops logic
  
  Revision  Changes    Path
  1.23      +12 -12    
jakarta-velocity/src/java/org/apache/velocity/anakia/AnakiaTask.java
  
  Index: AnakiaTask.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/anakia/AnakiaTask.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- AnakiaTask.java   2001/03/15 02:43:29     1.22
  +++ AnakiaTask.java   2001/03/15 03:12:33     1.23
  @@ -93,7 +93,7 @@
    * <a href="http://jakarta.apache.org/velocity/anakia.html">Website</a>.
    *   
    * @author <a href="[EMAIL PROTECTED]">Jon S. Stevens</a>
  - * @version $Id: AnakiaTask.java,v 1.22 2001/03/15 02:43:29 jon Exp $
  + * @version $Id: AnakiaTask.java,v 1.23 2001/03/15 03:12:33 geirm Exp $
    */
   public class AnakiaTask extends MatchingTask
   {
  @@ -256,20 +256,20 @@
               velocityPropertiesFile = new File("velocity.properties");
           }
   
  -        // If the props file doesn't exist AND a templatePath hasn't 
  -        // been defined, then throw the exception. otherwise, make
  -        // the propertiesFile null here so that we can check for it
  -        // when we initialize the Runtime.
  -        if (!velocityPropertiesFile.exists() && templatePath != null)
  -        {
  -            velocityPropertiesFile = null;
  -        }
  -        else if (templatePath != null)
  +
  +        /*
  +         * If the props file doesn't exist AND a templatePath hasn't 
  +         * been defined, then throw the exception.
  +         */
  +
  +        if ( !velocityPropertiesFile.exists() && templatePath == null )
           {
  -            throw new BuildException ("Could not locate velocity.properties file: " 
+ 
  +            throw new BuildException ("No template path and could not locate 
velocity.properties file: " + 
                   velocityPropertiesFile.getAbsolutePath());
           }
   
  +       
  +
           log("Transforming into: " + destDir.getAbsolutePath(), Project.MSG_INFO);
   
           // projectFile relative to baseDir
  @@ -288,7 +288,7 @@
           
           try
           {
  -            if (velocityPropertiesFile != null)
  +            if ( velocityPropertiesFile.exists() )
               {
                   Velocity.init(velocityPropertiesFile.getAbsolutePath());
               }
  
  
  

Reply via email to