<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.fusesource.hawtdispatch</groupId>
    <artifactId>hawtdispatch-project</artifactId>
    <version>1.2</version>
  </parent>

  <groupId>org.fusesource.hawtdispatch</groupId>
  <artifactId>hawtdispatch-example</artifactId>
  <version>1.2</version>

  <description>HawtDispatch: Examples</description>

  <dependencies>
    
    <dependency>
      <groupId>org.fusesource.hawtbuf</groupId>
      <artifactId>hawtbuf</artifactId>
      <version>1.1</version>
    </dependency>

    <dependency>
      <groupId>org.fusesource.hawtdispatch</groupId>
      <artifactId>hawtdispatch-scala</artifactId>
      <version>1.2</version>
    </dependency>

    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>${scala-version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-compiler</artifactId>
      <version>${scala-version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- Testing -->
    <dependency>
      <groupId>org.scalatest</groupId>
      <artifactId>scalatest</artifactId>
      <version>${scalatest-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>${log4j-version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <defaultGoal>install</defaultGoal>
    <sourceDirectory>src/main/scala</sourceDirectory>
    <testSourceDirectory>src/test/scala</testSourceDirectory>

    <plugins>

      <plugin>
        <groupId>org.scala-tools</groupId>
        <artifactId>maven-scala-plugin</artifactId>
        <version>${scala-plugin-version}</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <scaladocClassName>scala.tools.nsc.ScalaDoc</scaladocClassName>
          <jvmArgs>
            <jvmArg>-Xmx1024m</jvmArg>
          </jvmArgs>
          <args>
            <!-- <arg>-optimise</arg> -->
            <arg>-deprecation</arg>
            <arg>-P:continuations:enable</arg>
          </args>
          <scalaVersion>${scala-version}</scalaVersion>
          <compilerPlugins>
            <compilerPlugin>
              <groupId>org.scala-lang.plugins</groupId>
              <artifactId>continuations</artifactId>
              <version>${scala-version}</version>
            </compilerPlugin>
          </compilerPlugins>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.4.3</version>
        <configuration>
          <!-- we must turn off the use of system class loader so our tests can find stuff - otherwise ScalaSupport compiler can't find stuff -->
          <useSystemClassLoader>false</useSystemClassLoader>
          <!--forkMode>pertest</forkMode-->
          <childDelegation>false</childDelegation>
          <useFile>true</useFile>
          <failIfNoTests>false</failIfNoTests>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <profiles>

    <!-- helper for the IDEA scala integration, enable this profile in IDEA -->
    <profile>
      <id>idea</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.scala-tools</groupId>
            <artifactId>maven-scala-plugin</artifactId>
            <version>${maven-scala-plugin-version}</version>
            <configuration>
              <args>
                <arg>-deprecation</arg>
                <arg>-P:continuations:enable</arg>
              </args>
              <compilerPlugins>
                <compilerPlugin>
                  <groupId>org.scala-lang.plugins</groupId>
                  <artifactId>continuations</artifactId>
                  <version>${scala-version}</version>
                </compilerPlugin>
              </compilerPlugins>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>

</project>
