On Fri, 2009-06-12 at 11:05 -0700, Alex Boisvert 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"] > > generate = file(path_to(:target, "generated-source") => sources) do |dir| > mkdir_p dir.to_s # ensure directory is created > # generate sources > # e.g. > # ant('generate') do |ant| > # ... > # end > end > > compile.from generate > end Thanx for this!
I have one question: What is "sources" for? From my understanding the sources are generated _in_ (the body of) the generate task (a file task in this case)? Cheers, Martin > > I'm having issues creating the page in the wiki right now (confluence fails > on me). I'll create it when possible. > > alex
signature.asc
Description: This is a digitally signed message part
