ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 16923] New: - File arguments incorrectly processed using JDK 1.1
Date Mon, 10 Feb 2003 10:04:23 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16923>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16923

File arguments incorrectly processed using JDK 1.1

           Summary: File arguments incorrectly processed using JDK 1.1
           Product: Ant
           Version: 1.5.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: JPMcGrath@JPMcGrath.net


Ant messes up File arguments under the following circumstances:

   1) Running on Windows.
   2) Use a build file that is not in the current directory.
   3) Specify the path to the build file using forwar slashes.
   4) The basedir attribute for the project is a relative path.

Under these circumstances, Ant *does* find and run the build file.  However, for
any tasks that take a File argument, it passes the incorrect File value to the task.

=======================================================================
Steps:

Create the following shell script.  The paths to the JDKs will need to be
adjusted for your system.

    export ANT="/d/java/libraries/jakarta-ant-1.5.1/bin/ant"

    JDKs="1.4.1 1.1.8_009"

    for JDK in $JDKs ; do
        export JAVA_HOME="D:/Java/JDKs/jdk${JDK}"
        $ANT -DFileName="F_${JDK}.txt" -buildfile "subdir/FileBug.xml"
        $ANT -DFileName="B_${JDK}.txt" -buildfile "subdir\\FileBug.xml"
    done

    find . -name '*.txt'

Create the file "FileBug.xml" in a sub-directory named "subdir":

    <?xml version="1.0" encoding="UTF-8"?>

    <project name="FileBug" default="filebug" basedir="." >
        <target name="filebug">
            <echo file="${FileName}" 
                  message="Written using Java ${java.version}"/>
        </target>
    </project>

Run the shell script.  This will create the following files:

    ./F_1.1.8_009.txt
    ./subdir/B_1.1.8_009.txt
    ./subdir/B_1.4.1.txt
    ./subdir/F_1.4.1.txt

Mime
View raw message