<?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.kie</groupId>
    <artifactId>kie-docs</artifactId>
    <version>7.0.0-SNAPSHOT</version>
  </parent>

  <artifactId>dashbuilder-docs</artifactId>
  <packaging>jdocbook</packaging>

  <name>KIE :: Documentation :: Dashbuilder Docbook</name>
  <description>Dashbuilder Documentation</description>

  <dependencies>
    <dependency>
      <!-- Necessary because this is excluded by the maven-jdocbook-plugin, although we need it for conditional processing
           See: https://github.com/pressgang/maven-jdocbook-plugin/blob/maven-jdocbook-plugin-2.3.9/pom.xml#L194-L208
           See: https://github.com/pressgang/jdocbook-core/issues/13
       -->
      <groupId>net.sf.docbook</groupId>
      <artifactId>docbook-xsl</artifactId>
      <classifier>resources</classifier>
      <type>zip</type>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <!-- so that jbpm-asciidocs can inject this content -->
        <directory>src/main/docbook/en-US/</directory>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-xsl-sources</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>net.sf.docbook</groupId>
                  <artifactId>docbook-xsl</artifactId>
                  <classifier>resources</classifier>
                  <type>zip</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/xsl</outputDirectory>
                  <includes>**/*.xsl</includes>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-resources-pdf</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target/docbook/staging/images/images</outputDirectory>
              <resources>
                <resource>
                  <directory>${basedir}/../shared/images/</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-xsl-to-docbook</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target/docbook/staging/</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.directory}/xsl/docbook/</directory>
                  <filtering>false</filtering>
                </resource>
              </resources>
            </configuration>            
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
