<?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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.deephacks.lmdbjni</groupId>
    <artifactId>lmdbjni-project</artifactId>
    <version>0.3.2</version>
  </parent>

  <artifactId>lmdbjni-win64</artifactId>
  <version>0.3.2</version>

  <name>${project.artifactId}</name>
  <description>The lmdbjni Windows 64 bit native libraries</description>

  <properties>
    <lmdb-home>${project.build.directory}/lmdb/META-INF/native/lmdb-win64</lmdb-home>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.deephacks.lmdb</groupId>
      <artifactId>lmdb-win64</artifactId>
      <version>0.1.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.deephacks.lmdbjni</groupId>
      <artifactId>lmdbjni</artifactId>
      <version>0.3.2</version>
    </dependency>
  </dependencies>

  <build>
    <testSourceDirectory>${basedir}/../lmdbjni/src/test/java</testSourceDirectory>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.8</version>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>validate</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.deephacks.lmdb</groupId>
                  <artifactId>lmdb-win64</artifactId>
                  <version>0.1.2</version>
                  <type>jar</type>
                  <overWrite>false</overWrite>
                  <outputDirectory>${project.build.directory}/lmdb</outputDirectory>
                  <includes>META-INF/**</includes>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.3.1</version>
        <configuration>
          <classesDirectory>${basedir}/target/generated-sources/hawtjni/lib</classesDirectory>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkMode>once</forkMode>
          <environmentVariables>
            <LD_LIBRARY_PATH>${lmdb-home}</LD_LIBRARY_PATH>
          </environmentVariables>
          <systemProperties>
            <property>
              <name>java.library.tmpdir</name>
              <value>${lmdb-home}</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.fusesource.hawtjni</groupId>
        <artifactId>maven-hawtjni-plugin</artifactId>
        <version>${hawtjni-version}</version>
        <executions>
          <execution>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <name>lmdbjni</name>
          <classified>false</classified>
          <nativeSrcDependency>
            <groupId>org.deephacks.lmdbjni</groupId>
            <artifactId>lmdbjni</artifactId>
            <version>${project.version}</version>
            <classifier>native-src</classifier>
            <type>zip</type>
          </nativeSrcDependency>
          <packageDirectory>${basedir}/../lmdbjni/target/generated-sources/hawtjni/native-package</packageDirectory>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
