Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Eclipse

  1. In qa/eclipse you’ll find google-java-format-eclipse-plugin-X.X.X.jar. Copy that jar file to the Eclipse drop-ins folder to activate the plugin. You have to restart the IDE afterwards.
    The plugin adds a google-java-format formatter implementation that can be configured in Window > Preferences > Java > Code Style > Formatter > Formatter Implementation. Please activate it.

  2. In the same setting window, import taskana_formatter_eclipse.xml from taskana/qa/eclipse

  3. In Window > Preferences > Java > Code Style > Organize Imports import the Taskana import order from taskana/qa/eclipse

IntelliJ

  1. Install and activate this plugin. Activation can be found under File

...

  1. Settings

...

  1. Other Settings

...

  1. google-java-format Settings. Make sure the “Enable google-java-format”-checkbox is enabled.

  2. In File

...

  1. Manage IDE Settings

...

  1. Import Settings import the settings.zip file from qa/intellij. Import the templates and the macro.

  2. In Settings

...

  1. Editor

...

  1. Code Style

...

  1. → Java -> gear wheel (icon) -> Import Scheme -> IntelliJ IDEA code style XML import taskana_formatter_intellij.xml from taskana/qa/intellij.

  2. In Settings

...

  1. Keymap search for “save all” and bind ctrl+s to the macro, thus overriding the save key. The macro will automatically format the current file and save all files.

Info

Currently we are evaluating if Settings → Tools → Actions on save is an alternative to the macro. Feel free to use either one. Set at least the actions “Reformat code”, “Optimize imports” and “Rearrange code”.

Info

For other IDEs check out the official GitHub Repository