<?xml version="1.0"?>
<!--
  ~ Copyright (c) 2011-2014 The original author or authors
  ~
  ~  All rights reserved. This program and the accompanying materials
  ~  are made available under the terms of the Eclipse Public License v1.0
  ~  and Apache License v2.0 which accompanies this distribution.
  ~
  ~      The Eclipse Public License is available at
  ~      http://www.eclipse.org/legal/epl-v10.html
  ~
  ~      The Apache License v2.0 is available at
  ~      http://www.opensource.org/licenses/apache2.0.php
  ~
  ~  You may elect to redistribute this code under either of these licenses.
  -->
<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">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.vertx</groupId>
    <artifactId>vertx-grpc-aggregator</artifactId>
    <version>5.1.3</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <name>vertx-grpc-transcoding</name>
  <artifactId>vertx-grpc-transcoding</artifactId>

  <dependencies>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-grpc-server</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java-util</artifactId>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-grpc-common</artifactId>
      <version>${project.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-grpc-server</artifactId>
      <version>${project.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-protobuf</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-stub</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-netty-shaded</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- JMH -->
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-core</artifactId>
      <version>${jmh.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>benchmarks</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <executions>
                <execution>
                  <id>default-testCompile</id>
                  <configuration>
                    <annotationProcessorPaths>
                      <annotationProcessorPath>
                        <groupId>org.openjdk.jmh</groupId>
                        <artifactId>jmh-generator-annprocess</artifactId>
                        <version>${jmh.version}</version>
                      </annotationProcessorPath>
                    </annotationProcessorPaths>
                  </configuration>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>assemble-benchmarks</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <archive>
                    <manifest>
                      <mainClass>org.openjdk.jmh.Main</mainClass>
                    </manifest>
                  </archive>
                  <inlineDescriptors>
                    <inlineDescriptor>
                      <id>benchmarks</id>
                      <formats>
                        <format>jar</format>
                      </formats>
                      <includeBaseDirectory>false</includeBaseDirectory>
                      <fileSets>
                        <fileSet>
                          <directory>${project.build.testOutputDirectory}</directory>
                          <includes>
                            <include>io/vertx/benchmarks/**</include>
                            <include>META-INF/BenchmarkList</include>
                            <include>META-INF/CompilerHints</include>
                          </includes>
                          <outputDirectory>/</outputDirectory>
                        </fileSet>
                      </fileSets>
                      <dependencySets>
                        <dependencySet>
                          <outputDirectory>/</outputDirectory>
                          <scope>test</scope>
                          <includes>
                            <include>io.netty:*</include>
                            <include>com.fasterxml.jackson.core:*</include>
                            <include>io.vertx:*</include>
                            <include>org.openjdk.jmh:*</include>
                            <include>net.sf.jopt-simple:*</include>
                            <include>org.apache.commons:*</include>
                          </includes>
                          <unpack>true</unpack>
                          <unpackOptions>
                            <excludes>
                              <exclude>**/module-info.class</exclude>
                            </excludes>
                          </unpackOptions>
                        </dependencySet>
                      </dependencySets>
                    </inlineDescriptor>
                  </inlineDescriptors>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
