-1

I am trying to build a simple build.xml to create a tar ball with certain conditions. I have tried all possible options but, doesn't achieve what I am looking for.

I am looking for some sort of wild card which I can use to exclude all, and use pattern to include only those subdirs which are needed.

Below is sample source Dir. It has around 30 sub dirs, like prompts, audio, video, etc. Each of these sub dirs has multiple sub dirs with specific languages like en, fr-fr, etc. Each of lang dirs has some files like .au, .txt. htm, etc.

Source Dir:

Locale/

  `-- prompts
      |-- en
          |-- some files
      |-- en-gb
          |-- some files
      |-- fr-FR
          |-- some files
      |-- es-ES
          |-- some files

  `-- audio
      |-- en
          |-- some files
      |-- en-gb
          |-- some files
      |-- fr-FR
            |-- some files
      |-- es-ES
            |-- some files
  `-- video
        |-- en
            |-- some files
        |-- en-gb
            |-- some files
        |-- fr-FR
            |-- some files
        |-- es-ES
            |-- some files

What I am trying is after ant run, it will create a tar with specific language files only and exclude all.So final tar should look some thing as below for fr-Fr lang pack. I am planing to use -Darg=fr-FR as argument to ant on cmd, to select which lang pack I want to create. this way I can create any lang pack, with only those specific files.

Locale/

  `-- prompts
      |-- fr-FR
          |-- some files

  `-- audio
      |-- fr-FR
            |-- some files

  `-- video
        |-- fr-FR
            |-- some files
User0123456789
  • 760
  • 2
  • 10
  • 25
  • Just to add more info, I tried using . But still I am getting all lang dirs included. Excluding everything with specifying all dir name is not an option, as I need to create any specific lang pack as needed with providing lang name by -Darg. Hope this is clear – user2917246 Apr 22 '16 at 19:18

1 Answers1

0

In order for a file to be selected, it must match includes and must not match excludes. There is no such "excludes except" mechanism. Try specifying the include only.

Brett Kail
  • 33,593
  • 2
  • 85
  • 90
  • Hello Brett, Thanks for your suggestions. I tried what you suggested, i.e. specifying include only. But unfortunately, still doesnt work. In final tar, I still get all other dirs as well. – user2917246 Apr 25 '16 at 18:03
  • Below is sample of what I tried. I get all Files under audio, but for all langs. I want only for $lang, if $lang =fr-FR, then include files under prompts/audio/fr-Fr/ only. Currently it will have files under prompts/audio/fr-Fr/ and prompts/audio/en/ and so on. Can you please help ? – user2917246 Apr 25 '16 at 18:10
  • Why do you have the first tarfileset at all? Why not simply ``? – Brett Kail Apr 25 '16 at 18:55