maven-plugins/jdiff/plugin.jelly
2006-03-21 00:59:26 +00:00

191 lines
7.1 KiB
XML

<?xml version="1.0"?>
<!--
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<project
xmlns:j="jelly:core"
xmlns:maven="jelly:maven"
xmlns:doc="doc"
xmlns:scm="scm"
xmlns:assert="assert"
xmlns:ant="jelly:ant">
<j:if test="${bootstrapping == null}">
<!-- fake test because the assert:assertPluginAvailable tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
<assert:assertPluginAvailable groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="${plugin.artifactId}"/>
<assert:assertPluginAvailable groupId="maven" artifactId="maven-scm-plugin" minRelease="1.5" neededBy="${plugin.artifactId}"/>
</j:if>
<goal name="maven-jdiff-plugin:register">
<j:if test="${context.getVariable('maven.mode.online') == null}">
<j:set var="maven.mode.online" value="true" />
</j:if>
<j:if test="${maven.mode.online}">
<doc:registerReport
name="JDiff"
pluginName="maven-jdiff-plugin"
link="jdiff/changes"
target="_blank"
description="Report on the api difference report between versions."/>
</j:if>
</goal>
<goal name="maven-jdiff-plugin:deregister">
<doc:deregisterReport name="JDiff"/>
</goal>
<!-- ================================================================== -->
<!-- P R O J E C T D O C U M E N T A T I O N -->
<!-- ================================================================== -->
<goal name="maven-jdiff-plugin:report"
prereqs="jdiff"
description="Generate an api difference report between versions">
</goal>
<goal name="jdiff" prereqs="xdoc:init"
description="Generate an api difference report between versions">
<ant:property name="maven.jdiff.dir" value="${maven.build.dir}/jdiff"/>
<ant:mkdir dir="${maven.jdiff.dir}"/>
<j:set var="docsDest" value="${maven.docs.dest}"/>
<maven:get var="javadocDestdir" plugin="maven-javadoc-plugin" property="maven.javadoc.destdir" />
<ant:property name="maven.jdiff.changes.dir" value="${docsDest}/jdiff"/>
<ant:mkdir dir="${maven.jdiff.changes.dir}"/>
<maven:makeRelativePath var="javadocDestdir" path="${javadocDestdir}" basedir="${docsDest}" />
<j:set var="javadocDestdir" value="../${javadocDestdir}"/>
<ant:condition property="maven.jdiff.new.current" value="true">
<ant:equals arg1="${maven.jdiff.new.tag}" arg2="CURRENT"/>
</ant:condition>
<ant:condition property="maven.jdiff.old.current" value="true">
<ant:equals arg1="${maven.jdiff.old.tag}" arg2="CURRENT"/>
</ant:condition>
<j:set var="scmConnection" value="${pom.repository.connection}"/>
<j:set var="scmMethod" value="${scmConnection.substring(4,7)}"/>
<maven:makeRelativePath var="relativeSrcDir" basedir="${basedir}" path="${pom.build.sourceDirectory}" />
<j:choose>
<j:when test="${maven.jdiff.new.current}">
<ant:property name="maven.jdiff.new.src" value="${relativeSrcDir}"/>
</j:when>
<j:otherwise>
<ant:property name="maven.jdiff.new.dir" value="${maven.jdiff.dir}/${maven.jdiff.new.tag}"/>
<ant:mkdir dir="${maven.jdiff.new.dir}"/>
<scm:checkout
var="checkoutBean"
url="${scmConnection}"
tag="${maven.jdiff.new.tag}"
tagBase="${maven.scm.svn.tag.base}"
workingDirectory="${maven.jdiff.new.dir}"
username="${maven.scm.username}"
password="${maven.scm.password}"
/>
<ant:property name="maven.jdiff.new.src"
value="${maven.jdiff.new.dir}/${relativeSrcDir}"/>
</j:otherwise>
</j:choose>
<j:choose>
<j:when test="${maven.jdiff.old.current}">
<ant:property name="maven.jdiff.old.src" value="${relativeSrcDir}"/>
</j:when>
<j:otherwise>
<ant:property name="maven.jdiff.old.dir"
value="${maven.jdiff.dir}/${maven.jdiff.old.tag}"/>
<ant:mkdir dir="${maven.jdiff.old.dir}"/>
<scm:checkout
var="checkoutBean"
url="${scmConnection}"
tag="${maven.jdiff.old.tag}"
tagBase="${maven.scm.svn.tag.base}"
workingDirectory="${maven.jdiff.old.dir}"
username="${maven.scm.username}"
password="${maven.scm.password}"
/>
<ant:property name="maven.jdiff.old.src"
value="${maven.jdiff.old.dir}/${relativeSrcDir}"/>
</j:otherwise>
</j:choose>
<ant:property name="baseuri" value="${plugin.dir}"/>
<ant:property name="jdiff.cp" value="${plugin.getDependencyPath('jdiff')};${plugin.getDependencyPath('xerces:xercesImpl')}" />
<ant:path id="maven.cp">
<ant:pathelement location="${plugin.getDependencyPath('jdiff')}" />
<ant:path refid="maven.dependency.classpath" />
</ant:path>
<ant:javadoc
classpathref="maven.cp"
sourcepath="${maven.jdiff.old.src}"
packagenames="${pom.package}.*">
<ant:doclet name="jdiff.JDiff" path="${jdiff.cp}">
<ant:param name="-apidir" value="${maven.jdiff.dir}"/>
<ant:param name="-apiname" value="${maven.jdiff.old.tag}"/>
<ant:param name="-baseURI" value="${baseuri}"/>
</ant:doclet>
</ant:javadoc>
<ant:javadoc
classpathref="maven.cp"
packagenames="${pom.package}.*"
sourcepath="${maven.jdiff.new.src}">
<ant:doclet name="jdiff.JDiff" path="${jdiff.cp}">
<ant:param name="-apidir" value="${maven.jdiff.dir}"/>
<ant:param name="-apiname" value="${maven.jdiff.new.tag}"/>
<ant:param name="-baseURI" value="${baseuri}"/>
</ant:doclet>
</ant:javadoc>
<ant:javadoc
classpathref="maven.cp"
private="yes"
destdir="${maven.jdiff.changes.dir}"
packagenames="${pom.package}.*"
sourcepath="${maven.jdiff.new.src}">
<ant:doclet name="jdiff.JDiff" path="${jdiff.cp}">
<ant:param name="-stats"/>
<ant:param name="-oldapi" value="${maven.jdiff.old.tag}"/>
<ant:param name="-oldapidir" value="${maven.jdiff.dir}"/>
<ant:param name="-newapi" value="${maven.jdiff.new.tag}"/>
<ant:param name="-newapidir" value="${maven.jdiff.dir}"/>
<ant:param name="-javadocnew" value="${javadocDestdir}/"/>
</ant:doclet>
</ant:javadoc>
<ant:copy todir="${maven.jdiff.changes.dir}">
<ant:fileset dir="${plugin.resources}">
<ant:include name="*.gif"/>
</ant:fileset>
</ant:copy>
</goal>
</project>