<?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.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>
    
    <packaging>jar</packaging>
    <groupId>org.webjars</groupId>
    <artifactId>rgraph</artifactId>
    <version>3_2014-07-27-stable</version>
    <name>RGraph</name>
    <description>WebJar for RGraph</description>
    <url>http://webjars.org</url>

    <developers>
        <developer>
            <id>cleverdeveloper</id>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>MIT</name>
            <url>http://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>http://github.com/webjars/rgraph</url>
        <connection>scm:git:https://github.com/webjars/rgraph.git</connection>
        <developerConnection>scm:git:https://github.com/webjars/rgraph.git</developerConnection>
        <tag>rgraph-3_2014-07-27-stable</tag>
    </scm>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <upstream.version>3_2014-07-27-stable</upstream.version>
        <upstream.url>http://www.rgraph.net/</upstream.url>
        <destDir>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${upstream.version}</destDir>
        <requirejs>
           {
              "paths" : {

                "rgraph" : "RGraph.common.core",
                "rgraph-dynamic"  : "RGraph.common.dynamic",

                "rgraph-annotate" : "RGraph.common.annotate",
                "rgraph-context"  : "RGraph.common.context",
                "rgraph-effects"  : "RGraph.common.effects",
                "rgraph-key"      : "RGraph.common.key",
                "rgraph-resizing" : "RGraph.common.resizing",
                "rgraph-tooltips" : "RGraph.common.tooltips",
                "rgraph-zoom"     : "RGraph.common.zoom",

                "rgraph-bar"         : "RGraph.bar",
                "rgraph-bipolar"     : "RGraph.bipolar",
                "rgraph-cornergauge" : "RGraph.cornergauge",
                "rgraph-fuel"        : "RGraph.fuel",
                "rgraph-funnel"      : "RGraph.funnel",
                "rgraph-gantt"       : "RGraph.gantt",
                "rgraph-gauge"       : "RGraph.gauge",
                "rgraph-hbar"        : "RGraph.hbar",
                "rgraph-hprogress"   : "RGraph.hprogress",
                "rgraph-led"         : "RGraph.led",
                "rgraph-line"        : "RGraph.line",
                "rgraph-meter"       : "RGraph.meter",
                "rgraph-odo"         : "RGraph.odo",
                "rgraph-pie"         : "RGraph.pie",
                "rgraph-radar"       : "RGraph.radar",
                "rgraph-rose"        : "RGraph.rose",
                "rgraph-rscatter"    : "RGraph.rscatter",
                "rgraph-scatter"     : "RGraph.scatter",
                "rgraph-thermometer" : "RGraph.thermometer",
                "rgraph-vprogress"   : "RGraph.vprogress",
                "rgraph-waterfall"   : "RGraph.waterfall",

                "rgraph-drawing-rect"    : "RGraph.drawing.rect",
                "rgraph-drawing-yaxis"   : "RGraph.drawing.yaxis",
                "rgraph-drawing-xaxis"   : "RGraph.drawing.xaxis",
                "rgraph-drawing-poly"    : "RGraph.drawing.poly",
                "rgraph-drawing-marker1" : "RGraph.drawing.marker1",
                "rgraph-drawing-image"   : "RGraph.drawing.image",
                "rgraph-drawing-circle"  : "RGraph.drawing.circle",
                "rgraph-drawing-marker2" : "RGraph.drawing.marker2",
                "rgraph-drawing-text"    : "RGraph.drawing.text"

              },

              "shim" : {

                "rgraph" : [ "jquery" ],

                "rgraph-dynamic"  : [ "rgraph" ],

                "rgraph-annotate" : [ "rgraph-dynamic" ],
                "rgraph-context"  : [ "rgraph-dynamic" ],
                "rgraph-effects"  : [ "rgraph-dynamic" ],
                "rgraph-key"      : [ "rgraph-dynamic" ],
                "rgraph-resizing" : [ "rgraph-dynamic" ],
                "rgraph-tooltips" : [ "rgraph-dynamic" ],
                "rgraph-zoom"     : [ "rgraph-dynamic" ],

                "rgraph-bar"         : [ "rgraph" ],
                "rgraph-bipolar"     : [ "rgraph" ],
                "rgraph-cornergauge" : [ "rgraph" ],
                "rgraph-fuel"        : [ "rgraph" ],
                "rgraph-funnel"      : [ "rgraph" ],
                "rgraph-gantt"       : [ "rgraph" ],
                "rgraph-gauge"       : [ "rgraph" ],
                "rgraph-hbar"        : [ "rgraph" ],
                "rgraph-hprogress"   : [ "rgraph" ],
                "rgraph-led"         : [ "rgraph" ],
                "rgraph-line"        : [ "rgraph" ],
                "rgraph-meter"       : [ "rgraph" ],
                "rgraph-odo"         : [ "rgraph" ],
                "rgraph-pie"         : [ "rgraph" ],
                "rgraph-radar"       : [ "rgraph" ],
                "rgraph-rose"        : [ "rgraph" ],
                "rgraph-rscatter"    : [ "rgraph" ],
                "rgraph-scatter"     : [ "rgraph" ],
                "rgraph-thermometer" : [ "rgraph" ],
                "rgraph-vprogress"   : [ "rgraph" ],
                "rgraph-waterfall"   : [ "rgraph" ], 

                "rgraph-drawing-rect"    : [ "rgraph" ],
                "rgraph-drawing-yaxis"   : [ "rgraph" ],
                "rgraph-drawing-xaxis"   : [ "rgraph" ],
                "rgraph-drawing-poly"    : [ "rgraph" ],
                "rgraph-drawing-marker1" : [ "rgraph" ],
                "rgraph-drawing-image"   : [ "rgraph" ],
                "rgraph-drawing-circle"  : [ "rgraph" ],
                "rgraph-drawing-marker2" : [ "rgraph" ],
                "rgraph-drawing-text"    : [ "rgraph" ]

              }
           }
        </requirejs>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>wagon-maven-plugin</artifactId>
                <version>1.0-beta-4</version>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>download-single</goal>
                        </goals>
                        <configuration>
                            <url>http://www.rgraph.net/downloads</url>
                            <fromFile>RGraph${upstream.version}.zip</fromFile>
                            <toFile>${project.build.directory}/${project.artifactId}.zip</toFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <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" />
                                <move todir="${destDir}">
                                    <fileset dir="${project.build.directory}/RGraph/libraries" />
                                </move>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

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

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

        </plugins>
    </build>

</project>
