<?xml version="1.0" encoding="ISO-8859-1"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://maven.apache.org/POM/4.0.0">
    <!-- @version $Revision: 2667 $ ($Author: skarzhevskyy $) $Date: 2008-12-25 15:26:28 -0500 (Thu, 25 Dec 2008) $ -->
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>net.sf.bluecove</groupId>
        <artifactId>bluecove-parent</artifactId>
        <version>2.1.0</version><!--bluecove-version-->
        <relativePath>../pom.xml</relativePath>
    </parent>

    <groupId>net.sf.bluecove</groupId>
    <artifactId>bluecove-gpl</artifactId>
    <name>bluecove-gpl</name>
    <packaging>jar</packaging>

    <description>BlueCove Linux BlueZ module</description>

    <licenses>
        <license>
            <name>GNU General Public License (GPL)</name>
            <url>http://www.gnu.org/licenses/gpl.html</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Mina Shokry</name>
            <id>minashokry</id>
            <email>minashokry@gmail.com</email>
            <roles>
                <role>developer</role>
            </roles>
            <timezone>+2</timezone>
        </developer>
        <developer>
            <name>Vlad Skarzhevskyy</name>
            <id>skarzhevskyy</id>
            <email>skarzhevskyy@gmail.com</email>
            <organization>pyx4me.com</organization>
            <organizationUrl>http://www.pyx4me.com</organizationUrl>
            <roles>
                <role>admin</role>
                <role>developer</role>
                <role>Build master</role>
            </roles>
            <timezone>-5</timezone>
        </developer>
    </developers>

    <dependencies>

        <dependency>
            <groupId>net.sf.bluecove</groupId>
            <artifactId>bluecove</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
            <optional>true</optional>
        </dependency>

    </dependencies>

    <properties>
        <native.source.dir>${basedir}/src/main/c</native.source.dir>
    </properties>

    <build>

        <plugins>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.3</source>
                    <target>1.1</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Description>BlueCove JSR-82 implementation, BlueZ Linux module</Description>
                            <License>GNU General Public License (GPL)</License>
                            <Implementation-Version>${pom.version}</Implementation-Version>
                            <Implementation-Build>${buildLabel}</Implementation-Build>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>native-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>build-jni-headers</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>javah</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${native.source.dir}</outputDirectory>
                            <classNames>
                                <className>com.intel.bluetooth.BluetoothStackBlueZ</className> 
                                <className>com.intel.bluetooth.BluetoothStackBlueZConsts</className> 
                                <className>com.intel.bluetooth.BluetoothStackBlueZNativeTests</className> 
                            </classNames>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>clean-remove-generated-hreaders</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <delete>
                                    <fileset dir="${native.source.dir}" includes="com_intel_*.h"/>
                                </delete>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                   <execution>
                       <id>all-sources-gz</id>
                       <phase>install</phase>
                       <goals><goal>single</goal></goals>
                       <configuration>
                           <attach>false</attach>
                           <tarLongFileMode>gnu</tarLongFileMode>
                           <descriptors>
                               <descriptor>assembly-distr-sources.xml</descriptor>
                           </descriptors>
                       </configuration>
                   </execution>
                </executions>
            </plugin>

            <!-- jar sources during build -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                    <id>attach-sources</id>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

    </build>

    <profiles>

        <profile>
            <id>build_on_linux</id>
            <activation>
                <os>
                    <name>linux</name>
                    <family>unix</family>
                </os>
            </activation>
            <build>
                <plugins>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>compile-native-lib</id>
                                <phase>process-classes</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <tasks>
                                        <ant antfile="${basedir}/build.xml" target="compile-native-lib">
                                            <property name="basedir" value="${basedir}"/>
                                            <property name="buildEnv" value="${buildEnv}"/>
                                            <property name="java.home" value="${java.home}"/>
                                        </ant>
                                    </tasks>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>

        <profile>
            <id>build_on_windows</id>
            <activation>
                <os>
                    <name>Windows XP</name>
                    <family>windows</family>
                    <arch>x86</arch>
                    <version>5.1</version>
                </os>
            </activation>
            <build>
                <plugins>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludes>
                                <exclude>**/Native*.*</exclude>
                            </excludes>
                        </configuration>
                    </plugin>

                </plugins>
            </build>
        </profile>

        <profile>
            <id>build_on_osx</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <build>
                <plugins>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludes>
                                <exclude>**/Native*.*</exclude>
                            </excludes>
                        </configuration>
                    </plugin>

                </plugins>
            </build>
        </profile>


    </profiles>

</project>
