<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.sonarsource.javascript</groupId>
    <artifactId>sonar-plugin</artifactId>
    <version>10.16.0.27621</version>
  </parent>

  <artifactId>bridge</artifactId>

  <name>SonarQube JavaScript :: Bridge</name>

  <properties>
    <protobuf.version>3.25.5</protobuf.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.sonarsource.api.plugin</groupId>
      <artifactId>sonar-plugin-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-compress</artifactId>
    </dependency>
    <dependency>
      <groupId>org.tukaani</groupId>
      <artifactId>xz</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <version>${protobuf.version}</version>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
    </dependency>
     <dependency>
      <groupId>org.sonarsource.api.plugin</groupId>
      <artifactId>sonar-plugin-api-test-fixtures</artifactId>
    </dependency>
    <dependency>
      <groupId>org.sonarsource.sonarqube</groupId>
      <artifactId>sonar-plugin-api-impl</artifactId>
    </dependency>
  </dependencies>

  <build>
    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>1.7.1</version>
      </extension>
    </extensions>
    <plugins>
       <!-- copy runtimes so they are accessible by unit tests -->
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target/test-classes</outputDirectory>
              <resources>
                <resource>
                  <directory>${basedir}/../sonar-javascript-plugin/target/node</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

  <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <version>0.6.1</version>
        <executions>
          <execution>
            <id>generate-protobuf-java-sources</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
              </protocArtifact>
              <protoSourceRoot>${project.basedir}/src/main/protobuf</protoSourceRoot>
              <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protoc</artifactId>
            <version>${protobuf.version}</version>
            <type>exe</type>
            <classifier>${os.detected.classifier}</classifier>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

</project>
