archive task with "sparse" files
--------------------------------
Key: BUILDR-186
URL: https://issues.apache.org/jira/browse/BUILDR-186
Project: Buildr
Issue Type: Wish
Affects Versions: 1.3.2
Reporter: Ittay Dror
Fix For: 1.3.4
(from an email thread)
I asked:
> 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")
> >
> > or:
> > ['a/b/c/D.class', 'a/b/f/G.class'].each do |path|
> > zip.include("#{compile.target}/#{path}", :as => path
> > end
Assaf Says:
:base would be easiest because you can specify multiple files/patterns
in a single include.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.