Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Development Environment Setup

This page helps you to get your development environment up and running.

Setting up Git

We use Git to manage Crunch's source code. Before contributing patches you have to configure Git so that any patches you create are correctly attributed to you. Run the following commands, replacing the placeholders with your full name and email address:

No Format
  $ git config --global user.name "Your Name"
  $ git config --global user.email "your.address@example.com"

If you have never worked with Git before it's a good idea to make yourself familiar with it, for example by reading the first chapters of the free Pro Git book.

Getting the Source Code

You get the code by cloning the central repository:

No Format
  $ git clone http://git-wip-us.apache.org/repos/asf/crunch.git

Building Crunch

To build the project run the following Maven command:

No Format
  $ mvn package

To install the created JARs in your local Maven cache and also run the integration test suite:

No Format
  $ mvn install

Depending on your system, the test suite may take quite a while, but if you want to contribute to Crunch it's important that it works. Please tell us if there are any problems.

Setting Up Eclipse

Here's how you set up Eclipse for Crunch, assuming you use the m2e Eclipse plugin. First of all, import the code:

  1. Open the import dialog: File > Import
  2. Select import via the m2e plugin: Maven > Existing Maven Projects
  3. In the dialog box select Crunch's root directory and hit Finish
  4. Add crunch/target/generated-test-sources/ to the build path: Right-click on the directory, then select Build Path > Use as Source Folder

There are lots of warnings about missing serialVersionUID fields. They would clutter the code, so we ignore them:

  1. Select the crunch module
  2. Open the preferences menu: Window > Preferences
  3. Select Java > Compiler > Errors/Warnings
  4. Toggle Ignore on Potential programming problems / Serializable class without serialVersionUID

Import our formatter that is consistent with our coding style:

  1. Open the preferences menu: Window > Preferences
  2. Select Java > Code Style > Formatter
  3. Hit Import and pick crunch/src/main/config/crunch-formatting-styles.xml

Last but not least set up Eclipse's Checkstyle plugin:

  1. Open the preferences menu: _Window > Preferences
  2. Select Checkstyle and hit the New... button
  3. Select Project Relative Configuration from the Type drop-down box
  4. Enter "Crunch Coding Style" into the Name field
  5. Hit Browse and select crunch/src/main/config/checkstyle.xml, then hit OK

Now apply the Checkstyle config to the Crunch project:

  1. Select the crunch module
  2. Right-Click on Properties
  3. Select Checkstyle
  4. Pick "Crunch Coding Style" from the drop-down box
  5. Tick Checkstyle active for this project
  6. Hit OK