Showing posts with label IntelliJ. Show all posts
Showing posts with label IntelliJ. Show all posts

Saturday, December 13, 2014

Editing Arduino sketches with IntelliJ Idea 13.1 and C++ plugin

I started building Arduino backed robot per instructions in http://blog.miguelgrinberg.com/post/building-an-arduino-robot-part-ii-programming-the-arduino and quickly discovered pain of editing the sketches in Arduino IDE. The pain forced me to release C++ plugin 0.8.6 for IntelliJ Idea 13.1, new version is functionally identical to previous version except supports newer version of IntelliJ Idea.

To edit sketches one needs to specify extra include paths from Arduino Ide installation (e.g. %arduinoidepath%/Resources/Java/hardware/arduino/cores/arduino , %arduinoidepath%/Resources/Java/libraries/SoftwareSerial) and add "ino" extension mapped to c/c++ file type. Another needed configuration setting for resolving Arduino built-in symbols (like Serial) is specifying custom file in Additionally automatically included header file of C/C++ project settings. The file (e.g. ArduinoSetup.h) should have following content for auto adding Arduino specific symbols declarations in every file:

#define UBRRH
#include "Platform.h" // Arduino symbols declarations

Once one finishes with sketch editing one can use Arduino IDE to upload the sketch to the device.

Sunday, June 27, 2010

How to start hacking V8 JavaScript engine, IntelliJ IDEA Project Configuration

This blog post will describe how to start hacking V8 JavaScript engine with IntelliJ IDEA and C/C++ plugin.

First, one needs to checkout the sources from Subversion. You can do it using IntelliJ IDEA via action located in Version Control | Checkout from Version Control | Subversion. In appeared "Checkout from Subversion" dialog one should add "New repository location" e.g. "http://v8.googlecode.com/svn/branches/experimental/isolates". Choosing repository and pressing "Checkout" will show us "Destination directory dialog", specify target directory and press default buttons in next dialogs.

After checkout IDEA suggests you to open the project for the directory you chose. After accepting this on and pressing default buttons several times one gets IntelliJ IDEA project with V8 sources.

For V8 project additional macros should be defined (e.g. V8_TARGET_ARCH_IA32, ENABLE_DEBUGGER_SUPPORT, etc), it should be done in Settings | C++ project settings (see screenshot below), just separate the macros list with semicolon.



V8 is cross platform project, it contains several implementations of v8::internal::OS, with the same methods. To avoid getting many "duplicated" symbols warnings with C++ plugin one needs to deselect reporting of "Duplicated definitions" warnings in second part of C++ project settings, reference image added below.



If one starts C++ project first time then system wide settings (like where gcc / MS Visual C directory is, system wide defines, etc) should be configured in Settings| C++ IDE settings, see screenshot below for the reference.



In next blog post we will develop some patch for V8, stay tuned :)

Thursday, February 18, 2010

New version of CppTools plugin is available!

CppTools plugin v0.7.1 for IntelliJ IDEA 6/7/8/9 is available.
Change notes:
* IDEA 9 (Maia) / Community Edition support.
* Override / implement methods action for IDEA 7/8/9.
* Quick navigate info (aka Control + mouse hover) for IDEA 7/8/9.
* Report problem with instantiation of abstract classes.
* Quick fixes: static_cast / dynamic_cast when type cast error detected.
* Bugfixes.
Install it from IDEA's plugin manager