Versions Compared

Key

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

...

Note: this documentation is currently under maintenance. You , and you can help out as well! See: 

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyBEAM-5762

How to: Set up IntelliJ from scratch

TODO: Improve this documentation 

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyBEAM-5764
 

Create a working Gradle module

(as of IntelliJ 2018.1.6)

  1. Create an empty IntelliJ project outside of the Beam source tree.
  2. Under File > Project Structure > Project, select a Project SDK.
  3. Under File > Project Structure > Modules, click the + sign to add a module and select “Import Module”.
    1. Select the directory containing the Beam source tree.
    2. Tick the “Import module from external model” button and select Gradle from the list.
    3. Tick the following boxes.
      • Create separate module per source set
      • Use default gradle wrapper
  4. Delegate build actions to Gradle by going to FIle > Settings/Preferences > Build, Execution, Deployment > Build Tools > Gradle > Runner and checking “Delegate IDE build/run actions to gradle”.

This should result in a working Gradle project. Build the project by executing the “build” task in the root Gradle module.

Checkstyle

IntelliJ supports checkstyle within the IDE using the Checkstyle-IDEA plugin.

Note: Older versions of IntelliJ may not support the Checkstyle file used by Beam.

  1. Install the “Checkstyle-IDEA” plugin from the IntelliJ plugin repository
  2. Configure the plugin by going to Settings -> Other Settings -> Checkstyle
  3. Set Checkstyle version to the same as in /build_rules.gradle (e.g. 8.7)
  4. Set the “Scan Scope” to “Only Java sources (including tests)”
  5. In the “Configuration File” pane, add a new configuration using the plus icon:
    1. Set the “Description” to “Beam”
    2. Select “Use a local Checkstyle file”, and point it to sdks/java/build-tools/src/main/resources/beam/checkstyle.xml within your repository
    3. Check the box for “Store relative to project location”, and click “Next”
    4. Configure the checkstyle.suppressions.file property value to suppressions.xml, and click “Next”, then “Finish”
  6. Select “Beam” as the only active configuration file, and click “Apply” and “OK”
  7. Checkstyle will now give warnings in the editor for any Checkstyle violations

You can also scan an entire module by opening the Checkstyle tools window and clicking the “Check Module” button. The scan should report no errors.

Note: Selecting “Check Project” may report some errors from the archetype modules as they are not configured for Checkstyle validation.

Code Style

Uniform formatting for Java and Groovy code is automated by the build through the Spotless Gradle plugin. Instead of relying on the IDE, now you can run ./gradlew spotlessApply to reformat changes prior to commit.

If you want to autoformat in the same way while you are developing, use the Google Java Format plugin.

Code Insight Feature Problems

...

In IntelliJ 2016 and higher: go to Help → Edit Custom Properties → Paste the following inside the properties file:

Code Block
languagetext
#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE should provide code assistance for.
# The larger file is the slower its editor works and higher overall system memory requirements are
# if code assistance is enabled. Remove this property or set to very large number if you need
# code assistance for any files available regardless their size.
#---------------------------------------------------------------------
idea.max.intellisense.filesize=2500

...

  • Press CTRL + ALT + SHIT + S → Go to Project Settings → Facets → expand Python → click on child → Python Interpreter
  • Project Settings → Modules → Expand module → Python → Dependencies → select Python module SDK

You can find documentation on various developer workflows in the sub-pages. If you're setting up a brand new development environment, start with Set up IntelliJ from scratch.

Children Display


If you can't find the documentation you need, please file a bug on JIRA or contact us.

How to: Perform a full build

TODO: 

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyBEAM-5765

How to: Build and test a single module

TODO: 

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyBEAM-5766

How to: Run a single unit test

TODO: 

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyBEAM-5767

How to: Run a single IT for a particular runner

TODO: 

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyBEAM-5768

How to: Recover from IntelliJ project corruption

TODO: 

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyBEAM-5769

How to: Recover from common IDE errors (FAQ)

TODO:  JiraserverASF JIRAserverId5aa69414-a9e9-3523-82ec-879b028fb15bkeyBEAM-5770