blob: c9279fc18315f57d05d91b651408222a499e9cf8 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
A utility ant script to invoke AntRunner application with
Eclipse. This is handy since some ant scripts are running in
plain ant, but we'd like to use Eclipse's ant tasks for things
like p2 operations.
-->
<project
name="runAntRunner"
default="runAntRunner"
basedir=".">
<!-- = = = standard properties pattern = = = -->
<!--
Note to be cross-platform, "environment variables" are only
appropriate for some variables, e.g. ones we set, since
properties are case sensitive, even if the environment variables
on your operating system are not, e.g. it will be ${env.Path}
not ${env.PATH} on Windows
-->
<property
environment="env"/>
<!--
Let users override standard properties, if desired. If
directory, file, or some properties do not exist, then standard
properties will be used.
-->
<property
file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/>
<!-- = = = end standard properties pattern = = = -->
<fail
unless="env.BUILD_HOME"
message="all scripts need a BUILD_HOME"/>
<echo
level="info"
message="buildDirectory: ${buildDirectory}"/>
<property
name="keyCfgFile"
value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/>
<echo
level="debug"
message="keyCfgFile: ${keyCfgFile}"/>
<property
file="${keyCfgFile}"/>
<fail
unless="builderVersion"
message="Could not get builderVersion. Probably could not checkout build.cfg?"/>
<fail
unless="eclipse.builder.version"
message="Could not get eclipse.builder.version. Perhaps an old format build.cfg?"/>
<property
name="basebuilder.path"
value="${env.BASE_BUILDERS}/${eclipse.builder.version}"/>
<property
name="failOnError"
value="true"/>
<!-- if not set by caller, be sure it is empty string -->
<property
name="antrunnertarget"
value="build"/>
<fail
unless="antrunnerfile"
message="Must provide ant file to run"/>
<target
name="runAntRunner">
<!-- long term we should make this sensitive to if already running in eclipse, and if so,
just invoke the script? check if="eclipse.running" -->
<mkdir dir="${buildDirectory}/${buildLabel}"/>
<mkdir
dir="${buildDirectory}/${buildLabel}/buildworkspaces"/>
<java
taskname="AntRunner"
jar="${eclipse.launcher}"
fork="true"
failonerror="${failOnError}">
<jvmarg
value="-Djava.protocol.handler.pkgs=com.ibm.etools.www.protocol"/>
<jvmarg
value="-DurlLogLocation=${buildDirectory}/${buildLabel}/outgoinghttplog-antrunner.log"/>
<jvmarg
value="-Dosgi.ws=${env.BASEWS}"/>
<jvmarg
value="-Dosgi.os=${env.BASEOS}"/>
<jvmarg
value="-Dosgi.arch=${env.BASEARCH}"/>
<jvmarg
value="-Dbuild.home=${env.BUILD_HOME}"/>
<jvmarg
value="-DJAVA_6_HOME=${env.JAVA_6_HOME}"/>
<jvmarg
value="-DJAVA_5_HOME=${env.JAVA_5_HOME}"/>
<jvmarg
value="-DJAVA_4_HOME=${env.JAVA_4_HOME}"/>
<jvmarg
value="-Declipse.builder.version=${eclipse.builder.version}"/>
<jvmarg
value="-Declipse.builder=${eclipse.builder}"/>
<jvmarg
value="-Dprojectname=${projectname}"/>
<jvmarg
value="-DbuildDirectory=${buildDirectory}"/>
<jvmarg
value="-DbuildLabel=${buildLabel}"/>
<jvmarg
value="-Dwtp.builder.home=${wtp.builder.home}"/>
<jvmarg
value="-Dbuild.distribution=${build.distribution}"/>
<jvmarg
value="-Dcomponent=${component}"/>
<jvmarg
value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}"/>
<jvmarg
value="-Dosgi.instance.area=${buildDirectory}/${buildLabel}/buildworkspaces/workspace-runAntRunner-${antrunnerfile}-${antrunnertarget}" />
<arg
value="-application"/>
<arg
value="org.eclipse.ant.core.antRunner"/>
<arg
value="-buildfile"/>
<arg
value="${antrunnerfile}"/>
<arg
value="${antrunnertarget}"/>
</java>
</target>
</project>