Return-Path: Delivered-To: apmail-buildr-users-archive@www.apache.org Received: (qmail 72559 invoked from network); 10 Feb 2010 04:36:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Feb 2010 04:36:02 -0000 Received: (qmail 1983 invoked by uid 500); 10 Feb 2010 04:36:02 -0000 Delivered-To: apmail-buildr-users-archive@buildr.apache.org Received: (qmail 1850 invoked by uid 500); 10 Feb 2010 04:36:01 -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 1840 invoked by uid 99); 10 Feb 2010 04:36:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2010 04:36:01 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [208.72.237.35] (HELO sasl.smtp.pobox.com) (208.72.237.35) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2010 04:35:49 +0000 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id EB41C885B0; Tue, 9 Feb 2010 23:35:27 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=subject:from :to:cc:in-reply-to:references:content-type:date:message-id :mime-version:content-transfer-encoding; s=sasl; bh=wd/ZelGlApNn JIe6Pl8tXZMxq4c=; b=xRvodMwnD6uNysvjc/F1JxlZytccD1LFmtU3eyzoTbEs INdZ/47XM+FqMASM7JvJwCpMIVKm1aVwN9DnzyBBSYFCKX8h/VtKnmvOGK3f1jlQ JklxbQbHPKdivu+uwrTRagmN6MMGIiI527TtigI1LxIh5RWA2cTuVwDxBgkODLA= Received: from b-pb-sasl-quonix. (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id D9349885AF; Tue, 9 Feb 2010 23:35:26 -0500 (EST) Received: from [10.10.10.111] (unknown [71.196.80.188]) (using SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by b-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 8576E885AE; Tue, 9 Feb 2010 23:35:25 -0500 (EST) Subject: Re: New buildr user questions From: Kevin Smith To: antoine@lunar-ocean.com Cc: users@buildr.apache.org In-Reply-To: References: <1265763912.3871.593.camel@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" Date: Tue, 09 Feb 2010 23:35:24 -0500 Message-ID: <1265776524.3871.664.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-Pobox-Relay-ID: B5FD98A6-15FD-11DF-B61C-99270635E987-62387084!b-pb-sasl-quonix.pobox.com X-Virus-Checked: Checked by ClamAV on apache.org On Tue, 2010-02-09 at 17:10 -0800, Antoine Toulme wrote: > You can declare a unzip task, and build it: > build unzip(_("target/jetty")=>artifact(JETTY)) Thanks for your quick reply. I was unable to decipher this from what I have read in the docs. I can see that it starts with the JETTY artifact, but I don't see how that jar would end up being copied to the target directory, where it could be unzipped. But I tried it, and it magically works. The introductory docs are great, but what is missing is the intermediate level. I would love to understand the fundamental rules that describe why this bit of magic actually works. It looks like artifact magically exposes an actual file to unzip, but I sure don't see any hint of that in the api docs. Anyway, here is what I ended up with, which seems to work fine: build do dir = _('target', 'jetty') license_name = 'LICENSE.html' unzip(dir=>artifact(JETTY_SPEC)).include("**/#{license_name}") license_file = File.join(dir, 'LICENSE.html') install artifact(JETTY_LICENSE_SPEC).from(license_file) FileUtils::rm_rf dir end It would be great if you could add something like this to the user guide. > > On Tue, Feb 9, 2010 at 17:05, Kevin Smith wrote: > > 2. How to copy artifact files? > > > > This is closely related to #1. My script creates an ISO image. I would > > like to simply copy some artifacts into the ISO directory, but don't see > > any way to do it. My workaround is to create a zip containing the full > > directory structure I want, and then unzipping it into the ISO image. > > Seems like it should be easier. > > > Well, that's pure Ruby, off the top of my head: > cp a z Ok, so now I know how to unzip an artifact (from #1). How to convert an artifact into an actual file in _('target') that I can do something with? Still can't find it in the docs. The closest I have so far are: I could unzip it and then rezip it, or I could include it in a zip and then unzip it. > > 3. How to specify a dependency for a package task? > > > > Several times, I have wanted to specify that the package task for a > > project should depend on some other task. In one case, I had a master > > project and several related projects (which were not buildr subprojects > > because I couldn't get those to work the way I wanted). I simply wanted > > to create a 'package' target in the master project, which depends on the > > package targets of the other projects. I can see how to do this for > > 'build', but not for 'package'. > > > You use the enhance method that takes an array as argument: > > package(:zip).enhance [task1, task2] I didn't see .enhance anywhere in the docs, so still not quite sure what it is supposed to do. But I'm not sure it matters, because in my case, my master project doesn't have a single zip file. I wanted my master project to have an "empty" package task, just as you can have an empty build task. When I say "buildr package", I want it to invoke several package tasks in other projects, each of which create a zip or jar. The final outcome of my project is a jar with an associated sha1 file, a .iso file, a .exe file, a zip file, another zip file, and a few other files. In my mind, running 'buildr build' shouldn't actually create all those final files. I would think I would run 'buildr package', but that doesn't seem to work. So I tried to get my master 'build' task to depend on the other packages. It wouldn't be ideal, because sometimes I would just want to build enough to test, and other times I would want to take the extra time (and prompt the user for passwords) required to create signed jars. But I would take a master build task for now, as a starting point. So far, that hasn't worked either. Here was my latest failed attempt, inside the definition of my master project: build do jar = project('utils').package(:jar) unzip(_('target/utils')=>jar) end As far as I can tell, it had no effect whatsoever (no errors either). Would I have to define 'install' tasks in my non-master projects? If so, could I automatically invoke them from master:build? It seems wrong to run master:install to get all the other project artifacts in place, and then do a master:build after that do pull them all into _('target'). Kevin