<?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>
  <parent>
    <groupId>io.github.openfeign.querydsl</groupId>
    <artifactId>querydsl-tooling</artifactId>
    <version>7.4.0</version>
  </parent>

  <artifactId>querydsl-ksp-codegen</artifactId>
  <name>Querydsl - Kotlin KSP codegen support</name>

  <dependencies>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib</artifactId>
      <version>${kotlin.version}</version>
    </dependency>
    <dependency>
      <groupId>io.github.openfeign.querydsl</groupId>
      <artifactId>querydsl-core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.squareup</groupId>
      <artifactId>kotlinpoet</artifactId>
      <version>${kotlinpoet.version}</version>
    </dependency>
    <dependency>
      <groupId>com.squareup</groupId>
      <artifactId>kotlinpoet-ksp</artifactId>
      <version>${kotlinpoet.version}</version>
    </dependency>
    <dependency>
      <groupId>jakarta.persistence</groupId>
      <artifactId>jakarta.persistence-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.devtools.ksp</groupId>
      <artifactId>symbol-processing-api</artifactId>
      <version>${ksp.version}</version>
    </dependency>

    <!-- test -->
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-scripting-jsr223</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.mockk</groupId>
      <artifactId>mockk-jvm</artifactId>
      <version>1.14.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-script-runtime</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>dev.zacsweers.kctfork</groupId>
      <artifactId>core</artifactId>
      <version>${kctfork.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>dev.zacsweers.kctfork</groupId>
      <artifactId>ksp</artifactId>
      <version>${kctfork.version}</version>
      <scope>test</scope>
      <exclusions>
        <!-- com.google.devtools.ksp:symbol-processing is a pom-packaged aggregator;
             kctfork's gradle-published metadata declares it without type=pom, so
             Maven mistakenly tries to download a non-existent jar. The runtime
             artifacts kctfork actually needs (symbol-processing-aa-embeddable,
             symbol-processing-common-deps, symbol-processing-api) are declared
             separately in kctfork's pom and resolve fine. -->
        <exclusion>
          <groupId>com.google.devtools.ksp</groupId>
          <artifactId>symbol-processing</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- Align KSP runtime artifacts with the API version pinned in the root pom.
         kctfork pulls in 2.3.4; the API is at ${ksp.version}=2.3.7. The
         mismatch can surface as KaInvalidLifetimeOwnerAccessException at runtime. -->
    <dependency>
      <groupId>com.google.devtools.ksp</groupId>
      <artifactId>symbol-processing-aa-embeddable</artifactId>
      <version>${ksp.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.devtools.ksp</groupId>
      <artifactId>symbol-processing-common-deps</artifactId>
      <version>${ksp.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>test-compile</id>
            <goals>
              <goal>test-compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jetbrains.dokka</groupId>
        <artifactId>dokka-maven-plugin</artifactId>
      </plugin>
    </plugins>
    <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
    <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
  </build>
</project>
