<?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.2.6</version>
  </parent>
  <groupId>com.github.JesusMcCloud.tor-binary</groupId>
  <artifactId>tor-binary-macos</artifactId>
  <version>0.4.2.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-osx</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <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}/osx" />
                <exec failonerror="true" executable="${7z_executable}">
                  <arg line="x ${project.remote-resource.directory}/TorBrowser-${torbrowser.version}-osx64_en-US.dmg -o${project.build.directory}/osx -aoa *"></arg>
                </exec>
                <property name="path" value="${project.build.directory}/osx/Tor Browser.app/Contents/MacOS/Tor/" />
                <available file="${project.build.directory}/osx/TorBrowser.app" property="path" type="dir" value="${project.build.directory}/osx/TorBrowser.app/Contents/MacOS/Tor/" />
                <delete failonerror="false" dir="${project.basedir}/src/" />
                <delete dir="${project.remote-resource.directory}" />
                <mkdir dir="${project.basedir}/src/main/resources/native/osx/x64/" />
                <exec failonerror="true" dir="${path}" executable="tar">
                  <arg line="-cJvf ${project.basedir}/src/main/resources/native/osx/x64/tor.tar.xz ." />
                </exec>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
