<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/maven-v4_0_0.xsd">
    <!--
        Copyright (C) 2006,2007 Joerg Schaible
        Created on 17.09.2006 by Joerg Schaible
        
        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.
    -->
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>de.berlios.jsunit</groupId>
        <artifactId>jsunit-parent</artifactId>
        <version>1.3</version>
    </parent>

    <artifactId>jsunit</artifactId>
    <packaging>jar</packaging>
    <name>JsUnit</name>
    <description>
        The JsUnit utilities to embed the JsJunit library into a Java 
        environment.  It includes the JavaScript part as resources.
    </description>

    <build>
        <sourceDirectory>${basedir}/java/main</sourceDirectory>
        <resources>
            <resource>
                <directory>${basedir}/lib</directory>
            </resource>
        </resources>
        <testSourceDirectory>${basedir}/java/test</testSourceDirectory>
    </build>

    <profiles>
        <profile>
            <!-- Cannot activate by default, creates cycle in multi-module build -->
            <id>eat-own-dog-food</id>
            <activation>
                <property>
                    <name>local</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>de.berlios.jsunit</groupId>
                        <artifactId>jsunit-maven2-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>test</id>
                                <configuration>
                                    <sourceDirectory>lib</sourceDirectory>
                                    <sources>
                                        <source>JsUtil.js</source>
                                        <source>JsUnit.js</source>
                                    </sources>
                                    <testSourceDirectory>tests</testSourceDirectory>
                                    <reportsDirectory>target/surefire-reports</reportsDirectory>
                                    <testSuites>
                                        <testSuite>
                                            <name>JsUnitSuite</name>
                                            <type>TESTSUITES</type>
                                            <includes>
                                                <include>*.js</include>
                                            </includes>
                                        </testSuite>
                                    </testSuites>
                                </configuration>
                                <goals>
                                    <goal>jsunit-test</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>rhino</groupId>
            <artifactId>js</artifactId>
        </dependency>
        
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>jmock</groupId>
            <artifactId>jmock</artifactId>
        </dependency>
    </dependencies>
    
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <configuration>
                    <siteDirectory>java/site</siteDirectory>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

</project>

