<?xml version="1.0" encoding="UTF-8"?><!--
 * 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.shindig</groupId>
    <artifactId>shindig-project</artifactId>
    <version>2.5.0-beta3</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>shindig-php</artifactId>
  <packaging>pom</packaging>

  <name>Apache Shindig PHP</name>
  <description>PHP tests</description>

  <scm>
    <connection>scm:svn:http://svn.apache.org/repos/asf/shindig/tags/shindig-project-2.5.0-beta3/php</connection>
    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/shindig/tags/shindig-project-2.5.0-beta3/php</developerConnection>
    <url>http://svn.apache.org/viewvc/shindig/tags/shindig-project-2.5.0-beta3/php</url>
  </scm>

  <!-- common params -->
  <properties>
    <surefire.reports>target/surefire-reports</surefire.reports>
    <coverage.report>target/site/coverage-report</coverage.report>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <workingDirectory>target</workingDirectory>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <dependencies>
          <dependency>
            <!-- note that 1.8.0 has problems generating xslt output... -->
            <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>
          <!-- run basic lint -->
          <execution>
            <id>phplint</id>
            <phase>process-sources</phase>
            <goals><goal>run</goal></goals>
            <configuration>
              <target>
                <apply executable="php">
                  <arg value="-l" />
                  <arg value="-n" />
                  <fileset dir="." includes="src/**/*.php" />
                </apply>
              </target>
            </configuration>
          </execution>
          <!-- phpdocs -->
	  <execution>
	    <id>phpdoc</id>
	    <phase>pre-site</phase>
	    <goals><goal>run</goal></goals>
	    <configuration>
	      <target>
		<mkdir dir="target/site/phpdoc" />
		<exec executable="phpdoc" failonerror="true">
		  <arg value="-d" />
		  <arg value="src" />
		  <arg value="-t" />
		  <arg value="target/site/phpdoc" />
		  <arg value="-o" />
		  <arg value="HTML:frames:DOM/default" />
		  <arg value="--title" />
		  <arg value="Apache Shindig ${project.version}" />
		</exec>
	      </target>
	    </configuration>
	  </execution>
	  
          <!-- run phpunit -->
          <execution>
            <id>test</id>
            <phase>test</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <mkdir dir="${surefire.reports}" />
                <mkdir dir="${coverage.report}" />
		<mkdir dir="target/tmp" />
                <exec executable="phpunit" dir=".">
                  <arg value="--verbose" />
		  <env key="TMPDIR" value="${basedir}/target/tmp" />
                </exec>
                <xslt in="${surefire.reports}/phpunit-testresults.xml" out="${surefire.reports}/xslt.info" style="test/config/phpunit_to_surefire.xslt">
                  <param name="outputDir" expression="." />
                </xslt>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>reporting</id>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
          </plugin>
        </plugins>
      </reporting>
    </profile>
  </profiles>
</project>


