Tutorials‎ > ‎

Development Guide (How to build EclihX from sources)

posted Nov 7, 2011, 3:11 PM by Nikolay Krasko   [ updated Nov 13, 2011, 11:53 AM by Nikolay Krasko ]
There was a tutorial for developers already, but it dates back to 2009 year, was made for Windows at the time when eclihx project used SVN version control system. So today I would like to refresh it and show how you can try yourself as eclihx developer in no more than two hours. Here you will find the all steps for setting up a development environment on Ubuntu 11.10 (the most recent one).

You can run through the tutorial by looking the screenshots in picasa web album Development Guide (How to build EclihX from sources)

Table of Contents
  • Eclipse for RCP and RAP Developers
  • Java 1.6 SDK
  • Mercurial
  • Download EclihX sources
  • Hello world from EclihX
  • Where to go next

Eclipse for RCP and RAP Developers

As you probably know EclihX is in fact a plug-in for eclipse, and the very first thing we need to install is Eclipse, a special version for platform developers. Nothing is intricate here, just visit Eclipse download page, and proceed with Eclipse for RCP and RAP Developers (current version is Eclipse 3.7 Indigo). After downloading is finished, unpack it to the desired folder and be ready to start "eclipse" if you have Java 1.6 installed already. If you don't yet, the next section will guide you through the installation process.

Java 1.6 SDK

If you will try to run eclipse with no Java installed it just won't start with some error. So the next step is to install java. EclihX was developed and tested with JDK 1.6 and all you need is to install Java from Ubuntu Software Center. Just type "java" and click install in the row with "OpenJDK Java 6 Runtime".


Mercurial and Mercurial Eclipse plugin

Next stop is the installation of the Mercurial. When EclihX just started it used Subversion as code version control. But when Google shipped a support of Mercurial, it was decided to migrate to that system in order to provide a more easy way to contribute the project. I'm going to show how to download the sources right into the eclipse workspace.

First you will need "Ubuntu Software Center" again. This time continue with the installation of "scalable distributed version control system" that could be found by typing "mercurial" in the search field (note first m in lower case).
 

After that we should make an installation of a mercurial plug-in for eclipse itself. The list of steps is:
  • Start eclipse
  • Click Help -> Eclipse Marketplace... in main menu
  • Find the mercurial plug-in. The name is MercurialEclipse (was HgEclipse)
  • Several "Next" and "Ok" clicks in order to accept licence agreement, allow installation software with unsigned content and finaly confirm to restart eclipse.
All the process is showed on screenshots.



 


Download EclihX sources

Now setting up the environment is finished. The whole procedure doesn't take much time and as you can see doesn't require too much configuration. What we are going to do next is to start using the whole bunch of installed software. 

Now we will download the sources into eclipse workspace. Start your eclipse, open "Plug-in Development" perspective if it's not activated yet, than open Import dialog with right click in "Package Explorer" view or in "File -> Import..." from Eclipse main menu. Find "Clone Existing Mercurial Repository" in Mercurial submenu. In the opened wizard insert "https://code.google.com/p/eclihx" as repository location URL (this link could be found on source page of eclihx project). On the next page select "default" as a revision to clone, and finally on the last page of the wizard do not uncheck anything. Click Finish and you will get all sources downloaded to the local folder and imported to Eclipse workspace.

Again you can control all process with screenshots:


Select Clone from Mecurial sub-menu
Mercurial clone wizardSelect a branch to clone
Projects to clone

Hello world from EclihX

To make the tutorial more fun and add some interactivity, we will start show a message box with "Hello World" when starting EclihX project. 

Navigate to eclihx.ui -> src -> eclihx.ui.internal.ui -> EclihxUIPlugin.java file in Package Explorer view and insert the line:

MessageDialog.openInformation(null, "Test message", "Hello World from Eclihx!");

into the start method after 

super.start(context);

"Hello World" example
To launch the project click the right mouse button on eclihx.ui project and navigate to Run As -> Eclipse Application

Launch EclihX from Eclipse

Another instance of eclipse will start with the EclihX plugins included to the environment. After closing welcome screen and activating the EclihX perspective you should be able to see your "Hello World" message.

Hello World message box

Where to go next

Congratulation! You have just finished building EclihX project from sources. Probably you did it, because you are interested in the IDE internals or planning to implement you favorite feature you were always dreamed to see in haXe IDE. I didn't mention anything about Eclipse plug-in development itself, because it's a huge area of knowledge. To dive yourself into this domain I would recommend you to read Platform Plug-in Developer Guide, there you will find a comprehensive information about extending eclipse with your own functionality.

And of course feel free to contact me if you have any questions about extending and patching EclihX.

Will be glad to your feedbacks! :)

Thank you!

Comments