<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.sonarsource.javascript</groupId>
    <artifactId>sonar-plugin</artifactId>
    <version>10.23.0.32711</version>
  </parent>
  <artifactId>javascript-checks</artifactId>
  <version>10.23.0.32711</version>
  <name>SonarQube JavaScript :: Checks</name>
  <licenses>
    <license>
      <name>SSALv1</name>
      <url>https://sonarsource.com/license/ssal/</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <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.sonarsource.analyzer-commons</groupId>
      <artifactId>sonar-analyzer-commons</artifactId>
    </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>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.sonarsource.rspec</groupId>
        <artifactId>rspec-maven-plugin</artifactId>
        <version>1.0.0.47</version>
        <executions>
          <execution>
            <id>Generate Javascript/Typescript rules data</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>generate-rule-data</goal>
            </goals>
            <configuration>
              <ruleSubdirectory>javascript</ruleSubdirectory>
              <targetDirectory>${project.basedir}/../../resources/rule-data/javascript</targetDirectory>
            </configuration>
          </execution>
          <execution>
            <id>Generate CSS rules data</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>generate-rule-data</goal>
            </goals>
            <configuration>
              <ruleSubdirectory>css</ruleSubdirectory>
              <targetDirectory>${project.basedir}/../../resources/rule-data/css</targetDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.5.0</version>
        <executions>
          <execution>
            <id>Clean the Rule Data</id>
            <phase>clean</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>rm</executable>
              <workingDirectory>../..</workingDirectory>
              <arguments>
                <argument>-rf</argument>
                <argument>resources/rule-data</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>Deploy the rule data</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>npm</executable>
              <workingDirectory>../..</workingDirectory>
              <arguments>
                <argument>run</argument>
                <argument>deploy-rule-data</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>Generate the Java Check classes</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>npm</executable>
              <workingDirectory>../..</workingDirectory>
              <arguments>
                <argument>run</argument>
                <argument>generate-java-rule-classes</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>Update README with rule counts</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>npm</executable>
              <workingDirectory>../..</workingDirectory>
              <arguments>
                <argument>run</argument>
                <argument>count-rules</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
