Building an iOS Library

This example demonstrates how you can build an iOS library depending on another library using the Xcode plugin. Due to the xcode-lib packaging all Xcode specific tasks get automatically attached to the Maven lifecycle. I.e. calling mvn clean install will resolve the dependencies, compile the Xcode code, package the results and upload them into the local repository. Make sure that your plugin configuration contains the line <extensions>true</extensions> which is needed to enable the Maven lifecycle modification.

pom.xml

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

  <groupId>my.package</groupId>
  <artifactId>MyLibrary</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>xcode-lib</packaging>

  <dependencies>
    <dependency>
      <groupId>my.package</groupId>
      <artifactId>BaseLibrary</artifactId>
      <version>1.0</version>
      <type>xcode-lib</type>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>com.sap.prd.mobile.ios.mios</groupId>
        <artifactId>xcode-maven-plugin</artifactId>
        <version>1.14.5</version>
        <extensions>true</extensions>
        <!-- optional configurations, e.g.
          <configuration>
            <sdks> 
              <sdk>iphonesimulator</sdk> 
              <sdk>iphoneos</sdk>
            </sdks>
            <configurations>
              <configuration>Debug</configuration> 
              <configuration>Release</configuration>
            </configurations>
          <configuration>
        -->
      </plugin>
    </plugins>
  </build>
</project>