<?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>
    <artifactId>natives</artifactId>
    <groupId>org.powernukkit</groupId>
    <version>1.0.2-PN-ubuntu20.04</version>
    <name>PowerNukkit Natives</name>
    <description>Provides native ciphers to quickly hash data using AES and Sha256</description>
    <url>https://powernukkit.org</url>
    <inceptionYear>2020</inceptionYear>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/PowerNukkit/PowerNukkit-Natives/issues</url>
    </issueManagement>

    <scm>
        <connection>scm:git:https://github.com/PowerNukkit/PowerNukkit-Natives.git</connection>
        <developerConnection>scm:git:ssh://github.com:PowerNukkit/PowerNukkit-Natives.git</developerConnection>
        <url>https://github.com/PowerNukkit/PowerNukkit-Natives</url>
    </scm>

    <developers>
        <developer>
            <id>PowerNukkit</id>
            <organization>PowerNukkit</organization>
            <organizationUrl>https://powernukkit.org</organizationUrl>
        </developer>
        <developer>
            <id>CloudburstMC</id>
            <organization>CloudburstMC</organization>
            <organizationUrl>https://cloudburstmc.org</organizationUrl>
        </developer>
    </developers>

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

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

        <jni.classifier>${os.detected.name}-${os.detected.arch}</jni.classifier>

        <exe.make>make</exe.make>
        <exe.compiler>gcc</exe.compiler>
        <exe.archiver>ar</exe.archiver>
        <nativeLibName>libnukkit-natives</nativeLibName>
        <nativeIncludeDir>${project.basedir}/src/main/c</nativeIncludeDir>
        <nativeJarWorkdir>${project.build.directory}/native-jar-work</nativeJarWorkdir>
        <nativeObjsOnlyDir>${project.build.directory}/native-objs-only</nativeObjsOnlyDir>
        <nativeLibOnlyDir>${project.build.directory}/native-lib-only</nativeLibOnlyDir>
        <defaultJarFile>${project.build.directory}/${project.build.finalName}.jar</defaultJarFile>
        <nativeJarFile>${project.build.directory}/${project.build.finalName}-${jni.classifier}.jar</nativeJarFile>
    </properties>

    <distributionManagement>
        <repository>
            <id>powernukkit-releases</id>
            <name>powernukkit-releases</name>
            <url>https://api.bintray.com/maven/powernukkit/powernukkit/powernukkit-natives</url>
        </repository>
    </distributionManagement>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.6.2</version>
            </extension>
        </extensions>

        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <compilerVersion>11</compilerVersion>
                    <fork>true</fork>
                    <debug>true</debug>
                    <optimize>true</optimize>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                    <compilerArgument>-Xlint:-options</compilerArgument>
                    <meminitial>256m</meminitial>
                    <maxmem>1024m</maxmem>
                    <excludes>
                        <exclude>**/package-info.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <configuration> <!-- add this to disable checking -->
                    <source>8</source>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.0.0-M1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>3.0.0-M1</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>mac</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <properties>
                <exe.compiler>clang</exe.compiler>
                <jni.platform>darwin</jni.platform>
            </properties>
        </profile>
        <profile>
            <id>linux</id>
            <activation>
                <os>
                    <family>linux</family>
                </os>
            </activation>
            <properties>
                <jni.platform>linux</jni.platform>
            </properties>
        </profile>
        <profile>
            <id>freebsd</id>
            <activation>
                <os>
                    <family>unix</family>
                    <name>freebsd</name>
                </os>
            </activation>
            <properties>
                <exe.compiler>clang</exe.compiler>
                <exe.make>gmake</exe.make>
                <jni.platform>freebsd</jni.platform>
            </properties>
        </profile>
        <profile>
            <id>openbsd</id>
            <activation>
                <os>
                    <family>unix</family>
                    <name>openbsd</name>
                </os>
            </activation>
            <properties>
                <exe.compiler>clang</exe.compiler>
                <exe.make>gmake</exe.make>
                <jni.platform>openbsd</jni.platform>
            </properties>
        </profile>
    </profiles>
</project>
