You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Raja Nagendra Kumar <Na...@tejasoft.com> on 2008/07/23 19:43:13 UTC

Enforce order in copying so that my overiding works correctly

Hi I am looking for files to copied to same directory from different
locations as specified by fileset and its includes as below.

<copy todir="${build.wtk.res}" overwrite="true"
		  includeEmptyDirs="false" flatten="true">
		<fileset dir="${resources}">
		    <exclude name="**/Thumbs.db"/>
		    <include name="jad/app.jad"/>
		     <include name="images/deviceid/**/N73/*.jad/>
		</fileset>
	    </copy>

However, I wish includes would be applied in the order they are represented
in the fileset so that my overide would give the desired file.

e.g let us say I have app.jad files in jad directory and also in N73
directory. As N73 includes is last, the final copied file should be the
which existed in N73 directory and not the one which existed in jad
directory.

currently as the order is not clear to me, I am using 3 seperate copies with
one include with jad and other copy with n73 include i.e as below.

<copy todir="${build.wtk.res}" overwrite="true"
		  includeEmptyDirs="false" flatten="true">
		<fileset dir="${resources}">
		    <exclude name="**/Thumbs.db"/>
		    <include name="jad/app.jad"/>
		</fileset>
	    </copy>

<copy todir="${build.wtk.res}" overwrite="true"
		  includeEmptyDirs="false" flatten="true">
		<fileset dir="${resources}">
		    <exclude name="**/Thumbs.db"/>
		     <include name="images/deviceid/**/N73/*.jad/>
		</fileset>
	    </copy>

Though this does solve my issue, however it keeps my ant script bigger and
does not convey things as the first approach. Does any one have any idea how
to enable the first approach work..

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
- Experience Intellect

-- 
View this message in context: http://www.nabble.com/Enforce-order-in-copying-so-that-my-overiding-works-correctly-tp18616470p18616470.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


Re: Enforce order in copying so that my overiding works correctly

Posted by Lars Ræder Clausen <lr...@amplex.dk>.
On Thu, Jul 24, 2008 at 11:30 AM, Rebhan, Gilbert
<Gi...@huk-coburg.de> wrote:
>
>
>
> -----Original Message-----
> From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
> Sent: Thursday, July 24, 2008 11:21 AM
> To: Ant Users List
> Subject: RE: Enforce order in copying so that my overiding works
> correctly
>
> /*
> [ ... ]
>
> see =
> http://ant.apache.org/manual/CoreTypes/resources.html#collection
>
> */
>
> P.S. :
>
> here are your set operations =
>
> http://ant.apache.org/manual/CoreTypes/resources.html#union
> http://ant.apache.org/manual/CoreTypes/resources.html#intersect
> http://ant.apache.org/manual/CoreTypes/resources.html#difference

Went through some permutations -- the docs are a bit scanty -- but
here's an example that works:

  <fileset id="a" dir="${dist}"><include name="ampcom.jar"/> </fileset>
  <fileset id="b" dir="${extlib}"><include name="ant.jar"/></fileset>
  <union id="ab">
    <fileset refid="a"/><fileset refid="b"/>
  </union>

  <target name="aTest">
    <copy todir="/tmp">
      <union refid="ab"/>
    </copy>
  </target>

Wish we were using Ant 1.7 generally, there's a number of places this
would come in handy.

-Lars

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


RE: Enforce order in copying so that my overiding works correctly

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
 


-----Original Message-----
From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de] 
Sent: Thursday, July 24, 2008 11:21 AM
To: Ant Users List
Subject: RE: Enforce order in copying so that my overiding works
correctly

/*
[ ... ]

see =
http://ant.apache.org/manual/CoreTypes/resources.html#collection

*/

P.S. :

here are your set operations =

http://ant.apache.org/manual/CoreTypes/resources.html#union
http://ant.apache.org/manual/CoreTypes/resources.html#intersect
http://ant.apache.org/manual/CoreTypes/resources.html#difference


Regards, Gilbert

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


RE: Enforce order in copying so that my overiding works correctly

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
 

-----Original Message-----
From: Lars Ræder Clausen [mailto:lrc@amplex.dk] 
Sent: Thursday, July 24, 2008 9:36 AM
To: Ant Users List
Subject: Re: Enforce order in copying so that my overiding works correctly

[ ... ]

/*
Speaking of FileSet, is it just me who's having trouble doing a set
union on FileSets?  I'd have expected something like

<fileset id="set1" dir="/tmp"><include name="aFile"></fileset>
<fileset id="set2" dir="/etc"><include name="passwd"></fileset>
<fileset id="set3">
  <include refid="set1"/>
  <include refid="set2"/>
</fileset>

to give me a FileSet with two files in it, but it's not even legal,
and I have yet to find a legal way to do it.  Is it just that the
internal representation of FileSet is not compatible with that kind of
operation?
*/

that can be achieved via resource collections in ant 1.7

i didn't use ant 1.7 yet, but you can do things like =

<!-- subtract the intersection -->
<difference id="foobar">
 <fileset refid="yourfileset_1" />    
 <fileset refid="yourfileset_2" />
</difference>

and also count for further math operations =

<resourcecount property="count.foo">
 <fileset refid="foo" />
</resourcecount>

see =
http://ant.apache.org/manual/CoreTypes/resources.html#collection


Regards, Gilbert

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


Re: Enforce order in copying so that my overiding works correctly

Posted by Lars Ræder Clausen <lr...@amplex.dk>.
On Wed, Jul 23, 2008 at 7:43 PM, Raja Nagendra Kumar
<Na...@tejasoft.com> wrote:
>
> Hi I am looking for files to copied to same directory from different
> locations as specified by fileset and its includes as below.
>
> <copy todir="${build.wtk.res}" overwrite="true"
>                  includeEmptyDirs="false" flatten="true">
>                <fileset dir="${resources}">
>                    <exclude name="**/Thumbs.db"/>
>                    <include name="jad/app.jad"/>
>                     <include name="images/deviceid/**/N73/*.jad/>
>                </fileset>
>            </copy>
>
> However, I wish includes would be applied in the order they are represented
> in the fileset so that my overide would give the desired file.

A FileSet does not have a well-defined order, it's a set.  A FileList
does have an order, but I'm not sure if you can use that in a copy
task.

Speaking of FileSet, is it just me who's having trouble doing a set
union on FileSets?  I'd have expected something like

<fileset id="set1" dir="/tmp"><include name="aFile"></fileset>
<fileset id="set2" dir="/etc"><include name="passwd"></fileset>
<fileset id="set3">
  <include refid="set1"/>
  <include refid="set2"/>
</fileset>

to give me a FileSet with two files in it, but it's not even legal,
and I have yet to find a legal way to do it.  Is it just that the
internal representation of FileSet is not compatible with that kind of
operation?

-Lars

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


Re: Enforce order in copying so that my overiding works correctly

Posted by Raja Nagendra Kumar <Na...@tejasoft.com>.
Hi,

Thank you for pointing to filelist. However filelist does not support
selectors such as include and exclude. Are there ony future plans of
supporting these patterns in filelist or else fileset to be orderset. Any
ant developers pl. see if this could be a possible feature in future
versions.

Regards,
Nagendra
-- 
View this message in context: http://www.nabble.com/Enforce-order-in-copying-so-that-my-overiding-works-correctly-tp18616470p18627716.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