<?xml version="1.0"?>
<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>
        <groupId>org.locationtech.geomesa</groupId>
        <artifactId>geomesa_2.12</artifactId>
        <version>5.4.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>docs</artifactId>
    <name>GeoMesa Documentation</name>
    <packaging>pom</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <ant.version>1.10.13</ant.version>
        <ant.target>html</ant.target>
    </properties>

    <profiles>
        <profile>
            <id>html</id>
            <properties>
                <ant.target>html</ant.target>
            </properties>
        </profile>
        <profile>
            <id>singlehtml</id>
            <properties>
                <ant.target>singlehtml</ant.target>
            </properties>
        </profile>
        <profile>
            <id>latex</id>
            <properties>
                <ant.target>latex</ant.target>
            </properties>
        </profile>
        <profile>
            <id>docs</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>3.1.0</version>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.ant</groupId>
                                <artifactId>ant</artifactId>
                                <version>${ant.version}</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>compile</id>
                                <phase>compile</phase>
                                <configuration>
                                    <target>
                                        <property name="build.directory" value="${project.build.directory}" />
                                        <ant antfile="build.xml" dir="${basedir}" target="${ant.target}" />
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-resources</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                    <overwrite>true</overwrite>
                                    <resources>
                                        <resource>
                                            <directory>${basedir}</directory>
                                            <includes>
                                                <include>versions.py</include>
                                                <include>__init__.py</include>
                                            </includes>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
