blob: 43826a273fdfd8dd956d87f0ba761e2a143d6b0e [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<project
name="runbuild"
default="runbuild"
basedir=".">
<!-- main -->
<target
name="runbuild"
depends="init">
<dirname
file="${ant.file}"
property="scripts.build.dir"/>
<property
name="wtp.builder.home"
value="${scripts.build.dir}/../../.."/>
<!-- invoke runEclipseBuild to invokde antBuidler (just in case we
are not in ant builder, already) -->
<antcall target="runEclipseBuild"/>
<!-- fast fail, if serious problem indicated in output logs -->
<ant antfile="${wtp.builder.home}/scripts/build/checkForFastFail.xml"/>
</target>
<target
name="build"
depends="init"
if="doBuild">
<!--
this property required as of Eclipse 3.0 stream builds >
20031126
-->
<property
name="buildingOSGi"
value="true"/>
<!--
this generateFeatureVersionSuffix property causes feature
suffixes to be calcuated based on their own CVS tag, plus
the qualifier of their contained plugins
-->
<!--
https://bugs.eclipse.org/bugs/show_bug.cgi?id=138825 false
for builds intended for 3.1.2, since can generate
underscores true for builds instended for 3.2
-->
<property
name="generateFeatureVersionSuffix"
value="true"/>
<property
name="outputUpdateJars"
value="true"/>
<property
name="runPackager"
value="true"/>
<!--run the build for the specified component-->
<echo
level="debug"
message="basedir: ${basedir}"/>
<echo
level="debug"
message="component: ${component}"/>
<echo
level="debug"
message="wtp.builder.home: ${wtp.builder.home}"/>
<!--
tip from Andrew, in bug 309723
https://bugs.eclipse.org/bugs/show_bug.cgi?id=309723
Also, the property ${eclipse.pdebuild.scripts} is defined by pde.build and
points to the scripts directory of the running pde.build. Similarly,
${eclipse.pdebuild.templates} points to the templates folder. You can use this
instead of the more error prone manual "pde.build.scripts"
-->
<echo
level="debug"
message="eclipse.pdebuild.scripts: ${eclipse.pdebuild.scripts}"/>
<ant
antfile="build.xml"
dir="${eclipse.pdebuild.scripts}">
<property
name="builder"
value="${wtp.builder.home}/components/${component}"/>
<property
name="wtp.builder.home"
value="${wtp.builder.home}"/>
<property
name="buildBranch"
value="${buildBranch}"/>
<property
name="dependencyTargets"
value="${wtp.builder.home}/scripts/dependency/build.xml"/>
<property
name="baseLocation"
value="${env.PROJECT_PROJECTS}/${projectname}/eclipse"/>
<property
name="buildRoot"
value="${env.PROJECT_PROJECTS}/${projectname}"/>
</ant>
</target>
<!-- check if PDE basebuilder and WTP builder is present -->
<target
name="checkBaseBuilder"
depends="init">
<!--
we just check if both base, and our wtp specific one are
current, if either is not, we'll get them both
-->
<condition property="basebuilderlocal">
<available file="${pde.builder.path}"/>
</condition>
</target>
<!--
1)init -> set buildBranch, and create label.properties
2)checkBaseBuilder -> check is baseBuilder exists, if not
retrieve from CVS org.eclipse.releg.basebuilder 3)invoke
getWTPBaseBuilder -> checks if
org.eclipse.wtp.releng.tools_version.jar exist, if not download
from WTP build site
-->
<target
name="getBaseBuilder"
depends="init,checkBaseBuilder,installedEclipseBuilder,installEclipseBuilder,touchBaseBuilder"
if="eclipse.builder.fetch"
unless="basebuilderlocal">
<fail if="p2DirectorInstallFailed"/>
<echo
level="debug"
message="installed eclipse builder: ${pde.builder.path}"/>
</target>
<target
name="installedEclipseBuilder"
depends="init,checkBaseBuilder"
if="basebuilderlocal">
<echo
level="debug"
message="found installed eclipse builder: ${pde.builder.path}"/>
</target>
<target
name="installEclipseBuilder"
depends="init,checkBaseBuilder"
unless="basebuilderlocal">
<property
name="dependency.properties"
value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/${dependencyFileLocation}"/>
<available
file="${dependency.properties}"
property="dependency.properties.exists"/>
<fail
message="dependency file not found: ${dependency.properties}"
unless="dependency.properties.exists"/>
<property file="${dependency.properties}"/>
<ant
antfile="${wtp.builder.home}/scripts/dependency/dependency.xml"
target="prereq.eclipsebuilder"/>
<ant
antfile="${wtp.builder.home}/scripts/dependency/dependency.xml"
target="prereq.egit"/>
<ant
antfile="${wtp.builder.home}/scripts/dependency/dependency.xml"
target="prereq.gitfetchfactory"/>
<ant
antfile="${wtp.builder.home}/scripts/dependency/dependency.xml"
target="prereq.wtpbuildtools"/>
<!-- remember, we install wtp tools only when eclipse builder is installed,
so we'll want to remove the eclipse builder at the very start of every main build,
to make sure all is fresh and current
<antcall target="getWTPBaseBuilder"/>-->
</target>
<!--
touch base builder when used (but not fetched), so cleanup scripts that
look for "modified time" will know it is still being used. Modified times are sometimes
used instead of access times in scripts since even ls or find will change access times
-->
<target
name="touchBaseBuilder"
depends="init"
if="basebuilderlocal">
<touch>
<fileset dir="${eclipse.builder.base.install.dir}"/>
</touch>
</target>
<!--
check wtpBulderPresent property if false, download WTP builder
file org.eclipse.wtp.releng.tools_version.jar into baseBuiders
-->
<target
name="getWTPBaseBuilder"
depends="init">
<java
taskname="p2Director Install of wtp tools"
fork="true"
resultProperty="p2DirectorInstallResult"
failonerror="false"
timeout="1800000"
dir="${pde.builder.path}"
jvm="${env.JAVA_6_HOME}/bin/java"
classname="org.eclipse.equinox.launcher.Main">
<classpath>
<fileset dir="${pde.builder.path}/plugins">
<include name="org.eclipse.equinox.launcher_*.jar"/>
</fileset>
</classpath>
<jvmarg value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}"/>
<jvmarg value="-Dwtp.builder.home=${wtp.builder.home}"/>
<jvmarg value="-Dbuild.distribution=${build.distribution}"/>
<arg value="-nosplash"/>
<arg value="-debug"/>
<arg value="-consolelog"/>
<arg value="-data"/>
<arg value="${pde.builder.path}/wtptoolsp2DirectorInstall"/>
<jvmarg value="-Dosgi.instance.area=${pde.builder.path}/configuration"/>
<arg value="-application"/>
<arg value="org.eclipse.equinox.p2.director"/>
<arg value="-destination"/>
<arg value="${pde.builder.path}"/>
<arg value="-repository"/>
<arg value="${wtpBuildTools.repository}"/>
<arg value="-installIU"/>
<arg value="${wtpBuildTools.feature}"/>
<!-- make sure our forked env has a DISPLAY -->
<env
key="DISPLAY"
value="${env.DISPLAY}"/>
<redirector
output="${pde.builder.path}/fullOutputLogWTPp2Directory.txt"
error="${pde.builder.path}/fullErrorLogWTPp2Directory.txt"/>
</java>
<!-- If the task succeeds, this ouput log won't be that relevent ... (can be make better in future ... but for now we'll make a copy,
just in case we need it -->
<echo
level="debug"
message="p2DirectorInstallResult: ${p2DirectorInstallResult}"/>
<condition property="p2DirectorInstallFailed">
<not>
<equals
arg1="0"
arg2="${p2DirectorInstallResult}"/>
</not>
</condition>
</target>
<!-- set buildBranch, and create label.properties-->
<target
name="init"
unless="runBuildInitialized">
<!-- = = = 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"/>
<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?"/>
<echo
level="debug"
message="buildDirectory: ${buildDirectory}"/>
<!--
We should not always normalize ("-repack") jars by default,
since in production we sign the jars (which does the -repack for
us) and not in production we don't really care so why spend the
extra time. For jars which are not supposed to be normalized,
such as pre-existing jars, they need to be added to the
pack.properties file (see the updatePackProperties task). Note:
signing does the -repack when we sign. This can be over-ridden
by the caller setting normalize to true, but there are know
known cases where we want to normalize (and eventually pack) the
jar files but not sign them.
-->
<property
name="normalizeJarFiles"
value="false"/>
<!--
strip trailing blanks. Seems either Eclipse, or CVS make it
hard to not have trailing spaces
-->
<replaceregexp
flags="gm"
file="${wtp.builder.home}/build.properties"
match=" *$"
replace=""/>
<property file="${wtp.builder.home}/build.properties"/>
<ant antfile="${wtp.builder.home}/scripts/build/label.xml"/>
<property file="${buildDirectory}/label.properties"/>
<!--
fetch the HEAD stream of all projects if build type
specified as N
-->
<condition
property="fetchTag"
value="CVS=HEAD,GIT=origin/master">
<equals
arg1="${buildType}"
arg2="N"/>
</condition>
<!--
exit if the component directory doesn't exist (for example,
may not always be an "sdk" component, but we often generate
calls to it)
-->
<condition property="doBuild">
<available
file="${wtp.builder.home}/components/${component}"
type="dir"/>
</condition>
<property
name="local.cache.dir"
value="${env.LOCAL_PREREQS_CACHE}"/>
<!-- this should only be set here ... the purpose is we install only once per build session -->
<property
name="runBuildInitialized"
value="true"/>
</target>
<target
name="runEclipseBuild"
depends="init"
if="buildId">
<fail
message="dependency.properties must be specified by distribution script"
unless="dependency.properties"/>
<!--
if not otherwise set "externally", set the classpath jars
for the Execution Envirnonments we need in WTP. And other
parameters we need set. To successfully do local builds,
most of these do have to be provided externally, such as in
"localbuildproperties" directory
-->
<property
name="J2SE-1.4"
value="${env.JAVA_4_HOME}/jre/lib/core.jar:${env.JAVA_4_HOME}/jre/lib/xml.jar:${env.JAVA_4_HOME}/jre/lib/graphics.jar:${env.JAVA_4_HOME}/jre/lib/server.jar:${env.JAVA_4_HOME}/jre/lib/ibmorbapi.jar:${env.JAVA_4_HOME}/jre/lib/security.jar:${env.JAVA_4_HOME}/jre/lib/ibmpkcs.jar:${env.JAVA_4_HOME}/jre/lib/ibmjcefw.jar"/>
<property
name="J2SE-1.5"
value="${env.JAVA_5_HOME}/jre/lib/core.jar:${env.JAVA_5_HOME}/jre/lib/vm.jar:${env.JAVA_5_HOME}/jre/lib/xml.jar:${env.JAVA_5_HOME}/jre/lib/graphics.jar:${env.JAVA_5_HOME}/jre/lib/server.jar:${env.JAVA_5_HOME}/jre/lib/ibmorbapi.jar:${env.JAVA_5_HOME}/jre/lib/security.jar:${env.JAVA_5_HOME}/jre/lib/ibmpkcs.jar:${env.JAVA_5_HOME}/jre/lib/ibmjcefw.jar"/>
<property
name="JavaSE-1.6"
value="${env.JAVA_6_HOME}/jre/lib/rt.jar:${env.JAVA_6_HOME}/jre/lib/vm.jar:${env.JAVA_6_HOME}/jre/lib/java.util.jar:${env.JAVA_6_HOME}/jre/lib/xml.jar:${env.JAVA_6_HOME}/jre/lib/ibmorbapi.jar:${env.JAVA_6_HOME}/jre/lib/security.jar:${env.JAVA_6_HOME}/jre/lib/ibmpkcs.jar:${env.JAVA_6_HOME}/jre/lib/ibmjcefw.jar:${env.JAVA_6_HOME}/jre/lib/beans.jar:${env.JAVA_6_HOME}/jre/lib/logging.jar"/>
<!--
local builds should set build.donottagmaps to true, in
runbuild.properties, to avoid erroneous time stamps, though also requires "cvs write user" to be set to valid committer id, etc.
-->
<property
name="build.donottagmaps"
value="false"/>
<fail
unless="JavaSE-1.6"
message="classpath to JavaSE-1.6 Execution Environment must be set"/>
<fail
unless="J2SE-1.5"
message="classpath to J2SE-1.5 Execution Environment must be set"/>
<fail
unless="J2SE-1.4"
message="classpath to J2SE-1.4 Execution Environment must be set"/>
<!--
we read these in as ant properties, so in java call below,
we convert them to system (environment) properties, which is
where PDE expects to find them
-->
<!--
Note: echoing the class path values was changed from 'debug' to 'info' so the value would become part of the log.
This is a good practice especially since we started using symbolic links under the covers to point to insalled VMs,
so echoing their value to the log will provide an permentant recored of exactly which version of libraries were
used during compilation. Hard to find, and unlikely to ever be needed ... but, it will be there, just in case it is.
Correction: it did not fully resolve the names, before printing out. (Unlike "sun.boot.classpath" environment varialbe.
Guess someone can figure out how to add some special ant statements to fully resole, and print it out,
if anyone ever cares. Or, find a better way. But, should never need to know, so not worth much effort, if any.
-->
<echo
level="info"
message="JavaSE-1.6=${JavaSE-1.6}"/>
<echo
level="info"
message="J2SE-1.5=${J2SE-1.5}"/>
<echo
level="info"
message="J2SE-1.4=${J2SE-1.4}"/>
<!--
<mkdir dir="${buildDirectory}/${buildLabel}"/>
<mkdir dir="${buildDirectory}/${buildLabel}/buildworkspaces"/>
-->
<!--
TODO: should we capture exit code in resultproperty (javaEclipseBuildResult)
and (eventually) take some 'fail' action ... after saving logs, etc.? ...
but where?
-->
<condition
property="antQuietValue"
value="-quiet"
else="">
<istrue value="${env.USE_QUIET}"/>
</condition>
<java
taskname="build-${build.distribution}-${component}"
classname="org.eclipse.equinox.launcher.Main"
fork="true"
failonerror="false"
resultproperty="javaResult">
<classpath>
<fileset dir="${pde.builder.path}/plugins">
<include name="org.eclipse.equinox.launcher_*.jar"/>
</fileset>
</classpath>
<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="-DJavaSE-1.6=${JavaSE-1.6}"/>
<jvmarg value="-DJ2SE-1.5=${J2SE-1.5}"/>
<jvmarg value="-DJ2SE-1.4=${J2SE-1.4}"/>
<jvmarg value="-Dbuild.donottagmaps=${build.donottagmaps}"/>
<jvmarg value="-DbuildType=${buildType}"/>
<jvmarg value="-DdependencyFileLocation=${dependencyFileLocation}"/>
<jvmarg value="-DbuildId=${buildId}"/>
<jvmarg value="-DmapVersionTag=${mapVersionTag}"/>
<jvmarg value="-Dprojectname=${projectname}"/>
<jvmarg value="-DbuildLabel=${buildLabel}"/>
<jvmarg value="-Dreleng.jsf-mapVersionTag=${releng.jsf-mapVersionTag}"/>
<jvmarg value="-Dreleng.dali-mapVersionTag=${releng.dali-mapVersionTag}"/>
<jvmarg value="-Dreleng.jsdt-mapVersionTag=${releng.jsdt-mapVersionTag}"/>
<jvmarg value="-Dwtp.builder.home=${wtp.builder.home}"/>
<jvmarg value="-Dbuild.distribution=${build.distribution}"/>
<jvmarg value="-Dcomponent=${component}"/>
<jvmarg value="-Ddependency.properties=${dependency.properties}"/>
<jvmarg value="-DwtpBuildTools.file=${wtpBuildTools.file}"/>
<jvmarg value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}"/>
<jvmarg value="-DSKIP_JAR_SIGNING=${SKIP_JAR_SIGNING}"/>
<jvmarg value="-DnormalizeJarFiles=${normalizeJarFiles}"/>
<jvmarg value="-Dosgi.instance.area=${buildDirectory}/${buildLabel}/buildworkspaces/workspace-runbuild-${component}"/>
<arg value="-application"/>
<arg value="org.eclipse.ant.core.antRunner"/>
<arg value="${antQuietValue}"/>
<arg value="-buildfile"/>
<arg value="${ant.file}"/>
<arg value="build"/>
</java>
</target>
</project>