<?xml version="1.0"?>
<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-ai-parent</artifactId>
		<version>2.0.3</version>
	</parent>
	
	<artifactId>tl-chat</artifactId>

	<licenses>
	  <license>
	    <name>LicenseRef-BOS-TopLogic-1.0</name>
	    <url>https://github.com/top-logic/.github/blob/main/LICENSES/LicenseRef-BOS-TopLogic-1.0.md</url>
	  </license>
	</licenses>
	
	<properties>
		<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
		<msgbuf.version>1.2.2</msgbuf.version>
	</properties>

	<dependencies>
		<!-- TopLogic -->
		<dependency>
			<groupId>com.top-logic</groupId>
			<artifactId>tl-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.top-logic</groupId>
			<artifactId>tl-layout-view</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>com.top-logic</groupId>
			<artifactId>tl-element</artifactId>
		</dependency>
		<dependency>
			<groupId>com.top-logic</groupId>
			<artifactId>tl-ai-core</artifactId>
			<version>${project.version}</version>
		</dependency>
		<!-- Tests -->
		<dependency>
			<groupId>com.top-logic</groupId>
			<artifactId>tl-ai-vector-index</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.top-logic</groupId>
			<artifactId>tl-basic</artifactId>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.top-logic</groupId>
			<artifactId>tl-core</artifactId>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>com.github.eirslett</groupId>
				<artifactId>frontend-maven-plugin</artifactId>
				<version>1.15.4</version>
				<configuration>
					<workingDirectory>ui</workingDirectory>
					<installDirectory>ui</installDirectory>
				</configuration>
				<executions>
					<execution>
						<id>install-node</id>
						<goals>
							<goal>install-node-and-npm</goal>
						</goals>
						<configuration>
							<nodeVersion>v20.10.0</nodeVersion>
						</configuration>
					</execution>
					<execution>
						<id>npm-install</id>
						<goals>
							<goal>npm</goal>
						</goals>
						<configuration>
							<arguments>install</arguments>
						</configuration>
					</execution>
					<!--
						Type errors must fail the build, not reach the browser: the Vite lib build
						strips types without checking them, so tsc runs as its own step before it.
					-->
					<execution>
						<id>npm-typecheck</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>npm</goal>
						</goals>
						<configuration>
							<arguments>run typecheck</arguments>
						</configuration>
					</execution>
					<execution>
						<id>npm-test</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>npm</goal>
						</goals>
						<configuration>
							<arguments>test</arguments>
						</configuration>
					</execution>
					<execution>
						<id>npm-build</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>npm</goal>
						</goals>
						<configuration>
							<arguments>run build</arguments>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>de.haumacher.msgbuf</groupId>
				<artifactId>msgbuf-generator-maven-plugin</artifactId>
				<version>${msgbuf.version}</version>
				<executions>
					<execution>
						<id>generate-protocols</id>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
