Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-417

add log attribute to ant task and "stringUtils" to context

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.5
    • Texen
    • None

    Description

      logging.patch: adds a "logFile" attribute

      — src/java/org/apache/velocity/texen/ant/TexenTask.java.orig Thu Oct 20 15:12:22 2005
      +++ src/java/org/apache/velocity/texen/ant/TexenTask.java Thu Oct 20 15:55:07 2005
      @@ -21,6 +21,7 @@
      import java.util.Hashtable;
      import java.util.Iterator;
      import java.util.Map;
      +import java.util.Properties;

      import java.io.File;
      import java.io.Writer;
      @@ -136,6 +137,12 @@
      protected boolean useClasspath;

      /**
      + * The LogFile (incl. path) to log to.
      + */
      + protected String logFile;
      +
      +
      + /**

      • Path separator.
        */
        private String fileSeparator = System.getProperty("file.separator");
        @@ -253,6 +260,22 @@
        }

      /**
      + * Sets the log file.
      + */
      + public void setLogFile(String log)
      +

      { + this.logFile = log; + }

      +
      + /**
      + * Gets the log file.
      + */
      + public String getLogFile()
      +

      { + return this.logFile; + }

      +
      + /**

      • Set the context properties that will be
      • fed into the initial context be the
      • generating process starts.
        @@ -413,6 +436,11 @@
        ve.setProperty(
        "classpath." + VelocityEngine.RESOURCE_LOADER +
        ".modificationCheckInterval", "2");
        + }
        +
        + if (this.logFile != null)
        + { + ve.setProperty(ve.RUNTIME_LOG, this.logFile); }

      ve.init();

      stringUtils.patch: adds a stringutils obj to the context

      — src/java/org/apache/velocity/texen/ant/TexenTask.java.orig Wed Apr 14 14:26:42 2004
      +++ src/java/org/apache/velocity/texen/ant/TexenTask.java Thu Oct 20 15:09:03 2005
      @@ -568,6 +568,7 @@
      throws Exception

      { context.put("now", new Date().toString()); + context.put("stringUtils", new StringUtils()); }

      /**

      Attachments

        Activity

          People

            Unassigned Unassigned
            seb1723 sebastian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: