<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>uk.ac.sussex.gdsc</groupId>
    <artifactId>gdsc-test-parent</artifactId>
    <version>1.0.2</version>
  </parent>

  <artifactId>gdsc-test-api</artifactId>
  <packaging>jar</packaging>

  <name>GDSC Test API</name>
  <description>Genome Damage and Stability Centre Test API

Contains a generic framework for test predicates.
</description>

  <properties>
    <gdsc.automatic.module.name>uk.ac.sussex.gdsc.test.api</gdsc.automatic.module.name>
    <!-- Workaround to avoid duplicating config files. -->
    <parent.dir>${basedir}/..</parent.dir>
    <generated.sources>${project.build.directory}/generated-sources/java</generated.sources>
    <generated.test.sources>${project.build.directory}/generated-test-sources/java</generated.test.sources>
  </properties>

  <dependencies>
    <dependency>
      <groupId>uk.ac.sussex.gdsc</groupId>
      <artifactId>gdsc-test-generator</artifactId>
      <version>1.0.2</version>
      <!-- Only needed for compilation -->
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-rng-simple</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>net.revelc.code.formatter</groupId>
          <artifactId>formatter-maven-plugin</artifactId>
          <version>${formatter-maven-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>uk.ac.sussex.gdsc</groupId>
              <artifactId>gdsc-test-build-tools</artifactId>
              <version>${project.version}</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <classpathScope>compile</classpathScope>
              <executable>java</executable>
              <arguments>
                <argument>-classpath</argument>
                <!-- automatically creates the classpath using all project dependencies, also adding the project build directory -->
                <classpath />
                <argument>uk.ac.sussex.gdsc.test.generator.CodeGenerator</argument>
                <argument>src/main/templates</argument>
                <argument>${generated.sources}</argument>
                <argument>--header</argument>
                <argument>src/main/templates/license-header.txt</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>generate-test-sources</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <classpathScope>compile</classpathScope>
              <executable>java</executable>
              <arguments>
                <argument>-classpath</argument>
                <!-- automatically creates the classpath using all project dependencies, also adding the project build directory -->
                <classpath />
                <argument>uk.ac.sussex.gdsc.test.generator.CodeGenerator</argument>
                <argument>src/test/templates</argument>
                <argument>${generated.test.sources}</argument>
                <argument>--header</argument>
                <argument>src/main/templates/license-header.txt</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>process-sources</id>
            <phase>process-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${generated.sources}</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>process-test-sources</id>
            <phase>process-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${generated.test.sources}</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
