ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cyril Sagan <>
Subject Is it possible to get "location semantics" with <condition/>
Date Wed, 11 Dec 2013 23:07:54 GMT
I don't think it is possible, but I wanted to confirm here.

My goal is to be platform agnostic, and not get mixed separators in path
names, in order to accomplish this I don't think I can use <condition/>.

While I prefer to use "pure ant", in this case I think the <if/> is better
than lots of ${path.separtor}'s in strings.

Consider this example:

OUTPUT:   (note mixed separators)
C:\temp>ant -version
Apache Ant version 1.7.0 compiled on December 13 2006

Buildfile: build.xml
     [echo] = C:\temp\false\demo\path
     [echo] dir.fails = C:\temp/false/demo/path

Total time: 0 seconds

>From this build.xml:

<?xml version="1.0" encoding="utf-8"?>
<project name="condition-property-semantics-test">
    <taskdef resource="net/sf/antcontrib/antlib.xml"/>

        <istrue value="${}" />
            <property name=""
                      location="${basedir}/true/option" />
            <property name=""
                      location="${basedir}/false/demo/path" />

    <!-- not equivalent to above on windows, ${dir}
         will have both forward and backward slashes -->
    <condition property="dir.fails"
        <istrue value="${}" />

    <echo> = ${}</echo>
    <echo>dir.fails = ${dir.fails}</echo>

Anyone have any other suggested solution?   Thanks.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message