Getting the Subersion revision number in Ant

Subversion support in Ant, while present, isn’t that great.  It handles the basics, but not much else.   One are of improvement that I had needed was in accessing the repository metadata, specifically the revision number that was being used to build, so that the distributable could embed that as part of the filename.  Previously, I had been using the build date, but that’s obviously not accurate.

To support cross-platform, I ended up with JavaSVN from Tmate.  It didn’t totally do what I needed to do, but at least I could call it as a command line application to recursively display the information about every file in the repository.  After that, it’s only a matter of grep‘ing for “Revision:” and finding the highest revision.  I also had to write a simple sorting class to extend Ant (which has tail and head but no sort).  It works well, in a wasteful sort of way.

Here’s what I did:
<target name="checkRevision">
    <property name="source-root" value="."/>
    <java classname="org.tmatesoft.svn.cli.SVN"
       dir="${source-root}" fork="true" outputproperty="revision.list">
      <arg line="info -R ."/>
      <classpath>
        <pathelement location="${tools}/svnant/javasvn.jar" />
        <pathelement location="${tools}/svnant/javasvn-cli.jar" />
      </classpath>
      <redirector>
        <outputfilterchain>
          <linecontainsregexp>
            <regexp pattern="^Revision:"/>
          </linecontainsregexp>
          <deletecharacters chars="Revision: "/>
        </outputfilterchain>
      </redirector>
    </java>

    <java classname="Sort" inputString="${revision.list}"
    outputproperty="coconut.revision">
      <classpath>
        <pathelement location="${tools}/sort" />
      </classpath>
      <redirector>
        <outputfilterchain>
          <tailfilter lines="1"/>
        </outputfilterchain>
      </redirector>
    </java>

    <echo message="Latest commited revision: ${coconut.revision}"/>
  </target>

North 44 with the family

For Christmas, I took my family to North 44.  North 44 probably isn’t the best place I can think of to treat family (the cost is a major factor), but I wanted my siblings and mom to try something they would normally never be willing to try – and nearly everything on the North 44 menu is unusual.

Even the bread appetizers are a little different:

My family isn’t as used to my penchant for food photography, so I stuck to my own dishes.  I do love butternut squash soup:
butternut squash soup
It was quite satisfying, with a bit of a peppery taste.

Now I admit I got conned on this entree.  It was good, but far too expensive.  As I later tried to explain to friends at another dinner, however, as the cost goes up, my curiosity gets the better of me and makes more allowances for ridiculous pricing (up to a point!  Flying in just for a meal at French Laundry is excessive even for me!).  That evening, North 44 had four lobsters.  Hemming and hawing, recalling the delectable morsel of lobster I had the last time I was at North 44, I finally caved when even my dad said that I may as well get it if I like the lobster at North 44 so much.  It  was delicious:
lobster and shrimp ravioli.
The ravioli was filled with minced shrimp with some other ingredients to make a lovely seafood medley.  The ravioli was interesting in that it had been pan-fried, so it was crispy – a delight to eat.  Finally, the infamous lobster was excellent.  Small, of course, and the tail was far better than the claws, but it was wonderfully artery-clogging with a firm texture.  It was very rich – at the end I wasn’t enjoying it as much as at the beginning!

Nevertheless, no matter how rich the entree, dessert must never be skipped!  This is the Pear Mille Feuille, with ice cream (pistachio I think?):
Pear Mille Fueille
The wafers were a fun, sweet experience.  Taking it all at once – ice cream, pear, wafer – tasted very good.  The pears were caramelized (I think?), but I didn’t really notice too much different about them.  A solid dessert; not too unusual.

The food was good, there is no doubt.  However, North 44 has more than fairly received its share of my wallet for the next year or two, after hosting a party of seven with a host that has more curiosity than sense.  :)  The kind of place that’ll happily devour what you offer, just as I happily devoured what they presented.

Butternut squash soup (12); lobster and shrimp ravioli (87); pear mille feuille (14).  Yes, I am crazy sometimes.

Follow

Get every new post delivered to your Inbox.