Skip to main content
summaryrefslogtreecommitdiffstats
blob: a402d1fd53ca5c100e8cdba545284b461bb2a4d2 (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
<project
  name="Helper targets"
  default="generateEclipseIndex"
  basedir=".">

  <target
    name="init"
    depends="initStreamVariables"
    unless="genTestIndexesInitialized">
    <fail unless="buildId" />
    <fail unless="eclipseStream" />
    <fail unless="job" />


    <script language="javascript">
      <![CDATA[
        var buildId = project.getProperty("buildId");
        var pattern = new RegExp(/^([IMXYPNSR])(\d{8})-(\d{4})$/);

        var sArray = pattern.exec(buildId);
        // sArray 0 is "whole match"
        project.setProperty("buildType", sArray[1]);
      ]]>
    </script>
    <condition
      property="dropsDirSegment"
      value="drops4"
      else="drops">
      <equals
        arg1="${eclipseStreamMajor}"
        arg2="4" />
    </condition>
    <!-- publish.xml expects buildLabel in places, instead of buildId,
         though we use them interchangebly -->
    <property
      name="buildLabel"
      value="${buildId}" />
    <property
      name="dropsDirXSegment"
      value="${dropsDirSegment}" />

    <property
      name="buildRoot"
      value="${buildHome}/${eclipseStreamMajor}${buildType}" />

    <property
      name="postingDirectory"
      value="${buildRoot}/siteDir/eclipse/downloads/${dropsDirXSegment}" />
    <condition
      property="resultLocation"
      value="${postingDirectory}/${buildLabel}/performance"
      else="${postingDirectory}/${buildLabel}">
      <contains
        string="${job}"
        substring="-perf-" />
    </condition>
    <!-- Note: results template is selected based on
         conventions used in hudson jobs names. Should
         move to properties saved in during test run?
    -->
    <condition
      property="testTemplate"
      value="perfBaselineAltResults.php.template">
      <and>
        <isset property="job" />
        <contains
          string="${job}"
          substring="-baselineAlt" />
      </and>
    </condition>
    <condition
      property="testTemplate"
      value="perfBaselineResults.php.template">
      <and>
        <isset property="job" />
        <contains
          string="${job}"
          substring="-baseline" />
      </and>
    </condition>
    <condition
      property="testTemplate"
      value="performance.php.template"
      else="testResults.php.template">
      <and>
        <isset property="job" />
        <contains
          string="${job}"
          substring="-perf-" />
      </and>
    </condition>
    <condition
      property="testManifestFileName"
      value="${publishingContent}/performanceTestManifest.xml"
      else="${publishingContent}/testManifest.xml">
      <and>
        <isset property="job" />
        <contains
          string="${job}"
          substring="-perf-" />
      </and>
    </condition>

    <echo message="= = Properties in genTestIndexes.xml = = " />
    <echo message="job: ${job}" />
    <echo message="testTemplate: ${testTemplate}" />



    <property
      name="EBuilderDir"
      value="${postingDirectory}/${buildId}/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder" />

        <!-- This is purely a subset of tychoeclipsebuilder files, copyied at build time, so part of
        the results output we are working on, so they will be the same once the tests are done, even if gitCache updated by anohter build,
        or a run from previous test results -->
        <!-- /data/shared/eclipse/builds/4N/master/gitCache/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles -->
    <property
      name="publishingContent"
      value="${EBuilderDir}/eclipse/publishingFiles" />

        <!-- This is our new, "safe for every test" location -->
    <property
      name="base.builder"
      value="${postingDirectory}/${buildId}/org.eclipse.releng.basebuilder" />



        <!-- Not sure this is the "working directory" expected. May impact ability
        to get/find "buildNotes"? Need to copy such "source" things at build time. -->
    <property
      name="buildDirectory"
      value="${postingDirectory}/${buildId}" />


    <property
      name="genTestIndexesInitialized"
      value="true" />


  </target>

  <target
    name="generateEclipseIndex"
    depends="init">


    <condition
      property="generatorClass"
      value="org.eclipse.releng.generators.EclipseTestResultsGeneratorNoMail">
      <equals
        arg1="${hudson}"
        arg2="true" />
    </condition>
    <property
      name="generatorClass"
      value="org.eclipse.releng.generators.EclipseTestResultsGenerator" />

    <echo message="DEBUG: generatorClass: ${generatorClass}" />
    <available
      classname="${generatorClass}"
      property="class"
      value="${generatorClass}" />

    <property
      name="genTestIndexesdropTokenList"
      value="%sdk%,%tests%,%example%,%rcpruntime%,%rcpsdk%,%deltapack%,%runtime%,%jdt%,%jdtsdk%,%jdtc%,%pde%,%pdesdk%,%cvs%,%cvssdk%,%swt%,%relengtools%" />

    <property
      name="isBuildTested"
      value="true" />
    <property
      name="dropTokenList"
      value="${genTestIndexesdroptTokenList}" />
    <property
      name="platformIdentifierToken"
      value="%platform%" />

    <property
      name="indexFileName"
      value="index.php" />
    <property
      name="result"
      value="${postingDirectory}/${buildId}" />
    <property
      name="testResultsTemplateFileName"
      value="${publishingContent}/templateFiles/${testTemplate}" />
    <property
      name="dropTemplateFileName"
      value="${publishingContent}/templateFiles/index.php.template" />
    <property
      name="testManifestFileName"
      value="${publishingContent}/testManifest.xml" />

    <antcall target="publishEclipseIndex">
    </antcall>

  </target>

  <target
    name="publishEclipseIndex"
    depends="init">


        <!--regenerate the index page with links to test results -->
    <ant
      antfile="${EBuilderDir}/eclipse/buildScripts/publish.xml"
      dir="${publishingContent}"
      target="generateIndex">
      <property
        name="isBuildTested"
        value="true" />
      <property
        name="buildType"
        value="${buildType}" />
      <property
        name="dropTokenList"
        value="%sdk%,%tests%,%example%,%rcpruntime%,%rcpsdk%,%deltapack%,%runtime%,%jdt%,%jdtsdk%,%jdtc%,%pde%,%pdesdk%,%cvs%,%cvssdk%,%swt%,%relengtools%" />
      <property
        name="platformIdentifierToken"
        value="%platform%" />
      <property
        name="indexFileName"
        value="index.php" />
      <property
        name="result"
        value="${resultLocation}" />
      <property
        name="testResultsTemplateFileName"
        value="${publishingContent}/templateFiles/${testTemplate}" />
      <property
        name="dropTemplateFileName"
        value="${publishingContent}/templateFiles/index.php.template" />
      <property
        name="testManifestFileName"
        value="${publishingContent}/testManifest.xml" />
    </ant>

  </target>

  <target name="initStreamVariables">

    <fail
      unless="eclipseStream"
      message="eclipseStream must be provided by caller" />
    <condition property="streamOK">
      <matches
        pattern="\d\.\d\.\d"
        string="${eclipseStream}" />
    </condition>
    <fail
      message="eclipseStream variable had unexpected format. Should be digit.digit.digit, but was ${eclipseStream}"
      unless="streamOK" />
    <script language="javascript">
          <![CDATA[
            var eclipseStream = project.getProperty("eclipseStream");
            var pattern = new
            RegExp(/(\d+)\.(\d+)\.(\d+)/);

            var sArray = pattern.exec(eclipseStream);
            // sArray[0] is "whole match"
            project.setProperty("eclipseStreamMajor", sArray[1]);
            project.setProperty("eclipseStreamMinor", sArray[2]);
            project.setProperty("eclipseStreamService", sArray[3]);
          ]]>
    </script>

  </target>

</project>

Back to the top