aboutsummaryrefslogtreecommitdiff
path: root/basebuilder-3.6.2/org.eclipse.releng.basebuilder/plugins/org.eclipse.build.tools/scripts/publish.xml
blob: 11e9751e0bdaf25ecb00cb8d6b202994863ae7de (plain)
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
<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="countFiles" />
	<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

	
	
-->
	
	<property name="xmlDirectoryName" value="${result}/testresults/xml" />
	<property name="dropDirectoryName" value="${result}" />
	<property name="testResultsTemplateFileName" value="${basedir}/templateFiles/testResults.php.template" />
	<property name="dropTemplateFileName" value="${basedir}/templateFiles/index.html.template" />
	<property name="testResultsHtmlFileName" value="testResults.php" />
	<property name="hrefTestResultsTargetPath" value="testresults/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}"
  	platformSpecificTemplateList="${platformSpecificTemplateList}"
    dropHtmlFileName="${indexFileName}"
    xmlDirectoryName="${xmlDirectoryName}"
    dropDirectoryName="${dropDirectoryName}"
    testResultsTemplateFileName="${testResultsTemplateFileName}"
    dropTemplateFileName="${dropTemplateFileName}"
    testResultsHtmlFileName="${testResultsHtmlFileName}"
    hrefTestResultsTargetPath="${hrefTestResultsTargetPath}"
    hrefCompileLogsTargetPath="${hrefCompileLogsTargetPath}"
    compileLogsDirectoryName="${compileLogsDirectoryName}"
    testManifestFileName="${testManifestFileName}"
  />

	<tstamp>
		<format property="TODAY" pattern="MMMM d, yyyy"/>
	</tstamp>
	
  	<!--  Insert Build Type descriptor  -->
  	<antcall target="${buildType}" />
  	
  	<!--  Insert Build Date  -->
	<replace file="${result}/${indexFileName}" token="@date@" value="${TODAY}"/>
	<replace dir="${result}" value="${TODAY}">
	  <include name="**/*.php"/>
	  <replacetoken><![CDATA[@date@]]></replacetoken>
	</replace>
	
  	<!--  Insert Build Name  -->
	<replace file="${result}/${indexFileName}" token="@build@" value="${buildId}"/>
	<replace dir="${result}" value="${buildId}">
	  <include name="**/*.php"/>
	  <replacetoken><![CDATA[@build@]]></replacetoken>
	</replace>


  	<!--  Update timestamp on file to permit overwrite through Ant copy task  -->
	<touch file="${result}/${indexFileName}" />
	<touch>
	    <fileset dir="${result}">
	    	<include name="**/*.php"/>
	    </fileset>
	</touch>
		
</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>

<target name="countFiles">
<!--	files.count is a file that should exist in the drop directory with a count of the zip files in the same directory.
		It is required to generate a link to the build on the downloads page.
 -->
 <taskdef name="countFiles" classname="org.eclipse.releng.generators.FileCounter" />
 
	<countFiles 
		sourceDirectory="${result}"
		filterString=".zip,.tar.gz"
		outputFile="${result}/files.count"
	/>
	
</target>

<!--Build type descriptors-->
<target name="I">
	<replace file="${result}/${indexFileName}" token="@type@" value="Integration"/>
	<replace dir="${result}" value="Integration">
	  <include name="**/*.php"/>
	  <replacetoken><![CDATA[@type@]]></replacetoken>
	</replace>
</target>
	
<target name="N">
	<replace file="${result}/${indexFileName}" token="@type@" value="Nightly"/>
	<replace dir="${result}" value="Nightly">
	  <include name="**/*.php"/>
	  <replacetoken><![CDATA[@type@]]></replacetoken>
	</replace>
</target>
	
<target name="M">
	<replace file="${result}/${indexFileName}" token="@type@" value="Maintenance"/>
	<replace dir="${result}" value="Maintenance">
	  <include name="**/*.php"/>
	  <replacetoken><![CDATA[@type@]]></replacetoken>
	</replace>
</target>

<target name="R">
	<replace file="${result}/${indexFileName}" token="@type@" value="Release"/>
	<replace dir="${result}" value="Release">
	  <include name="**/*.php"/>
	  <replacetoken><![CDATA[@type@]]></replacetoken>
	</replace>
</target>
	
<target name="S">
	<replace file="${result}/${indexFileName}" token="@type@" value="Stable"/>
	<replace dir="${result}" value="Stable">
	  <include name="**/*.php"/>
	  <replacetoken><![CDATA[@type@]]></replacetoken>
	</replace>
</target>

<target name="T">
	<replace file="${result}/${indexFileName}" token="@type@" value="Test"/>
	<replace dir="${result}" value="Test">
	  <include name="**/*.php"/>
	  <replacetoken><![CDATA[@type@]]></replacetoken>
	</replace>
</target>
	
</project>