blob: d146e1342fed05353713808aae7d86ec8382a93a [file] [log] [blame]
<!--
******************************************************************************
* Copyright (c) 2016 Oracle
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Konstantin Komissarchik - initial implementation and ongoing maintenance
******************************************************************************
-->
<project name="corundum.macro.verify-about-html">
<!--
verify-about-html
Verifies that every plugin includes an about.html file.
-->
<macrodef name="verify-about-html">
<attribute name="repository"/>
<attribute name="includes" default="${verify.about.html.includes}"/>
<attribute name="excludes" default="${verify.about.html.excludes}"/>
<sequential>
<if>
<istrue value="${verify.about.html}"/>
<then>
<echo message="Verifying about.html files..."/>
<var name=".verify.about.html.failures" unset="true"/>
<for param="file">
<path>
<fileset dir="@{repository}/plugins" includes="@{includes}" excludes="@{excludes}"/>
</path>
<sequential>
<delete dir="${build.dir}/temp" quiet="true"/>
<mkdir dir="${build.dir}/temp"/>
<unzip src="@{file}" dest="${build.dir}/temp"/>
<if>
<not>
<available file="${build.dir}/temp/about.html"/>
</not>
<then>
<basename file="@{file}" property=".file.relative"/>
<if>
<isset property=".verify.about.html.failures"/>
<then>
<var name=".verify.about.html.failures" value="${.verify.about.html.failures};${.file.relative}"/>
</then>
<else>
<var name=".verify.about.html.failures" value="${.file.relative}"/>
</else>
</if>
<var name=".file.relative" unset="true"/>
</then>
</if>
<delete dir="${build.dir}/temp"/>
</sequential>
</for>
<if>
<isset property=".verify.about.html.failures"/>
<then>
<echo message="Bundles missing about.html file:"/>
<for param="file" list="${.verify.about.html.failures}" delimiter=";">
<sequential>
<echo message=" @{file}"/>
</sequential>
</for>
<fail message="Found one or more bundles missing about.html file."/>
</then>
</if>
<var name=".verify.about.html.failures" unset="true"/>
</then>
</if>
</sequential>
</macrodef>
</project>