(Quick Reference)

16.2 Build From Source and Run Tests - Reference Documentation

Authors: Andres Almiray

Version: 1.2.0

16.2 Build From Source and Run Tests

If you're interested in contributing fixes and features to the core framework, you will have to learn how to get hold of the project's source, build it and test it with your own applications. Before you start, make sure you have:
  • A JDK (1.6 or above)
  • A git client

Once you have all the pre-requisite packages installed, the next step is to download the Griffon source code, which is hosted at GitHub in several repositories owned by the "griffon" GitHub user. This is a simple case of cloning the repository you're interested in. For example, to get the core framework run:

git clone http://github.com/griffon/griffon.git

This will create a "griffon" directory in your current working directory containing all the project source files. The next step is to get a Griffon installation from the source.

Creating a Griffon installation

If you look at the project structure, you'll see that it doesn't look much like a standard GRIFFON_HOME installation. But, it's very simple to turn it into one. Just run this from the root directory of the project:

./gradlew installBinary

However before you do so make sure you configure GRIFFON_HOME pointing to a directory where the binaries will be placed. Once the above command has finished. When you next type run the griffon command, you'll be using the version you just built.

This will fetch all the standard dependencies required by Griffon and then build a GRIFFON_HOME installation. Note that this target skips the extensive collection of Griffon test classes, which can take some time to complete.

Running the test suite

All you have to do to run the full suite of tests is:

./gradlew test

These will take a while, so consider running individual tests using the command line. For example, to run the test case MappingDslTests simply execute the following command:

./gradlew -Dtest.single=EnvironmentTests :griffon-rt:test

Note that you need to specify the sub-project that the test case resides in, because the top-level "test" target won't work....

Developing in IntelliJ IDEA

You need to run the following gradle task:

./gradlew idea

Then open the project file which is generated in IDEA. Simple!