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

    Copyright (c) 2011, 2020 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Distribution License v. 1.0, which is available at
    http://www.eclipse.org/org/documents/edl-v10.php.
    
    SPDX-License-Identifier: BSD-3-Clause

-->
<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>

    <groupId>jakarta.json.bind</groupId>
    <artifactId>jakarta.json.bind-docs</artifactId>
    <version>2.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>JSON Binding Docs</name>

    <properties>
        <asciidoctor.maven.plugin.version>1.6.0</asciidoctor.maven.plugin.version>
        <asciidoctorj.version>1.6.2</asciidoctorj.version>
        <jruby.version>9.2.9.0</jruby.version>
        <rubygems.prawn.version>2.2.2</rubygems.prawn.version>
    </properties>

    <repositories>
        <repository>
            <id>rubygems-proxy-releases2</id>
            <name>RubyGems.org Proxy (Releases)</name>
            <url>http://rubygems-proxy.torquebox.org/releases</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>rubygems</groupId>
            <artifactId>prawn</artifactId>
            <version>${rubygems.prawn.version}</version>
            <type>gem</type>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <defaultGoal>process-resources</defaultGoal>
        <plugins>
            <plugin>
                <groupId>de.saumya.mojo</groupId>
                <artifactId>gem-maven-plugin</artifactId>
                <version>1.0.10</version>
                <configuration>
                    <jrubyVersion>${jruby.version}</jrubyVersion>
                    <gemHome>${project.build.directory}/gems</gemHome>
                    <gemPath>${project.build.directory}/gems</gemPath>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>initialize</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <version>${asciidoctor.maven.plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.jruby</groupId>
                        <artifactId>jruby-complete</artifactId>
                        <version>${jruby.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj</artifactId>
                        <version>${asciidoctorj.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <sourceDirectory>src/docs</sourceDirectory>
                    <sourceDocumentName>user-guide.adoc</sourceDocumentName>
                    <gemPath>${project.build.directory}/gems-provided</gemPath>
                    <attributes>
                        <sourcedir>${project.build.sourceDirectory}</sourcedir>
                    </attributes>
                </configuration>
                <executions>
                    <execution>
                        <id>asciidoc-to-html</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>html5</backend>
                            <sourceHighlighter>coderay</sourceHighlighter>
                            <attributes>
                                <imagesdir>./images</imagesdir>
                                <toc>left</toc>
                                <toclevels>3</toclevels>
                                <icons>font</icons>
                                <sectanchors>true</sectanchors>
                                <idprefix/>
                                <idseparator>-</idseparator>
                                <docinfo1>true</docinfo1>
                            </attributes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
