<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.netmoor.moorhaven</groupId>
        <artifactId>moorhaven-parent</artifactId>
        <version>0.3.2</version>
    </parent>

    <artifactId>moorhaven-ai-hailo</artifactId>
    <name>Moorhaven :: AI Hailo</name>
    <description>Hailo-8 AI accelerator backend via Java FFM/Panama (opt-in; requires HailoRT on the host)</description>

    <properties>
        <!-- Coverage ratchet (#50): own-module line coverage at measurement time minus
             a 2pp safety margin, see doc/coverage-baseline.md. Ratchet-only: raise when
             coverage improves, never lower. -->
        <jacoco.min>0.11</jacoco.min>
    </properties>

    <!--
      This module carries only the thin FFM shim (lib/<arch>/libmoorhaven_hailo.so),
      built by CI on Linux against the HailoRT headers; libhailort itself is required
      installed on the host (not bundled). On platforms/builds without the shim resource
      the loader reports the accelerator unavailable and callers fall back to CPU.
      Pure Java otherwise — FFM (java.lang.foreign) is final in Java 25, no extra deps.
    -->
    <dependencies>
        <dependency>
            <groupId>com.netmoor.moorhaven</groupId>
            <artifactId>moorhaven-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- FFM/Panama calls (SymbolLookup.libraryLookup, Linker.downcallHandle,
                 MemorySegment.reinterpret) are @Restricted and warn under -Xlint. They are
                 intentional here and gated at runtime by the enable-native-access flag; drop
                 only the 'restricted' category so -Werror and every other lint still apply. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerArgs>
                        <arg>-Xlint:all,-processing,-restricted</arg>
                        <arg>-Werror</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
