<?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">
  <parent>
    <artifactId>gluten-ut</artifactId>
    <groupId>org.apache.gluten</groupId>
    <version>1.3.0</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>gluten-ut-test</artifactId>
  <packaging>jar</packaging>
  <name>Gluten Unit Test</name>

  <dependencies>
    <dependency>
      <groupId>org.apache.gluten</groupId>
      <artifactId>gluten-ut-common</artifactId>
      <version>${project.version}</version>
      <scope>compile</scope>
      <type>test-jar</type>
    </dependency>
    <dependency>
      <groupId>org.apache.parquet</groupId>
      <artifactId>parquet-column</artifactId>
      <version>1.13.1</version>
      <scope>test</scope>
      <classifier>tests</classifier>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>backends-clickhouse</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.apache.gluten</groupId>
          <artifactId>backends-clickhouse</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.celeborn</groupId>
          <artifactId>celeborn-client-spark-${spark.major.version}-shaded_${scala.binary.version}</artifactId>
          <version>${celeborn.version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.arrow</groupId>
          <artifactId>arrow-memory-core</artifactId>
          <version>${arrow.version}</version>
          <scope>provided</scope>
          <exclusions>
            <exclusion>
              <groupId>io.netty</groupId>
              <artifactId>netty-common</artifactId>
            </exclusion>
            <exclusion>
              <groupId>io.netty</groupId>
              <artifactId>netty-buffer</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.apache.arrow</groupId>
          <artifactId>arrow-vector</artifactId>
          <version>${arrow.version}</version>
          <scope>provided</scope>
          <exclusions>
            <exclusion>
              <groupId>io.netty</groupId>
              <artifactId>netty-common</artifactId>
            </exclusion>
            <exclusion>
              <groupId>io.netty</groupId>
              <artifactId>netty-buffer</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>backends-velox</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.apache.gluten</groupId>
          <artifactId>backends-velox</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>       
      </dependencies>
      <properties>
        <clickhouse.lib.path></clickhouse.lib.path>
      </properties>
    </profile>
    <profile>
      <id>backends-omni</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.apache.gluten</groupId>
          <artifactId>backends-omni</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>       
      </dependencies>
      <properties>
      </properties>
    </profile>
  </profiles>

  <build>
    <outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
    <testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.scalastyle</groupId>
        <artifactId>scalastyle-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.scalatest</groupId>
        <artifactId>scalatest-maven-plugin</artifactId>
        <configuration>
          <junitxml>.</junitxml>
        </configuration>
        <executions>
          <execution>
            <id>test</id>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <systemProperties>
                <clickhouse.lib.path>${clickhouse.lib.path}</clickhouse.lib.path>
                <omni.lib.path>${project.basedir}/../../cpp-omni/build/releases/libspark_columnar_plugin.so</omni.lib.path>
                <tpcds.data.path>${tpcds.data.path}</tpcds.data.path>
              </systemProperties>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>prepare-test-jar</id>
            <phase>test-compile</phase>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>