On Sun, Oct 9, 2011 at 2:30 PM, Sprog : Weyert de Boer <sp...@nothing.ch>wrote:

> I would like to separate the packaging of the main project (has a special
> project.group set) from
> the other projects. The main project should be zipped. That's simple but
> the other projects need to
> be packed in a zip file and metafile alongside this zip file needs to be
> created. At the end it should
> result the following:
>
>   mainproject_01_01.zip
>   subprojects_01_01.zip
>   index_subprojects_01.01.csv
>
> What's the best way to get this working? Any ideas? Do I need to make a new
> package type to generate an extra file?
>

To package things as zip, you simply do package(:zip) and then call
include() to add stuff in it.

If you need to generate several zips, each needs a different id.  By
default, the id is the project's name.  You can change the id by doing,
e.g.,

package(:zip, :id => 'subprojects').tap do |zip|
  zip.include project('foo')
  zip.include project('bar')
  ...
end

For your csv file, you can either create a new packaging type as describe
here: http://buildr.apache.org/rdoc/classes/Buildr/Package.html#M000751

Or you can simply add a file task to your project's packages.

packages << file('index_subprojects_01.01.csv')

p.s. is it normal that it tries to compile all projects when you use
> main:project:build ?
>

Yes, buildr assumes parent projects are dependent on all their subprojects.
 (And there is no easy way to change that)

alex

Reply via email to