<?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">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>google-cloud-conformance-tests</artifactId>
  <version>0.0.1</version><!-- {x-version-update:google-cloud-conformance-tests:current} -->
  <packaging>jar</packaging>

  <parent>
    <groupId>com.google.cloud</groupId>
    <artifactId>google-cloud-shared-config</artifactId>
    <version>0.2.1</version>
  </parent>

  <properties>
    <guava.version>28.1-android</guava.version>
    <protobuf.version>3.10.0</protobuf.version>
    <junit.version>4.12</junit.version>
    <truth.version>1.0</truth.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-bom</artifactId>
        <version>0.115.0-alpha</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <version>${protobuf.version}</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.truth</groupId>
      <artifactId>truth</artifactId>
      <version>${truth.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.api.grpc</groupId>
      <artifactId>proto-google-cloud-firestore-v1</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.api.grpc</groupId>
      <artifactId>proto-google-cloud-bigtable-v2</artifactId>
    </dependency>
  </dependencies>

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

  <profiles>
    <profile>
      <id>gen-conformance-protos</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.xolstice.maven.plugins</groupId>
            <artifactId>protobuf-maven-plugin</artifactId>
            <version>0.6.1</version>
            <executions>
              <execution>
                <id>generate-main</id>
                <goals>
                  <goal>compile</goal>
                </goals>
                <phase>generate-sources</phase>
              </execution>
              <execution>
                <id>generate-test</id>
                <goals>
                  <goal>test-compile</goal>
                </goals>
                <phase>generate-test-sources</phase>
              </execution>
            </executions>
            <configuration>
              <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
            </configuration>
          </plugin>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <version>3.0</version>
            <executions>
              <execution>
                <id>license-main</id>
                <goals>
                  <goal>format</goal>
                </goals>
                <phase>process-sources</phase>
                <configuration>
                  <includes>
                    <include>src/main/java/**</include>
                    <include>target/generated-sources/**/java/**</include>
                  </includes>
                </configuration>
              </execution>
              <execution>
                <id>license-test</id>
                <goals>
                  <goal>format</goal>
                </goals>
                <phase>process-test-sources</phase>
                <configuration>
                  <includes>
                    <include>src/test/java/**</include>
                    <include>target/generated-test-sources/**/java/**</include>
                  </includes>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <header>copyright-header.txt</header>
              <mapping>
                <java>SLASHSTAR_STYLE</java>
              </mapping>
              <useDefaultExcludes>false</useDefaultExcludes>
            </configuration>
          </plugin>
          <plugin>
            <groupId>com.coveo</groupId>
            <artifactId>fmt-maven-plugin</artifactId>
            <version>2.9</version>
            <executions>
              <execution>
                <id>format-main</id>
                <goals>
                  <goal>format</goal>
                </goals>
                <phase>process-sources</phase>
              </execution>
              <execution>
                <id>format-test</id>
                <goals>
                  <goal>format</goal>
                </goals>
                <phase>process-test-sources</phase>
              </execution>
            </executions>
            <configuration>
              <additionalSourceDirectories>
                <directory>target/generated-sources/protobuf/java</directory>
              </additionalSourceDirectories>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
