Author: grobmeier
Date: Wed Jul 15 22:11:15 2009
New Revision: 794434

URL: http://svn.apache.org/viewvc?rev=794434&view=rev
Log:
maven build doesn't need any dependencies to ant build file anymore. 

Added:
    incubator/log4php/trunk/src/test/config/
    incubator/log4php/trunk/src/test/config/phpunit_to_surefire.xslt
Modified:
    incubator/log4php/trunk/pom.xml

Modified: incubator/log4php/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/pom.xml?rev=794434&r1=794433&r2=794434&view=diff
==============================================================================
--- incubator/log4php/trunk/pom.xml (original)
+++ incubator/log4php/trunk/pom.xml Wed Jul 15 22:11:15 2009
@@ -66,6 +66,10 @@
                <name>Apache Software Foundation</name>
                <url>http://www.apache.org</url>
        </organization>
+       <properties>
+               <surefire.reports>target/surefire-reports</surefire.reports>
+       </properties>
+
        <build>
                <plugins>
                        <plugin>
@@ -76,102 +80,72 @@
                        </plugin>
                        <plugin>
                                <artifactId>maven-antrun-plugin</artifactId>
+                               <dependencies>
+                                       <dependency>
+                                               
<groupId>org.apache.ant</groupId>
+                                               
<artifactId>ant-trax</artifactId>
+                                               <version>1.7.0</version>
+                                       </dependency>
+                                       <dependency>
+                                               <groupId>net.sf.saxon</groupId>
+                                               <artifactId>saxon</artifactId>
+                                               <version>8.7</version>
+                                       </dependency>
+                               </dependencies>
+
                                <executions>
-                                       <execution>
-                                               <phase>compile</phase>
-                                               <id>compile</id>
-                                               <configuration>
-                                                       <tasks>
-                                                               <ant 
target="compile" />
-                                                       </tasks>
-                                               </configuration>
+                                   <!--+
+                        | PHPDoc must be installed for this execution 
+                        +--> 
+                                   <execution>
+                                               <id>phpdoct</id>
+                                               <phase>pre-site</phase>
                                                <goals>
                                                        <goal>run</goal>
                                                </goals>
-                                       </execution>
-                                       <execution>
-                                               <phase>test-compile</phase>
-                                               <id>test-compile</id>
                                                <configuration>
-                                                       <tasks>
-                                                               <ant 
target="test-compile" />
-                                                       </tasks>
-                                               </configuration>
-                                               <goals>
-                                                       <goal>run</goal>
-                                               </goals>
-                                       </execution>
-                                       <execution>
-                                               <phase>test</phase>
-                                               <id>test</id>
-                                               <configuration>
-                                                       <tasks>
-                                                               <ant 
target="test" />
-                                                       </tasks>
-                                               </configuration>
-                                               <goals>
-                                                       <goal>run</goal>
-                                               </goals>
-                                       </execution>
-                                       <execution>
-                                               <phase>site</phase>
-                                               <id>site</id>
-                                               <configuration>
-                                                       <tasks>
-                                                               <ant 
target="apidocs" />
-                                                               <taskdef 
name="replaceregexp"
-                                                                       
classname="org.apache.tools.ant.taskdefs.optional.ReplaceRegExp" />
-                                                               <replaceregexp 
file="target/site/source-repository.html"
-                                                                       
match="/tags/[^ &quot;&apos;&lt;]*" replace="/trunk" flags="g" />
-                                                               <replaceregexp 
match="Documentation generated on .* by "
-                                                                       
replace="Documentation generated by " flags="g">
-                                                                       
<fileset dir="target/site/apidocs" includes="**/*.html" />
-                                                               </replaceregexp>
+                                                                               
        
