<?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>
    <groupId>io.vertx</groupId>
    <artifactId>vertx-lang-scala-parent_2.12</artifactId>
    <version>3.5.3</version>
    <relativePath>..</relativePath>
  </parent>

  <modelVersion>4.0.0</modelVersion>

  <artifactId>vertx-lang-scala-docs_2.12</artifactId>
  <packaging>jar</packaging>

  <dependencies>

    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-lang-scala-stack_2.12</artifactId>
      <version>${stack.version}</version>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-lang-scala-on-the-fly_2.12</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-codegen</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-docgen</artifactId>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-codetrans</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-amqp-bridge-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>



    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-consul-client-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-consul-service-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-mqtt-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-sql-common-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-bridge-common-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-jdbc-client-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-mongo-client-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-mongo-service-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-auth-common-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-auth-shiro-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-auth-htdigest-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-auth-oauth2-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-auth-mongo-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-auth-jwt-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-auth-jdbc-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web-common-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web-client-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-sockjs-service-proxy-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web-templ-freemarker-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web-templ-handlebars-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web-templ-jade-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web-templ-mvel-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web-templ-pebble-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web-templ-thymeleaf-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-mysql-postgresql-client-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-mail-client-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-rabbitmq-client-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-redis-client-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-stomp-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-tcp-eventbus-bridge-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-dropwizard-metrics-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-hawkular-metrics-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-shell-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-kafka-client-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-service-discovery-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-service-discovery-backend-zookeeper-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-service-discovery-backend-redis-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-service-discovery-bridge-consul-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-service-discovery-bridge-docker-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-service-discovery-bridge-docker-links-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-service-discovery-bridge-kubernetes-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-service-discovery-bridge-zookeeper-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-circuit-breaker-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-config-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-config-git-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-config-hocon-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-config-kubernetes-configmap-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-config-redis-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-config-spring-config-server-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-config-yaml-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-config-zookeeper-scala_2.12</artifactId>
      <version>${stack.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.8</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>

                <!-- Asciidoc -->
                <copy todir="target/docs" >
                  <fileset dir="../vertx-lang-scala">
                    <include name="src/main/asciidoc/scala/**"/>
                  </fileset>
                  <mapper type="regexp" from="^src/main/asciidoc/scala/(.*)" to="vertx-core/scala/\1"/>
                </copy>
                <copy todir="target/docs" >
                  <fileset dir="../vertx-lang-scala-stack">
                    <include name="vertx-*/src/main/asciidoc/scala/**"/>
                    <exclude name="vertx-config"/>
                    <exclude name="vertx-service-discovery"/>
                  </fileset>
                  <mapper type="regexp" from="^vertx-(.*)/src/main/asciidoc/scala/(.*)" to="vertx-\1/scala/\2"/>
                </copy>
                <copy todir="target/docs" >
                  <fileset dir="../vertx-lang-scala-stack/vertx-config">
                    <include name="vertx-*/src/main/asciidoc/scala/**"/>
                  </fileset>
                  <mapper type="regexp" from="^vertx-.*/src/main/asciidoc/scala/(.*)" to="vertx-config/scala/\1"/>
                </copy>
                <copy todir="target/docs" >
                  <fileset dir="../vertx-lang-scala-stack/vertx-service-discovery">
                    <include name="vertx-*/src/main/asciidoc/scala/**"/>
                  </fileset>
                  <mapper type="regexp" from="^vertx-.*/src/main/asciidoc/scala/(.*)" to="vertx-service-discovery/scala/\1"/>
                </copy>

                <!-- Sources -->
                <copy todir="target/sources" >
                  <fileset dir="../vertx-lang-scala">
                    <include name="src/main/scala/**"/>
                  </fileset>
                  <mapper type="regexp" from="^src/main/scala/(.*)" to="\1"/>
                </copy>
                <copy todir="target/sources" >
                  <fileset dir="../vertx-lang-scala-stack">
                    <include name="vertx-*/src/main/scala/**"/>
                  </fileset>
                  <mapper type="regexp" from="^vertx-.*/src/main/scala/(.*)" to="\1"/>
                </copy>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>doc</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <sourceDir>${project.build.directory}/sources</sourceDir>
              <reportOutputDirectory>${project.build.directory}</reportOutputDirectory>
              <outputDirectory>scaladocs</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>package-docs</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>docs.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
