<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>
    <groupId>ru.odnoklassniki</groupId>
    <artifactId>one-nio</artifactId>
    <packaging>jar</packaging>
    <version>1.7.1</version>
    <name>one-nio</name>
    <url>https://github.com/odnoklassniki/one-nio</url>
    <description>Unconventional Java I/O library</description>

    <licenses>
        <license>
            <name>Apache License Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/odnoklassniki/one-nio</url>
        <connection>scm:git:git@github.com:odnoklassniki/one-nio.git</connection>
        <developerConnection>scm:git:git@github.com:odnoklassniki/one-nio.git</developerConnection>
    </scm>
    <developers>
        <developer>
            <id>apangin</id>
            <name>Andrei Pangin</name>
            <email>noreply@pangin.pro</email>
        </developer>
        <developer>
            <id>incubos</id>
            <name>Vadim Tsesko</name>
            <email>incubos@yandex.com</email>
        </developer>
    </developers>

    <dependencies>
        <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm</artifactId>
            <version>9.2</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.36</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <defaultGoal>install</defaultGoal>
        <sourceDirectory>src</sourceDirectory>
        <testSourceDirectory>test</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <id>compile-native</id>
                        <phase>compile</phase>
                        <configuration>
                            <target name="compile-native">
                                <property name="build.dir"      value="target"/>
                                <property name="src.dir"        value="src"/>
                                <property name="gcc.args"       value="-O3 -fno-omit-frame-pointer -momit-leaf-frame-pointer"/>

                                <echo message="Compiling native library..."/>

                                <mkdir dir="${build.dir}/native"/>

                                <pathconvert property="src.native" pathsep=" ">
                                    <fileset dir="${src.dir}" includes="**/*.c"/>
                                </pathconvert>

				<!-- <exec os="Linux" executable="gcc">
                                    <arg line="-D_GNU_SOURCE -fPIC -shared -Wl,-soname,libonenio.so ${gcc.args}
                                               -o ${build.dir}/native/libonenio.so
                                               -I ${java.home}/include -I ${java.home}/include/linux
                                               -I ${java.home}/../include -I ${java.home}/../include/linux
                                               ${src.native} -ldl -lrt"/>
                                </exec>

				<move verbose="true" failonerror="false" file="${build.dir}/native/libonenio.so" todir="${build.dir}/classes"/> -->
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <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-gpg-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>
