<?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>

  <!-- ************************************************************* -->
  <!-- *** POM Relationships *************************************** -->
  <!-- ************************************************************* -->

  <parent>
    <groupId>org.nuiton.js</groupId>
    <artifactId>nuiton-js-lib</artifactId>
    <version>1.0.2</version>
  </parent>

  <artifactId>nuiton-js-angular-ui-tree</artifactId>
  <version>2.0.6-1</version>

  <name>Nuiton JS :: AngularJS UI-Tree</name>
  <description>The AngularJS Tree component with drag and drop support.</description>

  <url>http://jimliu.github.io/angular-ui-tree/</url>

  <properties>
    <license.licenseName>mit</license.licenseName>

    <upstreamVersion>2.0.6</upstreamVersion>
    <upstreamUrl>https://github.com/JimLiu/angular-ui-tree/archive</upstreamUrl>
    <upstreamFile>v${upstreamVersion}.zip</upstreamFile>
    <destDir>${project.build.outputDirectory}/META-INF/resources/${project.artifactId}</destDir>
  </properties>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://raw.githubusercontent.com/JimLiu/angular-ui-tree/master/LICENSE</url>
    </license>
  </licenses>

  <scm>
    <connection>scm:svn:https://svn.nuiton.org/nuiton-js/nuiton-js-angular-ui-tree/tags/nuiton-js-angular-ui-tree-2.0.6-1</connection>
    <developerConnection>scm:svn:https://svn.nuiton.org/nuiton-js/nuiton-js-angular-ui-tree/tags/nuiton-js-angular-ui-tree-2.0.6-1</developerConnection>
    <url>https://forge.nuiton.org/projects/nuiton-js/repository/show/nuiton-js-angular-ui-tree/tags/nuiton-js-angular-ui-tree-2.0.6-1</url>
  </scm>

  <dependencies>
    <dependency>
      <groupId>org.nuiton.js</groupId>
      <artifactId>nuiton-js-angularjs</artifactId>
      <version>1.2.10-1</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.nuiton.js</groupId>
      <artifactId>nuiton-js-test</artifactId>
      <version>1.0.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>wagon-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>download-single</goal>
            </goals>
            <configuration>
              <url>${upstreamUrl}</url>
              <fromFile>${upstreamFile}</fromFile>
              <toFile>${project.build.directory}/${project.artifactId}.zip</toFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <echo message="unzip archive" />
                <unzip src="${project.build.directory}/${project.artifactId}.zip" dest="${project.build.directory}" />
                <echo message="moving resources" />
                <copy todir="${destDir}">
                  <fileset dir="${project.build.directory}/angular-ui-tree-${upstreamVersion}/dist" includes="angular-ui-tree.js" />
                  <fileset dir="${project.build.directory}/angular-ui-tree-${upstreamVersion}/source" includes="angular-ui-tree.css" />
                </copy>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
