And now a year later, I realize it can be written more succinctly as:
task :unzip_birt => unzip(_("target/birt") => BIRT_WAR) do
compile.with Dir[_("target/birt/WEB-INF/lib") + "/*.jar"]
end
task :compile => :unzip_birt
alex
On Wed, Jul 29, 2009 at 3:26 PM, Alex Boisvert <[email protected]> wrote:
> For what it's worth, I've done a similar "download, unzip, find the jars,
> compile with the jars" job in a project last year... I didn't feel like
> creating artifacts for all the jars included in Eclipse BIRT... and it
> looked like:
>
> BIRT_WAR = artifact("org.eclipse.birt:birt-webapp:war:2.3.0")
>
> def unzip_birt_libs
> BIRT_WAR.invoke
> unless File.exist?(BIRT_TARGET)
> p "Unzipping BIRT libraries..."
> unzip(BIRT_TARGET => BIRT_WAR).extract
> end
> Dir["#{File.join(BIRT_TARGET, "WEB-INF", "lib")}/*.jar"].map { |jar|
> file(jar) }
> end
>
> and later,
>
> compile.with unzip_birt_libs
>
> alex
>
>>
>>