Tuesday, October 19, 2010

Building the Gherkin on OSX

cucumber64x64.png Update 2011-09-01: Updated changes of github repositories and changes in rake build.

Recently I wanted to build the Gherkin project to reproduce a certain behavior we observed in SpecFlow.
These were the steps that were necessary to build the Java version of the Gherkin parser on OS X:
Ragel installation:
I am using MacPorts. Installing Ragel is a breeze:
sudo port install ragel

rvm installation
I figured that rvm is the best option to install JRuby side by side of other Rubies.
I followed the installation instructions of rvm.

JRuby installation
... again a breeze with rvm:
rvm install jruby

Switch to JRuby
rvm use jruby

Clone gherkin:
git clone http://github.com/cucumber/gherkin.git

Clone cucumber:
To build gherkin you need the cucumber sources lying beside your gherkin sources.
git clone http://github.com/cucumber/cucumber.git

Required gems:
You need some gems to build gherkin:
gem install rspec json term-ansicolor rake_compiler awesome-print builder
(other gems like rake, bundler were already installed ...)

Java dependencies:
The rake build needs json-simple lying in your local Maven repository
cd java
mvn clean compile
The maven compile step of the maven build will fail, but it will download the json-simple dependency into your local repository.

Executing the rake build:
rake clean
rake jar

Executing the java build:
cd java
mvn clean compile test
All tests should pass. Now you can open the java project in your favorite IDE.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...