1

Using Ant, I need to copy files to a destination directory, and concatenate to the destination if the file already exists.

Below is the source and destination directory structure.

src_dir/  
    /values1/    
        strings.xml
        id.xml
    /values2/
        strings2.xml

dest_dir/  
    /values1/
        strings.xml
        id.xml

So in this case, I want strings.xml from src_dir/values1 to be appended to strings.xml in dest_dir/values1, and same with id.xml.

Also, since strings2.xml doesn't exist in dest_dir/values2, I would want to just create a values2 dir in dest_dir and copy strings2.xml over.

I have been making a mess trying to parse directories from src to build a destination for concat, but I am over my head.

kenorb
  • 155,785
  • 88
  • 678
  • 743
  • If its definitive list, then I think you can use available ant task to check existence of file on destination & based on which you can use copy or concat -with append=true ant task to achieve this. And I think ant is not intelligent enough to handle recursive directory mapping! – user1587504 Oct 10 '13 at 12:50

0 Answers0