+                                                       <tasks>
+                                <mkdir dir="target/site/apidocs"/>
+                                               <exec executable="phpdoc" 
failonerror="true">
+                                                       <arg value="-d"/>
+                                                       <arg 
value="src/main/php"/>
+                                                       <arg value="-t"/>
+                                                       <arg 
value="target/site/apidocs"/>
+                                               </exec>
+                                           </tasks>
+                            
+                                               </configuration>
+                                       </execution>
+                                       <!--+
+                        | PHPUnit must be installed for this execution 
+                        +-->      
+                                       <execution>
+                                       <!-- once LOG4PHP-55 is resolved: 
<phase>test</phase>  -->
+                        <phase>never</phase>
+                        <id>test</id>
+                        <configuration>
+                            
+                            <tasks>
+                                <mkdir dir="${surefire.reports}" />
+                                <exec executable="phpunit" dir="src/test/php">
+                                    <arg
+                                        line=" --log-xml 
../../../${surefire.reports}/phpunit-testresults.xml ." />
+                                </exec>
 
-                                                       </tasks>
-                                               </configuration>
-                                               <goals>
-                                                       <goal>run</goal>
-                                               </goals>
-                                       </execution>
-                                       <execution>
-                                               <phase>post-site</phase>
-                                               <id>post-site</id>
-                                               <configuration>
-                                                       <tasks>
-                                                               <ant 
target="post-site" />
-                                                       </tasks>
-                                               </configuration>
-                                               <goals>
-                                                       <goal>run</goal>
-                                               </goals>
-                                       </execution>
-                                       <execution>
-                                               <phase>site-deploy</phase>
-                                               <id>site-deploy</id>
-                                               <configuration>
-                                                       <tasks>
-                                                               <ant 
target="site-deploy" />
-                                                       </tasks>
-                                               </configuration>
-                                               <goals>
-                                                       <goal>run</goal>
-                                               </goals>
-                                       </execution>
+                                <xslt 
in="${surefire.reports}/phpunit-testresults.xml" 
out="${surefire.reports}/xslt.info"
+                                    
style="src/test/config/phpunit_to_surefire.xslt" processor="trax">
+                                    <param name="outputDir" 
expression="${surefire.reports}" />
+                                </xslt>
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
                                </executions>
-                               <dependencies>
-                                       <dependency>
-                                               <groupId>ant</groupId>
-                                               
<artifactId>ant-nodeps</artifactId>
-                                               <version>1.6.5</version>
-                                       </dependency>
-                                       <dependency>
-                                               <groupId>ant-contrib</groupId>
-                                               
<artifactId>ant-contrib</artifactId>
-                                               <version>1.0b2</version>
-                                       </dependency>
-                               </dependencies>
                        </plugin>
+
                        <plugin>
                                <artifactId>maven-assembly-plugin</artifactId>
                                <configuration>
@@ -233,6 +207,11 @@
         </configuration>
       </plugin>
       <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-report-plugin</artifactId>
+      </plugin>
+      
+      <plugin>
         <groupId>org.apache.rat</groupId>
         <artifactId>apache-rat-plugin</artifactId>
       </plugin>

Added: incubator/log4php/trunk/src/test/config/phpunit_to_surefire.xslt
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/config/phpunit_to_surefire.xslt?rev=794434&view=auto
==============================================================================
--- incubator/log4php/trunk/src/test/config/phpunit_to_surefire.xslt (added)
+++ incubator/log4php/trunk/src/test/config/phpunit_to_surefire.xslt Wed Jul 15 
22:11:15 2009
@@ -0,0 +1,42 @@
+<!-- 
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+ -->
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsl:stylesheet version="2.0"
+       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema";
+       xmlns:fn="http://www.w3.org/2005/xpath-functions";>
+       <xsl:output method="xml" version="1.0" encoding="UTF-8"
+               indent="yes" />
+       <xsl:param name="outputDir">.</xsl:param>
+
+       <xsl:template match="testsuites">
+               <xsl:apply-templates select="testsuite" />
+       </xsl:template>
+
+       <xsl:template match="testsuite">
+               <xsl:if test="testcase">
+                       <xsl:variable name="outputName" select="./@name" />
+                       <xsl:result-document 
href="file:///{$outputDir}/{$outputName}.xml" method="xml">
+                               <xsl:copy-of select="." />
+                       </xsl:result-document>
+               </xsl:if>
+
+               <xsl:apply-templates select="testsuite" />
+       </xsl:template>
+</xsl:stylesheet>


Reply via email to