<?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.1</version>
  <artifactId>tts-adapter-osx</artifactId>
  <packaging>bundle</packaging>

  <name>DAISY Pipeline 2 module :: TTS Adapter for MacOS X</name>
  <description>Implementation of the TTS API for Mac OS X Speech voices</description>

  <dependencies>
    <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>org.rococoa</groupId>
      <artifactId>rococoa-core</artifactId>
    </dependency>
    <dependency>
      <groupId>net.java.dev.jna</groupId>
      <artifactId>jna</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <properties>
    <expose-services>
      org.daisy.pipeline.tts.osx.impl.OSXSpeechService
    </expose-services>
  </properties>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <excludes>
          <exclude>META-INF/catalog.xml</exclude>
        </excludes>
      </resource>
      <!--
          this is only needed for testing (without OSGi), actual inclusion of resources is handled by maven-bundle-plugin
      -->
      <resource>
        <directory>${project.build.directory}/dependency/librococoa</directory>
        <targetPath>native/</targetPath>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>get-librococoa</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/dependency/librococoa</outputDirectory>
              <artifactItems>
                <artifactItem>
                  <groupId>org.rococoa</groupId>
                  <artifactId>librococoa</artifactId>
                  <version>0.10.0</version>
                  <type>dylib</type>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <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>
            <Include-Resource>
              src/main/resources/,
              target/generated-resources/spi/,
              native=target/dependency/librococoa
            </Include-Resource>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>