<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~  Copyright (c) 2019, Salesforce.com, Inc.
  ~  All rights reserved.
  ~  Licensed under the BSD 3-Clause license.
  ~  For full license text, see LICENSE.txt file in the repo root  or https://opensource.org/licenses/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/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>jprotoc-parent</artifactId>
        <groupId>com.salesforce.servicelibs</groupId>
        <version>1.2.2</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>jprotoc-test</artifactId>

    <dependencies>
        <!-- Test dependencies -->
        <dependency>
            <groupId>com.salesforce.servicelibs</groupId>
            <artifactId>grpc-contrib</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.salesforce.servicelibs</groupId>
            <artifactId>jprotoc</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-netty</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-core</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-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-protobuf</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.7.1</version>
            </extension>
        </extensions>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <!-- Don't install, since there isn't anything to install -->
                    <skip>true</skip>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.xolstice.maven.plugins</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <version>0.6.1</version>
                <configuration>
                    <protocArtifact>com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}</protocArtifact>
                </configuration>
                <executions>
                    <execution>
                        <id>protoc-proto</id>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>protoc-grpc</id>
                        <goals>
                            <goal>test-compile-custom</goal>
                        </goals>
                        <configuration>
                            <pluginId>grpc-java</pluginId>
                            <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
                        </configuration>
                    </execution>
                    <execution>
                        <id>protoc-java8</id>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                        <configuration>
                            <protocPlugins>
                                <protocPlugin>
                                    <id>java8</id>
                                    <groupId>com.salesforce.servicelibs</groupId>
                                    <artifactId>jprotoc</artifactId>
                                    <version>${project.version}</version>
                                    <mainClass>com.salesforce.jprotoc.jdk8.Jdk8Generator</mainClass>
                                </protocPlugin>
                            </protocPlugins>
                        </configuration>
                    </execution>
                    <execution>
                        <id>protoc-dump</id>
                        <goals>
                            <goal>test-compile-custom</goal>
                        </goals>
                        <configuration>
                            <pluginId>dump</pluginId>
                            <pluginArtifact>com.salesforce.servicelibs:jprotoc:${project.version}:exe:${os.detected.classifier}</pluginArtifact>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
