简体   繁体   中英

Ant tar fileset exclude ALL subdirs but one using pattern

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM