<?xml version="1.0" encoding="UTF-8"?>
<!--
 |  Copyright 2015 Adobe Systems Incorporated
 |
 |  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>

    <!-- ====================================================================== -->
    <!-- P A R E N T  P R O J E C T  D E S C R I P T I O N                      -->
    <!-- ====================================================================== -->
    <parent>
        <groupId>com.adobe.dx</groupId>
        <artifactId>admin.reactor</artifactId>
        <version>0.1.0</version>
        <relativePath>..</relativePath>
    </parent>

    <!-- ====================================================================== -->
    <!-- P R O J E C T  D E S C R I P T I O N                                   -->
    <!-- ====================================================================== -->
    <artifactId>admin</artifactId>
    <packaging>content-package</packaging>
    <name>${module.name} - App package</name>

    <!-- ====================================================================== -->
    <!-- B U I L D   D E F I N I T I O N                                        -->
    <!-- ====================================================================== -->
    <build>
        <sourceDirectory>jcr_root</sourceDirectory>
        <plugins>
            <!-- ====================================================================== -->
            <!-- V A U L T   P A C K A G E   P L U G I N S                              -->
            <!-- ====================================================================== -->
            <plugin>
                <groupId>org.apache.jackrabbit</groupId>
                <artifactId>filevault-package-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <packageType>application</packageType>
                    <properties>
                        <cloudManagerTarget>none</cloudManagerTarget>
                    </properties>
                    <group>com.adobe.dx</group>
                    <name>dx.admin.apps</name>
                    <filters>
                        <filter>
                            <root>/apps/cq/core/content</root>
                            <excludes>
                                <exclude>/apps/cq/core/content/(.*)?</exclude>
                            </excludes>
                        </filter>
                        <filter>
                            <root>/apps/cq/core/content/nav</root>
                            <excludes>
                                <exclude>/apps/cq/core/content/nav/(.*)?</exclude>
                            </excludes>
                            <includes>
                                <include>/apps/cq/core/content/nav/tools</include>
                            </includes>
                        </filter>
                        <filter>
                            <root>/apps/dx/admin</root>
                        </filter>
                    </filters>
                    <embeddeds>
                        <embedded>
                            <groupId>com.adobe.dx</groupId>
                            <artifactId>admin.core</artifactId>
                            <target>/apps/dx/install</target>
                            <filter>true</filter>
                        </embedded>
                    </embeddeds>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.day.jcr.vault</groupId>
                <artifactId>content-package-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.sling</groupId>
                <artifactId>htl-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>${frontend-maven-plugin.version}</version>
                <configuration>
                    <nodeVersion>${node.version}</nodeVersion>
                    <npmVersion>${npm.version}</npmVersion>
                    <workingDirectory>./</workingDirectory>
                    <installDirectory>../../../</installDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>npm install collection-view</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>install --no-optional ../../../react-collection-view-4.1.5.tgz</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>install --no-optional</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm build</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>run build-production</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm test and coverage</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>run test-coverage</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- ====================================================================== -->
    <!-- D E P E N D E N C I E S                                                -->
    <!-- ====================================================================== -->
    <dependencies>
        <dependency>
            <groupId>com.adobe.dx</groupId>
            <artifactId>admin.core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.dx</groupId>
            <artifactId>repository-structure</artifactId>
            <type>zip</type>
        </dependency>
    </dependencies>
</project>
