... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2006-04-07

Headless Eclipse Ant Builds

If you want to run an Ant build within the Eclipse environment, you can launch Eclipse headless as follows:

@echo off
setlocal

set JAVA="c:\esidev\jdk1.5.0_06\bin\java.exe"
set ECLIPSE="c:\esidev\eclipse3.1.x\startup.jar"
set WORKSPACE="c:\work\workspace"
set BUILDFILE="%WORKSPACE%\esi.environment utilities\rebuild-all.ant.xml"

@echo on
%JAVA% ^
  -cp %ECLIPSE% ^
  org.eclipse.core.launcher.Main ^
  -application org.eclipse.ant.core.antRunner ^
  -data %WORKSPACE% ^
  -buildfile %BUILDFILE% ^
  %*

This can come in handy if the Ant script uses some of the Eclipse tasks or if the build relies upon Eclipse's built-in build processes.

Blog Archive