<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>org.rococoa</groupId>
  <artifactId>rococoa-core</artifactId>
  <packaging>jar</packaging>
  <version>0.5</version>
  <name>Rococoa Core</name>
  <url>http://www.rococoa.org</url>
  
  <parent>
    <groupId>org.rococoa</groupId>
    <artifactId>rococoa</artifactId>
    <version>1</version>
  </parent>
  
  <build>  
    <plugins>
    
      <plugin>
    	<groupId>org.apache.maven.plugins</groupId>
    	<artifactId>maven-compiler-plugin</artifactId>
    	<configuration>
    		<source>${maven.compile.source}</source>
    		<target>${maven.compile.target}</target>
    	</configuration>
      </plugin>
    
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>build-native</id>
            <phase>compile</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <exec dir="." executable="xcodebuild" failonerror="true">               
                	<arg value="-project"/><arg value="rococoa.xcodeproj"/>
                	<arg value="-target"/><arg value="librococoa"/>
                	<arg value="-configuration"/><arg value="Release"/>
               	</exec>
              </tasks>
            </configuration>
          </execution>          
          <execution>
            <id>build-native-clean</id>
            <phase>clean</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <exec dir="." executable="xcodebuild" failonerror="true">
                	<arg value="-project"/><arg value="rococoa.xcodeproj"/>
                	<arg value="-target"/><arg value="librococoa"/>
                	<arg value="-configuration"/><arg value="Release"/>
                	<arg value="clean"/>
                </exec>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
    
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.4.3</version>
        <configuration>
          <excludes>
            <!-- Brain-dead plugin just looks for *Test* and so finds support classes -->
            <exclude>**/TestStruct*.java</exclude>
          </excludes>
          <forkMode>once</forkMode>
        </configuration>        
      </plugin>      
         
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptor>src/main/assembly/dist.xml</descriptor>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>attached</goal>
            </goals>
            <phase>package</phase>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.2</version>
        <executions>
          <execution>
            <id>install-library</id>
            <phase>install</phase>
            <goals>
              <goal>install-file</goal>
            </goals>
            <configuration>
              <groupId>org.rococoa</groupId>
              <artifactId>rococoa-core</artifactId>
              <version>rococoa.version</version>
              <packaging>dylib</packaging>
              <file>${basedir}/build/Release/librococoa.dylib</file>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.5</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      
    </plugins>
      
  </build>

</project>