<?xml version="1.0" encoding="UTF-8"?>
<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>

  <groupId>io.github.nyub</groupId>
  <artifactId>expekt-test</artifactId>
  <version>0.0.1</version>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>In-source snapshot testing for Kotlin/Java</description>
  <url>https://github.com/NyuB/expekt-test</url>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Brice Decaestecker</name>
      <organization>NyuB</organization>
      <organizationUrl>https://github.com/NyuB</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/NyuB/expekt-test.git</connection>
    <developerConnection>scm:git:ssh://github.com:NyuB/expekt-test.git</developerConnection>
    <url>http://github.com/NyuB/expekt-test/tree/main</url>
  </scm>

  <properties>
    <junit.version>5.10.0</junit.version>
    <kotlin.code.style>official</kotlin.code.style>
    <kotlin.compiler.jvmTarget>17</kotlin.compiler.jvmTarget>
    <kotlin.version>2.1.0</kotlin.version>
    <maven.compiler.release>17</maven.compiler.release>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spotless.sortOrder>scope,groupId,artifactId,classifier,version</spotless.sortOrder>
    <spotless.version>2.44.2</spotless.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.27.3</version>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib</artifactId>
      <version>${kotlin.version}</version>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${junit.version}</version>
    </dependency>

    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-test-junit5</artifactId>
      <version>${kotlin.version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <repositories>
    <repository>
      <id>mavenCentral</id>
      <url>https://repo1.maven.org/maven2/</url>
    </repository>
  </repositories>

  <build>
    <plugins>
      <plugin>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-maven-plugin</artifactId>
        <version>${kotlin.version}</version>
        <executions>
          <execution>
            <id>compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <phase>compile</phase>
          </execution>
          <execution>
            <id>test-compile</id>
            <goals>
              <goal>test-compile</goal>
            </goals>
            <phase>test-compile</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
      </plugin>

      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.22.2</version>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.6.0</version>
        <configuration>
          <mainClass>nyub.craftinginterpreters.Lox</mainClass>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless.version}</version>
        <configuration>
          <formats>
            <format>
              <includes>
                <include>.gitattributes</include>
                <include>.gitignore</include>
                <include>Makefile</include>
              </includes>
              <trimTrailingWhitespace/>
              <endWithNewline/>
              <indent>
                <tabs>true</tabs>
                <spacesPerTab>4</spacesPerTab>
              </indent>
            </format>
          </formats>
          <java>
            <googleJavaFormat>
              <style>GOOGLE</style>
              <reflowLongStrings>false</reflowLongStrings>
              <formatJavadoc>false</formatJavadoc>
            </googleJavaFormat>
          </java>
          <kotlin>
            <includes>
              <include>src/**/*.kt</include>
            </includes>
            <ktfmt>
              <style>KOTLINLANG</style>
              <maxWidth>120</maxWidth>
              <removeUnusedImports>true</removeUnusedImports>
              <manageTrailingCommas>true</manageTrailingCommas>
            </ktfmt>
          </kotlin>
          <pom>
            <sortPom>
              <encoding>UTF-8</encoding>
              <lineSeparator>${line.separator}</lineSeparator>
              <keepBlankLines>true</keepBlankLines>
              <indentBlankLines>false</indentBlankLines>
              <endWithNewline>true</endWithNewline>
              <nrOfIndentSpace>2</nrOfIndentSpace>
              <expandEmptyElements>false</expandEmptyElements>

              <sortDependencies>${spotless.sortOrder}</sortDependencies>
              <sortDependencyExclusions>${spotless.sortOrder}</sortDependencyExclusions>
              <sortProperties>true</sortProperties>
              <sortModules>true</sortModules>
              <sortPlugins/>
              <sortExecutions/>
            </sortPom>
          </pom>

        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jetbrains.dokka</groupId>
        <artifactId>dokka-maven-plugin</artifactId>
        <version>2.0.0</version>
        <executions>
          <execution>
            <goals>
              <goal>dokka</goal>
            </goals>
            <phase>package</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
          <execution>
            <id>dokka-jar</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <classifier>javadoc</classifier>
              <classesDirectory>${project.build.directory}/dokka</classesDirectory>
              <skipIfEmpty>true</skipIfEmpty>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.2.7</version>
        <configuration>
          <gpgArguments>
            <arg>--pinentry-mode</arg>
            <arg>loopback</arg>
          </gpgArguments>
        </configuration>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <goals>
              <goal>sign</goal>
            </goals>
            <phase>verify</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.7.0</version>
        <extensions>true</extensions>
        <configuration>
          <autoPublish>true</autoPublish>
          <publishingServerId>central</publishingServerId>
        </configuration>
      </plugin>
    </plugins>
    <sourceDirectory>src/main/kotlin</sourceDirectory>
    <testSourceDirectory>src/test/kotlin</testSourceDirectory>
  </build>
</project>
