Make a report with compiler output

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@291230 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
carlos committed 2005-09-24 00:41:01 +00:00
1 parent f62392ae8f
commit 80ad091328
7 files changed
+124 -2

No files matched your search

+74 -1
View File
@@ -22,7 +22,9 @@
xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
xmlns:define="jelly:define"
xmlns:maven="jelly:maven">
xmlns:maven="jelly:maven"
xmlns:doc="doc"
xmlns:util="jelly:util">
<!-- ================================================================== -->
<!-- P R E P A R E F I L E S Y S T E M -->
@@ -55,6 +57,15 @@
</ant:echo>
</j:if>
<!-- start capturing compiler output -->
<j:if test="${context.getVariable('maven.compile.fork')}">
<ant:record name="${maven.compile.log}"
action="start"
loglevel="warning"
emacsmode="true"
append="no"/>
</j:if>
<ant:javac
destdir="${maven.build.dest}"
excludes="**/package.html"
@@ -138,6 +149,12 @@
</ant:javac>
<j:if test="${context.getVariable('maven.compile.fork')}">
<ant:record name="${maven.compile.log}"
action="stop"/>
</j:if>
</j:when>
<j:otherwise>
<ant:echo>No java source files to compile.</ant:echo>
@@ -171,4 +188,60 @@
<echo>DEPRECATED: the use of dependency-handle is deprecated. Please use maven:get/set to modify properties of the java plugin</echo>
</define:tag>
</define:taglib>
<!-- ================================================================== -->
<!-- J A V A R E P O R T S -->
<!-- ================================================================== -->
<goal name="maven-java-plugin:register" prereqs="xdoc:init">
<doc:registerReport
name="Compiler output Report"
pluginName="maven-java-plugin"
link="java-compiler-output-report"
description="Formatted report of compiler output"
/>
</goal>
<goal name="maven-java-plugin:deregister">
<doc:deregisterReport name="Compiler output Report"/>
</goal>
<!-- ================================================================== -->
<!-- J A V A -->
<!-- ================================================================== -->
<goal name="maven-java-plugin:report"
description="Generate compiler output report" prereqs="java:compile,xdoc:init">
<j:set var="genDocs" value="${maven.gen.docs}" />
<!-- if the deprecation log file is not present, then create it. -->
<j:set var="logAvailable" value="false"/>
<util:available file="${maven.compile.log}">
<j:set var="logAvailable" value="true"/>
</util:available>
<j:if test="${!logAvailable}">
<ant:fail>
The compiler output log file ${maven.compile.log} could not be found. Did you set maven.compile.fork to true?
</ant:fail>
</j:if>
<util:file name="${maven.compile.log}" var="inputFileObject"/>
<util:loadText var="inputText" file="${inputFileObject}"/>
<!-- trim path to basedir/ -->
<j:set var="pathToTrim">${basedir}${file.separator}</j:set>
<j:invokeStatic var="inputText" className="org.apache.commons.lang.StringUtils" method="replace">
<j:arg type="java.lang.String" value="${inputText}" />
<j:arg type="java.lang.String" value="${pathToTrim}" />
<j:arg type="java.lang.String" value="" />
</j:invokeStatic>
<doc:text-xdoc
title="Compiler output Report"
section="Compiler output Report"
inputText="${inputText}"
output="${genDocs}/java-compiler-output-report.xml"/>
</goal>
</project>