You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Nick Leaton <ni...@gmail.com> on 2010/07/12 11:36:49 UTC
fileset problem
I'm trying to create a zip file to archive source.
However, I want to exclude the .hg directory (mercurial) apart from
the .hg/hgrc file which contains the configuration for the repository.
I can't get the fileset working properly. This is my attempt.
<target name="archive">
<tstamp/>
<antcall target="clean"/>
<zip destfile="c:/archive/${ant.project.name}-${DSTAMP}.zip">
<fileset dir=".">
<exclude name=".hg"/>
</fileset>
<fileset dir=".">
<include name=".hg/hgrc"/>
</fileset>
</zip>
</target>
Any ideas?
--
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: fileset problem
Posted by Nick Leaton <ni...@gmail.com>.
Thanks. Obvious in the end.
Nick
On Mon, Jul 12, 2010 at 4:09 PM, Stefan Bodewig <bo...@apache.org> wrote:
> On 2010-07-12, Nick Leaton wrote:
>
>> However, I want to exclude the .hg directory (mercurial) apart from
>> the .hg/hgrc file which contains the configuration for the repository.
>
>> I can't get the fileset working properly. This is my attempt.
>
> You don't say what your attempt results in 8-)
>
>> <target name="archive">
>> <tstamp/>
>> <antcall target="clean"/>
>> <zip destfile="c:/archive/${ant.project.name}-${DSTAMP}.zip">
>> <fileset dir=".">
>> <exclude name=".hg"/>
>
> This is a non-recursive match on the directory name. It will still
> allow all files inside that directory as well as all subdirectories to
> get included. To make this recursive you'd use .hg/** or just .hg/
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
--
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: fileset problem
Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-07-12, Nick Leaton wrote:
> However, I want to exclude the .hg directory (mercurial) apart from
> the .hg/hgrc file which contains the configuration for the repository.
> I can't get the fileset working properly. This is my attempt.
You don't say what your attempt results in 8-)
> <target name="archive">
> <tstamp/>
> <antcall target="clean"/>
> <zip destfile="c:/archive/${ant.project.name}-${DSTAMP}.zip">
> <fileset dir=".">
> <exclude name=".hg"/>
This is a non-recursive match on the directory name. It will still
allow all files inside that directory as well as all subdirectories to
get included. To make this recursive you'd use .hg/** or just .hg/
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org