Building the Plugin

From AVR-Eclipse

Revision as of 09:48, 7 July 2012 by Innot (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Attention: This description is outdated! The AVR Eclipse Plugin is now stored in a GIT repository and is build with maven.


Here are some reasons why you would want to build the plugin yourself from the sources:

  • Because you are just curious
  • Because you like to learn how to build Eclipse Plugins
  • Because you want to see how the AVR plugin performs its magic
  • Because you found a bug and like to include a fix with the bug report (great!)
  • Because you have a great idea for a new feature you like to implement (super!)
  • Because you plan to adapt the plugin for another toolchain (you are welcome!)

If any of these points matches then please read on. If none of the points matches then you are probably better of with the prebuild plugin which can be found on the Plugin Download page.


Contents


General

The following is a step-by-step instruction on how to download, build, debug and deploy the plugin. These steps should be self explanatory and assume very little knowledge of Eclipse. However they do not explain how the plugin works. For this you need to have a good understanding of Java and should be familiar with both Eclipse plugins in general and specifically CDT plugins. Maybe I will write an article on this sometime in the future, but for now you need to familiarize yourself. Contact me if you need links to some starting points.

Please note that while the prebuild plugin includes the source code, this is only to for debugging and to satisfy the requirements of the GPL. It is not enough to build the plugin itself, as some files required for the build process are only available on the project SVN repository.


Required Plugins

Development work for the AVR Eclipse Plugin is - of course - done in Eclipse. But there are a few plugins required to do this. Please skip ahead if you already have some or all of these plugins installed.

  • PDE (Plugin Development Environment)
  • CDT (C/C++ Development Toolkit)
  • Subversive (SVN client)
  • Pluginbuilder


Plugin Development Environment (PDE)

PDE is a collection of tools to develop plugins. Unless you already have an Eclipse installation you want to use for working on the plugin, it is probably best to download the Eclipse for RCP/Plug-in Developers from the Eclipse download center.

PDE Download.png


This package contains everything you will need to work on the plugin, incl. the Java Toolkit and an XML Editor.

Once you have downloaded the package, unzip it somewhere and run Eclipse. Select a place for the workspace where the plugin source project will later be stored.

Once Eclipse is started select Software Updates from the Help menu to install the other required plugins. Then go to the Available Software tab.


C/C++ Development Tools (CDT)

You could edit and build the plugin without CDT, but it is required to test and debug the plugin. It can be installed by selecting Eclipse C/C++ Development Platform and Eclipse C/C++ Development Tools from the Ganymede Update Site and then clicking on the "Install..." Button in the top right corner. Follow the dialogs, but a restart is not yet required (you can install the other plugins first)

CDT Install.png


Subversive (SVN client plugin)

To access the AVR Eclipse SVN source repository Eclipse needs an SVN Plugin. There are currently two similar plugins available - "subversive" and "subclipse". I use the former, because it is part of the Ganymede project.

However, due to licensing reasons, only part of the plugin is available on the Ganymede Update Site. It still needs some drivers, only available from an external update site. But to make it easier, everything can be loaded from this external site.

So click on the "Add Site..." button and enter the following link into the location field:

http://www.polarion.org/projects/subversive/download/eclipse/2.0/ganymede-site/

Then select the Subversive SVN Connectors plugin and one of the optional driver plugins (in this tutorial I will use the SVNKit 1.2.0 Implementation, which is written in native Java and requires no additional libraries)

Subversive download.png


Again, click on "Install..." and follow the dialogs.


Pluginbuilder

Generating deployable plugins with PDE is sometimes difficult to get right, especially if you like to automate the process and still like to get the version numbers right. It requires working with complicated ANT build scripts and is generally only targeted towards headless builds on a server.

Therefore I use the Pluginbuilder plugin, which makes the build process very easy.

The URL of its update site is here

http://self-3-4.pluginbuilder.org/nightly/p2-updateSite/

If you are still using Eclipse 3.3 (Europa), then you probably want the older 0.6.0 version found at this update site

http://self.pluginbuilder.org/updateSite/

Select the Pluginbuilder plugin from the update site and install it.

Pluginbuilder download.png


Now you have the essential plugins required to build the AVR Eclipse Plugin yourself. Restart Eclipse if you haven't done so already and continue with the next step.

Download the Sources

We will download the sources to the AVR Eclipse plugin directly from the SourceForge SVN repository.

With Eclipse open, change to the SVN Repository Exploring perspective (Window > Open Perspective... > Other... > SVN Repository Exploring)

Then click on the New Repository Location button

New repository location button.png


On the New Repository Location Dialog enter the following URL

https://avr-eclipse.svn.sourceforge.net/svnroot/avr-eclipse

and anonymous as user. Optionally you can set a custom label with a descriptive text.

New repository location dialog.png


Now you can see the repository content in the explorer.

The project uses a standard SVN repository layout.

  • trunk is were all new developments happen. This is the most recent version, but it might be unstable or not even compiling (though it usually does)
  • branches contains the branches for maintenance work on older releases (bug fixes)
  • tags contains fixed snapshots of all releases. If you like to use a stable version you could check out the projects in the latest tag.


For this example lets check out the plugin sources from trunk. Open the trunk folder and select all of the de.innot.avreclipse* folders and right click on them. Finally select Check Out to download all parts.

Check out plugin source.png


Depending on your internet connection speed it may take a few minutes to check all projects out, but once finished you are ready to work on and run the plugin.

Change back to the Java perspective (Window > Open Perspective > Java Browsing) and you will see a the avr eclipse projects, are ready to be worked on.

Debugging the Plugin

To debug the AVR Eclipse Plugin just right click on the de.innot.avreclipse.core project and select Debug As > Eclipse Application. That's all.


Debug Plugin.png


A new Eclipse instance is started which contains the AVR Eclipse Plugin. You can use this new Eclipse instance normally to write and upload your AVR applications. But you can also set breakpoints in the AVR Eclipse Plugin source code and start debugging to your hearts content.

Building the Plugin

Open.

Personal tools