<?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>

    <groupId>com.k3rnl.fuse</groupId>
    <artifactId>fuse-native</artifactId>
    <version>1.0.3</version>
    <packaging>jar</packaging>

    <!-- Project Metadata -->
    <name>Fuse Native</name>
    <description>A Java library for FUSE filesystem operations in GraalVM Native Image</description>
    <url>https://github.com/k3rnL/java-fuse-native</url>

    <!-- Licensing -->
    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>k3rnL</id>
            <name>Erwan Daniel</name>
            <email>contact@erwandaniel.fr</email>
        </developer>
    </developers>

    <!-- Source Control Management -->
    <scm>
        <connection>scm:git:https://github.com/k3rnL/java-fuse-native.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/k3rnL/java-fuse-native.git</developerConnection>
        <url>https://github.com/yourusername/fuse-native</url>
    </scm>

    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.graalvm.nativeimage</groupId>
            <artifactId>svm</artifactId>
            <version>23.1.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Maven Compiler Plugin -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>

            <!-- Maven Source Plugin -->
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- GraalVM Native Maven Plugin -->
            <plugin>
                <groupId>org.graalvm.buildtools</groupId>
                <artifactId>native-maven-plugin</artifactId>
                <version>0.10.3</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- Release Profile -->
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <!-- Maven Release Plugin -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>3.0.1</version>
                    </plugin>
                    <!-- Maven GPG Plugin for signing artifacts -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <keyname>180911A4092A2DB4</keyname>
                            <passphrase>${gpg.passphrase}</passphrase>
                        </configuration>
                    </plugin>
                    <!-- Sonatype publishing plugin -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.6.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </plugin>
                    <!-- Maven Javadoc Plugin to generate Javadoc JAR -->
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.4.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>build-examples</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>memory-fs</id>
                                <goals>
                                    <goal>compile-no-fork</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <mainClass>com.k3rnl.fuse.examples.MemoryFSOperations</mainClass>
                                    <imageName>memory-fs</imageName>
                                    <buildArgs>
                                        <arg>-O3</arg>
                                        <arg>--gc=G1</arg>
                                        <arg>--no-fallback</arg>
                                    </buildArgs>
                                </configuration>
                            </execution>
                            <execution>
                                <id>zip-fs</id>
                                <goals>
                                    <goal>compile-no-fork</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <mainClass>com.k3rnl.fuse.examples.ZipFSOperations</mainClass>
                                    <imageName>zip-fs</imageName>
                                    <buildArgs>
                                        <arg>-O3</arg>
                                        <arg>--no-fallback</arg>
                                    </buildArgs>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


</project>