ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Florin Iucha)
Subject question about filesets and conditions
Date Mon, 19 Jul 2004 19:34:42 GMT

I have a question: why can conditions be attached to "include/exclude" 
but not to (zip|tar)filesets?

I am creating a build_common imported from a lot of components whose
sources are stored in individual directories. Each component can have 
one of more of A, B, and C types of sources, stored in src/A, src/B
and src/C in a component directory.

When I try to package the sources using tar, I am trying a recipe like
   <target name="package.component">
      <tar destfile="${package.base}/${}" compression="gzip">
         <tarfileset dir="${src.dir}/A" prefix="P1">
            <include name="**/*" if="component.has.A" />
         <tarfileset dir="${src.dir}/B" prefix="P2">
            <include name="**/*" if="component.has.B" />
         <tarfileset dir="${src.dir}/C" prefix="P3">
            <include name="**/*" if="component.has.C" />

Now, this works for components that have src/A, src/B and src/C, but fails
for component that miss any of them, because the tarfileset refers to a
missing directory.

I could change it to 
         <tarfileset dir="${src.dir}" prefix="P2">
            <include name="B/**/*" if="component.has.B" />
but then there is no way to get rid of B since the tarfileset does not
accept a mapper.

Is that by design that filesets do not accept conditions, or should I 
just file an enhancement request?

Thank you,


Don't question authority: they don't know either!

View raw message