On Fri, Jun 12, 2009 at 11:44 AM, Assaf Arkin <[email protected]> wrote:

> On Fri, Jun 12, 2009 at 11:05 AM, Alex Boisvert <[email protected]
> >wrote:
>
> > On Fri, Jun 12, 2009 at 6:12 AM, Martin Grotzke <
> > [email protected]> wrote:
> >
> > > I needed to wrap the ant project with the generate = task ..., as
> > > otherwise (with just generate = ant('generate') do |ant| ...) the ant
> > > project was directly executed (AFAICS with the loading of the
> buildfile)
> > > and buildr complained with:
> > >  Buildr aborted!
> > >  Don't know how to build task 'Antwrap::AntProject[generate]'
> >
> >
> > Ooops. I forgot ant() didn't yeld a task; it executes right away.
> >
> > Do you think the stuff above is ok, so that we could push this to the
> > > buildr howtos (wiki)? Or is there still room for improvement?
> >
> >
> > I think the main improvement would be in wiring dependencies so the task
> > only executes when needed.
> >
> > Here's a revised version,
> >
> > define "generate-sources-example" do
> >
> >  # whatever you use to generate your sources
> >   sources = Dir[_("src/main/yak") + "/**/*.yk"]
>
>
> sources = FileList[_("src/main/yak/**/*.yk")]
>
> FileList, provided by Rake, is a better Dir. Also there's generally no need
> to decompose and recompose paths.
>
>
> >
> >  generate = file(path_to(:target, "generated-source") => sources) do
> |dir|
>
>
> likewise, file(_("target/generated-source")=>sources)


Thanks for the tips.  I've updated the How To page.

alex

Reply via email to