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
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2013-2016 IBM Corporation and others.
This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
mrennie - initial API and implementation
David Williams - modest modifications.
-->
<!-- ======================================================================
Jun 4, 2013 11:06:50 AM
API Tools builder integration
This buildfile calls all of the post-build Ant tasks
This buildfile requires the apitooling-ant.jar and the api-tasks.properties file
from the org.eclipse.pde.api.tools bundle
mrennie
====================================================================== -->
<project
name="API Tools builder integration"
default="apiToolsReports">
<!--
The default target that calls apitooling.apifreeze, apitooling.analysis and apitooling.apideprecation
and their respective _reportconversion tasks
-->
<target
name="apiToolsReports"
depends="init, checkCurrent, warnIfNotAvailable"
if="currentZipAvailable">
<!-- make a dir to place the XML and HTML output in, per build -->
<property
name="report"
value="${buildDirectory}/apitools" />
<mkdir dir="${report}" />
<property
name="freeze_report"
value="${report}/freeze_report.xml" />
<touch file="${freeze_report}" />
<property
name="freeze_html"
value="${report}/freeze_report.html" />
<!-- we would have to fetch the baseline we wanted, or perhaps just link to its location -->
<property
name="baseline"
value="${reference}/${previousBaselineFilename}" />
<!-- create properties for the filters -->
<property
name="exclude_list_location"
value="${EBuilderDir}/eclipse/apiexclude/exclude_list.txt" />
<property
name="exclude_list_external_location"
value="${EBuilderDir}/eclipse/apiexclude/exclude_list_external.txt" />
<!-- run the freeze task -->
<antcall target="dofreezeReport" />
<!-- create the Ant filterstore directory -->
<property
name="filter_store"
value="${buildDirectory}/apifilters" />
<mkdir dir="${filter_store}" />
<!-- copy all of the .api_filters files out of the plugins from their source -->
<copy todir="${filter_store}">
<fileset
dir="${buildWorkingArea}"
includes="**/.settings/.api_filters" />
<regexpmapper
from=".*(org.eclipse.*\/)(\.settings\/)(\.api_filters)"
to="\1\3" />
</copy>
<!-- create a zip of API filters -->
<property
name="apifilterzip"
value="${report}/apifilters-${buildId}.zip" />
<exec
executable="zip"
dir="${report}">
<arg line="-r ${apifilterzip} ${filter_store}" />
</exec>
<!-- create HTML output directory -->
<property
name="analysis_html"
value="${report}/analysis/html" />
<property
name="analysis_report"
value="${report}/analysis/xml" />
<!-- run the analysis -->
<apitooling.analysis
baseline="${baseline}"
profile="${current_location}"
report="${analysis_report}"
filters="${filter_store}"
excludelist="${exclude_list_external_location}"
debug="true" />
<apitooling.analysis_reportconversion
xmlfiles="${analysis_report}"
htmlfiles="${analysis_html}"
debug="true" />
<property
name="deprecation_report"
value="${report}/deprecation/apideprecation.xml" />
<property
name="deprecation_html"
value="${report}/deprecation/apideprecation.html" />
<!-- run the deprecation tasks -->
<apitooling.apideprecation
baseline="${baseline}"
profile="${current_location}"
report="${deprecation_report}"
debug="true" />
<apitooling.apideprecation_reportconversion
xmlfile="${deprecation_report}"
debug="true"
htmlfile="${deprecation_html}" />
</target>
<target
name="init"
unless="apitoolinginitialized"
depends="getfreezereference">
<!-- The name for the build - i.e. I20130603-2000 -->
<fail
unless="buildLabel"
message="buildLabel must be provided." />
<fail
unless="buildWorkingArea"
message="buildWorkingArea must be provided" />
<fail
unless="previousBaselineFilename"
message="previousBaselineFilename must be provided" />
<!--
The ?on-disk? location of the previous Eclipse build - for example Eclipse 4.2.2
If not defined, assume same as file name ... otherwise, assume can be used for "human readable name"?
-->
<property
name="previousBaselineName"
value="${previousBaselineFilename}" />
<fail
unless="previousBaseURL"
message="full URL of previous build must be provided" />
<!-- Default buildDirectory -->
<fail
unless="buildDirectory"
message="buildDirectory much be provided" />
<!-- a dir to extract previous baselines in ... remember not to copy apitoolingreference to downloads -->
<property
name="reference"
value="${buildDirectory}/apitoolingreference/${previousBaselineName}" />
<mkdir dir="${reference}" />
<get
dest="${reference}"
src="${previousBaseURL}" />
<!-- no need to unzip?
<unzip
src="${reference}/${previousBaselineFilename}"
dest="${reference}" />
-->
<property
name="apitoolinginitialized"
value="true" />
</target>
<target
name="warnIfNotAvailable"
unless="currentZipAvailable">
<echo message="[WARNING] current build not available, for API analysis. Likely due to earlier build failure." />
</target>
<target name="checkCurrent">
<!-- grab the currently built + zipped build -->
<property
name="current_location"
value="${buildDirectory}/eclipse-SDK-${buildLabel}-win32-x86_64.zip" />
<!--
If not available, build failed, for other reasons, so we'll prevent
errors from occuring here, which might be confusing in debugging.
-->
<available
file="${current_location}"
property="currentZipAvailable" />
</target>
<!-- there will not always be a freeze report, only after M6 -->
<target
name="getfreezereference"
if="freezeFilename">
<fail
unless="freezeBaseURL"
message="full URL of freeze build must be provided, if freezeFilename is." />
<!-- if not provided, assume freezeName is same as freezeFilename -->
<property
name="freezeName"
value="freezeFilename" />
<property
name="freezereference"
value="${buildDirectory}/apitoolingreference/${freezeName}" />
<mkdir dir="${freezereference}" />
<get
dest="${freezereference}"
src="${freezeBaseURL}" />
<!-- no need to unzip?
<unzip
src="${freezereference}/${freezeFilename}"
dest="${freezereference}" />
-->
</target>
<!-- there will not always be a freeze report, only after M6 -->
<target
name="dofreezeReport"
if="freezereference">
<!-- run the freeze task -->
<apitooling.apifreeze
baseline="${freezereference}/${freezeFilename}"
profile="${current_location}"
report="${freeze_report}"
excludelist="${exclude_list_location}"
debug="true" />
<apitooling.apifreeze_reportconversion
xmlfile="${freeze_report}"
htmlfile="${freeze_html}"
debug="true" />
</target>
</project>
|