You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2010/01/26 16:34:25 UTC
DO NOT REPLY [Bug 48621] New: Allow with multiple base
directories
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
Summary: Allow <fileset> with multiple base directories
Product: Ant
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Core tasks
AssignedTo: notifications@ant.apache.org
ReportedBy: rich@steelezone.net
The current implementations of <fileset> and <dirset> only allow for a single
base directory; I would like the ability to specify multiple base directories,
perhaps something like this:
<fileset>
<basedirs refid="src" />
<include name="*.java" />
</fileset>
Rationale:
The <javac> task allows for multiple source directories using the <src>
element; this is particularly useful for builds that generate source code. I
can create a generic (reusable) build file for generating source from an
arbitrary number of source directories using this element.
However, dealing with multiple source directories becomes problematic in other
areas, like creating a zip file of all the sources.
I'd prefer to not have to depend on a custom task, like using antcontrib's
<for>, because the script handling this is meant to be generic; the same
argument goes against writing my own task to do this (which I've done).
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
Stefan Bodewig <bo...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|unspecified |1.8Alpha (nightly)
Target Milestone|--- |1.8.1
Severity|normal |enhancement
--- Comment #3 from Stefan Bodewig <bo...@apache.org> 2010-01-26 21:21:23 UTC ---
I understand - you are correct if the list of basedirs is not known there is no
built-in way to do that.
You may get there using a <for> loop creating a fileset, echoing the included
filenames to a file using pathconvert and echo and finally use a filelist
reading the written file, but this is clumsy.
Extending <fileset> won't work since most tasks that work on fileset expect it
to have a single base directory (they invoke getBasedir and getIncludedFiles
and build up File instances).
What we can do is to write a resource collection that behaves like a union of
filesets that share the same include/exclude patterns with basedirs taken from
another resource collection. It shouldn't be too hard to do, but we are too
close to the 1.8.0 release to throw it in right now.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
Stefan Bodewig <bo...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|1.8.1 |1.8.2
--- Comment #6 from Stefan Bodewig <bo...@apache.org> 2010-05-18 10:24:37 EDT ---
you are correct. It's still on my TODO list but got burried under a bunch of
other things, sorry.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
--- Comment #14 from Matt Benson <mb...@apache.org> 2011-02-16 14:49:40 EST ---
If the only thing stopping you from using <augment> is antcontrib, can you
require Java 6 and use the built-in Rhino interpreter to do any iteration?
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
rich@steelezone.net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |NEW
--- Comment #2 from rich@steelezone.net 2010-01-26 08:03:51 UTC ---
That would work if I knew ahead of time the specific base directories I'm
dealing with; however, my (perhaps overly?) generic shared build file doesn't
know that: it's usually one source directory, sometimes two, but it could be
more.
For my project, the "concrete" build file that imports the generic build file
just sets a "java-build-sources-path" reference, which the common build script
uses by having <src refid="java-build-sources-path"> in the <javac> task.
This works for <javac>, but then how do I generically build the source zip file
artifact (for example)? I've struggled to figure out how to use the
java-build-sources-path reference with <zip>.
If you know of a way that doesn't resort to looping with either antcontrib or
any other custom task, I'll be happy to give it a try.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
--- Comment #7 from rich@steelezone.net 2010-05-18 10:27:59 EDT ---
Absolutely no need to be sorry! After all, I fully understand being buried
under a pile of work. I only asked so I can plan our migration path to 1.8.
Thanks.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
--- Comment #13 from rich@steelezone.net 2011-02-16 13:53:08 EST ---
> What we can do is to write a resource collection that behaves like a union of
> filesets that share the same include/exclude patterns with basedirs taken from
> another resource collection. It shouldn't be too hard to do, but we are too
> close to the 1.8.0 release to throw it in right now.
Is there any hope this will get resolved? Or is it already and I've just
missed it?
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
--- Comment #10 from rich@steelezone.net 2010-06-08 07:17:03 EDT ---
(In reply to comment #9)
> Just wanted to point out that the recently-added <augment> task would allow one
> to dynamically add nested filesets to a union...
Can you give or point to an example? I'm not familiar with <augment>.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
--- Comment #5 from rich@steelezone.net 2010-05-18 10:12:57 EDT ---
It looks like this change didn't make the 1.8.1 release that just went out,
unless I just missed it in the change notes. Can you confirm, please?
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
--- Comment #15 from Matt Benson <mb...@apache.org> 2011-02-16 14:52:18 EST ---
(In reply to comment #14)
> If the only thing stopping you from using <augment> is antcontrib, can you
> require Java 6 and use the built-in Rhino interpreter to do any iteration?
Actually, in this case you'd be beyond the help of <augment> since it's based
on the XML processing, but once you're scripting you can just work directly
with Ant's Java API. Alternatively you could write a custom task in Java, but
I think you said you already did so...
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
--- Comment #12 from rich@steelezone.net 2010-06-09 16:38:40 EDT ---
<augment> looks like something that's very useful; it's similar to, though more
general and more powerful (and more supported!) than a custom <modifypath> task
I created.
However, I still can't rely on using antcontrib tasks in my base build scripts.
Unfortunately, not all of the groups using these scripts will accept using
that, so I need a solution that doesn't.
Thanks, though, for the pointer. I'm really looking forward to upgrading to
1.8.1+.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
[Bug 48621] Allow with multiple base directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
--- Comment #17 from Stefan Bodewig <bo...@apache.org> ---
and svn revision 1578009 as a fix for my slipping fingers
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 48621] Allow with multiple base directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
Stefan Bodewig <bo...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
Target Milestone|1.8.2 |1.9.4
--- Comment #16 from Stefan Bodewig <bo...@apache.org> ---
I'm not sure whether anybody still needs this but I've finally managed to reach
the bottom of my Ant TODO list ...
More than four years later, oh my.
svn revision 1578003
--
You are receiving this mail because:
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
--- Comment #8 from seatracer@gmail.com 2010-06-04 22:36:24 EDT ---
Created an attachment (id=25530)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=25530)
This adds a datatype called the "BaseDirList" which essentially acts as a list
of FileSet s
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
--- Comment #9 from Matt Benson <mb...@apache.org> 2010-06-05 00:34:18 EDT ---
Just wanted to point out that the recently-added <augment> task would allow one
to dynamically add nested filesets to a union...
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
Stefan Bodewig <bo...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #1 from Stefan Bodewig <bo...@apache.org> 2010-01-26 07:43:19 UTC ---
Most if not all Ant tasks deal with resource collections now. Is there
anything, a <union> of <fileset>s doesn't cover?
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
--- Comment #4 from rich@steelezone.net 2010-01-27 18:29:34 UTC ---
Your solution seems like it would work, thank you very much.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 48621] Allow with multiple base
directories
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48621
--- Comment #11 from Matt Benson <mb...@apache.org> 2010-06-09 16:27:24 EDT ---
http://ant.apache.org/manual/Tasks/augment.html is the manual page. The way
you could accumulate FileSets using <augment> would be:
- set up a <path> or <union> with an id
- iterate over your basedirs using e.g. antcontrib <for>
- for each basedir, <augment> your id'd path|union from step 1 by adding a
<fileset> whose dir is the currently iterated member
HTH,
Matt
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.