Jump to: navigation, search

Difference between revisions of "Developer's guide to driving the AJDT build process"

 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The AJDT automated build process generates various artifacts not created by running an eclipse build, and now provides additional functionality such as packing JARs with the pack200 command, to produce a faster udpate siteHowever, getting the build working on your own machine has various gotchas, which this page hopes to help you through.
+
* Ensure that all important AJDT projects are checked out from cvsAs of Eclipse 3.6 (Helios), these projects are:
  
<strong> *** This is work in progress, currently being updated from draft version on another machine - please don't attempt to follow this guide until this comment is removed :-) *** </strong>
+
org.aspectj.ajde
 +
org.aspectj.runtime
 +
org.aspectj.weaver
 +
org.eclipse.ajdt-feature
 +
org.eclipse.ajdt.core
 +
org.eclipse.ajdt.core.tests
 +
org.eclipse.ajdt.doc.user
 +
org.eclipse.ajdt.examples
 +
org.eclipse.ajdt.mylyn.ui
 +
org.eclipse.ajdt.mylyn.ui.tests
 +
org.eclipse.ajdt.pde.build
 +
org.eclipse.ajdt.pde.build-feature
 +
org.eclipse.ajdt.releng
 +
org.eclipse.ajdt.ui
 +
org.eclipse.ajdt.ui.tests
 +
org.eclipse.ajdt.ui.visual.tests
 +
org.eclipse.aspectj
 +
org.eclipse.aspectj.feature_tests
 +
org.eclipse.contribution.visualiser
 +
org.eclipse.contribution.visualiser.tests
 +
org.eclipse.contribution.weaving-feature
 +
org.eclipse.contribution.weaving.jdt
 +
org.eclipse.contribution.weaving.jdt.tests
 +
org.eclipse.contribution.xref-feature
 +
org.eclipse.contribution.xref.core
 +
org.eclipse.contribution.xref.core.tests
 +
org.eclipse.contribution.xref.ui
 +
org.eclipse.contribution.xref.ui.tests
  
This guide assumes, for now, that your starting point is that you have followed all the steps in the standard developer's guide here:
+
* In the org.eclipse.ajdt.releng project, edit the local.properties file (but do not check this in).  Use whatever settings are appropriate for you.
 +
* Run ant buildAll.xml
  
