<?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: 2212 $ ($Author: skarzhevskyy $) $Date: 2008-05-25 12:18:18 -0400 (Sun, 25 May 2008) $ -->
    <modelVersion>4.0.0</modelVersion>

    <groupId>net.sf.bluecove</groupId>
    <version>2.0.3-SNAPSHOT</version><!--bluecove-version-->
    <artifactId>bluecove-gpl</artifactId>
    <name>bluecove-gpl</name>
    <packaging>jar</packaging>

    <description>BlueCove Linux version</description>

    <url>http://www.bluecove.org/bluecove-gpl/</url>

    <organization>
        <name>BlueCove Team</name>
        <url>http://bluecove.org</url>
    </organization>
    <inceptionYear>2007</inceptionYear>

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

    <scm>
        <connection>scm:svn:http://bluecove.googlecode.com/svn/bluecove-gpl/trunk</connection>
        <developerConnection>scm:svn:https://bluecove.googlecode.com/svn/bluecove-gpl/trunk</developerConnection>
        <url>http://code.google.com/p/bluecove/source/browse/bluecove-gpl/trunk</url>
    </scm>

	<issueManagement>
		<system>Google Code Issue Tracking</system>
		<url>http://code.google.com/p/bluecove/issues/list</url>
	</issueManagement>

    <mailingLists>
        <mailingList>
            <name>bluecove-users</name>
            <post>bluecove-users@googlegroups.com</post>
            <archive>http://groups.google.com/group/bluecove-users</archive>
        </mailingList>
        <mailingList>
            <name>bluecove-developers</name>
            <post>bluecove-developers@googlegroups.com</post>
            <archive>http://groups.google.com/group/bluecove-developers</archive>
        </mailingList>
    </mailingLists>

    <ciManagement>
        <system>Cruisecontrol</system>
        <url>https://pyx4j.com/cruisecontrol/</url>
    </ciManagement>

    <distributionManagement>
        <site>
            <id>test-pyx4j-site</id>
            <url>file:///home/apache/bluecove/bluecove-gpl</url>
        </site>
        <repository>
            <id>pyx4j.com-file-release</id>
            <url>file:///home/apache/pyx4j/maven2-release</url>
        </repository>
        <snapshotRepository>
            <id>pyx4j.com-file-development</id>
            <url>file:///home/apache/pyx4j/maven2</url>
        </snapshotRepository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>pyx4me-web-repo</id>
            <url>http://www.pyx4me.com/maven2-snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>


    <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>
            <version>3.8.1</version>
            <scope>test</scope>
            <optional>true</optional>
        </dependency>

    </dependencies>

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

    <build>
        <defaultGoal>install</defaultGoal>

        <plugins>

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

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>native-maven-plugin</artifactId>
                <extensions>false</extensions>
                <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>
                    <execution>
                        <id>build-native</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>compile</goal>
                            <goal>link</goal>
                        </goals>
                        <configuration>
                            <javahOS>linux</javahOS>
                            <sources>
                                <source>
                                    <directory>${native.source.dir}</directory>
                                    <fileNames>
                                        <fileName>common.c</fileName>
                                        <fileName>BlueCoveBlueZ.c</fileName>
                                        <fileName>BlueCoveBlueZ_LocalDevice.c</fileName>
                                        <fileName>BlueCoveBlueZ_Discovery.c</fileName>
                                        <fileName>BlueCoveBlueZ_SDPServer.c</fileName>
                                        <fileName>BlueCoveBlueZ_SDPQuery.c</fileName>
                                        <fileName>BlueCoveBlueZ_RFCOMM.c</fileName>
                                        <fileName>BlueCoveBlueZ_RFCOMMServer.c</fileName>
                                        <fileName>BlueCoveBlueZ_L2CAP.c</fileName>
                                        <fileName>BlueCoveBlueZ_L2CAPServer.c</fileName>
                                        <fileName>BlueCoveBlueZ_Tests.c</fileName>
                                    </fileNames>
                                </source>
                            </sources>
                            <compilerStartOptions>
                                <!-- This flag creates position independent code on 64 bit platform/ IA32 has this flag applied by default with GCC -->
                                <compilerStartOption>-fPIC</compilerStartOption>
                                <!-- ubuntu -->
                                <compilerStartOption>-fno-stack-protector</compilerStartOption>
                            </compilerStartOptions>
                            <linkerStartOptions>
                                <linkerStartOption>-shared</linkerStartOption>
                                <linkerStartOption>-lbluetooth</linkerStartOption>
                                <linkerStartOption>-nodefaultlibs</linkerStartOption>
                            </linkerStartOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <configuration>
                    <outputEncoding>UTF-8</outputEncoding>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>link-move-so</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <condition property="library_sufix" value="_x64" else="">
                                     <os name="Linux" arch="amd64"/>
                                </condition>
                                <move file="${project.build.directory}/${project.build.finalName}.jar" tofile="${project.build.directory}/classes/libbluecove${library_sufix}.so" overwrite="true"/>
                                <copy file="${project.build.directory}/classes/libbluecove${library_sufix}.so" todir="${basedir}/src/main/resources" overwrite="true"/>
                            </tasks>
                        </configuration>
                    </execution>
                    <execution>
                        <id>site-fix-css</id>
                        <phase>site</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <!-- Set build number -->
                                <replace dir="${project.build.directory}/site">
                                    <include name="*.html"></include>
                                    <replacefilter token="#build#" value="${label}"/>
                                    <replacefilter token="#version#" value="${version}"/>
                                    <replacetoken><![CDATA[</body>]]></replacetoken>
                                    <replacevalue><![CDATA[<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script><script type="text/javascript">_uacct = "UA-1249205-3";urchinTracker();</script></body>]]></replacevalue>
                                </replace>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </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>

            <!-- 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>hasBuildLabel</id>
            <activation>
                <property>
                    <name>label</name>
                </property>
            </activation>
            <properties>
                <buildLabel>${label}</buildLabel>
            </properties>
        </profile>

    </profiles>

</project>

