Return-Path: Delivered-To: apmail-incubator-buildr-user-archive@locus.apache.org Received: (qmail 37180 invoked from network); 11 Oct 2008 09:37:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Oct 2008 09:37:15 -0000 Received: (qmail 60649 invoked by uid 500); 11 Oct 2008 09:37:14 -0000 Delivered-To: apmail-incubator-buildr-user-archive@incubator.apache.org Received: (qmail 60618 invoked by uid 500); 11 Oct 2008 09:37:14 -0000 Mailing-List: contact buildr-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: buildr-user@incubator.apache.org Delivered-To: mailing list buildr-user@incubator.apache.org Received: (qmail 60607 invoked by uid 99); 11 Oct 2008 09:37:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Oct 2008 02:37:13 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of antoine.contal@gmail.com designates 209.85.200.169 as permitted sender) Received: from [209.85.200.169] (HELO wf-out-1314.google.com) (209.85.200.169) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Oct 2008 09:36:10 +0000 Received: by wf-out-1314.google.com with SMTP id 27so1108787wfd.21 for ; Sat, 11 Oct 2008 02:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=0XRHeR1qDS0Xn5mgw6+jpQxbu6IqTUdnamOTcV50prI=; b=tE5t/5jgTG8X12bx4Hz2Epvk++7L8p2wgx9G698IkU9mf7nKGlenPex8Qw5eAoxFHh tBObNbmE4FNoPn+xvZnbnXdHaXeD+ctjy/uTT0By/eQHFksRrfBTJ4Ere9Pa97IO4xsj 8yUKVshArxjx7tVpGYYwzca2az+rSR9EOqjGI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=S2KadJVfFPFyxLrMAxPso0E4gYydQU4KhzmYPVH9RXKf5G5QkGLO+fVfMgC9jf2EvW RRCvIK88+JEVFNoVwhDpU9An6ffWH8DFAi3baDXZ1yJesFWt3w/B1lIRLljDIupUqGZ3 13/kvvC94gQsZ5y53ecE38tNk4GnKjel/ycmo= Received: by 10.142.245.6 with SMTP id s6mr1348870wfh.157.1223717797851; Sat, 11 Oct 2008 02:36:37 -0700 (PDT) Received: by 10.142.241.3 with HTTP; Sat, 11 Oct 2008 02:36:37 -0700 (PDT) Message-ID: Date: Sat, 11 Oct 2008 11:36:37 +0200 From: lacton Sender: antoine.contal@gmail.com To: buildr-user@incubator.apache.org Subject: Re: Manifest In-Reply-To: <003101c92af5$6b7a6fb0$426f4f10$@com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <003101c92af5$6b7a6fb0$426f4f10$@com> X-Google-Sender-Auth: 73ab673621ff6bd0 X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Oct 10, 2008 at 6:29 PM, Nagaraj wrote: > Hi, > > > > While creating a jar file, I am adding manifest.mf using > > > > package(:jar).with :manifest=>_("META-INF/MANIFEST.MF") > > > > Now I want to dynamically set the value of Bundle-Version in manifest.mf. > > > > I tried the following in the buildfile > > > > package(:jar).with > :manifest=>manifest.replace('Bundle-Version'=>VERSION_NUMBER) > > > > > > But it is not working. Is there any way I can achieve this? I am new to Ruby > and Buildr. I can think of two ways to achieve this. One way would be to get rid of the file and use only a hash or the project manifest properties. E.g., package(:jar).with :manifest=>{ 'Implementation-Title'=>'foo', 'Bundle-Version'=>VERSION_NUMBER } OR manifest['Implementation-Title'] = 'foo' manifest['Bundle-Version'] = VERSION_NUMBER package(:jar) Another way would be to use a filter on your source file. E.g., Your file src/main/resources/META-INF/MANIFEST.MF contains Implementation-Title: foo Bundle-Version: ${version} Your buildfile contains resources.filter.using 'version'=>VERSION_NUMBER package(:jar).with :manifest=>_('target/resources/META-INF/MANIFEST.MF') Cheers. Lacton