AJDT: AspectJ Development Tools

Information for developers

Contributing

  1. How can I contribute to the AJDT project?
  2. Where will I find the source for AJDT?
  3. What do the version numbers mean?
  4. How can I connect the AJDT CVS repository?
  5. I am looking for the AJDT branch 1.X in the CVS repository, but I can’t find it. What gives?
  6. How do I setup an AJDT development environment in Eclipse?
  7. How can I package my sample code for contribution to the examples plug-in?
  8. How can I build tools which extend AJDT?

  1. How can I contribute to the AJDT project?

    Your contributions to the AJDT project are strongly welcomed! You can create a patch that fixes a bug or provides an enhancement and submit it to the AJDT developers either as an attachment to a bug in Bugzilla, or as an attachment to a post to the newsgroup or developer mailing list. You can also contribute sample code showing interesting uses of AspectJ, by adding entries to the example plug-in. All contributions must be made available under the terms of the Eclipse website see the Eclipse contribution and participation FAQ. Sorry, but for legal reasons we are unable to accept patches emailed directly to developers, and will normally ask you to resubmit these either via Bugzilla or the mailing list. AJDT development is run as a meritocracy, developers who have a track record of submitting good patches can become committers on the project.

  2. Where will I find the source for AJDT?

    AJDT source is held in the Eclipse CVS repository under /cvsroot/tools, see the root of the AJDT source tree online. AJDT is organized in subdirectories under org.eclipse.ajdt. The main source tree is in the “AJDT_src” subdirectory. The source code for the Eclipse 3.2 version of AJDT is contained in the "ajdt1_4" branch, and the source code for the Eclipse 3.1 version is contained in the "ajdt1_3" branch. Here is a description of the various AJDT plug-ins:

    Plug-ins under “AJDT_src” Description
    org.aspectj.ajde The AspectJ compiler and related classes
    org.aspectj.runtime The AspectJ runtime classes packaged in a jar file
    org.aspectj.weaver The AspectJ weaver packaged in a jar file
    org.eclipse.ajdt.build Automatic build plug-in – only used by the build process (AJDT 1.2 only)
    org.eclipse.ajdt.core Non-UI parts of AJDT
    org.eclipse.ajdt.core.tests AJDT Core tests
    org.eclipse.ajdt.examples AspectJ examples plug-in
    org.eclipse.ajdt.source Source code for AJDT plug-ins - only populated by the build process
    org.eclipse.ajdt.ui.tests AJDT UI Tests
    org.eclipse.ajdt.tests.performance AJDT performance tests
    org.eclipse.ajdt.ui The AJDT UI plug-in
    org.eclipse.aspectj The AspectJ feature
    org.eclipse.aspectj.feature The &ldquot;feature&rdquot; plug-in
    org.eclipse.contribution.visualiser The Visualiser plug-in
    org.eclipse.contribution.visualiser.tests Visualiser tests
    org.eclipse.contribution.xref.core The Cross References plug-in (non-UI)
    org.eclipse.contribution.xref.core.tests Tests for the above
    org.eclipse.contribution.xref.ui The Cross References UI plug-in
    org.eclipse.contribution.xref.ui.tests Tests for the above
    UpdateSite Plug-in used to build an update site



  3. What do the version numbers mean?

    Each Eclipse point release has a corresponding AJDT point release. Eclipse 3.1 requires AJDT 1.3, Eclipse 3.2 requires AJDT 1.4, Eclipse 3.3 requires AJDT 1.5, and Eclipse 3.4 requires AJDT 1.6. Future releases are expected to follow the same numbering system.

    In the CVS repository, each point release of AJDT has its own branch. To do development on a particular version, you must check out the appropriate branch. See How can I connect the AJDT CVS repository? and I am looking for the AJDT branch 1.X in the CVS repository, but I can’t find it. What gives? for more details/p>



  4. How can I connect the AJDT CVS repository and download?

    Use the following credentials to connect to the repository anonymously:

    connection type:pserver
    user:anonymous
    password:<blank>
    host:dev.eclipse.org
    path:/cvs/root/tools
    If you are connecting to the repository from Eclipse, do the following:
    1. Start with a clean workspace under Eclipse 3.2, 3.3, or 3.4
    2. Open the CVS Repository Exploring perspective.
    3. Right-click on the CVS Repositories view.
    4. Click “New” > “Repository Location”.
    5. Fill in the blanks using the above credentials.
    6. Click “Finish”.
    7. Use the CVS Repositories view to navigate to HEAD/org.eclipse.ajdt/AJDT_src.


  5. I am looking for the AJDT branch 1.X in the CVS repository, but I can’t find it. What gives?

    Each point version of AJDT has its own branch in the CVS repository. It may not be initially visible if you are browsing the repository through Eclsipe.

    To discover a branch, do the following:

    1. Right-click on the org.eclipse.ajdt
    2. Select “Configure Branches and Versions...”
    3. In the dialog that opens navigate to AJDT_src/org.aspect.ajde/.project
    4. Various tags should appear in the right hand side of the dialog
    5. Press “Add Checked Tags”, then “OK”
    6. Back in the CVS Repositories view you should now be able to navigate to Branches/ajdt1_6/org.eclipse.ajdt ajdt1_6/AJDT_src

  6. How do I setup an AJDT development environment in Eclipse?

    There are three stages to this: building AJDT, running the correctness tests, and creating an Eclipse update site. The first two stages are sufficient for most purposes.

    Building AJDT

    Many of the plugins which implement AJDT contain aspects, and so are AspectJ projects themselves. This means that you first need to install a recent build of AJDT into your development environment from the update site or zip file.

    Note also that in order to build AJDT from source you will probably need to increase the memory available to Eclipse. This is typically done by passing something like “-vmargs -Xmx512m” to the Eclipse launcher.

    See How can I connect the AJDT CVS repository? for instructions on how to download the projects from CVS.

    If you are using Eclipse 3.4 you now need to switch to the “ajdt1_6” branch in CVS. See I am looking for the AJDT branch 1.X in the CVS repository, but I can’t find it. What gives? for information on how to discover this branch.

    If you are using Eclipse 3.3 you need to switch to the “ajdt1_5” branch instead.

    If you are using Eclipse 3.2 you need to switch to the “ajdt1_4” branch instead. Note that AJDT 1.4 is only lightly supported now (i.e., there is no ongoing development and only major bugs will be fixed).

    Select the following projects, right-click and select “Check out” from the context menu:

    • org.aspectj.ajde,
    • org.aspectj.runtime,
    • org.aspectj.weaver,
    • org.eclipse.ajdt.core,
    • org.eclipse.ajdt.examples,
    • org.eclipse.ajdt.ui,
    • org.eclipse.contribution.visualiser,
    • org.eclipse.contribution.xref.core,
    • org.eclipse.contribution.xref.ui.

    Eclipse will build the projects as you import them, after which should you be ready to run the plugins inside Eclipse:

    • Switch to the Java Perspective if you’re not already in it...
    • From the run menu select “Run...”
    • Select “Eclipse Application” and click new
    • Give your launch configuration a name, and click “Run”
    • Subsequent runs can simpy use the launch configuration you just created

    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:

    • org.eclipse.ajdt.core.tests
    • org.eclipse.ajdt.ui.tests
    • org.eclipse.ajdt.ui.visual.tests
    • org.eclipse.contribution.visualiser.tests
    • org.eclipse.contribution.xref.core.tests
    • org.eclipse.contribution.xref.ui.tests

    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.tests project, then the src folder, then the org.eclipse.ajdt.core.tests package. Now select the AllCoreTests.java file, right-click and select “Run As” > “JUnit Plug-in Test”. 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.ui.tests project, then the src folder, then the org.eclipse.ajdt.ui.tests package. Now select the AllUITests.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&srquo;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&lrquo; 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 ui visual tests

    Along with the ui tests in the org.eclipse.ajdt.ui.tests project, there are visual ui tests in the org.eclipse.ajdt.ui.visual.tests project. Select the AllVisualTests.java file, right-click and select “Run As” > “JUnit Plug-in Test”. A new runtime work bench will launch and the tests will run inside of that; although be warned that you will not be able to do anything else while the tests are running (even switching to the other workbench) as the tests will fail. This is because keyboard events are generated in order to drive the user interface.

  7. How can I package my sample code for contribution to the examples plug-in?

    The org.eclipse.ajdt.examples plugin contains various sample projects which are made available under the Examples category of the New wizard, from where they can be imported into your workspace as AspectJ projects. It is easy to add new samples to this plugin, as follows:

    • Create a jar file containing your source code, and at least one build c onfiguration file. Place this in the archive folder of the examples plugin.
    • Add an entry to the plugin.xml file for your sample project, by copying one of the existing entries.
    • Change the src attribute of the import element to refer to your jar file, and change the title, description, pagetitle, and pagedescription property names as appropriate, and add corresponding entries to the plugin.properties file.
    • Change the build attribute to refer to your default build configuration file. Your project may contain more configurations but the one specified here will be the one used to initially build the project.
    • Optionally, you can specify an open attribute to the projectsetup element, which refers to a file, such as a README file, which is opened after the project has been imported to the workspace.



  8. How can I build tools which extend AJDT?

    See this Eclipsepedia page: Developer’s guide to building tools on top of AJDT and AspectJ.