<?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>javascript</artifactId>
    <version>8.7.0.17093</version>
  </parent>

  <artifactId>eslint-bridge</artifactId>
  <name>SonarQube JavaScript :: ESLint-bridge</name>

  <properties>
    <sonar.sources>src</sonar.sources>
    <sonar.tests>tests</sonar.tests>
    <sonar.javascript.lcov.reportPaths>coverage/lcov.info</sonar.javascript.lcov.reportPaths>
    <sonar.typescript.tsconfigPath>${project.basedir}/tests/tsconfig.json</sonar.typescript.tsconfigPath>
    <sonar.test.exclusions>tests/**/fixtures/**/*</sonar.test.exclusions>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>npm run build</id>
            <phase>generate-resources</phase>
            <goals><goal>exec</goal></goals>
            <configuration>
              <executable>npm</executable>
              <arguments>
                <argument>run</argument>
                <argument>build</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>npm run test</id>
            <phase>test</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>npm</executable>
              <commandlineArgs>run test -- --coverage --silent</commandlineArgs>
              <skip>${skipTests}</skip>
            </configuration>
          </execution>
          <execution>
            <id>npm run jar</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>npm</executable>
              <arguments>
                <argument>run</argument>
                <argument>jar</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <!-- This plugin is already configured in parent pom, however we want a configuration specific to this project -->
        <configuration>
          <includes>
            <include>src/**/*.ts</include>
            <include>src/**/*.tsx</include>
            <include>tests/**/*.ts</include>
          </includes>
          <excludes>
            <exclude>tests/**/fixtures/**/*.ts</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
