<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>io.sarl</groupId>
		<artifactId>io.sarl</artifactId>
		<version>0.7.2</version>
	</parent>

	<artifactId>io.sarl.tycho-parent</artifactId>
	<name>Tycho Module Parent</name>
	<packaging>pom</packaging>

	<!-- ======================================= -->
	<!-- ==== Plugins Dependency Management === -->
	<!-- ======================================= -->

	<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>target-platform-configuration</artifactId>
				<version>${tycho.version}</version>
				<configuration>
					<resolver>p2</resolver>
					<executionEnvironment>${jre.environment}</executionEnvironment>
					<environments>
						<environment>
							<os>win32</os>
							<ws>win32</ws>
							<arch>x86</arch>
						</environment>
						<environment>
							<os>win32</os>
							<ws>win32</ws>
							<arch>x86_64</arch>
						</environment>
						<environment>
							<os>macosx</os>
							<ws>cocoa</ws>
							<arch>x86_64</arch>
						</environment>
						<environment>
							<os>linux</os>
							<ws>gtk</ws>
							<arch>x86</arch>
						</environment>
						<environment>
							<os>linux</os>
							<ws>gtk</ws>
							<arch>x86_64</arch>
						</environment>
					</environments>
					<target>
						<artifact>
							<groupId>io.sarl</groupId>
							<artifactId>io.sarl.lang.targetplatform</artifactId>
							<version>${project.version}</version>
						</artifact>
					</target>
					<filters>
						<filter>
							<type>eclipse-plugin</type>
							<id>org.eclipse.xtext.xbase.lib</id>
							<restrictTo>
								<versionRange>[${xtext.version},${xtext.version.next})</versionRange>
							</restrictTo>
						</filter>
						<filter>
							<type>eclipse-plugin</type>
							<id>org.zeromq.jeromq</id>
							<restrictTo>
								<version>${zeromq.version}</version>
							</restrictTo>
						</filter>
					</filters>
					<!-- The following dependency-resolution is added for obtaining a runnable
					     product on MacOS  -->
					<dependency-resolution>
						<extraRequirements>
							<!-- to get the org.eclipse.osgi.compatibility.state plugin iff 
							the targeted Eclipse version (e.g., Luna) has it
							(backwards compatible with kepler and previous versions) -->
							<requirement>
								<type>eclipse-feature</type>
								<id>org.eclipse.rcp</id>
								<versionRange>0.0.0</versionRange>
							</requirement>
							<requirement>
								<type>eclipse-feature</type>
								<id>org.eclipse.jdt</id>
								<versionRange>0.0.0</versionRange>
							</requirement>
						</extraRequirements>
					</dependency-resolution>
				</configuration>
			</plugin>
		</plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-compiler-plugin</artifactId>
					<version>${tycho.version}</version>
					<configuration>
						<compilerArgument>-warn:none</compilerArgument>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-p2-director-plugin</artifactId>
					<version>${tycho.version}</version>
					<executions>
						<execution>
							<!-- install the product using the p2 director -->
							<id>materialize-products</id>
							<goals>
								<goal>materialize-products</goal>
							</goals>
						</execution>
						<execution>
							<!-- create zip file with the installed product -->
							<id>archive-products</id>
							<goals>
								<goal>archive-products</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-source-plugin</artifactId>
					<version>${tycho.version}</version>
					<executions>
						<execution>
							<id>plugin-source</id>
							<phase>prepare-package</phase>
							<goals>
								<goal>plugin-source</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.eclipse.tycho.extras</groupId>
					<artifactId>tycho-source-feature-plugin</artifactId>
					<version>${tycho.version}</version>
					<executions>
						<execution>
							<id>feature-source</id>
							<phase>package</phase>
							<goals>
								<goal>source-feature</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</pluginManagement>

	</build>

	<profiles>
		<profile>
			<id>default-profile</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.eclipse.tycho</groupId>
							<artifactId>tycho-p2-plugin</artifactId>
							<version>${tycho.version}</version>
							<executions>
								<execution>
									<id>attached-p2-metadata</id>
									<phase>package</phase>
									<goals>
										<goal>p2-metadata</goal>
									</goals>
								</execution>
							</executions>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>
		<profile>
			<id>generate-the-public-api</id>
			<activation>
				<property>
					<name>publicSarlApiModuleSet</name>
					<value>true</value>
				</property>
			</activation>
		</profile>
	</profiles>

	<!-- ===================== -->
	<!-- ==== Repositories === -->
	<!-- ===================== -->

	<repositories>
		<!-- Use the different P2 repositories in place of the P2 composite repository.
		     The list of the available P2 repositories is available at:
		     https://eclipse.org/Xtext/documentation/350_continuous_integration.html
		     -->
		<repository>
			<id>org.eclipse.modeling.tmf.xtext.updates</id>
			<layout>p2</layout>
			<url>http://download.eclipse.org/modeling/tmf/xtext/updates/releases/${xtext.version}/</url>
		</repository>
		<repository>
			<id>org.eclipse.modeling.emft.mwe.updates</id>
			<layout>p2</layout>
			<url>http://download.eclipse.org/modeling/emft/mwe/updates/releases/${mwe2.version}/</url>
		</repository>
		<repository>
			<id>org.eclipse.modeling.m2t.xpand.updates</id>
			<layout>p2</layout>
			<url>http://download.eclipse.org/modeling/m2t/xpand/updates/releases/${xpand.version}/</url>
		</repository>
		<!-- Eclipse and related libraries -->
		<repository>
			<id>org.eclipse.ide.oxygen</id>
			<layout>p2</layout>
			<url>http://download.eclipse.org/releases/oxygen/</url>
		</repository>
		<repository>
			<id>org.jboss.m2e-jdt-compiler.update.lastest</id>
			<layout>p2</layout>
			<url>http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-jdt-compiler/</url>
		</repository>
		<!-- Arakhne libraries -->
		<repository>
			<id>org.arakhne.p2</id>
			<layout>p2</layout>
			<url>http://download.tuxfamily.org/arakhne/p2/</url>
		</repository>
		<!-- SARL dependencies -->
		<repository>
			<id>io.sarl.dependencies</id>
			<layout>p2</layout>
			<url>http://dependencies.sarl.io</url>
		</repository>
		<!-- JavaFX libraries -->
		<repository>
			<id>org.eclipse.efxeclipse.updates</id>
			<layout>p2</layout>
			<url>http://download.eclipse.org/efxclipse/updates-released/${efxclipse.version}/site</url>
		</repository>
	</repositories>

</project>
