Skip to content

Build the project

Prerequisites

  • Java (OpenJDK) 11 or later

Check out, build, and extend Codyze

  1. Fork the Codyze repo on GitHub and clone it, including submodules:
    git clone --recurse-submodules git://github.com/<YOUR GITHUB>/codyze
  2. Create a branch for your contribution. We recommend prefixing the branch name with fix- if you are providing a bug fix or feature- if you plan to add a feature:
    git checkout -b feature-MY_EPIC_FEATURE
  3. Make your changes and make sure that the project builds without errors, passes all tests, and is properly formatted:
    Codyze v2: ./gradlew :codyze-v2:clean :codyze-v2:spotlessApply :codyze-v2:build :codyze-v2:publishToMavenLocal :codyze-v2:installDist
    Codyze v3: ./gradlew :codyze-v3:codyze:clean :codyze-v3:codyze:spotlessApply :codyze-v3:codyze:build :codyze-v3:codyze:installDist
    The purpose of these gradle tasks is as follows:
    • clean Removes previous build artifacts
    • spotlessApply Applies source code formatting with the settings in formatter-settings.xml. If the code is not properly formatted the build server will reject it.
    • build Builds the main artifact (the jar file containing Codyze)
    • publishToMavenLocal (optional, currently not available in Codze v3) publishes the build artifact to your local Maven repository, so it is available as a dependency for other projects
    • installDist Create an executable script for Linux, Mac, and Windows in codyze-v2/build/install/codyze/bin or codyze-v3/codyze/build/install/codyze/bin
  4. When everything works, git commit your changes and git push them to Github, then create a pull request (PR). Make sure to describe want you intend the code to do and refer to any issues your PR might address (using the notation #123)
  5. If you're not yet ready for a review, add "WIP" to the PR name to indicate it's a work in progress.
  6. Wait for the automated CI workflow to do some checks.
  7. Continue working on your PR by pushing further commits to your branch until you are satisfied
  8. When you're ready for a review, add a comment to the PR, and remove any "WIP" markers.

Code formatting

Codyze uses the gradle spotless plugin to format source code. You may import the code style definitions into your favorite IDE to apply it immediately.

Gradle

  • Simply run ./gradlew :codyze-v2:spotlessApply or ./gradlew :codyze-v3:codyze:spotlessApply

IntelliJ

  • In IntelliJ, open Settings->Editor->Code Style->Java and click on the cog icon.
  • Choose Import Scheme->Eclipse XML Profile and select the file formatter-settings.xml in the project's root folder.

Import code style formatter into IntelliJ

Eclipse

  • In Eclipse, open Window->Preferences->Java->Code Style->Formatter
  • Click Import and select the file formatter-settings.xml in the project's root folder.

Import code style formatter into Eclipse


Last update: 2022-08-23
Created: 2020-01-31