How do I setup an AJDT development environment in Eclipse?

There are several stages to this: building AJDT, running the correctness tests, running the performance tests, and creating an Eclipse update site. The first two stages are probably sufficient for most purposes. Note that the steps required for the first stage depend on whether you are using Eclipse 3.0 or 3.1.

Building AJDT

Note first of all that in order to build AJDT you may need to increase the memory available to Eclipse. This is typically done by passing something like "-vmargs -Xmx256m" to the Eclipse launcher.

Start with a clean workspace under Eclipse 3.0.1 or the latest milestone build of Eclipse 3.1. Now open the CVS Repository Exploring perspective. Right-click on the CVS Repositories view, then click "New" > "Repository Location". Host = dev.eclipse.org, Repository path = /home/technology, Username = anonymous, password should be left blank. Connection type = pserver. Click "Finish". Use the CVS Repositories view to navigate to org.eclipse.ajdt/AJDT_src. Select the following projects, right-click and select "Check out" from the context menu:

Eclipse will build the projects as you import them. Some projects contain source code for both Eclipse 3.0 and 3.1, so the next step is to ensure the correct build configurations are being used:

Now you're ready to run the plugins inside Eclipse:

Running the correctness tests

The next step is to add the test projects. These can be used to verify that everything is okay with your environment and configuration, plus of course to verify the integrity of any changes you might make. Switch back to the CVS perspective and check-out the following projects:

There are two steps to running all of the tests. The first is to run the AJDT core specific tests found in org.eclipse.ajdt.core.tests, and the second is to run the remaining tests.

To run the AJDT core specific tests expand the org.eclipse.ajdt.core.test project, then the src folder, then the org.eclipse.ajdt.core.tests package. Now select the AllAJDTCoreTests.java file, right-click and select "Run As" > "JUnit Plug-in Test". A new runtime workbench should then be launched and the tests run inside that. Progress and test results can be observed from the JUnit Eclipse view.

You can then run all of the remaining tests by expanding the org.eclipse.ajdt.test project, then the testsrc folder, then the org.eclipse.ajdt.test package. Now select the AllTests.java file, right-click and select "Run As" > "JUnit Plug-in Test". A new runtime workbench should then be launched and the tests run inside that. Progress and test results can be observed from the JUnit Eclipse view.

Now you're ready to start enhancing the plugins by adding to or extending the code in your projects - just use run (or debug) to try out your changes. When you have a patch to submit to the project, go to the "Team" item in the project context menu and select "Create Patch...". Naturally the correctness tests should also be run, and new tests written to accompany fixes or new features.

Running the performance tests

Work is underway on a new plugin, org.eclipse.ajdt.tests.performance, to monitor the performance of every build of AJDT. This plugin has dependencies on a number of Eclipse test projects, which are not shipped in the base Eclipse SDK. These instructions will be updated later when the plugin is fully up and running.

Creating an update site

Each of the AJDT plugin projects also contains an Ant build file, "build.xml." The default target builds a packaged version of the project in question. Check-out the "UpdateSite" project from CVS, and use the build.xml file in that project to invoke a master build that builds an entire update site structure in its "dist" directory. To run the build.xml file inside Eclipse, you need to do "Run As > Ant Build..." to bring up the run configuration dialog, then go to the "JRE" tab and select "Run in the same JRE as the workspace". This is required for the "eclipse.incrementalBuild" Ant task to work.

You can now test the built update site as follows:

Legal notices