<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2019 Red Hat, Inc.
    This program and the accompanying materials are made
    available under the terms of the Eclipse Public License 2.0
    which is available at:

        https://www.eclipse.org/legal/epl-2.0/

    SPDX-License-Identifier: EPL-2.0

    Contributors:
      Red Hat, Inc. - initial API and implementation

-->
<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>org.eclipse.jkube</groupId>
    <artifactId>jkube-kit-parent</artifactId>
    <version>0.2.0</version>
    <relativePath>../parent/pom.xml</relativePath>
  </parent>

  <artifactId>jkube-kit-doc</artifactId>
  <version>0.2.0</version>
  <packaging>jar</packaging>

  <name>JKube Kit :: Documentation</name>

  <build>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.asciidoctor</groupId>
          <artifactId>asciidoctor-maven-plugin</artifactId>
          <configuration>
            <sourceDirectory>src/main/asciidoc</sourceDirectory>
            <requires>
              <require>asciidoctor-diagram</require>
            </requires>
            <attributes>
              <icons>font</icons>
              <pagenums/>
              <version>${project.version}</version>
              <idprefix/>
              <idseparator>-</idseparator>
              <allow-uri-read>true</allow-uri-read>
            </attributes>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <!-- ==== HTML documentation ====================== -->
  <profiles>
    <profile>
      <id>html</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctor-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>output-html</id>
                <phase>package</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceHighlighter>coderay</sourceHighlighter>
                  <backend>html5</backend>
                  <sourceHighlighter>coderay</sourceHighlighter>
                  <attributes>
                    <toc>left</toc>
                    <linkcss>false</linkcss>
                  </attributes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <activation><activeByDefault>true</activeByDefault></activation>
    </profile>

    <!-- ==== PDF documentation ====================== -->

    <profile>
      <id>pdf</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctor-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>output-pdf</id>
                <phase>package</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <backend>pdf</backend>
                  <sourceHighlighter>rouge</sourceHighlighter>
                  <attributes>
                    <toc/>
                    <imagesdir>${project.build.directory}/generated-docs/images</imagesdir>
                  </attributes>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctorj-pdf</artifactId>
                <version>1.5.0-alpha.11</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
