Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 1.77 KB

ide-configuration.adoc

File metadata and controls

48 lines (37 loc) · 1.77 KB

IDE Setup Instructions

Before you start contributing, please follow the instructions below to set up a code style for an IDE of your choice.

Eclipse Setup

Open the Preferences window, and then navigate to Java → Code Style → Formatter. Click Import and then select the build/optaplanner-ide-config/src/main/resources/eclipse-format.xml file in the ide-configuration directory.

Next navigate to Java → Code Style → Organize Imports. Click Import and select the build/optaplanner-ide-config/src/main/resources/eclipse.importorder file.

IDEA Setup

Open the Preferences window (or Settings depending on your edition), navigate to Plugins and install the Eclipse Code Formatter Plugin from the Marketplace.

Restart your IDE, open the Preferences (or Settings) window again and navigate to Other Settings → Eclipse Code Formatter.

Select Use the Eclipse Code Formatter, then change the Eclipse Java Formatter Config File to point to the eclipse-format.xml file in the build/optaplanner-ide-config/src/main/resources/ directory. Make sure the Optimize Imports box is ticked, and select the eclipse.importorder file as the import order config file.

VS Code setup

  1. Open the Extensions window (Ctrl+Shift+X) and search for Language Support for Java™ by Red Hat and install it.

  2. Create settings file for your workspace

    cd optaplanner
    mkdir .vscode
    touch .vscode/settings.json
  3. Put in settings.json the following content:

    {
        "java.format.settings.url": "build/optaplanner-ide-config/src/main/resources/eclipse-format.xml",
        "java.completion.importOrder": [
            "java",
            "javax",
            "org",
            "com"
        ]
    }