Return-Path: X-Original-To: apmail-buildr-users-archive@www.apache.org Delivered-To: apmail-buildr-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DA8EB6D54 for ; Fri, 22 Jul 2011 01:39:15 +0000 (UTC) Received: (qmail 77736 invoked by uid 500); 22 Jul 2011 01:39:15 -0000 Delivered-To: apmail-buildr-users-archive@buildr.apache.org Received: (qmail 77643 invoked by uid 500); 22 Jul 2011 01:39:15 -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 77635 invoked by uid 99); 22 Jul 2011 01:39:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2011 01:39:14 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of antoine.toulme@gmail.com designates 209.85.212.44 as permitted sender) Received: from [209.85.212.44] (HELO mail-vw0-f44.google.com) (209.85.212.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2011 01:39:10 +0000 Received: by vws12 with SMTP id 12so2228313vws.17 for ; Thu, 21 Jul 2011 18:38:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=eD2ESKqCI4hwMHZ2WIzoHez5Z3DbQKajR2FA5VDHNpk=; b=Cy+8Dx/YT6gvnzBfFZrd1JKdyrXZrBasd8hYfbnGSocW9h5W1yZTUsseHV8ng2EiEF TJPLZcLJ7oFH0tCYPBbZPN6uuokErivGPHUhH5eCENI3HvWSejGYeNh1ds7xWh5klpdA 8gEtRFMsR8iEI870YMGuNTPhCCzB6Z8WtyJjg= Received: by 10.52.175.132 with SMTP id ca4mr968702vdc.98.1311298729112; Thu, 21 Jul 2011 18:38:49 -0700 (PDT) MIME-Version: 1.0 Reply-To: antoine@lunar-ocean.com Sender: antoine.toulme@gmail.com Received: by 10.52.107.40 with HTTP; Thu, 21 Jul 2011 18:38:28 -0700 (PDT) In-Reply-To: <4E28BB68.8030509@salsalabs.com> References: <4E28BB68.8030509@salsalabs.com> From: Antoine Toulme Date: Fri, 22 Jul 2011 01:38:28 +0000 X-Google-Sender-Auth: sqkHP3-2wZtG7Dnj1sViaX98Iic Message-ID: Subject: Re: Dumb packaging question To: users@buildr.apache.org Content-Type: multipart/alternative; boundary=bcaec51a7d40f174ca04a89e863c --bcaec51a7d40f174ca04a89e863c Content-Type: text/plain; charset=ISO-8859-1 There's a dozen ways to spread the butter on the bread here. Here is my humble take: You can use the union construct: | package(:war).libs |= [LIB_A, LIB_B] If you have arrays of arrays, you can flatten: package(:war).libs |= [LIB_A, LIB_B, [LIB_C, LIB_D]].flatten To remove stuff selectively, use the delete method ? package(:war).libs.delete(LIB_C) The array class in Ruby is very interesting. I recommend keeping this page around: http://www.ruby-doc.org/core/classes/Array.html Arrays are Enumerable (think java.util.Collection) so this is a good read too: http://www.ruby-doc.org/core/classes/Enumerable.html On Thu, Jul 21, 2011 at 23:51, Christopher Tiwald wrote: > This thing's driving me nuts, so I'm hoping for a little group wisdom. I'm > trying to package a WAR with some run-time libraries (i.e. unused in > compilation), but without other libraries (that throw tomcat errors because > tomcat already has them). > > i.e. I'm trying to do the following simultaneously: > > package(:war).libs += (LIBRARY_A, LIBRARY_B) > package(:war).libs -= (LIBRARY_C) > > The easiest way, of course, would be to just be write an array > (PACKAGE_THESE_LIBRARIES) that comprises all the correct libraries, and then > use the 'with' method. On the other hand I've got something like 100 > libraries and this doesn't strike me as terribly elegant. I'm trying to > maximize understandability, readability, and repeatability, because our > maven pom.xml's had none of those qualities. > > Is there an obvious way to do this I'm missing here? > > -- > Christopher > --bcaec51a7d40f174ca04a89e863c--