ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject Re: <filelist> and names with spaces
Date Mon, 02 Feb 2004 09:49:56 GMT
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


Mime
View raw message