ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morten S. Mortensen" <morten.morten...@tietoenator.com>
Subject RE: <filelist> and names with spaces
Date Mon, 02 Feb 2004 10:08:43 GMT

Hi,

Peter, you are right - no sorting! Got that from somewhere else (another, a bit different
discussion of scenarios with <path> in relation to <pathconvert>). My fault.

The patch you show - it looks good! When will it become "common" - is it to be part of 1.6.1?
(no, I have no trouble patching and compiling the Ant source, but it is somewhat difficult
to say to others, that "hey, use my private built of Ant, because this is not included in
any available version"...)
It is within CVS?

Regards,
Morten Sabroe Mortensen


-----Original Message-----
From: Peter Reilly [mailto:peter.reilly@corvil.com]
Sent: 2. februar 2004 10:50
To: Ant Users List
Subject: Re: <filelist> and names with spaces


Morten S. Mortensen wrote:

>Hi,
>
>Trying out -
>
>  <path
>    id="sub-project.path"
>  >
>
>    <filelist
>      dir="${project.dir}"
>      files=
>        "
>         XXX Core Library/System/Java/build.xml,
>         YYY Prime/System/Java/build.xml
>        "
>    />
>  </path>
>
>- I notice, that the "files" attributes *apparently* is not tokenized after a delimiter
',', because the first file-name becomes "XXX", not "XXX Core Library/System/Java/build.xml".

>
>An alternative to writing a <path> is -
>
>  <path
>    id="sub-project.path"
>  >
>
>    <pathelement location="XXX Core Library/System/Java/build.xml"/>
>    <pathelement location="YYY Prime/System/Java/build.xml"/>
>
>  </path>
>
>- and this works well for the specific example, but then I in general loose the control
of the sequence of names, because they are sorted - with <filelist>, I have this control!
>  
>
You are correct that filelist restriction to only using an attributes is 
wrong. (and easy to fix).
However the elements of a path are not sorted - (although duplicates are 
removed).

    <echo>Order A</echo>
    <ac:for param="file">
      <ac:path>
        <ac:pathelement location="path.xml"/>
        <ac:pathelement location="build.xml"/>
      </ac:path>
      <ac:sequential>
        <echo>File: @{file}</echo>
      </ac:sequential>
    </ac:for>
    <echo>Order B</echo>
    <ac:for param="file">
      <ac:path>
        <ac:pathelement location="build.xml"/>
        <ac:pathelement location="path.xml"/>
      </ac:path>
      <ac:sequential>
        <echo>File: @{file}</echo>
      </ac:sequential>
    </ac:for>

outputs:
order:
Order A
File: /home/preilly/learning/ant/path.xml
File: /home/preilly/learning/ant/build.xml
Order B
File: /home/preilly/learning/ant/build.xml
File: /home/preilly/learning/ant/path.xml

>This is less than optimal. In general, lists manifestated in the form of comma-separated
sucks!
>
>The in-ability of <filelist>'s handling of file-names with internal spaces is a
glitch, right?
>  
>
Yes,
with the attached patch one should be able to specify filelists like:

  <filelist dir="${project.dir}">
    <file name="XXX Core Library/System/Java/build.xml"/>
    <file name="YYY Prime/System/Java/build.xml"/>
  </filelist>


Peter



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


Mime
View raw message