Skip to content

Importing into IntelliJ

Patrick Werner edited this page Apr 9, 2020 · 17 revisions

IntelliJ IDEA Community Edition can be downloaded for free from here.

Adding the custom code style formatter

We have designed our code style formatter for Java code.

  • Go to File->Settings->Plugins and download the "Eclipse Code Formatter" plugin
  • Restart the IDE
  • Go to File->Settings->Eclipse Code Formatter and enable "Use the Eclipse Code Formatter"
  • In the line "Eclipse Java Formatter config file" click "Browse..." and select openRobertaJava formatter from ./Resources/formatter folder

Not tested: Javascript in IDEA Ultimate (may produce other formatting than Eclipse, prefer using Eclipse here)

  • Go to File->Settings->Editor->Code Style->Javascript->Cog symbol->Import Scheme->Eclipse XML Profile and import openRobertaJavascript formatter from ./Resources/formatter folder

Import the project in IntelliJ

This assumes that you have read and followed the 'Prerequisites' page in our wiki with the same paths.

  • Start IntelliJ and use 'File | Open Project (Alt + F + O)'
  • Navigate to the 'openroberta-lab' directory that was cloned with git and double-click it
  • In the upcoming dialog select 'Open as project'
  • If 'Unregistered VCS root detected' pops up, click 'Add root'
  • Right click OpenRobertaServer and choose 'Open Module Settings (F4)'
  • Under 'File | Project Structure | Project Settings | Modules', add all robot plugin modules as a Compile dependency (Not WedoInterpreter)

Start the server

  • Go to OpenRobertaServer module (de.fhg.iais.roberta.main)
    • locate 'ServerStarter.java' (src/main/java/de/fhg/iais/roberta/main/ServerStarter.java) and run it (Ctrl + Shift + F10)
      • This will immediately start the server, but paths to the compiler are not correct until now
      • Terminate the server with a click on the red square
  • Open newly generated Run Configuration (Menu: 'Run / Edit Configurations... ')
    • in Program Arguments add: -d database.parentdir=./OpenRobertaServer -d server.staticresources.dir=./OpenRobertaServer/staticResources -d robot.crosscompiler.resourcebase=../ora-cc-rsc
    • Make sure the Working directory is set: <path to your git repo> (relative paths also work)

Run the tests

  • Use 'Run | Edit Configurations'
  • Click 'Add', select 'Maven', call the new entry 'tests'
  • Set the working directory to 'OpenRobertaParent' (the git checkout dir)
  • Set the command line to 'test'
Clone this wiki locally