You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Andrew Pietsch <an...@pietschy.com> on 2008/05/15 02:45:53 UTC

NEWBIE: Merging Issues

Hi,

I'm looking to migrate to buildr from Ant/Ivy and have begun to migrate one
of my projects over as a bit of a test.  So far it looks pretty cool, but
I'm pretty new to Ruby and I think my brain is going to explode (c:

Anyway, my project uses Antlr and needs to incorporate the antlr runtime jar
into the project jar.  So far I've been able to package my jar and download
the artifact, but I can't seem to merge the artifact into my jar.  Here's
the code I'm using, any help would be greatly appreciated.  (I'm running on
Mac OSX 10.4).

# Generated by Buildr 1.3.0, change to your liking
# Version number for this release
VERSION_NUMBER = "1.0.0"
# Version number for the next release
NEXT_VERSION = "1.0.1"
# Group identifier for your projects
GROUP = "com.pietschy"
COPYRIGHT = "Andrew Pietsch"


ANTLR = 'org.antlr:antlr:jar:3.0'
ANTLR_RUNTIME = 'org.antlr:antlr-runtime:jar:3.0'
EASYMOCK = 'org.easymock:easymock:jar:2.2'


# Specify Maven 2.0 remote repositories here, like this:
repositories.remote << "http://www.ibiblio.org/maven2/"

desc "The Pectin Binding Framework for Swing"
define "pectin" do

   project.version = VERSION_NUMBER
   project.group = GROUP
   manifest["Implementation-Vendor"] = COPYRIGHT
   compile.options.target = '1.5'

   define "main" do

      artifact(ANTLR_RUNTIME).invoke

      compile.with ANTLR

      test.with EASYMOCK
      test.using :testng

      # this doesn't seem to work, the jar is produced but
      # it doesn't include any of the antlr classes.
      package(:jar).merge(artifact(ANTLR_RUNTIME))

   end

end


A couple of other notes on the newbie experience:
- The docs are pretty good, but sometimes they could have more context for
the absolute beginner.  So for instance in the packaging example there's the
following.

  For our next trick, we're going to try and create an artifact ourselves.
We're going to start with:

    package :jar

While you can pick up the context from following words, wrapping it in it's
define "my-project" do  would have helped enormously (especially for the
first example encountered in a particular section).

- It would be nice if there was a reference page containing common idioms
and what they mean: i.e. _('blah', 'blah').  Sort of a "things you'll see
often" page.
- There's a few references in the docs (and ruby doc) to ZipTask which
doesn't exists.  I presume it's been changed to ArchiveTask.


Other than that, it looks very nice and I hope can become a happy buildr
user.

Cheers
Andrew