blob: 2b342e8a4036cdb4a89b4fd54c8413e19ea5101e [file]
<?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) -->
<ant antfile="${wtp.builder.home}/scripts/build/runbuild.xml" 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,init.build.clean,init.check.builder.clean" if="doBuild">
<echo message="starting true build task (in seperate vm)" />
<!--
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="info" message="basedir: ${basedir}" />
<echo level="info" message="component: ${component}" />
<echo level="info" 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="info" 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>
<target name="getBaseBuilder" depends="init,init.build.clean,init.check.builder.clean,installedEclipseBuilder,installEclipseBuilder,touchBaseBuilder" if="doCleanBuilder">
<fail if="p2DirectorInstallFailed" />
<echo level="info" message="pde.builder.path: ${pde.builder.path}" />
</target>
<target name="installedEclipseBuilder" depends="init,init.build.clean,init.check.builder.clean,installEclipseBuilder" if="doCleanBuilder">
<echo level="info" message="pde.builder.path: ${pde.builder.path}" />
</target>
<target name="installEclipseBuilder" depends="init,init.build.clean,init.check.builder.clean" if="doCleanBuilder">
<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}" />
<echo message="starting installing eclipsebuilder prereq" />
<ant antfile="${wtp.builder.home}/scripts/dependency/dependency.xml" target="prereq.eclipsebuilder" />
<echo message="finished installing eclipsebuilder prereq" />
<echo message="starting installing prereq.wtpbuildtools" />
<ant antfile="${wtp.builder.home}/scripts/dependency/dependency.xml" target="prereq.wtpbuildtools" />
<echo message="finished installing prereq.wtpbuildtools" />
</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">
<touch>
<fileset dir="${eclipse.builder.base.install.dir}" />
</touch>
</target>
<target name="getWTPBaseBuilderMARKFORREMOVAL" depends="init,init.build.clean,init.check.builder.clean" if="doCleanBuilder">
<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" />
<jvmarg value="${buildcleanarg}" />
<jvmarg value="${buildercleanarg}" />
<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" depends="init.build.clean,init.check.builder.clean" >
<echo message="initializing runbuild.xml doClean: ${doClean}" />
<echo message="initializing runbuild.xml build.clean: ${build.clean}" />
<echo message="initializing runbuild.xml doCleanBuilder: ${doCleanBuilder}" />
<echo message="initializing runbuild.xml checkout.builder.clean: ${checkout.builder.clean}" />
<!-- = = = 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="HEAD">
<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}" />
<condition property="buildcleanarg" value="-Dbuild.clean=${build.clean}" else="-Dnoarg.build.clean=dummy">
<isset property="build.clean" />
</condition>
<condition property="buildercleanarg" value="-Dcheckout.builder.clean=${checkout.builder.clean}" else="-Dnoarg.checkout.builder.clean=dummy">
<isset property="checkout.builder.clean" />
</condition>
<!-- tempREmoved: this should only be set here ... the purpose is we install only once per build session -->
<property name="runBuildInitialized" value="true" />
</target>
<target name="init.build.clean">
<condition property="doClean">
<or>
<not>
<isset property="build.clean" />
</not>
<equals arg1="${build.clean}" arg2="true" />
</or>
</condition>
<echo message="build.clean: ${build.clean}" />
<echo message="doClean: ${doClean}" />
</target>
<target name="init.check.builder.clean">
<condition property="doCleanBuilder">
<or>
<not>
<isset property="checkout.builder.clean" />
</not>
<equals arg1="${checkout.builder.clean}" arg2="true" />
</or>
</condition>
<echo message="checkout.builder.clean: ${checkout.builder.clean}" />
<echo message="doCleanBuilder: ${doCleanBuilder}" />
</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>
<echo message="antQuietValue: ${antQuietValue}" />
<echo message="launcher path: ${pde.builder.path}/plugins/org.eclipse.equinox.launcher_*.jar" />
<echo message="doBuild: ${doBuild}" />
<echo message="buildcleanarg ${buildcleanarg}" />
<echo message="buildercleanarg: ${buildercleanarg}" />
<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="${buildcleanarg}" />
<jvmarg value="${buildercleanarg}" />
<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="-nosplash" />
<arg value="-debug" />
<arg value="-consolelog" />
<arg value="-application" />
<arg value="org.eclipse.ant.core.antRunner" />
<arg value="${antQuietValue}" />
<arg value="-buildfile" />
<arg value="${ant.file}" />
<arg value="build" />
</java>
<echo message="is javaResult set only on error? javaResult: ${javaResult}" />
</target>
</project>