-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgetEBuilder.xml
119 lines (96 loc) · 3.73 KB
/
getEBuilder.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?xml version="1.0" encoding="UTF-8"?>
<!--
A utility ant script get the eclipse builder from Git.
Hudson jobs can call this script from ant as one of it first build steps.
Such as, start with a wget fetch from CGit (where following $dash; is literally a '-',
it is escaped here just for XML rules against two dashes in a comment);
curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/testScripts/bootstrap/getEBuilder.xml
Then use ant to invoke the functionality. Example:
ant -f getEBuilder.xml
-->
<project
name="getEBuilder"
default="getEBuilder"
basedir=".">
<target
name="init"
unless="getEBuilderInitialized">
<!-- assign defaults if not on hudson, for local testing if nothing else -->
<property environment="env" />
<condition
property="WORKSPACE"
value="${env.WORKSPACE}"
else="${basedir}">
<isset property="env.WORKSPACE" />
</condition>
<!-- Can be provided by caller to use another branch, e.g. for testing changes -->
<condition
property="gitHost"
value="${env.GIT_HOST}"
else="https://github.com/eclipse-platform">
<isset property="env.GIT_HOST" />
</condition>
<property
name="testConfigurationBranch"
value="${buildId}"/>
<property
name="projectName"
value="eclipse.platform.releng.aggregator" />
<property
name="eScriptLocation"
value="${projectName}/production/testScripts" />
<echo message="=== Properties in 'getEBuilder.xml'" />
<echo message=" WORKSPACE: ${WORKSPACE}" />
<echo message=" projectName: ${projectName}" />
<echo message=" eScriptLocation: ${eScriptLocation}" />
<echo message=" test-configuration source git branch: ${testConfigurationBranch}" />
<property
name="getEBuilderInitialized"
value="true" />
</target>
<target
name="getEBuilder"
depends="init">
<!-- remove old one, if there, and make sure directory exists for
eventual checkout/copy/globmapper
-->
<delete dir="${WORKSPACE}/${projectName}" />
<mkdir dir="${WORKSPACE}/${projectName}" />
<antcall target="fetchEBuilderFromGit" />
<antcall target="readEclipseStream"/>
<property file="${WORKSPACE}/${projectName}/stream.properties"/>
<echo message="eclipseStream: ${eclipseStream}" />
<ant antfile="${WORKSPACE}/${eScriptLocation}/runTests2.xml" />
</target>
<target
name="fetchEBuilderFromGit"
depends="init">
<echo message="Fetching EBuilder from Git" />
<!--Create a partial and shallow clone and sprase-checkout only the 'production' sub-folder -->
<exec executable="git"
dir="${WORKSPACE}" failonerror="true">
<arg line="clone --depth=1 --filter=tree:0 --no-checkout"/>
<arg value="--branch=${testConfigurationBranch}"/>
<arg value="${gitHost}/${projectName}.git"/>
</exec>
<exec executable="git"
dir="${WORKSPACE}/${projectName}" failonerror="true">
<arg line="sparse-checkout set --no-cone production/ eclipse-platform-parent/"/>
</exec>
<exec executable="git"
dir="${WORKSPACE}/${projectName}" failonerror="true">
<arg line="checkout"/>
</exec>
</target>
<target name="readEclipseStream"
unless="eclipseStream">
<xmlproperty
file="${WORKSPACE}/${projectName}/eclipse-platform-parent/pom.xml"
prefix="eclipse-parent"/>
<!-- This target is called with a separate project and writes the stream property to a file,
which is read by the caller to not propagate back all properties read from the pom.xml.-->
<echo
message="eclipseStream=${eclipse-parent.project.properties.releaseVersion}.0"
file="${WORKSPACE}/${projectName}/stream.properties"/>
</target>
</project>