Setting up the development environment

1. Introduction

This document describes the steps for seting up the development environment for the Yawg project. The information contained here is targeted at developers of the Yawg project itself.

The instructions in this document assume a Linux environment, or Windows with Cygwin installed.

2. Requirements

The following packages are required for developing in the Yawg project:

You will need to have the above packages installed in your workstation.

In addition to the above, some other tools are also required. Those tools are available from specific platform packages. Depending on platform, you will need to install the packages mentioned on the table below.

Platform Packages

CentOS

gnupg2

graphviz

libxslt

Ubuntu

gnupg

graphviz

xsltproc

Cygwin

graphviz

libxslt

3. Add credentials to Maven settings

This is only needed in case you are responsible for making official releases of the Yawg software. See Deploying to Maven Central Repository for additional background and details.

Add your OSSRH Jira credentials, and your GnuPG key credentials to your ~/.m2/settings.xml Maven configuration:

<settings>

  <servers>
    <server>
      <id>yawg.ossrh</id>
      <username>YourOssrhJiraUsername</username>
      <password>XXXXXX</password>
    </server>
  </servers>

  <profiles>
    <profile>
      <id>yawg-maven-artifacts</id>
      <properties>
        <gpg.keyname>YourGpgKeyName</gpg.keyname>
        <gpg.passphrase>XXXXXX</gpg.passphrase>
      </properties>
    </profile>
  </profiles>

</settings>

Make sure the file is readable only by your user:

chmod 600 ~/.m2/settings.xml

4. Fetch source tree

To fetch the project source tree do the following:

git clone git@github.com:jorgefranconunes/yawg.git

After executing the above (and after a few moments) a directory named yawg will have been created in your current working directory. That yawg directory contains the project tree, and will be your working area.

5. Edit/compile/run cycle

To perform a full build, just run mvn from the top of the project tree:

mvn -f ./modules/pom.xml

6. Running unit tests

To run all unit tests:

mvn -f ./modules/pom.xml test

To run a single unit test suite in a given module, cd to the module directory and run:

mvn -Dtest=MyClassTest test

Of course, change the MyClassTest above with the test suite you actually want to run. By convention classes containing integration tests test suites have names ending in Test.

And to run a single unit test:

mvn -Dtest=MyClassTest#myTestMethod test

7. Running integration tests

To run all integration tests:

mvn -f ./modules/pom.xml verify

Running just one single integration test suite, or one single integraton test is the exact same procedure as for unit tests. By convention classes containing integration tests test suites have names ending in IT.

8. Code quality reports

To generate static analysis and test code coverage reports do the following:

./devtools/bin/build-bundle --with-reports

This will create under directory ./target/CodeQualityReports a set of HTML pages with the results of static analysis (Checkstyle, Findbugs, PMD) and test code coverage (Jacoco). The entry page will be at ./target/CodeQualityReports/index.html.

9. Creating a new release

To generate the tarball for an engineering build do the following:

./devtools/bin/build-bundle

The above will perform a full build and create a tarball named yawg-x.y.z-yyyyMMddhhmm.tar.bz2 at the top of the working area.

To generate an official release see the instructions at Creating a release of the Yawg software.