You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ca...@apache.org on 2005/09/24 02:41:05 UTC
svn commit: r291230 - in /maven/maven-1/plugins/trunk/java: plugin.jelly
plugin.properties project.xml xdocs/changes.xml xdocs/goals.xml
xdocs/index.xml xdocs/properties.xml
Author: carlos
Date: Fri Sep 23 17:41:01 2005
New Revision: 291230
URL: http://svn.apache.org/viewcvs?rev=291230&view=rev
Log:
Make a report with compiler output
Modified:
maven/maven-1/plugins/trunk/java/plugin.jelly
maven/maven-1/plugins/trunk/java/plugin.properties
maven/maven-1/plugins/trunk/java/project.xml
maven/maven-1/plugins/trunk/java/xdocs/changes.xml
maven/maven-1/plugins/trunk/java/xdocs/goals.xml
maven/maven-1/plugins/trunk/java/xdocs/index.xml
maven/maven-1/plugins/trunk/java/xdocs/properties.xml
Modified: maven/maven-1/plugins/trunk/java/plugin.jelly
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/java/plugin.jelly?rev=291230&r1=291229&r2=291230&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/java/plugin.jelly (original)
+++ maven/maven-1/plugins/trunk/java/plugin.jelly Fri Sep 23 17:41:01 2005
@@ -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>
Modified: maven/maven-1/plugins/trunk/java/plugin.properties
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/java/plugin.properties?rev=291230&r1=291229&r2=291230&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/java/plugin.properties (original)
+++ maven/maven-1/plugins/trunk/java/plugin.properties Fri Sep 23 17:41:01 2005
@@ -17,3 +17,5 @@
# -------------------------------------------------------------------
# P L U G I N P R O P E R T I E S
# -------------------------------------------------------------------
+
+maven.compile.log=${maven.build.dir}/compile.log
\ No newline at end of file
Modified: maven/maven-1/plugins/trunk/java/project.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/java/project.xml?rev=291230&r1=291229&r2=291230&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/java/project.xml (original)
+++ maven/maven-1/plugins/trunk/java/project.xml Fri Sep 23 17:41:01 2005
@@ -21,7 +21,7 @@
<pomVersion>3</pomVersion>
<id>maven-java-plugin</id>
<name>Maven Java Plug-in</name>
- <currentVersion>1.5</currentVersion>
+ <currentVersion>1.6-SNAPSHOT</currentVersion>
<description/>
<shortDescription>Compile java code</shortDescription>
<url>http://maven.apache.org/reference/plugins/java/</url>
@@ -97,4 +97,11 @@
</roles>
</developer>
</developers>
+ <contributors>
+ <contributor>
+ <name>Ron Gallagher</name>
+ <email>rongallagher@bellsouth.net</email>
+ <organization>RGI</organization>
+ </contributor>
+ </contributors>
</project>
Modified: maven/maven-1/plugins/trunk/java/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/java/xdocs/changes.xml?rev=291230&r1=291229&r2=291230&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/java/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/java/xdocs/changes.xml Fri Sep 23 17:41:01 2005
@@ -25,6 +25,9 @@
<author email="kschrader@karmalab.org">Kurt Schrader</author>
</properties>
<body>
+ <release version="1.6-SNAPSHOT" date="in SVN">
+ <action dev="carlos" type="add" issue="MPJAVA-40" due-to="Ron Gallagher">Make a report with compiler output</action>
+ </release>
<release version="1.5" date="2004-12-04">
<action dev="vmassol" type="fix" issue="MPJAVA-22">Make it work by default with any version of the JDK</action>
<action dev="brett" type="update">Deprecate dependency handle</action>
Modified: maven/maven-1/plugins/trunk/java/xdocs/goals.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/java/xdocs/goals.xml?rev=291230&r1=291229&r2=291230&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/java/xdocs/goals.xml (original)
+++ maven/maven-1/plugins/trunk/java/xdocs/goals.xml Fri Sep 23 17:41:01 2005
@@ -60,6 +60,30 @@
</td>
</tr>
<tr>
+ <td>maven-java-plugin:register</td>
+ <td>
+ <p>
+ Register the java compiler output report.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>maven-java-plugin:deregister</td>
+ <td>
+ <p>
+ Deregister the java compiler output report.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>maven-java-plugin:report</td>
+ <td>
+ <p>
+ Generate the java compiler output report.
+ </p>
+ </td>
+ </tr>
+ <tr>
<td>java:jar</td>
<td>
Deprecated. You must use jar:jar goal.
Modified: maven/maven-1/plugins/trunk/java/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/java/xdocs/index.xml?rev=291230&r1=291229&r2=291230&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/java/xdocs/index.xml (original)
+++ maven/maven-1/plugins/trunk/java/xdocs/index.xml Fri Sep 23 17:41:01 2005
@@ -38,6 +38,11 @@
by this plugin, please see the <a href="properties.html">properties</a>
document.
</p>
+ <p>
+ You can get a report from the compiler output adding
+ <code>maven-java-plugin</code> to the reports section of your pom.
+ (note that you need to set to true <code>maven.compile.fork</code>)
+ </p>
</section>
</body>
</document>
Modified: maven/maven-1/plugins/trunk/java/xdocs/properties.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/java/xdocs/properties.xml?rev=291230&r1=291229&r2=291230&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/java/xdocs/properties.xml (original)
+++ maven/maven-1/plugins/trunk/java/xdocs/properties.xml Fri Sep 23 17:41:01 2005
@@ -195,6 +195,14 @@
</td>
</tr>
<tr>
+ <td>maven.compile.log</td>
+ <td>Yes</td>
+ <td>
+ <p>Where to save the output of the compiler. Only works when fork is true.</p>
+ <p>The default value for this property is ${maven.build.dir}/compile.log</p>
+ </td>
+ </tr>
+ <tr>
<td>pom.build.sourceModifications</td>
<td>Yes</td>
<td>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org