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

    <parent>
        <groupId>org.wso2.carbon.devicemgt-proprietary</groupId>
        <artifactId>ios-plugin-impl-feature</artifactId>
        <version>3.2.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>org.wso2.carbon.device.mgt.ios.feature</artifactId>
    <packaging>pom</packaging>
    <name>WSO2 EMM - iOS Device Management Feature</name>
    <url>http://wso2.org</url>
    <description>
        This feature contains the core bundles required for Back-end and UIs for iOS Device Management functionality
    </description>

    <dependencies>
        <dependency>
            <groupId>org.wso2.carbon.devicemgt-proprietary</groupId>
            <artifactId>org.wso2.carbon.device.mgt.ios.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.devicemgt-proprietary</groupId>
            <artifactId>org.wso2.carbon.device.mgt.ios.payload</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.devicemgt</groupId>
            <artifactId>org.wso2.carbon.device.mgt.common</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.devicemgt</groupId>
            <artifactId>org.wso2.carbon.device.mgt.extensions</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.devicemgt-proprietary</groupId>
            <artifactId>org.wso2.carbon.device.mgt.ios.plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.orbit.org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.orbit.org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk15on</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io.wso2</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-lang.wso2</groupId>
            <artifactId>commons-lang</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-beanutils.wso2</groupId>
            <artifactId>commons-beanutils</artifactId>
        </dependency>
        <!-- JAX-RS -->
        <dependency>
            <groupId>org.wso2.carbon.devicemgt-proprietary</groupId>
            <artifactId>emm-ios-api</artifactId>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.devicemgt-proprietary</groupId>
            <artifactId>emm-ios-enrollment-api</artifactId>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.devicemgt-proprietary</groupId>
            <artifactId>org.wso2.carbon.device.mgt.ios.api.utils</artifactId>
        </dependency>
        <!-- APNS -->
        <dependency>
            <groupId>commons-codec.wso2</groupId>
            <artifactId>commons-codec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.devicemgt-proprietary</groupId>
            <artifactId>org.wso2.carbon.device.mgt.ios.apns</artifactId>
        </dependency>
        <dependency>
            <groupId>com.notnoop.apns</groupId>
            <artifactId>apns</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.orbit.com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.orbit.com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.orbit.com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <!-- UI -->
        <dependency>
            <groupId>com.h2database.wso2</groupId>
            <artifactId>h2-database-engine</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.6.1</version>
                <executions>
                    <execution>
                        <id>auto-clean</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${project.basedir}/src/main/resources/generated</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>src/main/resources</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>resources</directory>
                                    <includes>
                                        <include>build.properties</include>
                                        <include>p2.inf</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.9</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.wso2.carbon.devicemgt-proprietary</groupId>
                                    <artifactId>emm-ios-enrollment-api</artifactId>
                                    <version>${carbon.devicemgt.proprietary.version}</version>
                                    <type>war</type>
                                    <destFileName>ios-enrollment.war</destFileName>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.wso2.carbon.devicemgt-proprietary</groupId>
                                    <artifactId>emm-ios-api</artifactId>
                                    <version>${carbon.devicemgt.proprietary.version}</version>
                                    <type>war</type>
                                    <destFileName>api#device-mgt#ios#v1.0.war</destFileName>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${project.basedir}/src/main/resources/generated</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>unpack</id>
                        <phase>package</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.wso2.carbon.devicemgt-proprietary</groupId>
                                    <artifactId>org.wso2.carbon.device.mgt.ios.ui</artifactId>
                                    <version>${project.version}</version>
                                    <type>zip</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>
                                        ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/
                                    </outputDirectory>
                                    <includes>**/*</includes>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <!-- Creating ANDROID Mobile Plugin Management schema -->
                        <id>create-android-mobile-plugin-mgt-schema</id>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <echo message="########### Create iOS Mobile plugin Management H2 Schema ###########" />
                                <property name="db.dir" value="target/maven-shared-archive-resources/database" />
                                <property name="userid" value="wso2carbon" />
                                <property name="password" value="wso2carbon" />
                                <property name="dbURL" value="jdbc:h2:file:${basedir}/${db.dir}/WSO2MobileIOS_DB;DB_CLOSE_ON_EXIT=FALSE" />

                                <mkdir dir="${basedir}/${db.dir}" />

                                <sql driver="org.h2.Driver" url="${dbURL}" userid="${userid}" password="${password}" autocommit="true" onerror="continue">
                                    <classpath refid="maven.dependency.classpath" />
                                    <classpath refid="maven.compile.classpath" />
                                    <classpath refid="maven.runtime.classpath" />

                                    <fileset file="${basedir}/src/main/resources/dbscripts/plugins/h2.sql" />
                                </sql>
                                <echo message="##################### END ####################" />
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.wso2.maven</groupId>
                <artifactId>carbon-p2-plugin</artifactId>
                <version>${carbon.p2.plugin.version}</version>
                <executions>
                    <execution>
                        <id>p2-feature-generation</id>
                        <phase>package</phase>
                        <goals>
                            <goal>p2-feature-gen</goal>
                        </goals>
                        <configuration>
                            <id>org.wso2.carbon.device.mgt.ios</id>
                            <propertiesFile>../etc/feature.properties</propertiesFile>
                            <adviceFile>
                                <properties>
                                    <propertyDef>org.wso2.carbon.p2.category.type:server</propertyDef>
                                    <propertyDef>org.eclipse.equinox.p2.type.group:true</propertyDef>
                                </properties>
                            </adviceFile>
                            <bundles>
                                <!-- Plugin related bundles -->
                                <bundleDef>
                                    org.wso2.carbon.devicemgt-proprietary:org.wso2.carbon.device.mgt.ios.core:${carbon.devicemgt.proprietary.version}
                                </bundleDef>
                                <bundleDef>
                                    org.wso2.carbon.devicemgt-proprietary:org.wso2.carbon.device.mgt.ios.payload:${carbon.devicemgt.proprietary.version}
                                </bundleDef>
                                <bundleDef>
                                    org.wso2.orbit.org.bouncycastle:bcprov-jdk15on:${bcprov.wso2.version}
                                </bundleDef>
                                <bundleDef>
                                    org.wso2.orbit.org.bouncycastle:bcpkix-jdk15on:${bcpkix.wso2.version}
                                </bundleDef>

                                <bundleDef>
                                    org.wso2.carbon.devicemgt-proprietary:org.wso2.carbon.device.mgt.ios.plugin:${carbon.devicemgt.proprietary.version}
                                </bundleDef>
                                <!-- JAX-RS related bundles-->
                                <bundleDef>
                                    org.wso2.carbon.devicemgt-proprietary:org.wso2.carbon.device.mgt.ios.core:${carbon.devicemgt.proprietary.version}
                                </bundleDef>
                                <bundleDef>
                                    org.wso2.carbon.devicemgt-proprietary:org.wso2.carbon.device.mgt.ios.payload:${carbon.devicemgt.proprietary.version}
                                </bundleDef>
                                <bundleDef>
                                    org.wso2.carbon.devicemgt-proprietary:org.wso2.carbon.device.mgt.ios.api.utils:${carbon.devicemgt.proprietary.version}
                                </bundleDef>
                                <bundleDef>
                                    org.wso2.carbon.devicemgt-proprietary:org.wso2.carbon.device.mgt.ios.dep:${carbon.devicemgt.proprietary.version}
                                </bundleDef>
                                <!--APNS-->
                                <bundleDef>
                                    org.wso2.carbon.devicemgt-proprietary:org.wso2.carbon.device.mgt.ios.apns:${carbon.devicemgt.proprietary.version}
                                </bundleDef>
                                <bundleDef>
                                    com.notnoop.apns:apns:${notnoop.version}
                                </bundleDef>
                            </bundles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
