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

    Copyright (C) 2022 - 2023, the original author or authors.

    Licensed 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>io.github.ascopes.jct</groupId>
    <artifactId>java-compiler-testing-parent</artifactId>
    <version>0.6.2</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>java-compiler-testing</artifactId>

  <name>Java Compiler Testing framework</name>
  <!-- Need to override this as Maven injects the wrong URL otherwise -->
  <url>https://github.com/${project-slug}</url>

  <description>
    Microframework geared towards writing declarative integration tests against Java compiler
    plugins and annotation processors, with a focus on forwards-compatibility, fluency,
    and good testing practises.
  </description>

  <dependencies>
    <dependency>
      <groupId>com.google.jimfs</groupId>
      <artifactId>jimfs</artifactId>
    </dependency>

    <dependency>
      <groupId>me.xdrop</groupId>
      <artifactId>fuzzywuzzy</artifactId>
    </dependency>

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

    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jspecify</groupId>
      <artifactId>jspecify</artifactId>
    </dependency>

    <dependency>
      <!-- Used to provide convenience annotations -->
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>

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

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-testkit</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgs>
            <!--
              Disable warnings about modules. We cannot do much about some of these due to how Maven
              works with modules with Surefire.
            -->
            <arg>-Xlint:-module</arg>
          </compilerArgs>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>

        <configuration>
          <excludePackageNames>
            io.github.ascopes.jct.compilers.javac;
            io.github.ascopes.jct.**.impl;
            io.github.ascopes.jct.junit.ext;
            io.github.ascopes.jct.utils;
          </excludePackageNames>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>

        <configuration>
          <excludes>
            <!-- LoomPolyFill contains JDK-specific code, so 100% coverage isn't possible on a
                single platform. -->
            <exclude>io/github/ascopes/jct/utils/LoomPolyfill.class</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
