<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Copyright (c) 2007-2014 Kaazing Corporation. All rights reserved.
 * 
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.kaazing</groupId>
        <artifactId>gateway.client.ios.common</artifactId>
        <version>5.0.0.8</version>
    </parent>

    <groupId>org.kaazing</groupId>
    <artifactId>gateway.client.ios</artifactId>
    <version>5.0.0.9</version>
    <name>Kaazing WebSocket Gateway - iOS Library</name>
    <packaging>pom</packaging>

    <organization>
        <name>Kaazing Corporation</name>
    </organization>
    <inceptionYear>2007</inceptionYear>

    <url>https://github.com/kaazing/gateway.client.ios.git</url>
    <description>
        Objective-C implementation of WebSocket RFC-6455 specification.
    </description>
    <scm>
        <connection>scm:git:${project.scm.url}</connection>
        <developerConnection>scm:git:${project.scm.url}</developerConnection>
        <url>git@github.com:kaazing/gateway.client.ios.git</url>
    </scm>

    <build>
        <plugins>
            
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                  <execution>
                    <id>Build Framework</id>
                    <phase>compile</phase>
                    <configuration>
                      <executable>xctool</executable>
                      <arguments>
                        <argument>-project</argument>
                        <argument>${project.projectName}.xcodeproj</argument>
                        <argument>-scheme</argument>
                        <argument>Framework</argument>
                      </arguments>
                    </configuration>
                    <goals>
                      <goal>exec</goal>
                    </goals>
                  </execution>
                  
                  <!-- execute a custom script that tests the 32 bit ios lib -->
                  <execution>
                    <id>test-32bit-ios-gateway-lib</id>
                    <phase>test</phase>
                    <configuration>
                      <executable>xctool</executable>
                      <arguments>
                        <argument>-project</argument>
                        <argument>${project.projectName}.xcodeproj</argument>
                        <argument>-sdk</argument>
                        <argument>iphonesimulator</argument>
                        <argument>-scheme</argument>
                        <argument>${project.projectName}</argument>
                        <argument>-showTasks</argument>
                        <argument>-destination</argument>
                        <argument>name=iPhone Retina (4-inch)</argument>
                        <argument>-reporter</argument>
                        <argument>junit:target/test-reports/unit-tests-report.xml</argument>
                        <argument>ONLY_ACTIVE_ARCH=NO</argument>
                        <argument>test</argument>
                        <argument>-only</argument>
                        <argument>KGWebSocketTests</argument>
                        <argument>-freshInstall</argument>
                      </arguments>
                    </configuration>
                    <goals>
                      <goal>exec</goal>
                    </goals>
                  </execution>
                  
                  <!-- execute a custom script that tests the 64 bit ios lib -->
                  <execution>
                    <id>test-64bit-ios-gateway-lib</id>
                    <phase>test</phase>
                    <configuration>
                      <executable>xctool</executable>
                      <arguments>
                        <argument>-project</argument>
                        <argument>${project.projectName}.xcodeproj</argument>
                        <argument>-sdk</argument>
                        <argument>iphonesimulator</argument>
                        <argument>-scheme</argument>
                        <argument>${project.projectName}</argument>
                        <argument>-showTasks</argument>
                        <argument>-destination</argument>
                        <argument>name=iPhone Retina (4-inch 64-bit)</argument>
                        <argument>-reporter</argument>
                        <argument>junit:target/test-reports/unit-tests-report-64bit.xml</argument>
                        <argument>ONLY_ACTIVE_ARCH=NO</argument>
                        <argument>test</argument>
                        <argument>-only</argument>
                        <argument>KGWebSocketTests</argument>
                        <argument>-freshInstall</argument>
                      </arguments>
                    </configuration>
                    <goals>
                      <goal>exec</goal>
                    </goals>
                  </execution>
                </executions>
              </plugin>
            <!-- TODO: Add to ios-plugin package goal -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>build-distribution-file</id>
                        <phase>package</phase>
                        <configuration>
                            <executable>./make-dmg.sh</executable>
                            <environmentVariables>
                                <PROJECT_NAME>${project.projectName}</PROJECT_NAME>
                            </environmentVariables>
                        </configuration>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptors>
                        <descriptor>src/main/assembly/zip.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <properties>
        <project.projectName>KGWebSocket</project.projectName>
    </properties>
</project>
