buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Boisvert <boisv...@intalio.com>
Subject Re: How to generate sources for/before compile
Date Fri, 12 Jun 2009 00:45:11 GMT
On Thu, Jun 11, 2009 at 4:25 PM, Martin Grotzke <
martin.grotzke@javakaffee.de> wrote:

>
> I'm just wondering what's the best way to generate sources before the
> compile task is executed, whereas the generated sources shall also be
> compiled.
>
> The additional sources are e.g. generated with an ant task:
>
> task :generatesources do
>  ant('generate') do |ant|
>    ant.taskdef :name=>'myTask', :classname=>'some.AntTask',
> :classpath=>'path/to/jar.jar'
>    ant.myTask :targetDir=>_('target/generated-sources'),
> :someProp=>'some/path'
>  end
> end
>

I think it would be something along these lines:

sources = # whatever you use to generate your sources

generate = ant('generate' => sources) do |ant|
 # ...
end

compile.from file(path_to(:target, "generated-source") => generate)

alex

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message