Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: cfdc4d65f254a7db7b6b1602ec07890be8272f47 (plain) (blame)
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright (c) 2016 IBM Corporation and others.
    All rights reserved. This program and the accompanying materials
    are made available under the terms of the Eclipse Public License v1.0
    which accompanies this distribution, and is available at
    http://www.eclipse.org/legal/epl-v10.html
   
    Contributors:
        David Williams - initial API and implementation
 -->

<project
  name="Publish Build"
  default="default">

  <!-- Properties that must be passed to this script:
    buildDirectory: Path to perform the build in. (A working directory)
    buildType: Type of build (nightly, integration etc.)
    buildId: Build name
    buildLabel: <buildType>-<buildName>-<timestamp>
  -->
  <fail
    if="result"
    message="the value result was passed in as publish.xml started. As if someone was overriding buildDirectory?" />
  <fail
    if="dropDirectory"
    message="the value dropDirectory was passed in as publish.xml started. But we expect to compute it." />

  <fail
    unless="buildDirectory"
    message="buildDirectory must be defined for publish.xml " />

  <fail
    unless="buildLabel"
    message="buildLabel must be defined for publish.xml" />
  <!-- this is the "top" of the drop directory
    It is used internal to this script to define
    the "real" dropDirecotry. Sometimes equal to this root,
    but for tests, will be one level lower, such as testResult (for unit tests),
    performance (for main stream performance tests).
  -->
  <property
    name="dropDirectoryName"
    value="${postingDirectory}/${buildLabel}" />

  <condition property="notRedundantDir">
    <not>
      <equals
        arg1="${buildDirectory}"
        arg2="${dropDirectoryName}" />
    </not>
  </condition>

  <echo message="== buildDirectory: ${line.separator}==${buildDirectory}" />
  <echo message="== dropDirectoryName: ${line.separator}==${dropDirectoryName}" />

  <fail
    if="notRedundantDir"
    message="buildDirectory and dropDirectoryName are surpisingly NOT equal. Caller has passed in wrong value." />

  <target name="default">
    <antcall target="getStaticFiles" />
    <antcall target="generateIndex" />
  </target>

  <target name="generateIndex">

    <property
      name="class"
      value="org.eclipse.releng.generators.TestResultsGenerator" />
    <taskdef
      name="indexResults"
      classname="${class}" />

    <!--
      isBuildTested: true|false should JUnit plugin test results be used to generate index page
      dropTokenList: comma separated list of strings which should be replaced by the fileName attribute settings in the testManifest.xml.
      xmlDirectoryName: path to directory containing JUnit plugin test results in xml format (see doc is org.eclipse.test).
      dropDirectoryName: path to directory containing the result of the build.
      testResultsHtmlFileName: name of file which will be generated with links to JUnit test results
      dropHtmlFileName: name of generated index page
      hrefTestResultsTargetPath: relative path from index page to parent directory containing JUnit html and xml test results
      for example,
      if html is in
      .../testResults/html/...
      and xml is in
      .../testResults/xml/...
      then hrefTestResultsTargetPath would be set to testResults
      if, that is, the "testResults.php" page is a peer of the 'testResults'
      directory. If testResults.php page is under testResults directory,
      then the value would be ".".
      hrefCompileLogsTargetPath: relative path from index page directory containing compilelogs
      testManifestFileName: name of xml file containing descriptions of zip types and log files

    -->

    <!-- This list is for Eclipse. Equinox overrides and provides their own list -->
    <property
      name="dropTokenList"
      value="%sdk%,%tests%,%example%,%rcpruntime%,%rcpsdk%,%runtime%,%jdt%,%jdtsdk%,%jdtc%,%pde%,%pdesdk%,%cvs%,%cvssdk%,%swt%,%relengtools%" />

    <!-- xml results directory -->
    <condition
      property="xmlDirectoryName"
      value="${buildDirectory}/performance/xml">
      <contains
        string="${job}"
        substring="-perf-" />
    </condition>
    <!-- else standard default for unit tests -->
    <property
      name="xmlDirectoryName"
      value="${buildDirectory}/testresults/xml" />

    <condition
      property="indexFileName"
      value="performance/performance.php">
      <contains
        string="${job}"
        substring="-perf-" />
    </condition>
    <condition
      property="indexFileName"
      value="testResults.php">
      <contains
        string="${job}"
        substring="-unit-" />
    </condition>
    <!-- else standard default for download page -->
    <property
      name="indexFileName"
      value="index.php" />

    <condition
      property="dropTemplateFileName"
      value="${basedir}/templateFiles/performance.php">
      <contains
        string="${job}"
        substring="-perf-" />
    </condition>
    <condition
      property="dropTemplateFileName"
      value="${basedir}/staticDropFiles/testResults.php">
      <contains
        string="${job}"
        substring="-unit-" />
    </condition>
    <!-- else standard default for download index.php page -->
    <property
      name="dropTemplateFileName"
      value="${basedir}/templateFiles/index.template.php" />

    <condition
      property="manifestFile"
      value="${basedir}/performanceTestManifest.xml"
      else="${basedir}/testManifest.xml">
      <contains
        string="${job}"
        substring="-perf-" />
    </condition>

    <condition
      property="expectedConfigFilename"
      value="perfLRTestConfigs.php">
      <contains
        string="${job}"
        substring="LR-perf-" />
    </condition>
    <condition
      property="expectedConfigFilename"
      value="perfTestConfigs.php">
      <contains
        string="${job}"
        substring="-perf-" />
    </condition>
    <property 
      name="expectedConfigFilename" 
      value="testConfigs.php"/>

    <condition
      property="foundConfigFilename"
      value="perfTestConfigsFound.php"
      else="testConfigsFound.php">
      <contains
        string="${job}"
        substring="-perf-" />
    </condition>

    <condition
      property="testResultsHtmlFileName"
      value="performanceLRResultsTable.html">
      <contains
        string="${job}"
        substring="LR-perf-" />
    </condition>
    <condition
      property="testResultsHtmlFileName"
      value="performanceResultsTable.html">
      <contains
        string="${job}"
        substring="-perf-" />
    </condition>
    <property
      name="testResultsHtmlFileName"
      value="testResultsTables.html" />

    <condition
      property="hrefTestResultsTargetPath"
      value=".">
      <contains
        string="${job}"
        substring="-perf-" />
    </condition>
    <property
      name="hrefTestResultsTargetPath"
      value="testresults" />

    <!-- we should be able to do this now, and refine list in manifest. -->
    <property
      name="doMissingListValue"
      value="true" />

    <!-- it is surprising these are defined here? -->
    <property
      name="hrefCompileLogsTargetPath"
      value="compilelogs/plugins/" />
    <property
      name="compileLogsDirectoryName"
      value="${buildDirectory}/${hrefCompileLogsTargetPath}" />

    <property
      name="testManifestFileName"
      value="${manifestFile}" />
    <property
      name="perfManifestFileName"
      value="performanceTestManifest.xml" />
    <property
      name="perfLRManifestFileName"
      value="performanceLRTestManifest.xml" />

    <!-- test configs: follows pattern of [job]_[OSGiTriplet]_[VM]
      the underscores are significant. When we "select files" to group,
      in a column, part of the selection is based on plugin unit test result files that *end with*:
      '_' + [job]_[OSGiTriplet]_[VM] + ".xml" where what comes before the '_' is the plugin name.
      Then later, for display, we break [job]_[OSGiTriplet]_[VM] at the first and last underscores.
      (There can be other underscores besides "first and last", such as in 'x86_64'.
      In other words, the "expected config" must match exactly what the unit tests produce as
      the end of the filename. (Not sure of impact of "LR" on our
      heuristics.)
    -->
    <fail unless="eclipseStreamMajor" message="This publish.xml script needs eclipseStreamMajor and eclipseStreamMinor" />
    <fail unless="eclipseStreamMinor" message="This publish.xml script needs eclipseStreamMajor and eclipseStreamMinor"/>
    <condition
      property="perfLRConfigExpected"
      value="ep${eclipseStreamMajor}${eclipseStreamMinor}${buildType}LR-perf-lin64_linux.gtk.x86_64_8.0,ep${eclipseStreamMajor}${eclipseStreamMinor}${buildType}LR-perf-lin64-baseline_linux.gtk.x86_64_8.0">
      <contains
        string="${job}"
        substring="LR-perf-" />
    </condition>
    <condition
      property="perfConfigExpected"
      value="ep${eclipseStreamMajor}${eclipseStreamMinor}${buildType}-perf-lin64_linux.gtk.x86_64_8.0,ep${eclipseStreamMajor}${eclipseStreamMinor}${buildType}-perf-lin64-baseline_linux.gtk.x86_64_8.0">
      <contains
        string="${job}"
        substring="-perf-" />
    </condition>
    <!-- else normal unit tests configs -->
    <property
      name="testsConfigExpected"
      value="ep${eclipseStreamMajor}${eclipseStreamMinor}${buildType}-unit-cen64-gtk2_linux.gtk.x86_64_8.0,ep${eclipseStreamMajor}${eclipseStreamMinor}${buildType}-unit-mac64_macosx.cocoa.x86_64_8.0,ep${eclipseStreamMajor}${eclipseStreamMinor}${buildType}-unit-win32_win32.win32.x86_8.0,ep${eclipseStreamMajor}${eclipseStreamMinor}${buildType}-unit-cen64-gtk3_linux.gtk.x86_64_8.0,ep${eclipseStreamMajor}${eclipseStreamMinor}${buildType}-unit-cen64-gtk3-java9_linux.gtk.x86_64_9" />

    <echo message=" = = properties in publish.xml == " />
    <echo message="     job: ${job}" />
    <echo message="     buildDirectory: ${buildDirectory}" />
    <echo message="     xmlDirectoryName: ${xmlDirectoryName}" />
    <echo message="     dropDirectoryName ${dropDirectoryName}" />
    <echo message="     dropTemplateFileName: ${dropTemplateFileName}" />
    <echo message="     testResultsHtmlFileName: ${testResultsHtmlFileName}" />
    <echo message="     hrefTestResultsTargetPath: ${hrefTestResultsTargetPath}" />
    <echo message="     hrefCompileLogsTargetPath: ${hrefCompileLogsTargetPath}" />
    <echo message="     compileLogsDirectoryName: ${compileLogsDirectoryName}" />
    <echo message="     testManifestFileName: ${testManifestFileName}" />
    <echo message="     perfManifestFileName: ${perfManifestFileName}" />
    <echo message="     perfLRManifestFileName: ${perfLRManifestFileName}" />
    <echo message="     testsConfigExpected: ${testsConfigExpected}" />
    <echo message="     isBuildTested: ${isBuildTested}" />
    <echo message="     buildType:  ${buildType}" />
    <echo message="     doMissingListValue:  ${doMissingListValue}" />
    <echo message="     testsConfigExpected: ${testsConfigExpected}" />
    <echo message="     perfConfigExpected: ${perfConfigExpected}" />
    <echo message="     perfLRConfigExpected: ${perfLRConfigExpected}" />
    <echo message="     expectedConfigFilename: ${expectedConfigFilename}" />
    <echo message="     foundConfigFilename: ${foundConfigFilename}" />
    <indexResults
      isBuildTested="${isBuildTested}"
      buildType="${buildType}"
      dropTokenList="${dropTokenList}"
      dropHtmlFileName="${indexFileName}"
      xmlDirectoryName="${xmlDirectoryName}"
      dropDirectoryName="${dropDirectoryName}"
      dropTemplateFileName="${dropTemplateFileName}"
      testResultsHtmlFileName="${testResultsHtmlFileName}"
      hrefTestResultsTargetPath="${hrefTestResultsTargetPath}"
      hrefCompileLogsTargetPath="${hrefCompileLogsTargetPath}"
      compileLogsDirectoryName="${compileLogsDirectoryName}"
      testManifestFileName="${testManifestFileName}"
      perfManifestFileName="${perfManifestFileName}"
      perfLRManifestFileName="${perfLRManifestFileName}"
      testsConfigExpected="${testsConfigExpected}"
      perfConfigExpected="${perfConfigExpected}"
      perfLRConfigExpected="${perfLRConfigExpected}"
      expectedConfigFilename="${expectedConfigFilename}"
      foundConfigFilename="${foundConfigFilename}"
      doMissingList="${doMissingListValue}" />
  </target>

  <target name="getStaticFiles">
    <!--get static files required in the buildLabel directory -->
    <copy todir="${buildDirectory}">
      <fileset dir="staticDropFiles" />
    </copy>
  </target>
</project>

Back to the top