ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Ræder Clausen" <>
Subject Re: Checking existence of a set of files
Date Mon, 21 Jul 2008 15:14:56 GMT
On Mon, Jul 21, 2008 at 4:01 PM, Dominique Devienne <> wrote:
> On Mon, Jul 21, 2008 at 6:23 AM, Lars Ræder Clausen <> wrote:
>> What obvious task/combination of conditions am I missing?
> I'd use Ant-Contrib's <outofdate> with a nested <fail>, but in your
> case Ant's own <uptodate> and the usual target gymnastic (see other
> poster's code) would do too. --DD

Thanks, that almost got me to where I wanted to be.  One problem that
I think I've surmounted is the need for a file that's older than any
existing file:

  <target name="externaljars">
    <touch file="oldFile" millis="0"/>
    <uptodate property="externalJars.available" targetfile="oldFile">
      <srcfiles refid="requiredJars"/>
    <delete file="oldFile"/>
    <fail unless="externalJars.available"/>

The reason I say "I think" is that I haven't managed to make the
requiredJars FileSet.  Problem is, the required files come from
several different directories, some from within the build space, some
from without.  It was easy to make a ClassPath with them, but that's
not a usable argument for <srcfiles> in <uptodate> (but I need it
elsewhere). Reading the FileSet docs, I don't see a way to make a
FileSet without setting a dir - even if all I want to do is include
some other filesets.  Trying with dir="/" and then absolute paths
(prolly a problem on non-Unix systems) led to this interesting error:

/home/lars/Programming/Eclipse/ampep/Aas/build.xml:534: Syntax error
in property: � � ����q��tY
               e BR�
                     �֘�IĒ��s�x�s�QWV� �[ZZ�(ɬ4� d��6���ͱD�ޗ�b!Pa��&7U
 �ij��|f�[�4��R�g ��-S�    )�63�ұLV/�5� �� ���#�)�"�^ё�unԓ��M�$
�� [W�
2  oi�ӹxJ qHFO'bm�3�  �d֔�>�@�J�J�U`�
                    �;:�p q� ���� �LL**┬� � �:05
�X0�̀#� ��⎺��H�┼�3���L��T���F°^X␍
≠A─$π�:� ┐���܆─��� ─9��D4�D�

So your approach requires a FileSet, but I can only make FileList or
ClassPath structures for my list of files. Yes, I could kludge around
it by testing on several different FileSets in the existence test, but
surely there's a more structured way than that?

View raw message