<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2016 Karl Bennett
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <groupId>org.webjars</groupId>

    <artifactId>jsmockito-jshamcrest-integration</artifactId>

    <version>0.0.6</version>

    <name>jsmockito-jshamcrest-integration</name>

    <packaging>jar</packaging>

    <description>
        WebJar for jasmine-jsmockito-jshamcrest.
        This is an adaptor that integrates the jshamcrest and jsmockito frame works into the DOM window. It is built
        from the karma-jsmockito-jshamcrest (https://github.com/stephenhand/karma-jsmockito-jshamcrest) plugin.
    </description>

    <url>http://webjars.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <upstream.version>0.0.6</upstream.version>
        <upstream.library>karma-jsmockito-jshamcrest-${upstream.version}</upstream.library>
        <upstream.url>http://registry.npmjs.org/karma-jsmockito-jshamcrest/-/${upstream.library}.tgz</upstream.url>
        <download.file>${project.build.directory}/${upstream.library}.tgz</download.file>
        <gzip.file>${project.build.directory}/${upstream.library}.tar.gz</gzip.file>
        <tar.file>${project.build.directory}/${upstream.library}.tar</tar.file>
        <dest.dir>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${project.version}</dest.dir>
        <dest.file>${dest.dir}/${project.artifactId}.js</dest.file>
        <requirejs>
            {
              "paths": {
                "jsmockito-jshamcrest-integration": "jsmockito-jshamcrest-integration"
              },
              "shim": {
                "jsmockito-jshamcrest-integration": ["jshamcrest", "jsmockito"]
              }
            }
        </requirejs>
    </properties>

    <developers>
        <developer>
            <name>Karl Bennett</name>
            <email>karl.bennett.smt@gmail.com</email>
            <organization>shiver-me-timbers</organization>
            <organizationUrl>https://github.com/shiver-me-timbers</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
            <distribution>https://github.com/shiver-me-timbers/jasmine-jsmockito-jshamcrest</distribution>
        </license>
    </licenses>

    <dependencies>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jshamcrest</artifactId>
            <version>0.7.0</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jsmockito</artifactId>
            <version>1.0.4</version>
        </dependency>
    </dependencies>

    <scm>
        <url>http://github.com/webjars/${project.artifactId}</url>
        <connection>scm:git:https://github.com/webjars/${project.artifactId}.git</connection>
        <developerConnection>scm:git:https://github.com/webjars/${project.artifactId}.git</developerConnection>
        <tag>jsmockito-jshamcrest-integration-0.0.6</tag>
    </scm>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <goals><goal>run</goal></goals>
                        <configuration>
                            <target>
                                <echo message="download archive" />
                                <get src="${upstream.url}" dest="${download.file}" />
                                <echo message="rename archive" />
                                <move file="${download.file}" tofile="${gzip.file}" />
                                <echo message="gunzip archive" />
                                <gunzip src="${gzip.file}" />
                                <echo message="untar archive" />
                                <untar src="${tar.file}" dest="${project.build.directory}" />
                                <echo message="moving resources" />
                                <copy file="${project.build.directory}/package/src/adapter.js" tofile="${dest.file}" />
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.6</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>sonatype-nexus-staging</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
