tags:

views:

134

answers:

2

I have a folder path stored in the property nightly.basepath (here the value would be /path/to/my/nightly) :

/path/to/my/nightly
  |- build_20100310
  |- build_20100311
  |- build_20100312

I want to get the folder of the lastly generated build in the nightly.basepath folder, and store the path to this last folder in the nightly.last property. (So here, the value of nightly.last should be /path/to/my/nightly/build_20100312.)

Assume the alphabetical order reflects chronological order.

What is the easiest way to do that in Ant ?

+3  A: 

You could try the ant-contrib TimestampSelector. I haven't used that particular task but I have used other ones in ant-contrib and haven't had any issues with them.

TofuBeer
Thanks a lot, it will do.
subtenante
A: 

I have the same problem but I need the last file/folder based on alphabetical order rather than based on creation time.

My structure is the following

/versions
|-version_3_20_123
|-version_3_20_124
|-version_3_30_245
|-version_3_40_065

Where *version_3_30_245* might be built after *version_3_40_065* which I'm looking for.

Thank you!

Andreas Dietlicher
You should post follow-up questions as a separate thread, notas an answer. After all, it doesn't really answer *this*question. Also more people would see it and try to answer if you post it asyour own question.
sth