You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2004/12/28 19:15:37 UTC

DO NOT REPLY [Bug 32862] New: - Translate task does not skip the esc chars

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32862>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32862

           Summary: Translate task does not skip the esc chars
           Product: Ant
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: mahesh.dixit@MIROTechnologies.com


I have the following ant task to search and replace tokens from the properties
file. But the Replaced file has the escape chars in . 
e.g. C\:\\sandbox.miro\\Product1\\BuildMaster/source/html
The translate task does not skip/take care of the esacpe chars . 
Is this a bug or is there some other way to achieve what i want to accomplish ?

<!-- ============================================================ -->
  <!-- Look for <<property>> text in files, and replace it          -->
  <!-- ============================================================ -->
  <macrodef name="propertyReplace">
    <attribute name="fromdir"/>
    <attribute name="todir"/>
    <sequential>
        <!-- write out current ant settings as property translations -->
        <echo message="propertyReplace: from @{fromdir} to @{todir}"/>
        <mkdir dir="${dist}/ant"/>
        <echoproperties destfile="${dist}/ant/ant.properties"/>

        <!-- use ant to translate files -->
        <translate toDir="@{todir}"
                   starttoken="&lt;&lt;"
                   endtoken="&gt;&gt;"
                   bundle="${dist}/ant/ant"
                   forceoverwrite="no">
          <fileset dir="@{fromdir}">
          </fileset>
        </translate>
    </sequential>
  </macrodef>

<target name="test1" depends="init">
  <delete dir="${project}/test/replaced" quiet="true"/>
  <propertyReplace fromdir="${project}/test/replace" 
  todir="${project}/test/replaced"/>
  <echo message="${TOMCAT.GLOBAL.JDBC.DRIVER}"/>
</target>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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