<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.bytedeco</groupId>
    <artifactId>javacpp-presets</artifactId>
    <version>1.5.12</version>
  </parent>

  <groupId>org.bytedeco</groupId>
  <artifactId>tensorrt</artifactId>
  <version>10.12-${project.parent.version}</version>
  <name>JavaCPP Presets for TensorRT</name>

  <dependencies>
    <dependency>
      <groupId>org.bytedeco</groupId>
      <artifactId>cuda</artifactId>
      <version>12.9-9.10-${project.parent.version}</version>
    </dependency>
    <dependency>
      <groupId>org.bytedeco</groupId>
      <artifactId>javacpp</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.bytedeco</groupId>
        <artifactId>javacpp</artifactId>
        <configuration>
          <encoding>ISO-8859-1</encoding>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.bytedeco</groupId>
            <artifactId>cuda</artifactId>
            <version>12.9-9.10-${project.parent.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>javacpp-${javacpp.platform}</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>${javacpp.platform}</classifier>
              <includes>
                <include>org/bytedeco/tensorrt/${javacpp.platform}/*jni*</include>
                <include>META-INF/native-image/${javacpp.platform}/</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.moditect</groupId>
        <artifactId>moditect-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <encoding>ISO-8859-1</encoding>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>redist</id>
      <activation>
        <property>
          <name>redist</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
              <execution>
                <id>javacpp-${javacpp.platform}-redist</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <classifier>${javacpp.platform}-redist</classifier>
                  <classesDirectory>${project.build.directory}/native</classesDirectory>
                  <includes>
                    <include>org/bytedeco/tensorrt/${javacpp.platform}/</include>
                    <include>META-INF/native-image/${javacpp.platform}/</include>
                  </includes>
                  <excludes>
                    <exclude>org/bytedeco/tensorrt/${javacpp.platform}/*jni*</exclude>
                  </excludes>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.moditect</groupId>
            <artifactId>moditect-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>add-module-info-redist</id>
                <phase>package</phase>
                <goals>
                  <goal>add-module-info</goal>
                </goals>
                <configuration>
                  <modules>
                    <module>
                      <file>${project.build.directory}/${project.artifactId}-${javacpp.platform}-redist.jar</file>
                      <moduleInfoSource>
                        open module org.bytedeco.${javacpp.packageName}.${javacpp.platform.module}.redist {
                          requires transitive org.bytedeco.${javacpp.packageName};
                        }
                      </moduleInfoSource>
                    </module>
                  </modules>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
