blob: 589c1eb7f4bd2bd66de30cfced7d12270ca2b0f8 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
A utility ant script get the base builder from Git (or CVS).
Hudson jobs (or builds) can call this script from generic ant
as one of it first build steps to get the eclipse antRunner, for example.
-->
<project
name="getBaseBuilder"
default="getBaseBuilder"
basedir=".">
<target
name="init"
unless="getBaseBuilderInitialized">
<property environment="env" />
<condition
property="TMP"
value="${env.TMP_DIR}">
<isset property="env.TMP_DIR" />
</condition>
<condition
property="TMP"
value="${TMP_DIR}">
<isset property="TMP_DIR" />
</condition>
<condition
property="TMP"
value="${env.BUILD_ROOT}/tmp">
<isset property="${env.BUILD_ROOT}" />
</condition>
<condition
property="TMP"
value="${BUILD_ROOT}/tmp">
<isset property="${BUILD_ROOT}" />
</condition>
<property
name="TMP"
value="/shared/eclipse/tmp" />
<fail
unless="TMP"
message="TMP not defined, since TMP_DIR nor BUILD_ROOT was defined" />
<echo message="TMP: ${TMP}" />
<condition
property="basedownloadHost"
value="${env.BASE_DOWNLOAD_HOST}"
else="download.eclipse.org">
<isset property="env.BASE_DOWNLOAD_HOST" />
</condition>
<!--
TODO: need make platform independent, as in test.xml, to compute right one.
(and, pass in?)
(and make "version" variable)
-->
<!-- example of typical value, when "directory" and "label" are different
<property name="eclipseBaseDir" value="S-4.6M3-201510291100"/>
<property name="eclispeBaseLabel" value="4.6M3"/>
-->
<!-- for I or M build (which is the unusual case) the build directory and label are the same -->
<property name="eclipseBaseDir" value="I20160425-1300"/>
<property name="eclispeBaseLabel" value="I20160425-1300"/>
<property
name="platformURL"
value="http://${basedownloadHost}/eclipse/downloads/drops4/${eclipseBaseDir}" />
<!--
We used to use binary platform, since smaller, but moved to SDK, to be able to use API Tools.
But then moved back to Platform, after having some cases where we need to pick up new fixes from
API tools while continuting to use older "base" for stability.
-->
<property
name="platformFile"
value="eclipse-platform-${eclispeBaseLabel}-linux-gtk-x86_64.tar.gz" />
<!--
mavenproperties.properties is produced during the build and contains
significant variables (and values) that control the build. In this context,
'eclipserun-repo' is the one we want, so we only have to set it one place.
In "post-build" work, WORKSPACE is passed in as the "drop directory" on
the build machine, which is where the properties are written.
-->
<property file="${WORKSPACE}/mavenproperties.properties"/>
<echo message="eclipserun-repo: ${eclipserun-repo}" />
<!--
just in case mavenproperties.properties did not exist, we also
set a default value here. And, for now, at least, we have some
special logic to provide clear message "it was not set". We can
remove that, or change to a "fail" if we find it is always set
as expected in the ways we use it. (such as, may not exist yet,
if this is called too early?)
-->
<condition property="eclipserun-repo-is-set" value="${eclipserun-repo}" else="not set">
<isset property="eclipserun-repo" />
</condition>
<echo message="DEBUG: Before setting default, eclisperun-repo was found to be ${eclipserun-repo-is-set}" />
<!-- the following setting is just to make sure "its right" on the next run. Eventually, we'll change this
to a "<fail" element, once confident all paths lead to a correct value -->
<property
name="eclipserun-repo"
value="http://download.eclipse.org/eclipse/updates/4.6-I-builds/I20160425-1300/" />
<echo message="eclipserun-repo: ${eclipserun-repo}" />
<property
name="apiTools.repository"
value="${eclipserun-repo}" />
<property
name="apiTools.iu"
value="org.eclipse.pde.api.tools" />
<!-- since we specify specific repo for api tools, we can leave version to "highest" -->
<property
name="apiTools.iu.version"
value="" />
<property
name="buildTools.repository"
value="http://build.eclipse.org/eclipse/buildtools/" />
<property
name="buildTools.feature"
value="org.eclipse.releng.build.tools.feature.feature.group" />
<!-- Here, even though not specific repo, we always want the "latest". But, if that ever changes,
we can specify a concrete version here.
-->
<property
name="buildTools.feature.version"
value="" />
<property
name="webtools.repository"
value="http://download.eclipse.org/webtools/releng/repository/" />
<property
name="webtools.feature"
value="org.eclipse.wtp.releng.tools.feature.feature.group" />
<property
name="webtools.feature.version"
value="1.2.0.v201102200505-21-7w312213311616" />
<!-- assign default WORKSPACE if not on Hudson, for local testing if nothing else -->
<property
name="WORKSPACE"
value="${basedir}" />
<echo message="WORKSPACE: ${WORKSPACE}" />
<!--
The desired folder name (made to stay consistent with cvs module name,
even though Git project is named eclipse.platform.releng.basebuilder.
And, *this* script does not even need to git the Git project!
-->
<property
name="folderName"
value="org.eclipse.releng.basebuilder" />
<property name="java8vmbindir" value="/shared/common/jdk1.8.0_x64-latest/bin/" />
<property
name="getBaseBuilderInitialized"
value="true" />
</target>
<target
name="getBaseBuilder"
depends="init">
<!-- remove old one, if there, and make sure one exists for eventual checkout/copy/globmapper -->
<delete dir="${WORKSPACE}/${folderName}" />
<mkdir dir="${WORKSPACE}/${folderName}" />
<antcall target="fetchBasePlatform" />
</target>
<target
name="fetchBasePlatform"
depends="init"
if="platformURL">
<get
dest="${TMP}/${platformFile}"
src="${platformURL}/${platformFile}"
usetimestamp="true" />
<untar
compression="gzip"
src="${TMP}/${platformFile}"
dest="${TMP}">
</untar>
<!-- untar is broken in Ant 1.9.4. See https://bz.apache.org/bugzilla/show_bug.cgi?id=56641
<exec
executable="/bin/tar"
dir="${TMP}">
<arg value="-xf" />
<arg value="${TMP}/${platformFile}" />
</exec>
-->
<chmod perm="ugo+x">
<fileset dir="${TMP}/eclipse">
<include name="eclipse" />
<include name="*.so*" />
</fileset>
</chmod>
<exec
dir="${TMP}/eclipse"
failonerror="true"
executable="${TMP}/eclipse/eclipse">
<arg value="-nosplash" />
<arg value="-debug" />
<arg value="-consolelog" />
<arg value="-data" />
<arg value="${WORKSPACE}/workspace-toolsinstall" />
<arg value="-application" />
<arg value="org.eclipse.equinox.p2.director" />
<arg value="-repository" />
<arg value="${eclipserun-repo},${buildTools.repository},${webtools.repository}" />
<arg value="-installIU" />
<arg
value="${apiTools.iu}/${apiTools.iu.version},${buildTools.feature}/${buildTools.feature.version},${webtools.feature}/${webtools.feature.version}" />
<arg value="-vm" />
<arg value="${java8vmbindir}" />
<!-- vmargs must come last -->
<arg value="-vmargs" />
<arg value="-Djava.io.tmpdir=${TMP}" />
</exec>
<!-- we "move" so the directory structure so it flat under basebuilder ...
for compatibility to older code/scripts -->
<move todir="${WORKSPACE}/${folderName}">
<fileset dir="${TMP}/eclipse/">
</fileset>
</move>
<echo
message="platform and tools installed, platformURL: ${platformURL} platform: ${platformFile}, fetched using tychoeclipsebuilder/getBaseBuilderAndTools.xml" />
</target>
</project>