<!--

    Copyright (C) 2017-2025 Dominic Heutelbeck (dominic@heutelbeck.com)

    SPDX-License-Identifier: Apache-2.0

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>io.sapl</groupId>
		<artifactId>sapl-policy-engine</artifactId>
		<version>3.0.0</version>
	</parent>
	<name>SAPL Test Language</name>
	<artifactId>sapl-test-lang</artifactId>
	<packaging>jar</packaging>
	<dependencies>
		<dependency>
			<groupId>io.sapl</groupId>
			<artifactId>sapl-generator</artifactId>
			<version>${project.version}</version>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.eclipse.xtext</groupId>
			<artifactId>org.eclipse.xtext</artifactId>
			<version>${xtext.version}</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.xtext</groupId>
			<artifactId>org.eclipse.xtext.xbase</artifactId>
			<version>${xtext.version}</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.xtext</groupId>
			<artifactId>org.eclipse.xtext.xtext.generator</artifactId>
			<version>${xtext.version}</version>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.eclipse.emf</groupId>
			<artifactId>org.eclipse.emf.mwe2.launch</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.eclipse.xtext</groupId>
			<artifactId>xtext-antlr-generator</artifactId>
			<optional>true</optional>
		</dependency>
		<!-- Testing -->
		<dependency>
			<groupId>org.eclipse.xtext</groupId>
			<artifactId>org.eclipse.xtext.testing</artifactId>
			<version>${xtext.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.xtext</groupId>
			<artifactId>org.eclipse.xtext.xbase.testing</artifactId>
			<version>${xtext.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>3.0.0</version>
				<executions>
					<execution>
						<?m2e ignore?>
						<id>mwe2Launcher</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>java</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<mainClass>org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher</mainClass>
					<arguments>
						<argument>
							/${project.basedir}/src/main/java/io/sapl/test/grammar/GenerateSAPLTest.mwe2</argument>
						<argument>-p</argument>
						<argument>rootPath=/${project.basedir}/..</argument>
					</arguments>
					<classpathScope>compile</classpathScope>
					<includePluginDependencies>true</includePluginDependencies>
					<cleanupDaemonThreads>false</cleanupDaemonThreads><!-- see
					https://bugs.eclipse.org/bugs/show_bug.cgi?id=475098#c3 -->
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<configuration>
					<filesets combine.children="append">
						<fileset>
							<directory>
								${basedir}/../sapl-test-lang/src/main/xtext-gen/</directory>
							<includes>
								<include>**/*</include>
							</includes>
						</fileset>
						<fileset>
							<directory>
								${basedir}/../sapl-test-lang/src/test/xtext-gen/</directory>
							<includes>
								<include>**/*</include>
							</includes>
						</fileset>
						<fileset>
							<directory>
								${basedir}/../sapl-test-ide/src/main/xtext-gen/</directory>
							<includes>
								<include>**/*</include>
							</includes>
						</fileset>
						<fileset>
							<directory>
								${basedir}/../sapl-test-web/src/main/xtext-gen/</directory>
							<includes>
								<include>**/*</include>
							</includes>
						</fileset>
						<fileset>
							<directory>${basedir}/model/generated/</directory>
						</fileset>
					</filesets>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>initialize</phase>
						<goals>
							<goal>add-source</goal>
							<goal>add-resource</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/main/xtext-gen</source>
							</sources>
							<resources>
								<resource>
									<directory>src/main/xtext-gen</directory>
									<excludes>
										<exclude>**/*.java</exclude>
										<exclude>**/*.g</exclude>
									</excludes>
								</resource>
								<resource>
									<directory>model/generated</directory>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>add-test-source</id>
						<phase>initialize</phase>
						<goals>
							<goal>add-test-source</goal>
							<goal>add-test-resource</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/test/xtext-gen</source>
							</sources>
							<resources>
								<resource>
									<directory>src/test/xtext-gen</directory>
									<excludes>
										<exclude>**/*.java</exclude>
									</excludes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>biz.aQute.bnd</groupId>
				<artifactId>bnd-maven-plugin</artifactId>
				<version>6.4.0</version>
				<executions>
					<execution>
						<goals>
							<goal>bnd-process</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifestFile>
							${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>net.ju-n.maven.plugins</groupId>
				<artifactId>checksum-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>
