You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Saloucious <sa...@gmail.com> on 2007/04/26 16:14:02 UTC

Conflicts include exclude

Hi,

I've got a problem wih a conflict include exclude :  

Here is my task : 

<copy todir="${classes.dir}" flatten="true" includeemptydirs="false">
 <fileset dir="${root.dir}">
  <include name="${config.path}/*.xml"/>
  <exclude name="${config.path}/*-mock.xml" />
  <exclude name="${config.path}/*-${value}.xml"/>
  <include name="${config.path}/*-${value}-mock.xml"/>
  </fileset>
</copy>

I desire to copy all XML files, 
Exclude XML files ended with mock.xml excepted pattern like
something-${value}-mock.xml
Exclude XML files ended  with something-${value}.xml

It seems to have a conflict between 

<exclude name="${config.path}/*-mock.xml" />
<include name="${config.path}/*-${value}-mock.xml"/>

Ant does not copy files with pattern *-${value}-mock.xml

I think there is a very trivial solution but can find it ... and I may be i
have not well understand exclude / include priority

Thanks


-- 
View this message in context: http://www.nabble.com/Conflicts-include-exclude-tf3651842.html#a10201064
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


Re: Conflicts include exclude

Posted by Dominique Devienne <dd...@gmail.com>.
On 4/26/07, Saloucious <sa...@gmail.com> wrote:
> It seems to have a conflict between
> <exclude name="${config.path}/*-mock.xml" />
> <include name="${config.path}/*-${value}-mock.xml"/>
> Ant does not copy files with pattern *-${value}-mock.xml

<exclude> always wins over <include>. Their relative order in the
fileset doesn't matter.

For greater flexibility, use selectors and notably the <filename>
selection with <and> and <or> grouping. --DD

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