<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>com.projectdarkstar.example.hack</groupId>
    <artifactId>hack</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>

  <artifactId>hack-ai</artifactId>
  <name>Hack Example AI</name>
  <packaging>jar</packaging>
  <description>
    Client AI module for the Project Darkstar Hack example.
  </description>

  <dependencies>
    <!-- Compile time dependencies -->
    <dependency>
      <groupId>com.projectdarkstar.client</groupId>
      <artifactId>sgs-client-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.projectdarkstar.example.hack</groupId>
      <artifactId>hack-shared</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>com.projectdarkstar.example.hack</groupId>
      <artifactId>hack-client</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>

    <!-- Runtime dependencies -->
    <dependency>
      <groupId>com.projectdarkstar.client</groupId>
      <artifactId>sgs-client</artifactId>
    </dependency>
  </dependencies>


  <profiles>
    <!-- The test-run profile enables the antrun plugin
	 to run the application in the process-test-resources
	 phase of the lifecycle
	 In order to run, use the following command:
	 mvn process-test-resources -Ptest-run -->
    <profile>
      <id>test-run</id>
      <build>
	<plugins>
	  <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
	    <executions>
	      <execution>
		<id>test-run</id>
		<phase>process-test-resources</phase>
		<goals>
		  <goal>run</goal>
		</goals>
		<configuration>
		  <tasks>

		    <java classname="com.sun.sgs.example.hack.client.ai.AIClient"
			  fork="true">
		      <jvmarg line="${run.jvm.args}"/>
		      <jvmarg line="-server"/>
		      <sysproperty key="java.util.logging.config.file"
				   file="${run.logging}"/>
		      <sysproperty key="host"
				   value="${hack.host}"/>
		      <sysproperty key="port"
				   value="${hack.port}"/>
		      <classpath>
			<path refid="maven.test.classpath"/>
		      </classpath>
		      <arg value="${ai.clients}"/>
		    </java>
		  </tasks>
		</configuration>
	      </execution>
	    </executions>
	  </plugin>
	</plugins>
      </build>
    </profile>

  </profiles>

  <properties>
    <run.jvm.args></run.jvm.args>
    <run.logging>${basedir}/src/test/properties/logging.properties</run.logging>
    <hack.host>localhost</hack.host>
    <hack.port>4458</hack.port>
    <ai.clients>1</ai.clients>
  </properties>


</project>
