<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.kaazing</groupId>
        <artifactId>ios.client.ws.common</artifactId>
        <version>5.0.0.10</version>
    </parent>

    <groupId>org.kaazing</groupId>
    <artifactId>gateway.client.ios</artifactId>
    <version>5.0.0.10</version>
    <name>Kaazing iOS Client - WebSocket RFC-6455 Implementation</name>
    <packaging>pom</packaging>

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

    <url>https://github.com/kaazing/ios.client.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/ios.client.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>
