You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Chris Dean <ct...@sokitomi.com> on 2010/10/15 20:01:49 UTC
Best way to make a distribution tar
I'd like to make up a distribution tar file that includes my projects
jar file, configuration files, and a shell scripts. I'd also like to
include all the dependency jar files as well. (The project is about 90%
Clojure code if that matters.)
I suppose we'll need a separate task that depends on th package task.
But I'm not sure how get the name of the package file.
Any examples welcome.
Cheers,
Chris Dean
Re: Best way to make a distribution tar
Posted by Chris Dean <ct...@sokitomi.com>.
Alex Boisvert <al...@gmail.com> writes:
> On Fri, Oct 15, 2010 at 11:01 AM, Chris Dean <ct...@sokitomi.com> wrote:
>> I'd like to make up a distribution tar file that includes my projects
>> jar file, configuration files, and a shell scripts.
>
> Here's a rough example,
Works great, thanks!
Here's my code for those interested.
package(:tgz, :id => "#{name}-dist").path("#{name}-#{project.version}").tap do |distro|
distro.include ["README"]
distro.include _("doc")
distro.include _("bin")
distro.path("config").include _("src/main/config"), :as => "."
# libraries
distro.path("lib").include artifacts(compile.dependencies)
distro.path("lib").include package(:jar)
end
Cheers,
Chris Dean
Re: Best way to make a distribution tar
Posted by Alex Boisvert <al...@gmail.com>.
On Fri, Oct 15, 2010 at 11:01 AM, Chris Dean <ct...@sokitomi.com> wrote:
> I'd like to make up a distribution tar file that includes my projects
> jar file, configuration files, and a shell scripts. I'd also like to
> include all the dependency jar files as well. (The project is about 90%
> Clojure code if that matters.)
>
> I suppose we'll need a separate task that depends on th package task.
> But I'm not sure how get the name of the package file.
>
> Any examples welcome.
>
Here's a rough example,
package(:tgz, :id=>"#{name}-all").tap do |distro|
distro.include ["RELEASE_NOTES", "README"]
# third party licenses
Dir[_("license/*LICENSE")].each { |l| distro.include(l, :path=>"lib") }
# examples
distro.path("examples").include _("src/examples"), :as=>"."
# libraries
distro.path("lib").include artifacts(COMMONS.logging, LOG4J, ...,
compile.dependencies)
# plugins
distro.path("plugins").include project("plugins") # gets all packages from
plugins project
end
Hope this helps,
alex