Skip to main content
summaryrefslogtreecommitdiffstats
blob: 2318cd26b6c486ed690c60c5dfda8d159a4aeb50 (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
<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>
-->
<property name="result" value="${buildDirectory}/${buildLabel}" />

<!--name of generated index page-->
<property name="indexFileName" value="index.html" />

<target name="default">
  <antcall target="generateIndex" />
  <antcall target="getStaticFiles" />
</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.
  testResultsTemplateFileName:  path to template file used to generate page with links to JUnit test results
  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 directory containing JUnit html test results
  hrefCompileLogsTargetPath:  relative path from index page directory containing compilelogs
  testManifestFileName:  name of xml file containing descriptions of zip types and log files



-->
  <condition
    property="testType"
    value="perfBaseline">
    <and>
      <isset property="job" />
      <contains
        string="${job}"
        substring="-baseline" />
    </and>
  </condition>
  <condition
    property="testType"
    value="perf"
    else="test">
    <and>
      <isset property="job" />
      <contains
        string="${job}"
        substring="-perf-" />
    </and>
  </condition>
  <condition
    property="testTemplate"
    value="perfBaselineResults.php.template">
    <and>
      <isset property="job" />
      <contains
        string="${job}"
        substring="-baseline" />
    </and>
  </condition>
  <condition
    property="testTemplate"
    value="perfResults.php.template"
    else="testResults.php.template">
    <and>
      <isset property="job" />
      <contains
        string="${job}"
        substring="-perf-" />
    </and>
  </condition>

  <condition property="testType" value="perfBaseline">
    <contains string="${job}" substring="-baseline" />
  </condition>
  <condition property="testType" value="perf" else="test">
    <contains string="${job}" substring="-perf-" />
  </condition>

  <property name="xmlDirectoryName" value="${result}/${testType}results/xml" />
  <property name="dropDirectoryName" value="${result}" />
  <property name="testResultsTemplateFileName" value="${basedir}/templateFiles/${testTemplate}" />
<!-- TODO: should require this, and others to be passed in, and fail, if not -->
  <property name="dropTemplateFileName" value="${basedir}/templateFiles/index.html.template" />
  <property name="testResultsHtmlFileName" value="${testType}Results.php" />
  <property name="hrefTestResultsTargetPath" value="${testType}results/html" />
  <property name="hrefCompileLogsTargetPath" value="compilelogs" />
  <property name="compileLogsDirectoryName" value="${result}/compilelogs" />
  <property name="testManifestFileName" value="${basedir}/testManifest.xml" />


  <indexResults
    isBuildTested="${isBuildTested}"
    buildType="${buildType}"
    dropTokenList="${dropTokenList}"
    platformIdentifierToken="${platformIdentifierToken}"
    dropHtmlFileName="${indexFileName}"
    xmlDirectoryName="${xmlDirectoryName}"
    dropDirectoryName="${dropDirectoryName}"
    testResultsTemplateFileName="${testResultsTemplateFileName}"
    dropTemplateFileName="${dropTemplateFileName}"
    testResultsHtmlFileName="${testResultsHtmlFileName}"
    hrefTestResultsTargetPath="${hrefTestResultsTargetPath}"
    hrefCompileLogsTargetPath="${hrefCompileLogsTargetPath}"
    compileLogsDirectoryName="${compileLogsDirectoryName}"
    testManifestFileName="${testManifestFileName}"
  />



    <!--  Insert Build Name ... apparently still required, until we can update indexing task directly -->
    <replace file="${result}/${indexFileName}" token="@build@" value="${buildId}"/>


    <replace dir="${result}" value="${buildId}">
      <include name="**/*.php"/>
      <replacetoken><![CDATA[@build@]]></replacetoken>
    </replace>

    <replace file="${result}/${indexFileName}" token="@buildlabel@" value="${buildId}"/>

    <replace dir="${result}" value="${buildId}">
      <include name="**/*.php"/>
      <replacetoken><![CDATA[@buildlabel@]]></replacetoken>
    </replace>

    <!-- TODO: fix so these replace's are not required -->

</target>


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

  <!--copy buildnotes from plugin directories-->
  <mkdir dir="${result}/buildnotes" />
  <copy todir="${result}/buildnotes" flatten="true">
    <fileset dir="${buildDirectory}/plugins" includes="**/buildnotes_*.html" />
  </copy>
</target>

</project>

Back to the top