<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>io.github.lorenzobettini.xtextutils</groupId>
		<artifactId>xtext-maven-parent</artifactId>
		<version>0.7.2</version>
		<relativePath>../../xtext-maven-parent/io.github.lorenzobettini.xtextutils.xtext-maven-parent</relativePath>
	</parent>
	<artifactId>xtext-tycho-parent</artifactId>
	<packaging>pom</packaging>

	<name>Xtext Maven/Tycho Parent</name>
	<description>An Xtext Parent POM for building Xtext DSLs as Maven/Tycho projects.</description>

	<properties>
		<!-- Tycho settings -->
		<tycho-version>2.7.1</tycho-version>
		<!-- Define overridable properties for tycho-surefire-plugin -->
		<platformSystemProperties></platformSystemProperties>
		<moduleProperties></moduleProperties>
		<previewProperties></previewProperties>
		<!-- For Tycho surefire plugin -->
		<useUIHarness>false</useUIHarness>
		<useUIThread>true</useUIThread>
		<!-- These additional properties, inherited from parent, are
			also used for Tycho surefire plugin:
			systemProperties, additionalTestArguments, coverageTestArguments> -->
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-maven-plugin</artifactId>
				<version>${tycho-version}</version>
				<extensions>true</extensions>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-source-plugin</artifactId>
				<version>${tycho-version}</version>
				<executions>
					<execution>
						<id>plugin-source</id>
						<goals>
							<goal>plugin-source</goal>
						</goals>
					</execution>
					<execution>
						<id>feature-source</id>
						<goals>
							<goal>feature-source</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-p2-plugin</artifactId>
				<version>${tycho-version}</version>
				<executions>
					<execution>
						<id>attach-p2-metadata</id>
						<phase>package</phase>
						<goals>
							<goal>p2-metadata</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<version>${tycho-version}</version>
				<configuration>
					<environments>
						<environment>
							<os>macosx</os>
							<ws>cocoa</ws>
							<arch>x86_64</arch>
						</environment>
						<environment>
							<os>win32</os>
							<ws>win32</ws>
							<arch>x86_64</arch>
						</environment>
						<environment>
							<os>linux</os>
							<ws>gtk</ws>
							<arch>x86_64</arch>
						</environment>
					</environments>
					<dependency-resolution>
						<extraRequirements>
							<requirement>
								<type>eclipse-plugin</type>
								<id>org.eclipse.xtext.logging</id>
								<versionRange>1.2.15</versionRange>
							</requirement>
							<!-- to get the org.eclipse.osgi.compatibility.state plugin if the target 
								platform is Luna or later. (backward compatible with kepler and previous 
								versions) see https://bugs.eclipse.org/bugs/show_bug.cgi?id=492149 -->
							<requirement>
								<type>eclipse-feature</type>
								<id>org.eclipse.rcp</id>
								<versionRange>0.0.0</versionRange>
							</requirement>
							<!-- to force the same version of jdt.compiler.apt and jdt.core
								(for xtext-maven-plugin) 
								see https://github.com/eclipse/xtext-maven/issues/146 -->
							<requirement>
								<type>eclipse-plugin</type>
								<id>org.eclipse.jdt.compiler.apt</id>
								<versionRange>0.0.0</versionRange>
							</requirement>
						</extraRequirements>
					</dependency-resolution>
				</configuration>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-versions-plugin</artifactId>
					<version>${tycho-version}</version>
				</plugin>
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-compiler-plugin</artifactId>
					<version>${tycho-version}</version>
					<configuration>
						<useProjectSettings>true</useProjectSettings>
					</configuration>
				</plugin>
				<!-- to skip running (and compiling) tests use commandline flag: -Dmaven.test.skip
					To skip tests, but still compile them, use: -DskipTests
					To allow all tests in a pom to pass/fail, use commandline flag: -fae (fail
					at end) -->
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-surefire-plugin</artifactId>
					<version>${tycho-version}</version>
					<configuration>
						<!-- THE FOLLOWING LINE MUST NOT BE BROKEN BY AUTOFORMATTING -->
						<argLine>${coverageTestArguments} ${previewProperties} ${platformSystemProperties} ${systemProperties} ${moduleProperties} ${additionalTestArguments}</argLine>
						<failIfNoTests>false</failIfNoTests>
						<useUIHarness>${useUIHarness}</useUIHarness>
						<useUIThread>${useUIThread}</useUIThread>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.eclipse.tycho.extras</groupId>
					<artifactId>tycho-eclipserun-plugin</artifactId>
					<version>${tycho-version}</version>
				</plugin>
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-p2-repository-plugin</artifactId>
					<version>${tycho-version}</version>
				</plugin>
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-p2-director-plugin</artifactId>
					<version>${tycho-version}</version>
				</plugin>
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-packaging-plugin</artifactId>
					<version>${tycho-version}</version>
				</plugin>
				<plugin>
					<!--This plugin's configuration is used to store Eclipse m2e settings only.
						It has no influence on the Maven build itself. -->
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.eclipse.tycho
										</groupId>
										<artifactId>
											tycho-compiler-plugin
										</artifactId>
										<versionRange>
											[0.23.1,)
										</versionRange>
										<goals>
											<goal>validate-classpath</goal>
											<goal>compile</goal>
											<goal>testCompile</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.eclipse.tycho
										</groupId>
										<artifactId>
											tycho-packaging-plugin
										</artifactId>
										<versionRange>
											[0.23.1,)
										</versionRange>
										<goals>
											<goal>build-qualifier</goal>
											<goal>build-qualifier-aggregator</goal>
											<goal>validate-id</goal>
											<goal>validate-version</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.eclipse.tycho
										</groupId>
										<artifactId>
											target-platform-configuration
										</artifactId>
										<versionRange>
											[2.4.0,)
										</versionRange>
										<goals>
											<goal>target-platform</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>macos</id>
			<activation>
				<os>
					<family>mac</family>
				</os>
			</activation>
			<properties>
				<!-- THE FOLLOWING LINE MUST NOT BE BROKEN BY AUTOFORMATTING -->
				<platformSystemProperties>-XstartOnFirstThread</platformSystemProperties>
			</properties>
		</profile>
		<profile>
			<id>jdk9-or-newer</id>
			<activation>
				<jdk>[9,)</jdk>
			</activation>
			<properties>
				<moduleProperties>--add-modules=ALL-SYSTEM</moduleProperties>
			</properties>
		</profile>
		<profile>
			<id>jdk12-or-newer</id>
			<activation>
				<jdk>[12,)</jdk>
			</activation>
			<properties>
				<previewProperties>--enable-preview</previewProperties>
			</properties>
		</profile>
		<profile>
			<id>xtend-compile</id>
			<!-- This profile will be activated when the system property "skipXtend" is not defined,
				or is defined with a value which is not "true" -->
			<activation>
				<property>
					<name>skipXtend</name>
					<value>!true</value>
				</property>
			</activation>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<!-- For Tycho projects we don't specify
								testOutputDirectory to xtend-gen
								since usually for Eclipse plug-in projects
								tests are in their own projects (with only
								tests) -->
							<groupId>org.eclipse.xtend</groupId>
							<artifactId>xtend-maven-plugin</artifactId>
							<version>${xtextVersion}</version>
							<executions>
								<execution>
									<goals>
										<goal>compile</goal>
										<goal>xtend-install-debug-info</goal>
									</goals>
								</execution>
							</executions>
							<configuration>
								<outputDirectory>${basedir}/xtend-gen</outputDirectory>
							</configuration>
						</plugin>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-clean-plugin</artifactId>
							<configuration>
								<filesets>
									<fileset>
										<directory>${basedir}/xtend-gen</directory>
										<includes>
											<include>**/*</include>
										</includes>
										<excludes>
											<exclude>**/.gitignore</exclude>
										</excludes>
									</fileset>
								</filesets>
							</configuration>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>
		<profile>
			<!-- Activated if the directory 'xtend-gen' is found
				in the base dir of a project -->
			<id>xtend-gen</id>
			<activation>
				<file>
					<exists>xtend-gen</exists>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<!-- enabled unless another profile disables xtend-maven-plugin,
							see profile xtend-compile -->
						<groupId>org.eclipse.xtend</groupId>
						<artifactId>xtend-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<!-- Activated if the file 'ui-tests.txt' is found
				in the base dir of a project -->
			<id>ui-tests</id>
			<activation>
				<file>
					<exists>ui-tests.txt</exists>
				</file>
			</activation>
			<properties>
				<useUIHarness>true</useUIHarness>
				<useUIThread>true</useUIThread>
			</properties>
		</profile>
		<profile>
			<!-- Activated if the file 'swtbot-tests.txt' is found
				in the base dir of a project -->
			<id>swtbot-tests</id>
			<activation>
				<file>
					<exists>swtbot-tests.txt</exists>
				</file>
			</activation>
			<properties>
				<useUIHarness>true</useUIHarness>
				<useUIThread>false</useUIThread>
			</properties>
		</profile>
	</profiles>

</project>