<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>com.googlecode.jperipheral</groupId>
		<artifactId>jperipheral</artifactId>
		<version>1.0.4</version>
	</parent>
	<artifactId>jperipheral-cpp</artifactId>
	<name>JPeripheral C++</name>
	<description>JPeripheral, C++ source-code</description>
	<url>http://code.google.com/p/jperipheral/</url>
	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<scm>
		<url>https://jperipheral.googlecode.com/hg/</url>
		<connection>scm:hg:https://jperipheral.googlecode.com/hg/</connection>
		<developerConnection>scm:hg:https://jperipheral.googlecode.com/hg/</developerConnection>
	</scm>
	<developers>
		<developer>
			<id>cowwoc</id>
			<name>Gili Tzabari</name>
		</developer>
	</developers>
	<build>
		<plugins>
			<plugin>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.3</version>
				<executions>
					<execution>
						<!-- used by peer generation and compilation process -->
						<id>unpack-dependencies</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>com.googlecode.boost-maven-project</groupId>
									<artifactId>boost-api</artifactId>
									<version>${boost.version}</version>
									<outputDirectory>${project.build.directory}/dependency/boost/${boost.classifier}</outputDirectory>
								</artifactItem>
								<artifactItem>
									<groupId>com.googlecode.jace</groupId>
									<artifactId>jace-core-cpp</artifactId>
									<classifier>${classifier}</classifier>
									<version>1.2.5</version>
									<outputDirectory>${project.build.directory}/dependency/jace/${classifier}</outputDirectory>
								</artifactItem>
								<artifactItem>
									<groupId>com.googlecode.jperipheral</groupId>
									<artifactId>jperipheral-java</artifactId>
									<version>${project.version}</version>
									<outputDirectory>${project.build.directory}/dependency/jperipheral</outputDirectory>
								</artifactItem>
								<artifactItem>
									<groupId>org.slf4j</groupId>
									<artifactId>slf4j-api</artifactId>
									<version>1.6.1</version>
									<outputDirectory>${project.build.directory}/dependency/slf4j</outputDirectory>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
					<execution>
						<id>copy-dependencies</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>copy</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/cmake/${platform}</outputDirectory>
							<artifactItems>
								<artifactItem>
									<groupId>com.google.guava</groupId>
									<artifactId>guava</artifactId>
									<version>r09</version>
								</artifactItem>
								<artifactItem>
									<groupId>org.slf4j</groupId>
									<artifactId>slf4j-api</artifactId>
									<version>1.6.1</version>
								</artifactItem>
								<artifactItem>
									<groupId>ch.qos.logback</groupId>
									<artifactId>logback-core</artifactId>
									<version>0.9.26</version>
								</artifactItem>
								<artifactItem>
									<groupId>ch.qos.logback</groupId>
									<artifactId>logback-classic</artifactId>
									<version>0.9.26</version>
								</artifactItem>
								<artifactItem>
									<groupId>com.google.inject</groupId>
									<artifactId>guice</artifactId>
									<version>3.0</version>
								</artifactItem>
								<artifactItem>
									<groupId>javax.inject</groupId>
									<artifactId>javax.inject</artifactId>
									<version>1</version>
								</artifactItem>
								<artifactItem>
									<groupId>com.googlecode.jace</groupId>
									<artifactId>jace-runtime</artifactId>
									<version>1.2.5</version>
								</artifactItem>
								<artifactItem>
									<groupId>${project.groupId}</groupId>
									<artifactId>jperipheral-java</artifactId>
									<version>${project.version}</version>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.googlecode.cmake-maven-project</groupId>
				<artifactId>cmake-maven-plugin</artifactId>
				<version>0.3</version>
				<executions>
					<execution>
						<id>cmake</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>generate</goal>
							<goal>compile</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<sourcePath>${basedir}/../cpp</sourcePath>
					<targetPath>${project.build.directory}/cmake/${platform}</targetPath>
					<generator>${cmake.generator}</generator>
					<projectPath>${project.build.directory}/cmake/${platform}/jperipheral.sln</projectPath>
					<buildType>${build.type}</buildType>
					<environmentVariables>
						<BOOST_HOME>${project.build.directory}/dependency/boost/${boost.classifier}</BOOST_HOME>
						<JACE_HOME>${project.build.directory}/dependency/jace/${classifier}</JACE_HOME>
					</environmentVariables>					
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<classifier>${classifier}</classifier>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.googlecode.jace</groupId>
				<artifactId>jace-maven-plugin</artifactId>
				<version>1.2.5</version>
				<executions>
					<execution>
						<id>jace.generate.SerialChannel.peer</id>
						<goals>
							<goal>generate-cpp-peer</goal>
						</goals>
						<configuration>
							<classFile>${project.build.directory}/dependency/jperipheral/org/jperipheral/SerialChannel.class</classFile>
							<outputHeaders>${project.build.directory}/generated-sources/include</outputHeaders>
							<outputSources>${project.build.directory}/generated-sources/source</outputSources>
						</configuration>
					</execution>
					<execution>
						<id>jace.generate.SerialChannel.proxies</id>
						<goals>
							<goal>generate-cpp-proxies</goal>
						</goals>
						<configuration>
							<inputHeaders>
								<path>${project.build.directory}/../windows/include</path>
								<path>${project.build.directory}/generated-sources/include</path>
							</inputHeaders>
							<inputSources>
								<path>${project.build.directory}/../windows/source</path>
								<path>${project.build.directory}/generated-sources/source</path>
							</inputSources>
							<outputHeaders>${project.build.directory}/generated-sources/include</outputHeaders>
							<outputSources>${project.build.directory}/generated-sources/source</outputSources>
							<classPath>
								<entry>${env.JAVA_HOME}/jre/lib/rt.jar</entry>
								<entry>${project.build.directory}/dependency/jperipheral</entry>
								<entry>${project.build.directory}/dependency/slf4j</entry>
							</classPath>
							<exportSymbols>true</exportSymbols>
							<accessibility>PRIVATE</accessibility>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-install-plugin</artifactId>
				<version>2.3.1</version>
			</plugin>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.5</version>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.outputDirectory}</outputDirectory>
							<resources>
								<resource>
									<directory>${project.build.directory}/cmake/${platform}/${build.type}</directory>
									<includes>
										<include>*.lib</include>
										<include>*.dll</include>
										<include>*.pdb</include>
									</includes>
									<excludes>
										<exclude>main.pdb</exclude>
									</excludes>
									<targetPath>lib</targetPath>
								</resource>
							</resources>              
						</configuration>            
					</execution>
					<execution>
						<id>copy-sources</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/sources</outputDirectory>
							<resources>
								<resource>
									<directory>${basedir}/windows</directory>
									<targetPath>windows</targetPath>
								</resource>
							</resources>              
						</configuration>            
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${project.build.directory}/sources</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<classifier>${platform}-${build.type}</classifier>
		<boost.version>1.47.0-b1</boost.version>
	</properties>
	<profiles>
		<profile>
			<id>windows-i386-vs10-debug</id>
			<properties>
				<cmake.generator>Visual Studio 10</cmake.generator>
				<platform>windows-i386-vs10</platform>
				<build.type>debug</build.type>
				<boost.classifier>windows-i386-vs10</boost.classifier>
			</properties>
		</profile>
		<profile>
			<id>windows-i386-vs10-release</id>
			<properties>
				<cmake.generator>Visual Studio 10</cmake.generator>
				<platform>windows-i386-vs10</platform>
				<build.type>release</build.type>
				<boost.classifier>windows-i386-vs10</boost.classifier>
			</properties>
		</profile>
		<profile>
			<id>windows-amd64-vs10-debug</id>
			<properties>
				<cmake.generator>Visual Studio 10 Win64</cmake.generator>
				<platform>windows-amd64-vs10</platform>
				<build.type>debug</build.type>
				<boost.classifier>windows-amd64-vs10</boost.classifier>
			</properties>
		</profile>
		<profile>
			<id>windows-amd64-vs10-release</id>
			<properties>
				<cmake.generator>Visual Studio 10 Win64</cmake.generator>
				<platform>windows-amd64-vs10</platform>
				<build.type>release</build.type>
				<boost.classifier>windows-amd64-vs10</boost.classifier>
			</properties>
		</profile>
	</profiles>
</project>
