| <html> |
| <head> |
| <title>Headless Building with APT in Eclipse</title> |
| </head> |
| |
| <body> |
| <h1>Headless Building with APT in Eclipse</h2> |
| <h2>Instructions for building workspaces from the command-line directly or with ant</h3> |
| |
| <p> |
| The APT plugin can be used in conjunction with Eclipse to build your preconfigured |
| workspace, either directly from the command-line or via ant with its built-in ant task. |
| </p> |
| |
| <h3>Building from the command-line</h3> |
| Given an installation of Eclipse with the APT plugin installed, you can invoke the command-line builder |
| with the following command (with no line breaks): |
| |
| <pre> |
| java -cp %ECLIPSE_HOME%/startup.jar org.eclipse.core.launcher.Main |
| -noupdate -application org.eclipse.jdt.apt.core.aptBuild -data %WORKSPACE% |
| </pre> |
| |
| This invokes Eclipse in headless mode and builds the workspace as provided on the command-line. |
| Any configuration for the provided workspace will be observed in the build. |
| <p> |
| |
| <h3>Building with Ant</h3> |
| Again, you will need an installation of Eclipse with the APT plugin installed. Given this, the "apt" |
| task can be invoked with the following xml in your build.xml file: |
| |
| <pre> |
| <project name="test_eclipse" default="build" basedir="."> |
| |
| <taskdef name="apt" classname="org.eclipse.jdt.apt.core.build.JdtApt"/> |
| |
| <target name="build"> |
| <apt workspace="%WORKSPACE%" eclipseHome="%ECLIPSE_HOME%"/> |
| </target> |
| |
| </project> |
| </pre> |
| |
| You will need to add the jar for APT to your ant installation's <b>lib</b> directory, or place it on |
| the classpath when invoking ant. The jar lives in |
| <pre>%ECLIPSE_HOME%/plugins/org.eclipse.jdt.apt.core_X/aptcore.jar</pre> |
| |