On Sun, Oct 19, 2008 at 3:32 AM, Ittay Dror <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I want to build a zip by picking out specific files.
>
> Say my tree is
> a/
>  b/
>   c/
>     D.class
>     E.class
>   f/
>     G.class
>     H.class
>
> I want to package D.class and G.class only.
>
> What is the cleanest way of doing that?
>
> The cleanest way seems to me if I could pass the task a base directory and
> a list of relative paths so it will include the paths in the zip (as-is)
> taken from expanding them with the base directory (e.g.,
> zip('a/b/c/D.class', 'a/b/f/G.class', :base => compile.target, :as-is =>
> true))
>
> AFAIK, I can do:
> zip.include("#{compile.target}/a/b/c/D.class", :as => 'a/b/c/D.class')
> zip.include("#{compile.target}/a/b/f/G.class", :as => 'a/b/f/G.class')
>
> or:
> zip.path('a/b/c').include("#{compile.target}/a/b/c/D.class")
> zip.path('a/b/f').include("#{compile.target}/a/b/f/G.class")


I agree it's not exactly good-looking.  It would be nice to be able to write
something like:

package(:jar).include_classes [ 'a.b.c.D', 'a.b.f.G', 'a.b.j.*' ]

alex

Reply via email to