blob: 9f03c69f36c549e8c4bece630164415232c4cac5 [file] [log] [blame]
<project
name="AggregationTasks"
basedir="."
default="default">
<property environment="env" />
<!--
This property file name is itself a property, so it can be overridden
on one machine versus another. We do it this way, instead of just specifying
-propertyFile on command line, so that the property values can be "nested"
in other property values and evaluated lazily.
-->
<fail
unless="release"
message="release must be specified for this script, such as -Drelease=mars" />
<property
name="aggrPropertyFile"
value="aggr.properties" />
<loadproperties srcfile="${aggrPropertyFile}" />
<target
name="installAggregatorAndTools"
depends="init, savePrevious,installAggregator,installRelengTools"
if="installEclipseAndTools">
<echo message="Installed fresh Eclipse, Aggregator, and Tools" />
</target>
<target
name="installAggregator"
depends="init, savePrevious"
if="installEclipseAndTools">
<property
name="APP_NAME"
value="org.eclipse.equinox.p2.director" />
<property
name="OTHER_ARGS_AGG"
value="-metadataRepository http://download.eclipse.org/modeling/emft/b3/updates-4.4/ -artifactRepository http://download.eclipse.org/modeling/emft/b3/updates-4.4/ -installIU org.eclipse.b3.aggregator.engine.feature.feature.group" />
<!--
<property
name="OTHER_ARGS_AGG"
value="-metadataRepository http://download.eclipse.org/modeling/emft/b3/updates-4.4/ -artifactRepository http://download.eclipse.org/modeling/emft/b3/updates-4.4/
-installIU org.eclipse.b3.aggregator.engine.feature.feature.group" />
<property
name="OTHER_ARGS_AGG"
value="-metadataRepository http://download.eclipse.org/modeling/emft/b3/updates-4.4/,http://download.eclipse.org/releases/luna
-artifactRepository http://download.eclipse.org/modeling/emft/b3/updates-4.4/,http://download.eclipse.org/releases/luna -installIU
org.eclipse.b3.aggregator.engine.feature.feature.group" />
-->
<!-- usually do not need the version, just to "get the latest" from
buckminster builder site -version 1.0.0.v20090415-1651 -->
<property
name="VM_ARGS"
value="-Xmx256m" />
<mkdir dir="${ECLIPSE_HOME}" />
<untar
compression="gzip"
overwrite="true"
src="${FULL_FILENAME}"
dest="${ECLIPSE_HOME}" />
<!--
This .options file is most useful on non-eclipse.org sites, since
on eclipse.org, by design, should not go through mirrors, but that's the
purpose of the .options ... so list which mirrors that artifacts come from.
<copy
file="${BUILD_HOME}/${BUILD_TOOLS}/p2options/.options"
todir="${ECLIPSE_HOME}/eclipse/" />
-->
<!--
Weird this chmod is required? Maybe an ant bug? Maybe no longer needed?
(That is, maybe an early bug in packages?)
-->
<chmod
file="${ECLIPSE_HOME}/eclipse/eclipse"
perm="ugo+x"
verbose="true" />
<!-- and now get latest -->
<exec
executable="${eclipseExecutable}"
dir="${basedir}"
failonerror="true">
<arg
line="-data ${eclipseWorkspace} -debug -consolelog -nosplash --launcher.suppressErrors -application ${APP_NAME} ${OTHER_ARGS_AGG} -vm ${JAVA_EXEC_DIR} -vmargs ${VM_ARGS}" />
</exec>
</target>
<target
name="installTests"
depends="init, savePreviousTest"
if="installEclipseTests">
<property
name="APP_NAME"
value="org.eclipse.equinox.p2.director" />
<!-- usually do not need the version, just to "get the latest" from
buckminster builder site -version 1.0.0.v20090415-1651 -->
<property
name="VM_ARGS"
value="-Xmx256m" />
<mkdir dir="${ECLIPSE_HOME_TEST}" />
<untar
compression="gzip"
overwrite="true"
src="${FULL_TEST_FILENAME}"
dest="${ECLIPSE_HOME_TEST}" />
<!-- weird this chmod is required? probably ant bug -->
<chmod
file="${ECLIPSE_HOME_TEST}/eclipse/eclipse"
perm="ugo+x"
verbose="true" />
<!-- get raw files from git ... this is now done by Hudson
<echo message=" removing previous HOLD_BRANCH.zip if it exists, in ${BUILD_HOME}" />
<delete
file="${BUILD_HOME}/HOLD_BRANCH.zip"
failonerror="false" />
<echo message=" getting ${CGITURL}/${RELENG_TESTS_REPO}.git/snapshot/${BRANCH_TESTS}.zip to ${BUILD_HOME}" />
<get
src="${CGITURL}/${RELENG_TESTS_REPO}.git/snapshot/${BRANCH_TESTS}.zip"
dest="${BUILD_HOME}/HOLD_BRANCH.zip"
verbose="true" />
<unzip
src="${BUILD_HOME}/HOLD_BRANCH.zip"
dest="${BUILD_HOME}/${TMPDIR_TESTS}" />
-->
<copy todir="${ECLIPSE_HOME_TEST}/eclipse/dropins/${RELENG_TESTS_BUNDLE_ID}">
<fileset
dir="${BUILD_HOME}/${RELENG_TESTS_DIR}/${RELENG_TESTS_PATH}/"
includes="**/*" />
</copy>
<!-- cleanup temp working files
<delete file="${BUILD_HOME}/HOLD_BRANCH.zip" />
<delete dir="${BUILD_HOME}/${TMPDIR_TESTS}" />
-->
</target>
<target
name="installRelengTools"
depends="init"
if="installEclipseAndTools">
<property
name="APP_NAME"
value="org.eclipse.equinox.p2.director" />
<property
name="OTHER_ARGS_TOOLS"
value="-metadataRepository http://download.eclipse.org/webtools/releng/repository/ -artifactRepository http://download.eclipse.org/webtools/releng/repository/ -installIU org.eclipse.wtp.releng.tools.feature.feature.group" />
<property
name="VM_ARGS"
value="-Xmx256m" />
<!-- install latest -->
<exec
executable="${eclipseExecutable}"
dir="${basedir}"
failonerror="true">
<arg
line="-data ${eclipseWorkspace} -debug -consolelog -nosplash --launcher.suppressErrors -application ${APP_NAME} ${OTHER_ARGS_TOOLS} -vm ${JAVA_EXEC_DIR} -vmargs ${VM_ARGS}" />
</exec>
</target>
<macrodef name="git-rev-parse">
<attribute name="repodir" />
<attribute
name="reference"
default="HEAD" />
<attribute name="returnProperty" />
<sequential>
<echo message="execute git in @{repodir}" />
<echo message="git rev-parse @{reference} returned in @{returnProperty}" />
<local name="rc" />
<local name="result" />
<exec
executable="git"
failonerror="false"
outputproperty="result"
resultproperty="rc"
dir="@{repodir}">
<arg line="rev-parse @{reference}" />
</exec>
<property
name="@{returnProperty}"
value="${result}" />
<echo message="In macro rc is ${rc}" />
<echo message="In macro result is ${result}" />
<echo message="In macro @{returnProperty} is ${@{returnProperty}}" />
</sequential>
</macrodef>
<macrodef name="git-clone">
<attribute name="repository" />
<attribute name="dir" />
<attribute name="branch" />
<sequential>
<echo message="execute git in @{dir}" />
<echo message="git clone -b @{branch} @{repository} --config core.autocrlf=input --config merge.defaultToUpstream=true" />
<exec
executable="git"
failonerror="false"
resultproperty="cloneResult"
dir="@{dir}">
<arg line="clone -b @{branch} @{repository} --config core.autocrlf=input --config merge.defaultToUpstream=true" />
</exec>
<antcall target="checkStatus">
<param
name="status"
value="${cloneResult}" />
<param
name="message"
value="Cloning Failed" />
</antcall>
</sequential>
</macrodef>
<!--
We do modify the source tree during build, to change URLs to local file system,
if building on build.eclipse.org, so need to 'clean' and 'reset' before pull.
For pull we always do a fetch followed by a checkout, in case we change branches
in Hudson job, etc. ... say, to do a "Luna_maintenance_patch".
-->
<macrodef name="git-pull">
<attribute name="dir" />
<attribute name="branch" />
<attribute name="origin" />
<sequential>
<echo message="= = = execute git in @{dir}" />
<echo message="git clean -d -ff -x" />
<exec
executable="git"
failonerror="false"
resultproperty="RCclean"
dir="@{dir}">
<arg line="clean -d -ff -x" />
</exec>
<antcall target="checkStatus">
<param
name="status"
value="${RCclean}" />
<param
name="message"
value="Cleaning Failed" />
</antcall>
<echo message="git reset --hard" />
<exec
executable="git"
failonerror="false"
resultproperty="RCreset"
dir="@{dir}">
<arg line="reset --hard" />
</exec>
<antcall target="checkStatus">
<param
name="status"
value="${RCreset}" />
<param
name="message"
value="Reset Failed" />
</antcall>
<echo message="git fetch @{origin}" />
<exec
executable="git"
failonerror="false"
resultproperty="RCfetch"
dir="@{dir}">
<arg line="fetch @{origin}" />
</exec>
<antcall target="checkStatus">
<param
name="status"
value="${RCfetch}" />
<param
name="message"
value="fetch Failed" />
</antcall>
<echo message="git checkout -B @{branch} --track @{origin}/@{branch}" />
<exec
executable="git"
failonerror="false"
resultproperty="RCcheckout"
dir="@{dir}">
<arg line="checkout -B @{branch} --track @{origin}/@{branch}" />
</exec>
<antcall target="checkStatus">
<param
name="status"
value="${RCcheckout}" />
<param
name="message"
value="Checkout Failed" />
</antcall>
</sequential>
</macrodef>
<!--
This can leave repo in "detached" state, which, shouldn't hurt anything we're doing,
as long as Hudson can check out/clone branch the next time the job runs.
-->
<macrodef name="git-checkout">
<attribute name="dir" />
<attribute name="commit" />
<sequential>
<echo message="execute git checkout @{commit} in @{dir}" />
<exec
executable="git"
failonerror="false"
resultproperty="RCcheckout"
dir="@{dir}">
<arg line="checkout @{commit}" />
</exec>
<antcall target="checkStatus">
<param
name="status"
value="${RCcheckout}" />
<param
name="message"
value="Checkout Failed" />
</antcall>
</sequential>
</macrodef>
<!--
We never really need/use 'clone' when on Hudson.
We do use "pull", to make sure "current", and then
in main task we "checkout" the exact commit we want. This is primarily so that
all tasks (validate, build-with-Cache, and build-Clean, all operate on exact
same input). [Though, still need "exact" input in b3aggrcon files, for that to be completely
valid.]
-->
<target
name="getModelFromGit"
depends="init, cloneRepo, cloneToolsRepo, cloneTestsRepo, pullRepo, pullToolsRepo, pullTestsRepo"
unless="modelRetrived">
<!--
While Hudson normall does clone and 'pull', we "check" here to make sure.
In particular, in some cases, a build might be triggered by a change in "tools"
repo, so even then we want to make sure to get 'latest' of "build" repo.
In both cases, we *then* want to get a specific revision, if passed to us by
a previous job. This is so that the various jobs we have, 'validate',
'build', and 'build_clean' can all work on the same revision.
-->
<git-checkout
dir="${BUILD_MODEL_DIR}"
commit="${commitOrBranch}" />
<echo message="on HUDSON: checkedout ${commitOrBranch} of ${BUILD_MODEL} into ${BUILD_MODEL_DIR}" />
<git-checkout
dir="${BUILD_TOOLS_DIR}"
commit="${toolsCommitOrBranch}" />
<echo message="on HUDSON: checkedout ${toolsCommitOrBranch} of ${BUILD_TOOLS} into ${BUILD_TOOLS_DIR}" />
<property
name="modelRetrived"
value="true" />
</target>
<target
name="cloneRepo"
depends="init"
unless="localRepoExists">
<echo message="git clone task for ${BUILD_MODEL} to execute in ${BUILD_HOME} using branch ${BRANCH_BUILD}" />
<git-clone
repository="git://git.eclipse.org/gitroot/simrel/${BUILD_MODEL}.git"
dir="${BUILD_HOME}"
branch="${BRANCH_BUILD}" />
</target>
<target
name="cloneToolsRepo"
depends="init"
unless="localToolsRepoExists">
<echo message="git clone task for ${BUILD_TOOLS} to execute in ${BUILD_HOME} using branch ${BRANCH_TOOLS}" />
<git-clone
repository="git://git.eclipse.org/gitroot/simrel/${BUILD_TOOLS}.git"
dir="${BUILD_HOME}"
branch="${BRANCH_TOOLS}" />
</target>
<target
name="cloneTestsRepo"
depends="init"
unless="localTestsRepoExists">
<echo message="git clone task for ${BUILD_TESTS} to execute in ${BUILD_HOME} using branch ${BRANCH_TESTS}" />
<git-clone
repository="git://git.eclipse.org/gitroot/simrel/${BUILD_TESTS}.git"
dir="${BUILD_HOME}"
branch="${BRANCH_TESTS}" />
</target>
<target
name="pullRepo"
depends="init"
if="localRepoExists">
<echo message="git pull task to execute in ${BUILD_MODEL_DIR}" />
<!-- in macro "pull", we actually do a fetch, then check out -->
<git-pull
dir="${BUILD_MODEL_DIR}"
branch="${BRANCH_BUILD}"
origin="${BUILD_ORIGIN}" />
</target>
<target
name="pullToolsRepo"
depends="init"
if="localToolsRepoExists">
<echo message="git pull task to execute in ${BUILD_TOOLS_DIR}" />
<git-pull
dir="${BUILD_TOOLS_DIR}"
branch="${BRANCH_TOOLS}"
origin="${TOOLS_ORIGIN}" />
</target>
<target
name="pullTestsRepo"
depends="init"
if="localTestsRepoExists">
<echo message="git pull task to execute in ${BUILD_TESTS_DIR}" />
<git-pull
dir="${BUILD_TESTS_DIR}"
branch="${BRANCH_TESTS}"
origin="${TESTS_ORIGIN}" />
</target>
<!--
This is "the key" task. If it succeeds, we run tests (reports), and
if they "pass", we promote to "staging".
-->
<target
name="runAggregatorCleanBuild"
depends="init,getModelFromGit,rewriteRepositoryURL,installAggregatorAndTools,installTests">
<!--
If not otherwise set in properties file, use these values. Note
the build.eclipse.org production machine must override these values for property
values appropriate for it (namely production.properties).
-->
<!--
We no longer "trust" Eclipse and Equinox repos.
-trustedContributions Eclipse,Equinox
-->
<property
name="AGG_APP_ARGS"
value="${AGGREGATOR_APP_ARGS_CLEAN_BUILD}" />
<!-- Important: on any non-production machines it is important to _not_ use
eclipse.p2.mirrors=false, so this value should be supplied by calling script's
properties. Note, we include '-vmargs' here, in case there are not any. Not
sure if the use of -vmargs _requires_ arguments or not, but probably would.
note: -Declipse.p2.MD5Check=false may be needed as a workaround for bug [253713]
(should not actually be required ... but have left note for historical reference)
note: rememeber that JAVA_6 should not be used for jar processor, see
for example, bug 244603 and bug 279596.
-->
<!-- -Dorg.eclipse.update.jarprocessor.pack200=${JAVA_6_HOME}/jre/bin -Declipse.p2.mirrors=false" -->
<property
name="BUILDER_VM_ARGS"
value="-Xmx1024m -Djava.io.tmpdir=${BUILD_HOME}/tmp" />
<echo message="AGG_APP_ARGS: ${AGG_APP_ARGS}" />
<echo message="BUILDER_VM_ARGS: -vmargs ${BUILDER_VM_ARGS}" />
<exec
executable="${eclipseExecutable}"
dir="${basedir}"
failonerror="false"
resultproperty="buildStatus">
<arg value="-debug" />
<arg value="file://${BUILD_HOME}/${BUILD_TOOLS}/p2options/.options" />
<!--
Adding -consolelog makes for too much, unneeded output, since the aggregator
produces its verbose own output, slightly cleaner.
<arg value="-consolelog" />
-->
<arg value="-nosplash" />
<arg value="-data" />
<arg value="${eclipseWorkspace}" />
<arg value="--launcher.suppressErrors" />
<arg value="-application" />
<arg value="org.eclipse.b3.cli.headless" />
<arg value="aggregate" />
<arg value="--buildId" />
<arg value="${buildTimestamp}" />
<arg line="${AGG_APP_ARGS}" />
<arg value="-vm" />
<arg value="${JAVA_8_HOME}/jre/bin" />
<arg value="-vmargs" />
<arg line="${BUILDER_VM_ARGS}" />
</exec>
<antcall target="checkStatus">
<param
name="status"
value="${buildStatus}" />
<param
name="message"
value="Aggregation Failed" />
</antcall>
<antcall target="createBuildinfo" />
<!--
The tests depend on the symbolic link of "latests" being created,
so we pause a few seconds for NSF to catch up.
-->
<echo message="Waiting 2 seconds..." />
<sleep seconds="2" />
<echo message="Waiting 2 seconds..." />
<sleep seconds="2" />
<echo message="Waiting 2 seconds..." />
<sleep seconds="2" />
<antcall target="runTests" />
</target>
<!-- runTests can be ran as manual job, but then should use custom workspace,
to run against previous build, and acquire the lock, for that job -->
<target name="runTests">
<ant
antfile="${BUILD_HOME}/testInstance/eclipse/dropins/${RELENG_TESTS_BUNDLE_ID}/runTests.xml"
target="cleanBuildTests"
dir="${BUILD_HOME}" />
</target>
<target name="checkStatus">
<echo message="status: ${status}" />
<condition
property="statusOK"
value="true">
<equals
forceString="true"
arg1="${status}"
arg2="0" />
</condition>
<echo message="statusOK: ${statusOK}" />
<antcall target="writeStatus" />
<fail
message="${message}"
unless="statusOK" />
</target>
<target
name="writeStatus"
unless="statusOK">
<echo
message="build failed"
file="${BUILD_HOME}/buildStatusFailed" />
</target>
<!--
Note: many tests would not be valid on "cached" version of repo, but, some might?
Currently no tests are called, but, we might alter, so we make sure installed now,
in anticipation.
-->
<target
name="runAggregatorBuildOnly"
depends="init,getModelFromGit,rewriteRepositoryURL,installAggregatorAndTools, installTests">
<!--
If not otherwise set in properties file, use these values. Note
the build.eclipse.org production machine must override these values for property
values appropriate for it.
-->
<property
name="AGG_APP_ARGS"
value="${AGGREGATOR_APP_ARGS_BUILDONLY}" />
<!--
Important: on any non-production machines it is important to _not_ use
eclipse.p2.mirrors=false, so this value should be supplied by calling script's
properties. Note, we include '-vmargs' here, in case there are not any. Not
sure if the use of -vmargs _requires_ arguments or not, but probably would.
note: -Declipse.p2.MD5Check=false may be needed as a workaround for bug [253713]
(should not be required any longer ... but have left note for historical reference)
note: rememeber that JAVA_6 should not be used for jar processor, see
for example, bug 244603 and bug 279596.
-->
<!-- -Dorg.eclipse.update.jarprocessor.pack200=${JAVA_6_HOME}/jre/bin -Declipse.p2.mirrors=false" -->
<property
name="BUILDER_VM_ARGS"
value="-Xmx1024m -Djava.io.tmpdir=${BUILD_HOME}/tmp" />
<echo message="AGG_APP_ARGS: ${AGG_APP_ARGS}" />
<echo message="BUILDER_VM_ARGS: -vmargs ${BUILDER_VM_ARGS}" />
<exec
executable="${eclipseExecutable}"
dir="${basedir}"
failonerror="false"
resultproperty="buildStatus">
<arg value="-debug" />
<arg value="file://${BUILD_HOME}/${BUILD_TOOLS}/p2options/.options" />
<!--
Adding -consolelog makes for too much, unneeded output, since the aggregator
produces its verbose own output, slightly cleaner.
<arg value="-consolelog" />
-->
<arg value="-nosplash" />
<arg value="-data" />
<arg value="${eclipseWorkspace}" />
<arg value="--launcher.suppressErrors" />
<arg value="-application" />
<arg value="org.eclipse.b3.cli.headless" />
<arg value="aggregate" />
<arg value="--buildId" />
<arg value="${buildTimestamp}" />
<arg line="${AGG_APP_ARGS}" />
<arg value="-vm" />
<arg value="${JAVA_8_HOME}/jre/bin" />
<arg value="-vmargs" />
<arg line="${BUILDER_VM_ARGS}" />
</exec>
<antcall target="checkStatus">
<param
name="status"
value="${buildStatus}" />
<param
name="message"
value="Aggregation Failed" />
</antcall>
<antcall target="createBuildinfo" />
<ant
antfile="${BUILD_HOME}/testInstance/eclipse/dropins/${RELENG_TESTS_BUNDLE_ID}/runTests.xml"
target="cachedBuild"
dir="${BUILD_HOME}" />
</target>
<!--
Note, we currently have no "tests" for the "validate only" case, but we could, might
someday, so we go ahead an install, in anticipation. For example, we might simply
test that all b3aggrcon files specify unique URL (to simple repository) or
that "versions" are specified in *.b3aggrcon file.
-->
<target
name="runAggregatorValidateOnly"
depends="init,getModelFromGit,rewriteRepositoryURL,installAggregatorAndTools, installTests">
<!--
If not otherwise set in properties file, use these values. Note
the build.eclipse.org production machine must override these values for property
values appropriate for it.
-->
<property
name="AGG_APP_ARGS"
value="${AGGREGATOR_APP_ARGS_VALIDATEONLY}" />
<!--
Important: on any non-production machines it is important to _not_ use
eclipse.p2.mirrors=false, so this value should be supplied by calling script's
properties. Note, we include '-vmargs' here, in case there are not any. Not
sure if the use of -vmargs _requires_ arguments or not, but probably would.
note: -Declipse.p2.MD5Check=false may be needed as a workaround for bug [253713]
(should not actually be required ... but have left note for historical reference)
note: rememeber that JAVA_6 should not be used for jar processor, see
for example, bug 244603 and bug 279596.
-->
<!-- -Dorg.eclipse.update.jarprocessor.pack200=${JAVA_6_HOME}/jre/bin -Declipse.p2.mirrors=false" -->
<property
name="BUILDER_VM_ARGS"
value="-Xmx1024m -Djava.io.tmpdir=${BUILD_HOME}/tmp" />
<echo message="AGG_APP_ARGS: ${AGG_APP_ARGS}" />
<echo message="BUILDER_VM_ARGS: -vmargs ${BUILDER_VM_ARGS}" />
<exec
executable="${eclipseExecutable}"
dir="${basedir}"
failonerror="false"
resultproperty="buildStatus">
<arg value="-debug" />
<arg value="file://${BUILD_HOME}/${BUILD_TOOLS}/p2options/.options" />
<!--
Adding -consolelog makes for too much, unneeded output, since the aggregator
produces its verbose own output, slightly cleaner.
<arg value="-consolelog" />
-->
<arg value="-nosplash" />
<arg value="-data" />
<arg value="${eclipseWorkspace}" />
<arg value="--launcher.suppressErrors" />
<arg value="-application" />
<arg value="org.eclipse.b3.cli.headless" />
<arg value="aggregate" />
<arg value="--buildId" />
<arg value="${buildTimestamp}" />
<arg line="${AGG_APP_ARGS}" />
<arg value="-vm" />
<arg value="${JAVA_6_HOME}/jre/bin" />
<arg value="-vmargs" />
<arg line="${BUILDER_VM_ARGS}" />
</exec>
<antcall target="checkStatus">
<param
name="status"
value="${buildStatus}" />
<param
name="message"
value="Aggregation Failed" />
</antcall>
<!-- setting dir to our workspace, so tests done on what "we" have -->
<antcall target="createBuildinfo" />
<ant
antfile="${BUILD_HOME}/testInstance/eclipse/dropins/${RELENG_TESTS_BUNDLE_ID}/runTests.xml"
target="validateOnly"
dir="${BUILD_HOME}" />
</target>
<target
name="init"
depends="getBuildTimestamp, getJobName, getBUILD_HOME"
unless="isInitialized">
<fail
unless="release"
message="release must be specified for this script, such as -Drelease=mars" />
<property environment="env" />
<!--
This property file name is itself a property, so it can be overridden
on one machine versus another. We do it this way, instead of just specifying
-propertyFile on command line, so that the property values can be "nested"
in other property values and evaluated lazily.
-->
<property
name="aggrPropertyFile"
value="aggr.properties" />
<loadproperties srcfile="${aggrPropertyFile}" />
<!--
rewriteRepositoryURLValue is an important variable, passed in through
production.properties. It is the trigger to change http:// values, to
file:// values.
At one point, we needed, unrewriteMapsLine, to know how to "change back" and
now use commonRepositoryDownloadURLValue to know "what to look for" to change
to rewriteRepositoryURLValue, but this should not be needed to be changed,
since we make the strong assumption that, in *.b3aggrcon files, this string
occurs only in repository location attributes. If not true, more complex
parsing/replacement would be required.
-->
<property
name="commonRepositoryDownloadURLValue"
value="http://download.eclipse.org" />
<!--
Often, especially for Huson slaves, it is easiest to set hostForURL "manually" in properties or
on command line, e.g. -DhostForURL=hudson ... but, if not defined yet, we'll fallback to reasonable guess.
Note: not sure this is needed any longer?
-->
<property
name="hostForURL"
value="${HOSTNAME}" />
<condition property="localRepoExists">
<available file="${BUILD_MODEL_DIR}/.git" />
</condition>
<condition property="localToolsRepoExists">
<available file="${BUILD_TOOLS_DIR}/.git" />
</condition>
<condition property="localTestsRepoExists">
<available file="${BUILD_TESTS_DIR}/.git" />
</condition>
<condition
property="commitOrBranch"
value="${commit}"
else="${BRANCH_BUILD}">
<isset property="commit" />
</condition>
<condition
property="toolsCommitOrBranch"
value="${toolsCommit}"
else="${BRANCH_TOOLS}">
<isset property="toolsCommit" />
</condition>
<condition
property="testsCommitOrBranch"
value="${testsCommit}"
else="${BRANCH_TESTS}">
<isset property="testsCommit" />
</condition>
<condition
property="logURL"
value="${LOG_URL}"
else="${hostForURL}">
<isset property="LOG_URL" />
</condition>
<property
name="eclipseWorkspace"
value="${BUILD_HOME}/eclipseworkingspace" />
<!--
If the eclipse workspace exists, remove it, to make sure we are starting "fresh". Eclipse will create it. Be sure some "archive
artifacts" job saves it away, if desired, just for it's ".log", if nothing else.
-->
<delete
dir="${eclipseWorkspace}"
quiet="true" />
<property
name="javaIOTmpdir"
value="${BUILD_HOME}/tmp" />
<mkdir dir="${javaIOTmpdir}" />
<!--
In case java.io.tmpdir is "passed in", technically, it is BUILDER_VM_ARGS
that is passed in from aggr.properties. So, make sure this value matches
the properties.
-->
<property
name="eclipseExecutable"
value="${ECLIPSE_EXE}" />
<available
file="${ECLIPSE_HOME}/eclipse"
type="dir"
property="eclipseExists" />
<!--
set installEclipseAndTools on command line to force a reinstall,
is only done if not installed yet.
-->
<condition property="installEclipseAndTools">
<not>
<isset property="eclipseExists" />
</not>
</condition>
<!--
saveAndInstallEclipseAndTools should only be true if "installEclipseAndTools" are
set on command line properties (and a version already exists).
-->
<condition property="saveAndInstallEclipseAndTools">
<and>
<isset property="eclipseExists" />
<isset property="installEclipseAndTools" />
</and>
</condition>
<available
file="${ECLIPSE_HOME_TEST}/eclipse/dropins/${RELENG_TESTS_DIR}"
type="dir"
property="eclipseTestsExists" />
<!--
set installEclipseTests on command line to force a reinstall,
else is done only if not installed yet.
-->
<condition property="installEclipseTests">
<not>
<isset property="eclipseTestsExists" />
</not>
</condition>
<!--
saveAndInstallEclipseTests should only be true if "installEclipseTests" are
set on command line properties (and a version already exists).
-->
<condition property="saveAndInstallEclipseTests">
<and>
<isset property="eclipseTestsExists" />
<isset property="installEclipseTests" />
</and>
</condition>
<echo message="= = = Properties in init = = = " />
<echo message="commit: ${commit}" />
<echo message="toolsCommit: ${toolsCommit}" />
<echo message="testsCommit: ${testsCommit}" />
<echo message="aggrPropertyFile: ${aggrPropertyFile}" />
<echo message="buildId: ${buildTimestamp}" />
<echo message="user.dir: ${user.dir}" />
<echo message="user.home: ${user.home}" />
<echo message="BUILD_HOME (HUDSON workspace): ${BUILD_HOME}" />
<echo message="Eclipse WORKSPACE: ${eclipseWorkspace}" />
<echo message="PATH: ${env.PATH}" />
<echo message="JAVA_HOME: ${JAVA_HOME}" />
<echo message="hostForURL: ${hostForURL}" />
<echo message="JOB_NAME: ${env.JOB_NAME}" />
<echo message="BUILD_NUMBER: ${env.BUILD_NUMBER}" />
<echo message="logURL: ${logURL}" />
<echo message="ECLIPSE_EXE: ${ECLIPSE_EXE}" />
<echo message="eclipseExists: ${eclipseExists}" />
<echo message="eclipseTestsExists: ${eclipseTestsExists}" />
<echo message="BUILDER_VM_ARGS: ${BUILDER_VM_ARGS}" />
<echo message="javaIOTmpdir: ${javaIOTmpdir}" />
<echo message=" = = = = = = = = = = = = " />
<echoproperties />
<!--
remove "build failed" status file, if there is one from previous run.
-->
<delete
failonerror="false"
quiet="true">
<fileset dir="${BUILD_HOME}">
<include name="buildStatusFailed" />
</fileset>
</delete>
<!--
no need to initialize twice
-->
<property
name="isInitialized"
value="true" />
</target>
<target
name="getBuildTimestamp"
depends="getHudsonTimestamp"
unless="buildTimestamp">
<tstamp>
<format
property="buildTimestamp"
pattern="yyyy-MM-dd_HH-mm-ss"
timezone="UTC_TIME" />
</tstamp>
<echo message="Using ant computed timestamp. Why?" />
</target>
<target
name="getHudsonTimestamp"
unless="buildTimestamp"
if="env.BUILD_ID">
<property
name="buildTimestamp"
value="${env.BUILD_ID}" />
<echo message="Using timestamp from Hudson Build ID: ${buildTimestamp}" />
</target>
<target
name="getJobName"
depends="getHudsonJobName"
unless="jobName">
<property
name="jobName"
value="localbuild" />
<echo message="Using default jobName: localbuild. Why?" />
</target>
<target
name="getHudsonJobName"
unless="jobName"
if="env.JOB_NAME">
<property
name="jobName"
value="${env.JOB_NAME}" />
<echo message="Using jobName from Hudson Builder: ${jobName}" />
</target>
<target
name="getBUILD_HOME"
depends="getJobName, getHudsonBUILD_HOME"
unless="BUILD_HOME">
<property
name="BUILD_HOME"
value="${basedir}" />
<echo message="Setting BUILD_HOME as basedir: ${BUILD_HOME}" />
</target>
<target
name="getHudsonBUILD_HOME"
depends="getWorkspace"
unless="BUILD_HOME">
<property
name="BUILD_HOME"
value="${env.WORKSPACE}" />
<echo message="Setting BUILD_HOME from Hudson Builder WORKSPACE: ${BUILD_HOME}" />
</target>
<target
name="getWorkspace"
unless="BUILD_HOME">
<property
name="BUILD_HOME"
value="${WORKSPACE}" />
<echo message="Setting BUILD_HOME from direct property of Hudson Builder WORKSPACE: ${BUILD_HOME}" />
</target>
<target
name="savePrevious"
depends="init"
if="saveAndInstallEclipseAndTools"
unless="previousSaved">
<!--
Remember, old, saved versions may have to be maually cleaned up,
from time to time. But probably handled well enough by an occasional,
manual "clean workspace" from Hudson's web interface.
-->
<move
verbose="true"
todir="${ECLIPSE_HOME}/eclipse${buildTimestamp}">
<fileset dir="${ECLIPSE_HOME}/eclipse" />
</move>
<property
name="previousSaved"
value="true" />
</target>
<target
name="savePreviousTest"
depends="init"
if="saveAndInstallEclipseTests">
<!-- remember, old ones have to be maually cleaned up, from time to time -->
<fail unless="buildTimestamp" />
<move todir="${ECLIPSE_HOME_TEST}/eclipse${buildTimestamp}">
<fileset dir="${ECLIPSE_HOME_TEST}/eclipse" />
</move>
</target>
<!-- Only rewrite, if a value has been provided -->
<!-- TODO: should make the "exclude" part automatic based on presence/abscense of "useTrusted" property -->
<target
name="rewriteRepositoryURL"
if="rewriteRepositoryURLValue">
<replace
dir="${BUILD_MODEL_DIR}"
token="${commonRepositoryDownloadURLValue}"
value="${rewriteRepositoryURLValue}">
<include name="*.b3aggrcon" />
<!--
<exclude name="ep.b3aggrcon"/>
<exclude name="equinox.b3aggrcon"/>
-->
</replace>
<echo message="Rewrote repository location URLs ..." />
<echo message=" From: ${commonRepositoryDownloadURLValue}" />
<echo message=" To: ${rewriteRepositoryURLValue}" />
<echo message=" Excluding no files since no composite artifacts, just agregate" />
<!--
<echo message=" Excluding: ep.b3aggrcon"/>
<echo message=" Excluding: ep.b3aggrcon, equinox.b3aggrcon"/>
-->
</target>
<target name="checkAvailableDirs">
<available
file="${BUILD_MODEL_DIR}"
property="buildModelAvailable" />
<available
file="${BUILD_TOOLS_DIR}"
property="toolsAvailable" />
<available
file="${BUILD_TESTS_DIR}"
property="testsAvailable" />
</target>
<target
name="createBuildinfo"
depends="checkAvailableDirs, gitRevParseModel, gitRevParseTools, gitRevParseTests">
<property
name="BUILD_INFO_DIR"
value="${AGGREGATOR_RESULTS}/final/buildInfo" />
<mkdir dir="${BUILD_INFO_DIR}" />
<propertyfile file="${BUILD_INFO_DIR}/buildInfo.properties">
<entry
key="commit"
value="${buildModelCommit}" />
<entry
key="toolsCommit"
value="${toolsRepoCommit}" />
<entry
key="testsCommit"
value="${testsRepoCommit}" />
<entry
key="triggerJobName"
value="${env.JOB_NAME}" />
<entry
key="triggerJobNumber"
value="${env.BUILD_NUMBER}" />
<entry
key="triggerBuildTimestamp"
value="${buildTimestamp}" />
<entry
key="triggerBuildId"
value="${buildTimestamp}" />
</propertyfile>
<!-- echo the three key ones to end of log, just to have redundant record. -->
<echo message="commit: ${buildModelCommit}" />
<echo message="toolsCommit: ${toolsRepoCommit}" />
<echo message="testsCommit: ${testsRepoCommit}" />
<echo message="triggerJobName: ${env.JOB_NAME}" />
<echo message="triggerJobNumber: ${env.BUILD_NUMBER}" />
<echo message="triggerBuildTimestamp: ${buildTimestamp}" />
<echo message="triggerBuildId: ${buildTimestamp}" />
<!-- just as well write out everything ... just in case something else needed in future. -->
<echoproperties destfile="${BUILD_INFO_DIR}/allInfo.properties" />
</target>
<target
name="gitRevParseModel"
if="buildModelAvailable">
<git-rev-parse
repodir="${BUILD_MODEL_DIR}"
returnproperty="buildModelCommit" />
<echo message="In target, buildModelCommit: ${buildModelCommit}" />
</target>
<target
name="gitRevParseTools"
if="toolsAvailable">
<git-rev-parse
repodir="${BUILD_TOOLS_DIR}"
returnproperty="toolsRepoCommit" />
<echo message="In target, toolsRepoCommit: ${toolsRepoCommit}" />
</target>
<target
name="gitRevParseTests"
if="testsAvailable">
<git-rev-parse
repodir="${BUILD_TESTS_DIR}"
returnproperty="testsRepoCommit" />
<echo message="In target, testsRepoCommit: ${testsRepoCommit}" />
</target>
<!--
No longer used ... we will rely on cleaning all of Hudson workspace manually,
from time to time, from Hudson't web interface.
But otherwise, rely on "BUILD_CLEAN" in aggregator to get a clean aggregation.
-->
<target
name="cleanPreviousAggregations"
unless="nocleanAggregations">
<!-- we will clean the aggregation directory ourselves, as work around for bug 354321
https://bugs.eclipse.org/bugs/show_bug.cgi?id=354321
The bug has been fixed ... but ... we'll leave as is. Perhaps gives more
flexibility?
-->
<echo message="Removing any previous aggregation results, from ${AGGREGATOR_RESULTS}" />
<delete
dir="${AGGREGATOR_RESULTS}"
failonerror="false" />
<mkdir dir="${AGGREGATOR_RESULTS}" />
</target>
<target name="default">
<echo message="There is no default target for this build file" />
</target>
</project>