Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
132 lines (93 sloc) 5.55 KB

OpenFastTrace Developer Guide

This document contains technical information for developers contributing to OpenFastTrace (short OFT).

If you want to know more about how to contribute to OFT, please check out our Contributor Guide.

Getting the OpenFastTrace Library

Getting OFT via Maven

To use OpenFastTrace as a dependency in your Maven project add this to your pom.xml:

<dependencies>
    <dependency>
        <groupId>org.itsallcode</groupId>
        <artifactId>openfasttrace</artifactId>
        <version>2.2.0</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

Getting OFT via Gradle

To use OpenFastTrace as a dependency in your Gradle project:

dependencies {
    compile "org.itsallcode:openfasttrace:2.2.0"
}

Build Time Dependencies

The list below shows all build time dependencies in alphabetical order. Note that except the Maven build tool all required modules are downloaded automatically by Maven.

Dependency Purpose License
Apache Maven Build tool Apache License 2.0
Equals Verifier Automatic contract checker for equals() and hash() Apache License 2.0
Hamcrest Auto Matcher Speed-up for building Hamcrest matchers GNU General Public License V3
JUnit Unit testing framework Eclipse Public License 1.0
Mockito Mocking framework MIT License
JUnit5 System Extensions JUnit extension for testing System.x calls Eclipse Public License 2.0
Pitest Mutation testing Apache License 2.0

Preparations

OpenFastTrace uses Apache Maven as technical project management tool that resolves and downloads the build-dependencies before building the packages.

Installation of Initial Build Dependencies on Linux

Ubuntu or Debian

If you want to build OFT:

apt-get install openjdk-8-jdk maven

Essential Build Steps

  • git clone https://github.com/itsallcode/openfasttrace.git
  • Run mvn test to run unit tests.
  • Run mvn exec:java@trace to run requirements tracing.

Using Eclipse

Import as a Maven project using "File" → "Import..." → "Maven" → "Existing Maven Projects"

Configure Logging

We use java.util.logging for logging. To configure log level and formatting, add the following system property:

-Djava.util.logging.config.file=src/test/resources/logging.properties

## License File Header

* We use [license-maven-plugin](http://www.mojohaus.org/license-maven-plugin) to check in `verify` phase that all files have the correct license header. The build will fail if there are any files with missing/outdated headers.
* To update files with correct license headers and generate file `LICENSE.txt`, run command

```bash
mvn license:update-project-license license:update-file-header

Run local sonar analysis

mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar \
    -Dsonar.host.url=https://sonarcloud.io \
    -Dsonar.organization=itsallcode \
    -Dsonar.login=[token]

See analysis results at https://sonarcloud.io/dashboard?id=org.itsallcode%3Aopenfasttrace

Run mutation testing

mvn org.pitest:pitest-maven:mutationCoverage
# speed up repeated analysis with history
mvn -DwithHistory org.pitest:pitest-maven:mutationCoverage

Publishing to JCenter

  1. Add the following to your ~/.m2/settings.xml:

    <servers>
        <server>
            <id>itsallcode-maven-repo</id>
            <username>[bintray-username]</username>
            <password>[bintray-api-key]</password>
        </server>
    </servers>
  2. Checkout the develop branch.

  3. Update version in pom.xml and README.md, commit and push.

  4. Run command

    mvn deploy
  5. Merge to master branch

  6. Create a release of the master branch on GitHub.

  7. Sign in at bintray.com

  8. Go to the Bintray project page

  9. There should be a notice saying "You have 6 unpublished item(s) for this package". Click the "Publish" link. Binaries will be available for download at JCenter

  10. Publish to Maven Central by clicking the "Sync" button at https://bintray.com/itsallcode/itsallcode/openfasttrace#central. After some time the new version will appear at https://repo1.maven.org/maven2/org/itsallcode/openfasttrace/.