ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knuplesch, Juergen" <Juergen.Knuple...@icongmbh.de>
Subject AW: conditional exclude
Date Mon, 08 Sep 2008 06:16:13 GMT
You could use the <if> task from antcontrib and use two copy tasks depending on your
property. 


-- 
Jürgen Knuplesch
Geschäftsführer: Uwe Seltmann
HRB Stuttgart 17655
USt-IdNr.: DE 811944121 
-----Ursprüngliche Nachricht-----
Von: heights08 [mailto:daydream4inc@yahoo.com] 
Gesendet: Samstag, 6. September 2008 09:08
An: user@ant.apache.org
Betreff: conditional exclude


Hello. I need to apply two exclude conditions, one mandatory, one conditional based on properties
value. I wish I could just use "if" with an "exclude"
tag. Alas, I've tried many other things. This is the current non-working
version:

    <selector id="selector.exclusions.conditional" >
        <filename name="theme/foo/**/*"  />
        <filename name="theme/bar/**/*" />
    </selector>

    <selector id="selector.exclusions.all" >
        <filename name="script/**/*"  />
        <filename name="META_INF/**/*" />
    </selector>

<target name="resources" depends="init" description="Build resources">
        <copy todir="${resources.dir}" includeEmptyDirs="false">
            <fileset dir="${resource.dir}">
                <and>
                    <not>
                        <selector refid="selector.exclusions.conditional"
if="build.exclusions"/>
                    </not>
                    <not>
                        <selector refid="selector.exclusions.all"/>
                    </not>
                    <filename name="**/*"/>
                </and>
            </fileset>
        </copy>
	</target>


BUILD FAILED
C:\dev\vcm\main\vui-vcm\build.xml:275: Only one selector is allowed within the <selector>
tag

--
View this message in context: http://www.nabble.com/conditional-exclude-tp19343682p19343682.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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


Mime
View raw message