<!--

    Copyright (C) 2009-2012 Barchart, Inc. <http://www.barchart.com />

    All rights reserved. Licensed under the OSI BSD License.

    http://www.opensource.org/licenses/bsd-license.php

-->
<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>com.barchart.base</groupId>
		<artifactId>barchart-archon</artifactId>
		<version>2.5.10</version>
		<relativePath />
	</parent>

	<groupId>com.barchart.udt</groupId>
	<artifactId>barchart-udt-archon</artifactId>
	<version>2.3.0</version>
	<packaging>pom</packaging>

	<scm>
		<url>https://github.com/barchart/barchart-udt</url>
	    <connection>scm:git:git@github.com:barchart/barchart-udt.git</connection>
    	<developerConnection>scm:git:git@github.com:barchart/barchart-udt.git</developerConnection>
		<tag>barchart-udt-2.3.0</tag>
	</scm>

	<description>Java wrapper around native C++ UDT protocol</description>

	<url>https://github.com/barchart/barchart-udt</url>

	<inceptionYear>2009</inceptionYear>

	<issueManagement>
		<system>github</system>
		<url>https://github.com/barchart/barchart-udt/issues</url>
	</issueManagement>

	<properties>

		<projectJavaVersion>1.6</projectJavaVersion>
		<projectMavenVersion>3.0.4</projectMavenVersion>

		<projectBuildStamp><![CDATA[build stamp: ${project.artifactId} ${project.version} ${projectTimeISO}]]></projectBuildStamp>

		<!-- arch/os jni library classifier keys -->

		<arm>arm-Linux-gpp-jni</arm>
		<lin32>i386-Linux-gpp-jni</lin32>
		<lin64>amd64-Linux-gpp-jni</lin64>
		<mac32>i386-MacOSX-gpp-jni</mac32>
		<mac64>x86_64-MacOSX-gpp-jni</mac64>
		<win32>x86-Windows-gpp-jni</win32>
		<win64>amd64-Windows-gpp-jni</win64>

		<!-- latest maven-nar-plugin -->

		<!-- <narPluginGroupId>org.apache.maven.plugins</narPluginGroupId> -->
		<!-- <narPluginArtifactId>maven-nar-plugin</narPluginArtifactId> -->
		<!-- <narPluginVersion>2.1-SNAPSHOT</narPluginVersion> -->

		<!-- <narPluginGroupId>com.barchart.nar</narPluginGroupId> -->
		<!-- <narPluginArtifactId>maven-nar-plugin</narPluginArtifactId> -->
		<!-- <narPluginVersion>2.0.1-SNAPSHOT</narPluginVersion> -->

		<narPluginGroupId>org.codeswarm</narPluginGroupId>
		<narPluginArtifactId>maven-nar-plugin</narPluginArtifactId>
		<narPluginVersion>20121119</narPluginVersion>

	</properties>

	<build>

		<pluginManagement>
			<plugins>

				<!-- maven-nar-plugin is ever in flux -->
				<plugin>
					<groupId>${narPluginGroupId}</groupId>
					<artifactId>${narPluginArtifactId}</artifactId>
					<version>${narPluginVersion}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<!-- fork so we can switch jdk with maven option -->
						<fork>true</fork>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<configuration>
						<forkMode>always</forkMode>
						<argLine>${javaBits}</argLine>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<configuration>
						<reportPlugins>

							<plugin>
								<groupId>org.apache.maven.plugins</groupId>
								<artifactId>maven-project-info-reports-plugin</artifactId>
								<version>2.6</version>
								<reportSets>
									<reportSet>
										<reports>
											<report>index</report>
											<report>summary</report>
											<report>dependencies</report>
											<report>project-team</report>
											<report>license</report>
											<report>issue-tracking</report>
											<report>mailing-list</report>
											<report>scm</report>
										</reports>
									</reportSet>
								</reportSets>
								<configuration>
									<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
								</configuration>
							</plugin>

							<plugin>
								<groupId>org.apache.maven.plugins</groupId>
								<artifactId>maven-jxr-plugin</artifactId>
								<version>2.3</version>
							</plugin>

							<plugin>
								<groupId>org.apache.maven.plugins</groupId>
								<artifactId>maven-javadoc-plugin</artifactId>
								<version>2.9</version>
								<configuration>
									<quiet>true</quiet>
									<verbose>false</verbose>
									<links>
										<show>public</show>
										<link>http://java.sun.com/javase/1.6.0/docs/api</link>
									</links>
									<linksource>true</linksource>
									<detectLinks>true</detectLinks>
									<windowtitle><![CDATA[${project.name} API ${project.version} / ${projectTimeISO}]]></windowtitle>
									<doctitle><![CDATA[${project.name} API ${project.version} / ${projectTimeISO}]]></doctitle>
									<header><![CDATA[<a href="${project.organization.url}" target="_blank">${project.organization.name}</a>]]></header>
									<footer><![CDATA[<a href="${project.organization.url}" target="_blank">${project.organization.name}</a>]]></footer>
									<bottom>
										<!-- note: these "years" are internal javadoc plugin tags -->
										Copyright © {inceptionYear}-{currentYear}
										<![CDATA[<a href="${project.organization.url}" target="_blank">${project.organization.name}</a>]]>.
										All Rights Reserved.
									</bottom>
								</configuration>
								<reportSets>
									<reportSet>
										<reports>
											<report>javadoc</report>
										</reports>
									</reportSet>
								</reportSets>
							</plugin>

							<plugin>
								<groupId>org.apache.maven.plugins</groupId>
								<artifactId>maven-surefire-report-plugin</artifactId>
								<version>2.12.4</version>
								<reportSets>
									<reportSet>
										<reports>
											<report>report-only</report>
										</reports>
									</reportSet>
								</reportSets>
							</plugin>

							<!-- http://site.supose.org/doxygen-maven-plugin/report-mojo.html -->
							<plugin>
								<groupId>com.soebes.maven.plugins.dmg</groupId>
								<artifactId>doxygen-maven-plugin</artifactId>
								<version>1.0.1</version>
								<configuration>
									<projectName>${project.build.finalName}</projectName>
									<input>${basedir}/src/main/c++</input>
									<recursive>true</recursive>
									<filePatterns>*.h *.c *.cpp</filePatterns>
									<haveDot>true</haveDot>
									<classGraph>true</classGraph>
									<collaborationGraph>true</collaborationGraph>
									<stripFromPath>${basedir}</stripFromPath>
								</configuration>
							</plugin>

						</reportPlugins>
					</configuration>
				</plugin>

			</plugins>
		</pluginManagement>

		<plugins>

			<!-- Work around for http://jira.codehaus.org/browse/SCM-709 -->
			<!-- Requires manual push or jenkins build step after release. -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<configuration>
					<resume>false</resume>
					<pushChanges>false</pushChanges>
					<localCheckout>true</localCheckout>
					<tagNameFormat>barchart-udt-@{project.version}</tagNameFormat>
					<arguments><![CDATA[-DskipTests -U -P modules,artifact-version,release-attach,package-bundle]]></arguments>
				</configuration>
			</plugin>

		</plugins>

	</build>

	<profiles>

		<!-- "thinking different": macosx provides tools.jar classes already in 
			classes.jar and does not provide tools.jar as sun does -->
		<profile>
			<id>jdk-tools-jar</id>
			<activation>
				<property>
					<!-- jdk 1.6 vendor property -->
					<!-- linux: java.vendor="Sun Microsystems Inc." -->
					<!-- macosx: java.vendor="Apple, Inc." -->
					<!-- windows: java.vendor="Sun Microsystems Inc." -->
					<name>java.vendor</name>
					<value>Sun Microsystems Inc.</value>
				</property>
			</activation>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-antrun-plugin</artifactId>
							<dependencies>
								<dependency>
									<groupId>com.sun.jdk</groupId>
									<artifactId>jdk-tools</artifactId>
									<version>${projectJavaVersion}</version>
									<scope>system</scope>
									<systemPath>${java.home}/../lib/tools.jar</systemPath>
								</dependency>
							</dependencies>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>

		<!-- ${archosClassifier} arch/os selector profiles -->
		<profile>
			<id>nar_arm-Linux-gpp</id>
			<activation>
				<os>
					<arch>arm</arch>
					<name>Linux</name>
				</os>
			</activation>
			<properties>
				<archosClassifier>${arm}</archosClassifier>
				<javaBits />
			</properties>
		</profile>
		<profile>
			<id>nar_i386-Linux-gpp</id>
			<activation>
				<os>
					<arch>i386</arch>
					<name>Linux</name>
				</os>
			</activation>
			<properties>
				<archosClassifier>${lin32}</archosClassifier>
				<javaBits>-d32</javaBits>
			</properties>
		</profile>
		<profile>
			<id>nar_amd64-Linux-gpp</id>
			<activation>
				<os>
					<name>Linux</name>
					<arch>amd64</arch>
				</os>
			</activation>
			<properties>
				<archosClassifier>${lin64}</archosClassifier>
				<javaBits>-d64</javaBits>
			</properties>
		</profile>
		<profile>
			<id>nar_i386-MacOSX-gpp</id>
			<activation>
				<os>
					<arch>i386</arch>
					<name>Mac OS X</name>
				</os>
			</activation>
			<properties>
				<archosClassifier>${mac32}</archosClassifier>
				<javaBits>-d32</javaBits>
			</properties>
		</profile>
		<profile>
			<id>nar_x86_64-MacOSX-gpp</id>
			<activation>
				<os>
					<arch>x86_64</arch>
					<name>Mac OS X</name>
				</os>
			</activation>
			<properties>
				<archosClassifier>${mac64}</archosClassifier>
				<javaBits>-d64</javaBits>
			</properties>
		</profile>
		<profile>
			<id>nar_x86-Windows-gpp</id>
			<activation>
				<os>
					<arch>x86</arch>
					<family>windows</family>
				</os>
			</activation>
			<properties>
				<archosClassifier>${win32}</archosClassifier>
				<javaBits />
			</properties>
		</profile>
		<profile>
			<id>nar_amd64-Windows-gpp</id>
			<activation>
				<os>
					<arch>amd64</arch>
					<family>windows</family>
				</os>
			</activation>
			<properties>
				<archosClassifier>${win64}</archosClassifier>
				<javaBits />
			</properties>
		</profile>

		<!-- release and snapshot versions, regardless of the build stage -->
		<profile>
			<id>artifact-version</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>groovy-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>artifact-version</id>
								<phase>validate</phase>
								<goals>
									<goal>execute</goal>
								</goals>
								<configuration>
									<source>
<![CDATA[
					
					def snapshot = '-SNAPSHOT'
					def version  = project.version
					
					def releaseVersion
					def snapshotVersion
					
					if( version.contains(snapshot) ){
						releaseVersion  = version.replaceAll(snapshot,'')
						snapshotVersion = version
					}else{
						releaseVersion  = version
						snapshotVersion = version + snapshot
					}
					
					println( '### releaseVersion  = ' + releaseVersion )
					println( '### snapshotVersion = ' + snapshotVersion )

					project.properties[ 'releaseVersion'  ] = releaseVersion
					project.properties[ 'snapshotVersion' ] = snapshotVersion
					
]]>
									</source>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- activate modules explicitly -->
		<profile>
			<id>modules</id>
			<modules>
				<module>../barchart-udt-core</module>
				<module>../barchart-udt-bundle</module>
			</modules>
		</profile>

	</profiles>

</project>
