Skip to content

Importing into IntelliJ

Maximilian Göckel edited this page Jul 2, 2019 · 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 and JavaScript code.

  • Go to File->Settings->Editor->Code Style->Java->Cog symbol->Import Scheme->Eclipse XML Profile and import openRobertaJava 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'
  • In the popup in the button 'Unregistered VCS root detected', click 'Add root'
  • Right click OpenRobertaServer and choose 'Open Module Settings (F4)'
  • Under 'Project Settings | Modules', add all robot plugin modules as a Compile dependency
  • Under 'Project Settings | Project' set the project SDK to Java 1.8

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