On Thu, Jun 11, 2009 at 4:25 PM, Martin Grotzke <
[email protected]> 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

Reply via email to