<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.top-logic</groupId>
    <artifactId>tl-parent-all</artifactId>
    <version>8.0.0-alpha3</version>
    <relativePath>..</relativePath>
  </parent>

  <artifactId>tl-build-doclet</artifactId>
	<name>${project.artifactId}</name>
	<url>https://github.com/top-logic/tl-engine/</url>

  <properties>
	<dependency-check.skip>true</dependency-check.skip>
  </properties>

  <dependencies>
  	<dependency>
  		<groupId>com.top-logic</groupId>
  		<artifactId>tl-tools-resources</artifactId>
  	</dependency>
  </dependencies>
  
  <build>
	<plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>

            <configuration>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>

            <executions>
                <execution>
                    <id>make-assembly</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
			<plugin>
				<groupId>com.github.eirslett</groupId>
				<artifactId>frontend-maven-plugin</artifactId>
				<version>1.15.4</version>

				<configuration>
					<!-- All npm / node commands run here -->
					<workingDirectory>resources/frontend</workingDirectory>
				</configuration>
				<executions>
					<!-- Install Node.js locally -->
					<execution>
						<id>install-node</id>
						<goals>
							<goal>install-node-and-npm</goal>
						</goals>
						<configuration>
							<nodeVersion>v20.10.0</nodeVersion>
						</configuration>
					</execution>

					<!-- npm install -->
					<execution>
						<id>npm-install</id>
						<goals>
							<goal>npm</goal>
						</goals>
						<configuration>
							<arguments>install</arguments>
						</configuration>
					</execution>

					<!-- Nunjucks compile -->
					<execution>
						<id>compile-nunjucks</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>npm</goal>
						</goals>
						<configuration>
							<arguments>run compile</arguments>
						</configuration>
					</execution>
					<!-- Minify file -->
					<execution>
						<id>minify-js</id>
						<phase>process-resources</phase>
						<goals>
							<goal>npm</goal>
						</goals>
						<configuration>
							<arguments>run minify</arguments>
						</configuration>
					</execution>
				</executions>
			</plugin>

   	</plugins>
  </build>
  
</project>
