Skip to content

Latest commit

 

History

History
56 lines (45 loc) · 2.3 KB

intellij-idea.md

File metadata and controls

56 lines (45 loc) · 2.3 KB

Integration with IntelliJ IDEA

Both plugin and plugin-less integrations use Run Configurations to apply Mainframer as a Make step. This is not a hack, aparently IDE supports this for years. Since Run Configurations are flexible it is possible to do different things.

  • Create a new Configuration for Mainframer-specific purposes.
    • Example: creating a Configuration A for building on a local machine and a Configuration B for building on a remote machine.
  • Change a Configuration Template to apply Mainframer to all derivative configurations.
    • Example: changing a JUnit template to apply Mainframer to all JUnit runs.

⚠️ Android Studio

Android Studio tends to break the IDE contract and injects Gradle-aware Make step even if Mainframer step was explicitly declared. This happens on every Gradle Sync operation. Please refer to the Android Studio issue for details.

Plugin

There is a third-party plugin, please refer to the project documentation for installation and advanced instructions.

The plugin is not required though, it is completely possible to use Mainframer without it.

Instructions

It is important to determine beforehand which console command should be invoked on the remote machine. This <COMMAND> usually builds but not runs the result. Example: ./gradlew assembleDebug, but not ./gradlew installDebug.

  1. Open RunEdit Configurations...
    • To create a new Configuration click the + button.
    • To change a Configuration Template use the Templates category.
  2. Choose a Configuration.
  3. Remove default Build / Make step from the Before Launch section using the - button.
  4. Click the + button.
    • The plugin is available.
      1. Choose the Mainframer item.
      2. Insert the <COMMAND>.
    • The plugin is not available.
      1. Choose the Run External Tool item.
      2. Click the + button.
      3. Name: something meaningful, like mainframer <COMMAND>.
      4. Program: mainframer.
      5. Arguments: <COMMAND>.
      6. Working Directory: Insert Macro$ProjectFileDir$.
  5. Save.
  6. Choose the Configuration and Run it.