<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://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.comixedproject</groupId>
    <artifactId>comixed</artifactId>
    <version>1.6.5-1</version>
  </parent>
  <groupId>org.comixedproject</groupId>
  <artifactId>comixed-webui</artifactId>
  <name>comixed-webui</name>
  <url>http://www.comixedproject.org</url>
  <properties>
    <sonar.sources>./src</sonar.sources>
    <sonar.test.inclusions>**/*spec.ts</sonar.test.inclusions>
    <sonar.javascript.lcov.reportPaths>coverage/lcov.info</sonar.javascript.lcov.reportPaths>
  </properties>
  <build>
    <resources>
      <resource>
        <directory>target/dist</directory>
        <targetPath>static</targetPath>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>1.12.1</version>
        <executions>
          <execution>
            <id>Install node and yarn</id>
            <goals>
              <goal>install-node-and-yarn</goal>
            </goals>
            <phase>initialize</phase>
            <configuration>
              <nodeVersion>v16.16.0</nodeVersion>
              <yarnVersion>v1.22.19</yarnVersion>
            </configuration>
          </execution>
          <execution>
            <id>Install yarn dependencies</id>
            <goals>
              <goal>yarn</goal>
            </goals>
            <phase>initialize</phase>
            <configuration>
              <arguments>install</arguments>
            </configuration>
          </execution>
          <execution>
            <id>Yarn lint</id>
            <goals>
              <goal>yarn</goal>
            </goals>
            <phase>process-sources</phase>
            <configuration>
              <arguments>lint</arguments>
            </configuration>
          </execution>
          <execution>
            <id>Build the frontend code</id>
            <goals>
              <goal>yarn</goal>
            </goals>
            <phase>prepare-package</phase>
            <configuration>
              <arguments>build --configuration production</arguments>
            </configuration>
          </execution>
          <execution>
            <id>Angular tests</id>
            <goals>
              <goal>yarn</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <arguments>run test</arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
