maven-plugins/jdiff/plugin.jelly
brett f8a47011df PR: MPJDIFF-6
Submitted by: Phil Steitz
Reviewed by:  Brett Porter
Support other SCMs through the SCM plugin (v1.5 required)
Applied with modifications to verify the correct SCM plugin is installed


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@226466 13f79535-47bb-0310-9956-ffa450edef68
2005-07-30 02:34:25 +00:00

188 lines
6.7 KiB
XML

<?xml version="1.0"?>
<!--
/*
* Copyright 2001-2004 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:ant="jelly:ant">
<j:if test="${bootstrapping == null}">
<!-- Poor mans version check - plugin dependencies still suck for multiple versions -->
<maven:get plugin="maven-scm-plugin" property="plugin" var="scmPlugin" />
<j:if test="${scmPlugin.currentVersion.compareTo('1.5') lt 0}">
<ant:fail>
Must have SCM plugin v1.5 installed to use this version of the jdiff plugin.
Try: maven plugin:download -DgroupId=maven -DartifactId=maven-scm-plugin -Dversion=1.5
You can find the latest version of the SCM plugin on the Maven Download page at
http://maven.apache.org/start/download.html
</ant:fail>
</j:if>
</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}"/>
<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.tagBase}"
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.tagBase}"
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="maven.cp.sub" refid="maven-classpath"/>
<ant:property name="jdiff.jar" value="${plugin.getDependencyPath('jdiff')}"/>
<ant:property name="maven.cp" value="${maven.cp.sub};${jdiff.jar};${java.class.path}"/>
<ant:property name="baseuri" value="${plugin.dir}"/>
<ant:javadoc
sourcepath="${maven.jdiff.old.src}"
packagenames="${pom.package}.*">
<ant:doclet name="jdiff.JDiff" path="${maven.cp}">
<ant:param name="-apiname" value="${maven.jdiff.old.tag}"/>
<ant:param name="-baseURI" value="${baseuri}"/>
</ant:doclet>
</ant:javadoc>
<ant:javadoc
packagenames="${pom.package}.*"
sourcepath="${maven.jdiff.new.src}">
<ant:doclet name="jdiff.JDiff" path="${maven.cp}">
<ant:param name="-apiname" value="${maven.jdiff.new.tag}"/>
<ant:param name="-baseURI" value="${baseuri}"/>
</ant:doclet>
</ant:javadoc>
<ant:javadoc
private="yes"
destdir="${maven.jdiff.changes.dir}"
packagenames="${pom.package}.*"
sourcepath="${maven.jdiff.new.src}">
<ant:doclet name="jdiff.JDiff" path="${maven.cp}">
<ant:param name="-stats"/>
<ant:param name="-oldapi" value="${maven.jdiff.old.tag}"/>
<ant:param name="-newapi" value="${maven.jdiff.new.tag}"/>
<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>