<?xml version="1.0" encoding="UTF-8"?>

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>
    <artifactId>com.io7m.xoanon</artifactId>
    <groupId>com.io7m.xoanon</groupId>
    <version>2.0.0</version>
  </parent>

  <artifactId>com.io7m.xoanon.commander</artifactId>

  <name>com.io7m.xoanon.commander</name>
  <description>JUnit 5 JavaFX test harness (Commander implementation)</description>
  <url>https://www.io7m.com/software/xoanon</url>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>com.io7m.xoanon.commander.api</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>com.io7m.jxtrand</groupId>
      <artifactId>com.io7m.jxtrand.vanilla</artifactId>
    </dependency>

    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-base</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-fxml</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-graphics</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-controls</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.annotation.bundle</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.annotation.versioning</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- Ignore dependencies that bytecode analysis gets wrong. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <configuration>
          <failOnWarning>true</failOnWarning>
          <ignoredUnusedDeclaredDependencies>
            <ignoredUnusedDeclaredDependency>org.openjfx:*:*</ignoredUnusedDeclaredDependency>
          </ignoredUnusedDeclaredDependencies>
          <ignoredUsedUndeclaredDependencies>
            <ignoredUsedUndeclaredDependency>org.openjfx:*:*</ignoredUsedUndeclaredDependency>
          </ignoredUsedUndeclaredDependencies>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.io7m.stmp</groupId>
        <artifactId>string-template-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-version</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>render</goal>
            </goals>
            <configuration>
              <templates>
                <template>
                  <directory>src/main/string-template</directory>
                  <name>XBVersion</name>
                  <target>
                    ${project.build.directory}/generated-sources/string-template/com/io7m/xoanon/commander/XBVersion.java
                  </target>
                  <properties>
                    <appVersion>${project.version}</appVersion>
                    <appBuild>${buildNumber}</appBuild>
                  </properties>
                </template>
              </templates>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
