<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (c) 2020-2025, Aayush Atharva

  Brotli4j licenses this file to you 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">
    <parent>
        <artifactId>brotli4j-parent</artifactId>
        <groupId>com.aayushatharva.brotli4j</groupId>
        <version>1.20.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>brotli4j</artifactId>
    <name>Brotli4j</name>
    <packaging>jar</packaging>

    <properties>
        <javaModuleName>com.aayushatharva.brotli4j</javaModuleName>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.aayushatharva.brotli4j</groupId>
            <artifactId>service</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>linux-x86_64</id>
            <activation>
                <os>
                    <family>Linux</family>
                    <arch>amd64</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.aayushatharva.brotli4j</groupId>
                    <artifactId>native-linux-x86_64</artifactId>
                    <version>${project.parent.version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>linux-s390x</id>
            <activation>
                <os>
                    <family>Linux</family>
                    <arch>s390x</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.aayushatharva.brotli4j</groupId>
                    <artifactId>native-linux-s390x</artifactId>
                    <version>${project.parent.version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>linux-ppc64le</id>
            <activation>
                <os>
                    <family>Linux</family>
                    <arch>ppc64le</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.aayushatharva.brotli4j</groupId>
                    <artifactId>native-linux-ppc64le</artifactId>
                    <version>${project.parent.version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>linux-aarch64</id>
            <activation>
                <os>
                    <family>Linux</family>
                    <arch>aarch64</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.aayushatharva.brotli4j</groupId>
                    <artifactId>native-linux-aarch64</artifactId>
                    <version>${project.parent.version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>linux-armv7</id>
            <activation>
                <os>
                    <family>Linux</family>
                    <arch>arm</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.aayushatharva.brotli4j</groupId>
                    <artifactId>native-linux-armv7</artifactId>
                    <version>${project.parent.version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>linux-riscv64</id>
            <activation>
                <os>
                    <family>Linux</family>
                    <arch>riscv64</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.aayushatharva.brotli4j</groupId>
                    <artifactId>native-linux-riscv64</artifactId>
                    <version>${project.parent.version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>windows-x86_64</id>
            <activation>
                <os>
                    <family>Windows</family>
                    <arch>amd64</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.aayushatharva.brotli4j</groupId>
                    <artifactId>native-windows-x86_64</artifactId>
                    <version>${project.parent.version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>windows-aarch64</id>
            <activation>
                <os>
                    <family>Windows</family>
                    <arch>aarch64</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.aayushatharva.brotli4j</groupId>
                    <artifactId>native-windows-aarch64</artifactId>
                    <version>${project.parent.version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>osx-x86_64</id>
            <activation>
                <os>
                    <family>Mac</family>
                    <arch>x86_64</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.aayushatharva.brotli4j</groupId>
                    <artifactId>native-osx-x86_64</artifactId>
                    <version>${project.parent.version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>osx-aarch64</id>
            <activation>
                <os>
                    <family>Mac</family>
                    <arch>aarch64</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.aayushatharva.brotli4j</groupId>
                    <artifactId>native-osx-aarch64</artifactId>
                    <version>${project.parent.version}</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.moditect</groupId>
                <artifactId>moditect-maven-plugin</artifactId>
                <version>1.0.0.RC2</version>
                <executions>
                    <execution>
                        <id>add-module-infos</id>
                        <phase>package</phase>
                        <goals>
                            <goal>add-module-info</goal>
                        </goals>
                        <configuration>
                            <jvmVersion>9</jvmVersion>
                            <module>
                                <moduleInfoSource>
                                    module ${javaModuleName} {
                                    requires com.aayushatharva.brotli4j.service;
                                    exports com.aayushatharva.brotli4j;
                                    exports com.aayushatharva.brotli4j.common;
                                    exports com.aayushatharva.brotli4j.decoder;
                                    exports com.aayushatharva.brotli4j.encoder;
                                    uses com.aayushatharva.brotli4j.service.BrotliNativeProvider;
                                    }
                                </moduleInfoSource>
                            </module>
                            <jdepsExtraArgs>
                                <arg>--multi-release</arg>
                                <arg>9</arg>
                            </jdepsExtraArgs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
