<?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.gatein.shindig</groupId>
    <artifactId>shindig-project</artifactId>
    <version>2.0.2</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>shindig-features</artifactId>
  <packaging>jar</packaging>

  <name>Apache Shindig Features</name>
  <description>Packages all the features that shindig provides into a single jar file to allow
    loading from the classpath
  </description>

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

  <pluginRepositories>
    <pluginRepository>
      <id>jsdoctk2</id>
      <url>http://jsdoctk-plugin.googlecode.com/svn/repo</url>
    </pluginRepository>
  </pluginRepositories>

  <build>
    <resources>
      <resource>
        <targetPath>features</targetPath>
        <directory>${basedir}/src/main/javascript/features</directory>
      </resource>
      <resource>
        <targetPath>META-INF</targetPath>
        <directory>${basedir}</directory>
        <includes>
          <include>NOTICE</include>
        </includes>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <targetPath>features</targetPath>
        <directory>${basedir}/src/test/javascript/features</directory>
      </testResource>
    </testResources>

    <pluginManagement>
      <!-- set versions of common plugins for reproducibility, ordered alphabetically by owner -->
      <plugins>
        <!-- Misc -->
        <plugin>
          <groupId>de.berlios.jsunit</groupId>
          <artifactId>jsunit-maven2-plugin</artifactId>
          <version>1.3</version>
          <dependencies>
            <dependency>
                <groupId>rhino</groupId>
                <artifactId>js</artifactId>
                <version>1.7R1</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>net.sf.alchim</groupId>
          <artifactId>yuicompressor-maven-plugin</artifactId>
          <version>0.7.1</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <!-- ordered alphabetically by owner -->
    <plugins>
      <plugin>
        <groupId>de.berlios.jsunit</groupId>
        <artifactId>jsunit-maven2-plugin</artifactId>
        <executions>
          <execution>
            <configuration>
              <sourceDirectory>${basedir}/src/main/javascript/features</sourceDirectory>
              <sources>
                <source>../../../../src/test/javascript/features/mocks/env.js</source>
                <source>../../../../src/test/javascript/features/mocks/window.js</source>
                <source>../../../../src/test/javascript/features/mocks/xhr.js</source>
                <source>globals/globals.js</source>
                <source>core.config/config.js</source>
                <source>core.config/configcontainer.js</source>
                <source>core.config/configgadget.js</source>
                <source>core.json/json.js</source>
                <source>shindig.auth/auth.js</source>
                <source>core.util/util.js</source>
                <source>core.prefs/prefs.js</source>
                <source>core.log/log.js</source>
                <source>core.io/io.js</source>
                <source>i18n/currencycodemap.js</source>
                <source>i18n/datetimeformat.js</source>
                <source>i18n/datetimeparse.js</source>
                <source>i18n/formatting.js</source>
                <source>i18n/numberformat.js</source>
                <source>setprefs/setprefs.js</source>
                <source>views/views.js</source>
                <source>shindig.uri/uri.js</source>
                <source>shindig.xhrwrapper/xhrwrapper.js</source>
                <source>xmlutil/xmlutil.js</source>
                <source>opensocial-data-context/datacontext.js</source>
                <source>opensocial-data/data.js</source>
                <source>opensocial-reference/opensocial.js</source>
                <source>opensocial-reference/activity.js</source>
                <source>opensocial-reference/address.js</source>
                <source>opensocial-reference/album.js</source>
                <source>opensocial-reference/bodytype.js</source>
                <source>opensocial-reference/collection.js</source>
                <source>opensocial-reference/container.js</source>
                <source>opensocial-reference/datarequest.js</source>
                <source>opensocial-reference/dataresponse.js</source>
                <source>opensocial-reference/email.js</source>
                <source>opensocial-reference/enum.js</source>
                <source>opensocial-reference/environment.js</source>
                <source>opensocial-reference/idspec.js</source>
                <source>opensocial-reference/mediaitem.js</source>
                <source>opensocial-reference/message.js</source>
                <source>opensocial-reference/name.js</source>
                <source>opensocial-reference/navigationparameters.js</source>
                <source>opensocial-reference/organization.js</source>
                <source>opensocial-reference/person.js</source>
                <source>opensocial-reference/phone.js</source>
                <source>opensocial-reference/responseitem.js</source>
                <source>opensocial-reference/url.js</source>
                <source>opensocial-base/fieldtranslations.js</source>
                <source>opensocial-base/jsonactivity.js</source>
                <source>opensocial-base/jsonalbum.js</source>
                <source>opensocial-base/jsonmediaitem.js</source> 
                <source>opensocial-base/jsonperson.js</source>
                <source>opensocial-jsonrpc/jsonrpccontainer.js</source>
                <source>osapi/osapi.js</source>
                <source>osapi/batch.js</source>
                <source>osapi/jsonrpctransport.js</source>
                <source>osapi/peoplehelpers.js</source>
                <source>../../../../src/test/javascript/lib/testutils.js</source>
                <source>oauthpopup/oauthpopup.js</source>
              </sources>
              <testSourceDirectory>${basedir}/src/test/javascript/features</testSourceDirectory>
              <testSuites>
                <testSuite>
                  <name>FeatureTests</name>
                  <type>TESTCASES</type>
                  <includes>
                    <include>mocks/*.js</include>
                    <include>*/*test.js</include>
                  </includes>
                </testSuite>
              </testSuites>
            </configuration>
            <goals>
              <goal>jsunit-test</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
      </plugin>
      <plugin>
        <!-- TODO: Replace this with the more generic javascript plugin that
          allows the use of arbitrary compressor / compilers.
          The maven-javascript-plugin does not seem to work.
        -->
        <!-- <groupId>net.sf.hammerfest</groupId> -->
        <!-- <artifactId>maven-javascript-plugin</artifactId> -->
        <groupId>net.sf.alchim</groupId>
        <artifactId>yuicompressor-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>compress</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <suffix>.opt</suffix>
          <excludes>
            <exclude>**/*.xml</exclude>
            <!-- Caja & swfobject are already minified -->
            <exclude>**/caja/*.js</exclude>
            <exclude>**/swfobject/*.js</exclude>
          </excludes>
          <jswarn>false</jswarn>
          <statistics>false</statistics>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>reporting</id>
      <build>
        <plugins>
          <plugin>
            <groupId>nl.windgazer</groupId>
            <artifactId>jsdoctk-plugin</artifactId>
            <version>2.3.0-RC1</version>
            <configuration>
              <recurse>3</recurse><!-- This is the level of recursion, not a boolean -->
              <srcDir>${basedir}/src/main/javascript/features</srcDir>
              <ext>js</ext>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
