| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Copyright (c) 2018 IBM Corporation and others. |
| |
| This program and the accompanying materials |
| are made available under the terms of the Eclipse Public License 2.0 |
| which accompanies this distribution, and is available at |
| https://www.eclipse.org/legal/epl-2.0/ |
| |
| SPDX-License-Identifier: EPL-2.0 |
| |
| Contributors: |
| David Williams - initial API and implementation |
| --> |
| |
| <!-- |
| A utility ant script which gets the Eclipse Platform binary from 'archive' server then uses it to |
| install additional tools and utilities from several p2 repositories: from 'downloads', the 'build' machine, |
| and one that is on an 'external' site, to actually test that proxies work. (The external one is a "real" project, |
| so this script should not be ran so often to "stress" that site, or throw off their download statistics.) |
| |
| Hudson jobs (or builds) can call a script like this one from generic ant |
| as one of it first build steps to get the eclipse tools or applications, such as antRunner. |
| --> |
| <project |
| name="getBaseBuilder" |
| default="getBaseBuilder" |
| basedir="."> |
| |
| <target |
| name="init" |
| unless="getBaseBuilderInitialized"> |
| |
| <property environment="env" /> |
| |
| <!-- this property file is optional. It's primarily used to set |
| the "proxy setting preferences" for Eclpse. --> |
| <property file="platformSpecific.properties" /> |
| |
| <!-- jvm usually set in the platformSpecific.properties file, but if not, we |
| will force one possibly valid value. --> |
| <property |
| name="jvm" |
| value="/shared/common/jdk1.8.0_x64-latest/bin" /> |
| |
| |
| <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="${basedir}/tmp" /> |
| |
| <fail |
| unless="TMP" |
| message="TMP not defined, since TMP_DIR nor BUILD_ROOT was defined" /> |
| <echo message="TMP: ${TMP}" /> |
| |
| <mkdir dir="${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.10M3-201710291100"/> |
| <property name="eclispeBaseLabel" value="4.10M3"/> |
| --> |
| <!-- for I or M build (which is the unusual case) the build directory and label are the same --> |
| <property |
| name="eclipseBaseDir" |
| value="S-4.10M1-201810101800" /> |
| <property |
| name="eclispeBaseLabel" |
| value="4.10M1" /> |
| |
| <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 we have a reasonable "fallback" value, such as when |
| using this script on Hudson to do "clean up" of repositories. Should change it to "well known" version, |
| such as updates/4.9/ once it is ready. |
| --> |
| <property |
| name="eclipserun-repo" |
| value="http://download.eclipse.org/eclipse/updates/4.10-I-builds/" /> |
| <echo message="eclipserun-repo: ${eclipserun-repo}" /> |
| |
| <property |
| name="ide.repository" |
| value="${eclipserun-repo}" /> |
| <property |
| name="ide.iu" |
| value="org.eclipse.platform.ide" /> |
| |
| <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="file:///shared/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="buildTools.derby.feature" |
| value="org.apache.derby.core.feature.feature.group" /> |
| <property |
| name="buildTools.derby.feature.version" |
| value="" /> |
| |
| <property |
| name="webtools.repository" |
| value="http://download.eclipse.org/webtools/downloads/drops/R3.10.0/S-3.10.0.RC4-20180611164516/repositoryunittests" /> |
| <property |
| name="webtools.feature" |
| value="org.eclipse.wtp.releng.tools.feature.feature.group" /> |
| <property |
| name="webtools.feature.version" |
| value="1.2.0.v201405010053" /> |
| |
| <!-- |
| This repo ONLY used for testing proxies. Not production runs. |
| Have included this "external" site, just to give a true |
| test of the proxies themselves. I got this site from "marketplace" |
| and because this is a "real" project for someone, we should not |
| overuse the "test" aspect, or will throw off their numbers. |
| If it is ever desired to "run this test" ever day, or similar, |
| then a better "test site" should be found or created. --> |
| <property |
| name="external.repository" |
| value=" http://fabrizioiannetti.github.io/p2/" /> |
| <property |
| name="external.feature" |
| value="com.github.fabeclipse.textedgrep_feature.feature.group" /> |
| <property |
| name="external.feature.version" |
| value="" /> |
| |
| <!-- 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 is broken in Ant 1.9.4. See https://bz.apache.org/bugzilla/show_bug.cgi?id=56641 --> |
| <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> |
| |
| <antcall target="installSettings" /> |
| |
| <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="${ide.iu},${apiTools.iu}/${apiTools.iu.version},${buildTools.feature}/${buildTools.feature.version},${webtools.feature}/${webtools.feature.version},${buildTools.derby.feature}/${buildTools.derby.feature.version}" /> |
| <arg value="-destination" /> |
| <arg value="${WORKSPACE}/${folderName}" /> |
| <arg value="-profile" /> |
| <arg value="SDKProfile" /> |
| <arg value="-vm" /> |
| <arg value="${java8vmbindir}" /> |
| <!-- vmargs must come last --> |
| <arg value="-vmargs" /> |
| <arg value="-Djava.io.tmpdir=${TMP}" /> |
| </exec> |
| |
| <!-- we generate basebuilder directly in the destination folder. no need of this |
| so the directory structure so it flat under basebuilder ... |
| for compatibility to very old code/scripts |
| <move todir="${WORKSPACE}/${folderName}"> |
| <fileset dir="${TMP}/eclipse/" /> |
| </move> |
| --> |
| |
| <delete dir="${TMP}/eclipse" /> |
| |
| <echo |
| message="platform and tools installed. platformURL: ${platformURL} platform: ${platformFile}, fetched using tychoeclipsebuilder/getBaseBuilderAndTools.xml" /> |
| <echo message="The following were the properties in effect:" /> |
| <echoproperties /> |
| </target> |
| <target |
| name="installSettings" |
| if="org.eclipse.core.net.prefs"> |
| <property |
| name="settingsDir" |
| value="org.eclipse.releng.basebuilder/configuration/.settings" /> |
| |
| <mkdir dir="${settingsDir}" /> |
| <echo |
| message="${org.eclipse.core.net.prefs}" |
| file="${settingsDir}/org.eclipse.core.net.prefs" /> |
| </target> |
| |
| </project> |