<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
  ~
  ~ WSO2 LLC. licenses this file to you 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">

    <parent>
        <groupId>org.wso2.is</groupId>
        <artifactId>identity-server-parent</artifactId>
        <version>7.2.0-beta</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>wso2is-identity-integration-ui-templates</artifactId>
    <packaging>pom</packaging>
    <name>Identity Server : identity-integration-ui-templates</name>

    <dependencies>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.custom-application</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.custom-protocol-application</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.m2m-application</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.mcp-client-application</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.mobile-application</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.single-page-application</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.traditional-web-application</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.salesforce</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.google</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.microsoft-365</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.microsoft-365-v2</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.zoom</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.slack</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.notification.providers.firebase</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.react-application</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.integration.ui.templates</groupId>
            <artifactId>org.wso2.carbon.identity.integration.ui.templates.applications.nextjs-application</artifactId>
            <type>zip</type>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <!-- Download integration templates from nexus and copy to the target/unpacked-resources folder-->
                    <execution>
                        <id>download-integration-ui-templates</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <type>zip</type>
                            <outputDirectory>${project.build.directory}/unpacked-resources</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>prepare-templates-structure</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <mkdir dir="${project.build.directory}/templates" />
                                <copy todir="${project.build.directory}/templates" overwrite="true">
                                    <fileset dir="${project.build.directory}/unpacked-resources">
                                        <include name="**/*" />
                                    </fileset>
                                    <cutdirsmapper dirs="1" />
                                </copy>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
