<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.github.JesusMcCloud.tor-binary</groupId>
    <artifactId>tor-binary</artifactId>
    <version>0.4.3.6</version>
  </parent>
  <groupId>com.github.JesusMcCloud.tor-binary</groupId>
  <artifactId>tor-binary-windows</artifactId>
  <version>0.4.3.6</version>
  <name>JesusMcCloud/tor-binary</name>
  <description>Tor  binary packaged in a way that can be used for java projects</description>
  <url>https://github.com/JesusMcCloud/tor-binary</url>
  <inceptionYear>2017</inceptionYear>
  <developers>
    <developer>
      <id>JesusMcCloud</id>
      <name>Bernd Prünster</name>
      <email></email>
    </developer>
  </developers>
  <scm>
    <connection>scm:git://github.com/JesusMcCloud/tor-binary.git</connection>
    <developerConnection>scm:git://github.com/JesusMcCloud/tor-binary.git</developerConnection>
    <url>git://github.com/JesusMcCloud/tor-binary.git</url>
  </scm>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.8</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-remote-resources-plugin</artifactId>
        <version>1.6.0</version>
        <executions>
          <execution>
            <goals>
              <goal>process</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <resourceBundles>
            <resourceBundle>com.github.JesusMcCloud:tor-binary-resources:${project.version}</resourceBundle>
          </resourceBundles>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.8</version>
        <executions>
          <execution>
            <id>unpack-windows</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <taskdef resource="org/apache/ant/compress/antlib.xml" classpathref="maven.plugin.classpath" />
                <property name="7z_executable" value="${project.remote-resource.directory}/p7zip/7z" />
                <chmod perm="+x" includes="**/*" dir="${7z_executable}/.." />
                <property environment="env" />
                <available file="7z" filepath="${env.PATH}" property="7z_executable" value="7z" />
                <delete failonerror="false" dir="${project.build.directory}/windows/" />
                <exec failonerror="true" executable="${7z_executable}">
                  <arg line="x ${project.remote-resource.directory}/torbrowser-install-${torbrowser.version}_en-US.exe -o${project.build.directory}/windows -aoa Browser/TorBrowser/Tor/*"></arg>
                </exec>
                <tar destfile="${project.build.directory}/win32.tar">
                  <tarfileset dir="${project.build.directory}/windows/Browser/TorBrowser/Tor/" />
                </tar>
                <delete failonerror="false" dir="${project.basedir}/src/" />
                <delete dir="${project.remote-resource.directory}" />
                <xz destfile="${project.basedir}/src/main/resources/native/windows/x86/tor.tar.xz" src="${project.build.directory}/win32.tar" />
              </target>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-compress</artifactId>
            <version>1.4</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
</project>