[http://www.eclipse.org/ajdt/developers.php AJDT Developer's Guide]
+
[[Category:AJDT]]
 
+
It is certainly a good idea to familiarise yourself with the Eclipse environment prior to attempting a command line build, but by no means essential.  It is also assumed that you are building on Windows XP, or failing that, that you will understand the changes required in order to build on, say, Linux.
+
 
+
The first thing to do is create a root build directory, e.g.
+
 
+
<pre> C:\ajdt\build </pre>
+
 
+
and inside it <strong> two </strong> directories containing Eclipse installs (including AJDT) versions 3.2 and 3.3, e.g.:
+
 
+
<pre>C:\ajdt\build\eclipse32
+
C:\ajdt\build\eclipse33
+
</pre>
+
 
+
NB The naming of these directories is important so use these names, unless you want to change config files (clue: you don't). Both these versions of Eclipse are required, as the build runs using 3.2 but needs 3.3 to build the latest versions of AJDT.  So, the simplest thing to do is run up a couple of versions of Eclipse, install AJDT in each, then copy the file sets to your build directory.
+
 
+
Next you need to patch the two Eclipse installs to use the AJDT version of a file called "pdebuild-ant.jar".  You'll find that target version under the two respective eclipse3x directories, e.g.:
+
 
+
<pre> eclipse\plugins\org.eclipse.pde.build_3.2.100.v20061210\lib\pdebuild-ant.jar </pre>
+
 
+
or something silmilar, depending on the versions of the plugin you have.  Replace this file with the AJDT version from:
+
 
+
<pre> eclipse\plugins\org.eclipse.ajdt.pde.build_1.5.0.200611060620\lib\pdebuild-ant.jar </pre>
+
 
+
again, allowing for the version of AJDT you have.  This patching results in the AspectJ compiler being used instead of the Java one, so is important, as it saves you wasting a lot of time staring at lots of compilation errors :-)
+
 
+
You now need the AJDT build file for the version of AJDT that you want to build.  This is not currently available in CVS, so has been added here as a separate document here on the wiki for now [http://wiki.eclipse.org/index.php/build-ajdt1.5.xml AJDT 1.5 build file]
+
 
+
Save this to your root build directory.  You now need to set up some environment variables. Add the ant binaries directory to your path and set the ant home variable.  If you don't have ant, go get it from [http://ant.apache.org/bindownload.cgi Apache Ant Downloads]. E.g.:
+
 
+
<pre>
+
set PATH=%PATH%;C:\ant\bin
+
set ANT_HOME=C:\ant
+
</pre>
+
 
+
Before running the build script, you need to override the default setting for your JDK 1.5.  You can either edit the java15-home property at the top of the build script, or override it on the command line with the option (e.g.)
+
 
+
<pre>
+
-Djava15-home=C:\jdk1.5.0_08
+
</pre>
+
 
+
when you run the ant script (where C:\jdk1.5.0_08 is obviously the location of your JDK).  The other properties should be fine with the defaults, unless the location of the CVS repository/package or the update site URL have changed.
+
 
+
You should now be able to run a PDE build, using the following command:
+
 
+
<pre>ant -buildfile build-ajdt1.5.xml pdebuild -D-Djava15-home=C:\jdk1.5.0_08 </pre>
+
 
+
Or for more debugging information from ant:
+
 
+
<pre>ant -buildfile build-ajdt1.5.xml pdebuild -D-Djava15-home=C:\jdk1.5.0_08 -verbose</pre>
+
 
+
Assuming you are not using the verbose switch, the first message from ant will be:
+
 
+
<pre>[taskdef] Could not load definitions from resource com/ibm/lakeba/ant/taskdefs.properties. It could not be found.</pre>
+
 
+
This is to be expected and can be ignored.  However, you should be wary of the ant "Build successful" message once the task has compelted; it's a good idea to check the output for any obvious stack traces, or earlier instances of "Build failed".  Assuming all is well, you should now be able to see the built artifacts in (e.g.):
+
 
+
<pre> C:\ajdt\build\eclipse33\eclipse\eclipse.build </pre>
+
 
+
Look under the 'updateSite' subdirectory to see the built 'features' and 'plugins' subdirectories, and the contents therein.
+

Latest revision as of 10:16, 17 March 2010

  • Ensure that all important AJDT projects are checked out from cvs. As of Eclipse 3.6 (Helios), these projects are:
org.aspectj.ajde
org.aspectj.runtime
org.aspectj.weaver
org.eclipse.ajdt-feature
org.eclipse.ajdt.core
org.eclipse.ajdt.core.tests
org.eclipse.ajdt.doc.user
org.eclipse.ajdt.examples
org.eclipse.ajdt.mylyn.ui
org.eclipse.ajdt.mylyn.ui.tests
org.eclipse.ajdt.pde.build
org.eclipse.ajdt.pde.build-feature
org.eclipse.ajdt.releng
org.eclipse.ajdt.ui
org.eclipse.ajdt.ui.tests
org.eclipse.ajdt.ui.visual.tests
org.eclipse.aspectj
org.eclipse.aspectj.feature_tests
org.eclipse.contribution.visualiser
org.eclipse.contribution.visualiser.tests
org.eclipse.contribution.weaving-feature
org.eclipse.contribution.weaving.jdt
org.eclipse.contribution.weaving.jdt.tests
org.eclipse.contribution.xref-feature
org.eclipse.contribution.xref.core
org.eclipse.contribution.xref.core.tests
org.eclipse.contribution.xref.ui
org.eclipse.contribution.xref.ui.tests
  • In the org.eclipse.ajdt.releng project, edit the local.properties file (but do not check this in). Use whatever settings are appropriate for you.
  • Run ant buildAll.xml