<?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/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.daisy.pipeline.modules</groupId>
    <artifactId>modules-parent</artifactId>
    <version>1.15.4</version>
    <relativePath>../../parent</relativePath>
  </parent>

  <version>3.2.2</version>
  <artifactId>tts-adapter-sapinative</artifactId>
  <packaging>bundle</packaging>

  <name>DAISY Pipeline 2 module :: TTS Adapter for SAPI</name>
  <description>Implementation of the TTS API for the SAPI native version</description>

  <dependencies>
    <dependency>
      <groupId>org.daisy.pipeline</groupId>
      <artifactId>common-utils</artifactId>
    </dependency>
    <dependency>
      <groupId>org.daisy.pipeline.modules</groupId>
      <artifactId>tts-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.daisy.libs</groupId>
      <artifactId>saxon-he</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>xmlunit</groupId>
      <artifactId>xmlunit</artifactId>
      <version>1.5</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <properties>
    <expose-services>
      org.daisy.pipeline.tts.sapi.impl.SAPIService
    </expose-services>
  </properties>

  <build>
    <plugins>
      <plugin>
	<groupId>org.apache.felix</groupId>
	<artifactId>maven-bundle-plugin</artifactId>
	<configuration>
	  <instructions>
	    <Import-Package>
	      net.sf.saxon.*;version="${saxon.versionRange}",
	      !org.daisy.common.spi,
	      *
	    </Import-Package>
	  </instructions>
	</configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
	<plugin>
	  <groupId>org.codehaus.mojo</groupId>
	  <artifactId>native-maven-plugin</artifactId>
	  <version>1.0-alpha-7</version>
	</plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <!-- Run mvn -Pgenerate-sapinative-headers compile native:javah to generate again the C++ headers from the Java class -->
      <id>generate-sapinative-headers</id>
      <build>
	<plugins>
	  <plugin>
	    <groupId>org.codehaus.mojo</groupId>
	    <artifactId>native-maven-plugin</artifactId>
	    <executions>
	      <execution>
		<phase>none</phase>
		<id>default-cli</id>
		<goals>
		  <goal>javah</goal>
		</goals>
		<configuration>
		  <javahOS>windows</javahOS>
		  <javahOutputDirectory>src/main/jni/sapinative</javahOutputDirectory>
		  <javahClassNames>
		    <javahClassName>org.daisy.pipeline.tts.onecore.SAPI</javahClassName>
		  </javahClassNames>
		</configuration>
	      </execution>
	    </executions>
	  </plugin>
	</plugins>
      </build>
    </profile>
    <profile>
      <!-- Run mvn -Pgenerate-onecorenative-headers compile native:javah to generate again the C++ headers from the Java class -->
      <id>generate-onecorenative-headers</id>
      <build>
	<plugins>
	  <plugin>
	    <groupId>org.codehaus.mojo</groupId>
	    <artifactId>native-maven-plugin</artifactId>
	    <executions>
	      <execution>
		<phase>none</phase>
		<id>default-cli</id>
		<goals>
		  <goal>javah</goal>
		</goals>
		<configuration>
		  <javahOS>windows</javahOS>
		  <javahOutputDirectory>src/main/jni/onecore</javahOutputDirectory>
		  <javahClassNames>
		    <javahClassName>org.daisy.pipeline.tts.onecore.Onecore</javahClassName>
		  </javahClassNames>
		</configuration>
	      </execution>
	    </executions>
	  </plugin>
	</plugins>
      </build>
    </profile>
  </profiles>

</project>