Yeah, resources.from only works for static resources. If I generate
resources, I would typically do it like:
define 'my-project' do
project.version = '0.1-SNAPSHOT'
project.group = 'myProject'
clean do
rm_rf _(:generated, :resources)
end
resources do
mkdir_p _(:generated, :resources)
touch _(:generated, :resources, :foo)
end
package(:jar).include _(:generated, :resources)
end
alex
On Sat, Oct 9, 2010 at 12:42 AM, Peter Donald <[email protected]>wrote:
> Hi,
>
> Whats the process for adding generated resources to a project? i.e. I
> have a task that generates resources and I want to include these
> resources in a jar. Something like
>
> ------------------------------------------------------
> file("generated/resources") do
> mkdir_p "generated/resources"
> end
>
> define 'my-project' do
> project.version = '0.1-SNAPSHOT'
> project.group = 'myProject'
>
> resources.from file("generated/resources")
> package :jar
> end
> ------------------------------------------------------
>
> But this generates the exception;
>
> ------------------------------------------------------
> (in C:/dev/test, development)
> Buildr aborted!
> RuntimeError : Source directory C:/dev/test/generated/resources doesn't
> exist
> C:/dev/test/buildfile:10
>
> c:/Applications/jruby-1.5.2/lib/ruby/gems/1.8/gems/buildr-1.4.2-java/lib/buildr/core/application.rb:416:in
> `raw_load_buildfile'
>
> c:/Applications/jruby-1.5.2/lib/ruby/gems/1.8/gems/buildr-1.4.2-java/lib/buildr/core/application.rb:218:in
> `load_buildfile'
>
> c:/Applications/jruby-1.5.2/lib/ruby/gems/1.8/gems/buildr-1.4.2-java/lib/buildr/core/application.rb:213:in
> `load_buildfile'
> (See full trace by running task with --trace)
> ------------------------------------------------------
>
> So is there an easy way to do this?
>
> --
> Cheers,
>
> Peter Donald
>