ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Visher" <tim.vis...@gmail.com>
Subject Re: 'clean' target specifying all files 'except' a given fileset
Date Mon, 16 Jun 2008 15:29:12 GMT
Hey David,

Thanks for the help.  This is the final copy, and it appears to be working.

    <target name="clean" depends="init" >
        <delete includeemptydirs="true">
            <fileset dir="${basedir}">
                <exclude name="build.xml"/>
                <exclude name="test.xml"/>
                <exclude name="src/**/*"/>
                <exclude name="tests/**/*"/>
            </fileset>
        </delete>
    </target>

I had to add the /* to the end of the directories to get the actual
files under those directory trees to be excluded, but other than that
it's pretty much what you had.  In the docs, they say you're supposed
to be able to have each of the exclude/include statements incorporate
a group of patterns, separated by ',' or ' ', but I haven't been able
to get this to work.  Anyone know anything about those?

On Mon, Jun 16, 2008 at 11:21 AM, David Weintraub <qazwart@gmail.com> wrote:
> One more thing I just noticed (bad eyesight due to staring at computer
> screens for way too long), You have just "src/*" and "test/*". You
> probably want "src/**" and "test/**". A single asterisk means just the
> current directory. A double asterisk means all subdirectories too.
>
> --
> David Weintraub
> qazwart@gmail.com
>
>
> On Mon, Jun 16, 2008 at 10:57 AM, Tim Visher <tim.visher@gmail.com> wrote:
>> Partially solved my own problem at this point.  No longer getting
>> NullPointer but I still can't get the right includes.  My syntax must
>> be off or something.  Good news is that the exclude seems to be
>> working.
>>
>> Current target contents:
>> <target name="clean" depends="init" >
>>        <delete>
>>            <fileset dir="." includes="**/*">
>>                <exclude name="build.xml" />
>>                <exclude name="test.xml" />
>>                <exclude name="src/*" />
>>                <exclude name="test/*" />
>>            </fileset>
>>        </delete>
>>    </target>
>>
>> On Mon, Jun 16, 2008 at 10:46 AM, Tim Visher <tim.visher@gmail.com> wrote:
>>> Hey Everyone,
>>>
>>> I'm trying to develop a clean target that essentially deletes
>>> everything but a given set of files, rather than explicitly specifying
>>> everything to delete.  This seems like a slightly more elegant
>>> solution than the alternative, but I'm having very little success at
>>> the moment.  I've included the contents of the clean target here
>>> (since it's pretty small at the moment).  Any help would be greatly
>>> appreciated.
>>>
>>> Now:
>>> <target name="clean" depends="init" >
>>>        <delete failonerror="false">
>>>            <fileset>
>>>                <not>
>>>                    <filename name="build.xml" />
>>>                    <filename name="test.xml" />
>>>                    <filename name="src/*" />
>>>                    <filename name="tests/*" />
>>>                </not>
>>>            </fileset>
>>>        </delete>
>>> </target>
>>>
>>> Former:
>>> <target name="clean" depends="init" >
>>>        <delete dir="${build}" />
>>>        <delete dir="${dist}" />
>>>        <delete dir="${doc}" />
>>>        <delete dir="${tests:out}" />
>>>        <delete dir="${tests:reports}" />
>>> </target>
>>>
>>> FYI: I'm actually failing on an error, a Null Pointer Exception to be
>>> exact.  So it's not only not deleting the desired fileset; it's not
>>> even executing.
>>>
>>> --
>>>
>>> In Christ,
>>>
>>> Timmy V.
>>>
>>> http://burningones.com/
>>> http://five.sentenc.es/ - Spend less time on e-mail
>>>
>>
>>
>>
>> --
>>
>> In Christ,
>>
>> Timmy V.
>>
>> http://burningones.com/
>> http://five.sentenc.es/ - Spend less time on e-mail
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



-- 

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message