Return-Path: Delivered-To: apmail-buildr-users-archive@www.apache.org Received: (qmail 55850 invoked from network); 24 Feb 2010 18:36:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Feb 2010 18:36:41 -0000 Received: (qmail 11205 invoked by uid 500); 24 Feb 2010 18:36:41 -0000 Delivered-To: apmail-buildr-users-archive@buildr.apache.org Received: (qmail 11135 invoked by uid 500); 24 Feb 2010 18:36:41 -0000 Mailing-List: contact users-help@buildr.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@buildr.apache.org Delivered-To: mailing list users@buildr.apache.org Received: (qmail 11125 invoked by uid 99); 24 Feb 2010 18:36:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2010 18:36:41 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of alex.boisvert@gmail.com designates 209.85.219.212 as permitted sender) Received: from [209.85.219.212] (HELO mail-ew0-f212.google.com) (209.85.219.212) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2010 18:36:32 +0000 Received: by ewy4 with SMTP id 4so1180007ewy.28 for ; Wed, 24 Feb 2010 10:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=PEJmzw2hNXNH8reAH2Tqk32qb93q3guZner9dWZ7WFM=; b=NYI0WYFwXKvpUuHbQhVIJBoRpjaueLDPuLiOX7NZsbEGQwiqXAJ7QdfPzmX7EPgT9N 0LPrEHCxs9JR7DU7E85XKc5nAvM5e0ntHurP2EVo2+yOnmPJJnLNrUKptZfnU0bPB7bg lXBJBSKY+0uAdiEPi455gZRrPL4xcuNCrbrZ0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Ka/woVEKjeQwTRL3nG4S1nsh1hwZxBBiGzcyd4gZ0FYw7f6173OEAaQplqhl5+ut74 uzDt8slKWgnK+pFqCJjsGhsaJrb14QeqHfTmusHQMpnu3xjzHImH28fz8APrn9X0+HwK GR11srubHK0OsCO2wmd1FI1CzCJhWcDN+udm0= MIME-Version: 1.0 Received: by 10.216.93.77 with SMTP id k55mr90589wef.196.1267036564501; Wed, 24 Feb 2010 10:36:04 -0800 (PST) In-Reply-To: <323a37201002240837lce9fc36vdf82cd456b603ff8@mail.gmail.com> References: <323a37201002240837lce9fc36vdf82cd456b603ff8@mail.gmail.com> Date: Wed, 24 Feb 2010 10:36:04 -0800 Message-ID: <4dcd15a91002241036r4b694600s464c5e025838c5e0@mail.gmail.com> Subject: Re: generate geronimo-application.xml during EAR packaging? From: Alex Boisvert To: users@buildr.apache.org Content-Type: multipart/alternative; boundary=0016e6d77e125836f504805cf015 --0016e6d77e125836f504805cf015 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Feb 24, 2010 at 8:37 AM, Will Rogers wrote: > Buildr's EAR packaging automatically generates an application.xml and > includes it in the output's META-INF directory. I would like to do > something similar to generate a geronimo-application.xml for inclusion > in the EAR. I can handle the actual file generation part, but I'm not > sure how/where to hook that into buildr's packaging. > > Where do I stick my code for generating and including a file in the > EAR package so it works similar to the built-in application.xml > generation? > Haven't looked into the code recently so this is mostly a high-level idea, class GeronimoApplicationXml < Rake::FileTask def initialize(*args) #:nodoc: super enhance do |task| // do you stuff File.open(task.name, "wb") { |file| file.write content } end end ... end class Buildr::Project def geronimo_application_xml() ear = package(:ear) descriptor = GeronimoApplicationXml.define_task(project.path_to(:target, ...), ear) ear.enhance [ descriptor ] ear.enhance do |zip| zip.include descriptor, :path => "..." end end end so in your projects where you need to generate the descriptor, you only need to call geronimo_application_xml. Should be easy to turn into a plugin. Hope this helps, alex --0016e6d77e125836f504805cf015--