blob: de4ec10115e7193a3d9a516cf2b949677f5a1144 [file] [log] [blame]
<?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>