<?xml version="1.0" encoding="UTF-8"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.yakindu.sct</groupId>
	<artifactId>org.yakindu.sct.releng</artifactId>
	<version>2.1.2-SNAPSHOT</version>
	<packaging>pom</packaging>

	<!-- this is the parent POM from which all modules inherit common settings -->
	<properties>
		<tycho-version>0.18.1</tycho-version>
		<tycho-extras-version>0.18.1</tycho-extras-version>
		<antrun-version>1.6</antrun-version>
		<p2.base.repository>file:../org.yakindu.base.repository/target/repository</p2.base.repository>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<testFailureIgnore>true</testFailureIgnore>
	</properties>
	<build>
		<!--resources> <resource> <directory> [your folder here] </directory> </resource> 
			</resources -->
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.5</version>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<!-- enable tycho build extension -->
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-maven-plugin</artifactId>
				<version>${tycho-version}</version>
				<extensions>true</extensions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>${antrun-version}</version>
				<executions>
					<execution>
						<id>replace-build-token</id>
						<phase>generate-sources</phase>
						<configuration>
							<target>
								<taskdef resource="net/sf/antcontrib/antcontrib.properties"
									classpathref="maven.plugin.classpath" />
								<if>
									<available file="about.mappings" />
									<then>
										<echo
											message="Replacing @build@ token within about.mappings with build id." />
										<replace file="about.mappings">
											<replacefilter token="@build@"
												value="${unqualifiedVersion}.${buildQualifier}" />
										</replace>
									</then>
								</if>
								<if>
									<available file="javadocOptions.txt" />
									<then>
										<echo
											message="Replacing @build@ token within javadocOptions.txt with build id." />
										<replace file="javadocOptions.txt">
											<replacefilter token="@build@"
												value="${unqualifiedVersion}.${buildQualifier}" />
										</replace>
									</then>
								</if>
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
					<execution>
						<id>replace-back-build-token</id>
						<phase>verify</phase>
						<configuration>
							<target>
								<taskdef resource="net/sf/antcontrib/antcontrib.properties"
									classpathref="maven.plugin.classpath" />
								<if>
									<available file="about.mappings" />
									<then>
										<echo
											message="Replacing back build id within about.mappings with @build@ token." />
										<replace file="about.mappings">
											<replacefilter token="${unqualifiedVersion}.${buildQualifier}"
												value="@build@" />
										</replace>
									</then>
								</if>
								<if>
									<available file="javadocOptions.txt" />
									<then>
										<echo
											message="Replacing back build id within javadocOptions.txt with @build@ token." />
										<replace file="javadocOptions.txt">
											<replacefilter token="${unqualifiedVersion}.${buildQualifier}"
												value="@build@" />
										</replace>
									</then>
								</if>
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>ant-contrib</groupId>
						<artifactId>ant-contrib</artifactId>
						<version>20020829</version>
					</dependency>
				</dependencies>
			</plugin>
			<!-- Configure sources (Source feature has to be added to category manually) -->
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-source-plugin</artifactId>
				<version>${tycho-version}</version>
				<executions>
					<execution>
						<id>attach-source</id>
						<goals>
							<goal>plugin-source</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho.extras</groupId>
				<artifactId>tycho-source-feature-plugin</artifactId>
				<version>${tycho-extras-version}</version>
				<executions>
					<execution>
						<id>source-feature</id>
						<phase>package</phase>
						<goals>
							<goal>source-feature</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!-- pack plugins with pack200, which are smaller class files (Part I) -->
			<plugin>
				<groupId>org.eclipse.tycho.extras</groupId>
				<artifactId>tycho-pack200a-plugin</artifactId>
				<version>${tycho-extras-version}</version>
				<executions>
					<execution>
						<id>pack200-normalize</id>
						<goals>
							<goal>normalize</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!-- TODO sign here -->
			<!-- pack plugins with pack200, which are smaller class files (Part II) 
				and add them to p2-metadata -->
			<plugin>
				<groupId>org.eclipse.tycho.extras</groupId>
				<artifactId>tycho-pack200b-plugin</artifactId>
				<version>${tycho-extras-version}</version>
				<executions>
					<execution>
						<id>pack200-pack</id>
						<goals>
							<goal>pack</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!-- Then, alter p2-metadata to make the .pack.gz and the source bundles 
				visible from other modules -->
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-p2-plugin</artifactId>
				<version>${tycho-version}</version>
				<executions>
					<execution>
						<id>p2-metadata</id>
						<goals>
							<goal>p2-metadata</goal>
						</goals>
						<phase>package</phase>
					</execution>
				</executions>
				<configuration>
					<defaultP2Metadata>false</defaultP2Metadata>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<version>${tycho-version}</version>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<!-- Avoid the generation of maven archive information in the META-INF 
					folder -->
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-packaging-plugin</artifactId>
					<version>${tycho-version}</version>
					<configuration>
						<archive>
							<addMavenDescriptor>false</addMavenDescriptor>
						</archive>
					</configuration>
				</plugin>
				<!-- TYCHO -->
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-compiler-plugin</artifactId>
					<version>${tycho-version}</version>
					<configuration>
						<encoding>UTF-8</encoding>
						<source>6.0</source>
						<target>6.0</target>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>2.5</version>
					<configuration>
						<encoding>UTF-8</encoding>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>1.3</version>
					<executions>
						<execution>
							<id>add-source</id>
							<phase>generate-sources</phase>
							<goals>
								<goal>add-source</goal>
							</goals>
							<configuration>
								<sources>
									<source>${project.build.directory}/xtend-gen</source>
								</sources>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>2.4.1</version>
				</plugin>
				<plugin>
					<groupId>org.fornax.toolsupport</groupId>
					<artifactId>fornax-oaw-m2-plugin</artifactId>
					<version>3.3.0</version>
				</plugin>
				<plugin>
					<groupId>org.eclipse.tycho.extras</groupId>
					<artifactId>tycho-source-feature-plugin</artifactId>
					<version>${tycho-extras-version}</version>
					<executions>
						<execution>
							<id>source-feature</id>
							<phase>package</phase>
							<goals>
								<goal>source-feature</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.eclipse.xtend</groupId>
					<artifactId>xtend-maven-plugin</artifactId>
					<version>2.4.2</version>
					<configuration>
						<!-- need to prefix by basedir to generate to currently built module -->
						<outputDirectory>${basedir}/xtend-gen</outputDirectory>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-p2-repository-plugin</artifactId>
					<version>${tycho-version}</version>
				</plugin>
				<!-- APACHE MAVEN PLUGINS -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>1.3</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-assembly-plugin</artifactId>
					<version>2.2-beta-4</version>
				</plugin>
				<plugin>
					<artifactId>maven-release-plugin</artifactId>
					<configuration>
						<preparationGoals>clean -DnewVersion=${releaseVersion}
							-Dprudent=true
							org.eclipse.tycho:tycho-versions-plugin:set-version
							verify
							scm:checkin</preparationGoals>
						<arguments>-Prelease</arguments>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.eclipse.dash.maven</groupId>
					<artifactId>eclipse-signing-maven-plugin</artifactId>
					<version>1.0.2</version>
				</plugin>
				<plugin>
					<!-- Base configuration of target environments -->
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>target-platform-configuration</artifactId>
					<version>${tycho-version}</version>
					<configuration>
						<environments>
							<environment>
								<os>linux</os>
								<ws>gtk</ws>
								<arch>x86</arch>
							</environment>
							<environment>
								<os>linux</os>
								<ws>gtk</ws>
								<arch>x86_64</arch>
							</environment>
							<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>
						</environments>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<pluginRepositories>
		<!-- Fornax Workflow Runner plugin -->
		<pluginRepository>
			<id>fornax</id>
			<url>http://www.fornax-platform.org/m2/repository</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</pluginRepository>
		<pluginRepository>
			<id>eclipse-xtend</id>
			<url>http://build.eclipse.org/common/xtend/maven</url>
		</pluginRepository>
	</pluginRepositories>

	<repositories>
		<repository>
			<id>yakindu-base</id>
			<layout>p2</layout>
			<url>${p2.base.repository}</url>
		</repository>
	</repositories>

	<profiles>
		<profile>
			<id>builds-target</id>
			<activation>
				<!-- ActiveByDefault does not work because of macosx-profile with is 
					triggered by property -->
				<!-- <activeByDefault>true</activeByDefault> -->
				<property>
					<name>!noBuildsTarget</name>
				</property>
			</activation>
			<properties>
				<p2.base.repository>https://projects.itemis.de/data/yakindu/base/kepler/snapshot/</p2.base.repository>
			</properties>
		</profile>
		<profile>
			<id>Indigo.target</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>target-platform-configuration</artifactId>
						<version>${tycho-version}</version>
						<configuration>
							<!-- add target file content to target platform -->
							<target>
								<artifact>
									<groupId>org.yakindu.base</groupId>
									<artifactId>org.yakindu.base.target</artifactId>
									<version>2.1.2-SNAPSHOT</version>
									<classifier>Juno</classifier>
								</artifact>
							</target>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>Kepler.target</id>
			<activation>
				<!-- ActiveByDefault does not work because of macosx-profile with is 
					triggered by property -->
				<!-- <activeByDefault>true</activeByDefault> -->
				<property>
					<name>!noKeplerTarget</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>target-platform-configuration</artifactId>
						<version>${tycho-version}</version>
						<configuration>
							<!-- add target file content to target platform -->
							<target>
								<artifact>
									<groupId>org.yakindu.base</groupId>
									<artifactId>org.yakindu.base.target</artifactId>
									<version>2.1.2-SNAPSHOT</version>
									<classifier>Kepler</classifier>
								</artifact>
							</target>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>CI</id>
			<!-- Test failures are collected by jenkins and evaluated for instable 
				builds -->
			<properties>
				<testFailureIgnore>true</testFailureIgnore>
			</properties>
		</profile>
		<profile>
			<id>macosx</id>
			<activation>
				<os>
					<family>mac</family>
				</os>
			</activation>
			<properties>
				<ui.test.vmargs>-Xmx512m -XX:MaxPermSize=256m -XstartOnFirstThread</ui.test.vmargs>
			</properties>
		</profile>
		<profile>
			<id>other-os</id>
			<activation>
				<os>
					<family>!mac</family>
				</os>
			</activation>
			<properties>
				<ui.test.vmargs>-Xmx512m -XX:MaxPermSize=256m</ui.test.vmargs>
			</properties>
		</profile>
		<profile>
			<id>enableSigning</id>
			<build>
				<plugins>
					<plugin>
						<groupId>de.itemis.signing</groupId>
						<artifactId>itemis-jarsigner</artifactId>
						<version>0.0.3</version>
						<configuration>
							<sshKey>${ssh.key}</sshKey>
						</configuration>
						<executions>
							<execution>
								<id>sign</id>
								<goals>
									<goal>sign</goal>
								</goals>
								<phase>package</phase>
							</execution>
						</executions>
					</plugin>
					<!-- pack plugins with pack200, which are smaller class files (Part 
						II) and add them to p2-metadata -->
					<!-- Configured again to place behind jarsigner in same phase -->
					<plugin>
						<groupId>org.eclipse.tycho.extras</groupId>
						<artifactId>tycho-pack200b-plugin</artifactId>
						<version>${tycho-extras-version}</version>
						<executions>
							<execution>
								<id>pack200-pack</id>
								<goals>
									<goal>pack</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
			<pluginRepositories>
				<pluginRepository>
					<id>nexus-projects.itemis.de</id>
					<url>https://projects.itemis.de/nexus/content/groups/maven-plugins/</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
				</pluginRepository>
			</pluginRepositories>
		</profile>
	</profiles>

	<modules>
		<!-- Only for access without m2-repo -->
		<module>../org.yakindu.base.target</module>

		<module>../org.yakindu.sct.commons</module>
		<module>../org.yakindu.sct.doc.user</module>
		<module>../org.yakindu.sct.examples.trafficlight</module>
		<module>../org.yakindu.sct.generator.core</module>
		<module>../org.yakindu.sct.generator.genmodel</module>
		<module>../org.yakindu.sct.generator.genmodel.test</module>
		<module>../org.yakindu.sct.generator.genmodel.ui</module>
		<module>../org.yakindu.sct.model.sexec</module>
		<module>../org.yakindu.sct.model.sexec.edit</module>
		<module>../org.yakindu.sct.model.sexec.test</module>
		<module>../org.yakindu.sct.model.sgen</module>
		<module>../org.yakindu.sct.model.sgen.edit</module>
		<module>../org.yakindu.sct.model.sgraph</module>
		<module>../org.yakindu.sct.model.sgraph.edit</module>
		<module>../org.yakindu.sct.model.sgraph.test</module>
		<module>../org.yakindu.sct.model.sgraph.ui</module>
		<module>../org.yakindu.sct.model.stext</module>
		<module>../org.yakindu.sct.model.stext.edit</module>
		<module>../org.yakindu.sct.model.stext.resource</module>
		<module>../org.yakindu.sct.model.stext.resource.test</module>
		<module>../org.yakindu.sct.model.stext.test</module>
		<module>../org.yakindu.sct.model.stext.ui</module>
		<module>../org.yakindu.sct.simulation.core</module>
		<module>../org.yakindu.sct.simulation.ui</module>
		<module>../org.yakindu.sct.simulation.core.sexec</module>
		<module>../org.yakindu.sct.simulation.ui.sexec</module>
		<module>../org.yakindu.sct.simulation.core.sexec.test</module>
		<module>../org.yakindu.sct.ui</module>
		<module>../org.yakindu.sct.ui.editor</module>
		<module>../org.yakindu.sct.ui.examples</module>
		<module>../org.yakindu.sct.ui.integration.stext</module>
		<module>../org.yakindu.sct.ui.navigator</module>
		<module>../org.yakindu.sct-feature</module>

		<module>../org.yakindu.sct.test.models</module>

		<module>../org.yakindu.sct.generator.c</module>
		<module>../org.yakindu.sct.generator.c.test</module>
		<module>../org.yakindu.sct.generator.c-feature</module>

		<module>../org.yakindu.sct.generator.cpp</module>
		<module>../org.yakindu.sct.generator.cpp.test</module>

		<module>../org.yakindu.sct.generator.java</module>
		<module>../org.yakindu.sct.generator.java.test</module>
		<module>../org.yakindu.sct.generator.java-feature</module>

		<module>../org.yakindu.sct.refactoring</module>
		<module>../org.yakindu.sct.refactoring.tests</module>

		<module>../org.yakindu.sct.generator-feature</module>
		<module>../org.yakindu.sct.sdk-feature</module>
		<module>../org.yakindu.sct.test-feature</module>

		<module>../org.yakindu.sct.repository</module>
		<module>../org.yakindu.sct.repository.full</module>

		<module>../org.yakindu.sct.compare</module>
	</modules>

</project>
