<?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">
  <parent>
    <artifactId>crash.parent</artifactId>
    <groupId>org.crashub</groupId>
    <version>1.7.7-RC01</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>crash.doc</artifactId>
  <packaging>pom</packaging>
  <version>1.7.7-RC01</version>

  <name>CRaSH Doc</name>

  <modules>
    <module>api</module>
    <module>reference</module>
    <module>cookbook</module>
  </modules>

  <dependencies>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.sun</groupId>
      <artifactId>tools</artifactId>
      <version>1.7.0</version>
      <scope>system</scope>
      <systemPath>${env.JAVA_HOME}/lib/tools.jar</systemPath>
    </dependency>
  </dependencies>
  <build>
    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <executions>
            <execution>
              <id>copy-asciidoc</id>
              <phase>generate-resources</phase>
              <goals>
                <goal>copy-resources</goal>
              </goals>
              <configuration>
                <resources>
                  <resource>
                    <directory>src/main/asciidoc</directory>
                  </resource>
                </resources>
                <outputDirectory>target/asciidoc</outputDirectory>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.asciidoctor</groupId>
          <artifactId>asciidoctor-maven-plugin</artifactId>
          <executions>
            <execution>
              <id>generate-html</id>
              <phase>prepare-package</phase>
              <goals>
                <goal>process-asciidoc</goal>
              </goals>
              <configuration>
                <!-- asciidoctor -d book -o target/book.html -a copycss -a toc2 -a sectanchors \
                     -a source-highlighter=coderay -a stylesheet=rocket-panda.css -a crash-version=${project.version} \
                     target/asciidoc/book.asciidoc -->
                <sourceDirectory>${project.build.directory}/asciidoc</sourceDirectory>
                <sourceDocumentName>book.asciidoc</sourceDocumentName>
                <outputDirectory>target/docs/html</outputDirectory>
                <backend>html</backend>
                <doctype>book</doctype>
                <attributes>
                  <toc2>1</toc2>
                  <stylesheet>rocket-panda.css</stylesheet>
                  <stylesdir>${project.basedir}/src/main/resources</stylesdir>
                  <source-highlighter>coderay</source-highlighter>
                  <crash-version>${project.version}</crash-version>
                  <sectanchors>1</sectanchors>
                  <icons>font</icons>
                  <sourcesdir>${project.build.directory}/sources</sourcesdir>
                </attributes>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <executions>
            <execution>
              <id>assemble-html</id>
              <phase>package</phase>
              <goals>
                <goal>single</goal>
              </goals>
              <configuration>
                <descriptors>
                  <descriptor>src/main/assembly/html.xml</descriptor>
                </descriptors>
              </configuration>
            </execution>
          </executions>
        </plugin>

      </plugins>
    </pluginManagement>
  </build>

</project>
