<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.plugins.api</artifactId>
		<version>0.12.0</version>
	</parent>
	<artifactId>io.sarl.core</artifactId>
	<packaging>eclipse-plugin</packaging>
	<name>SDK Core Library</name>

	<build>
		<plugins>
			<plugin>
				<groupId>com.google.code.maven-replacer-plugin</groupId>
				<artifactId>replacer</artifactId>
				<executions>
					<execution>
						<id>prepare-eclipse-buildproperties</id>
						<phase>process-resources</phase>
						<goals>
							<goal>replace</goal>
						</goals>
						<configuration>
							<encoding>${project.build.sourceEncoding}</encoding>
							<file>${project.basedir}/build.properties</file>
							<regexFlags><regexFlag>MULTILINE</regexFlag></regexFlags>
							<replacements>
								<replacement>
									<token>^(jre\.compilation\.profile *= *)(.*)$</token>
									<value>$1${sarl-dsl.min.jre.environment}</value>
								</replacement>
							</replacements>
						</configuration>
					</execution>
					<execution>
						<id>prepare-eclipse-manifestmf</id>
						<phase>process-resources</phase>
						<goals>
							<goal>replace</goal>
						</goals>
						<configuration>
							<encoding>${project.build.sourceEncoding}</encoding>
							<file>${project.basedir}/META-INF/MANIFEST.MF</file>
							<regexFlags><regexFlag>MULTILINE</regexFlag></regexFlags>
							<replacements>
								<replacement>
									<token>^(Bundle-RequiredExecutionEnvironment: *)(.*)$</token>
									<value>$1${user.min.jre.environment}</value>
								</replacement>
							</replacements>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>io.sarl.maven</groupId>
				<artifactId>sarl-maven-plugin</artifactId>
				<!-- Maven extension mechanism seems not working because the plugin is defined in the same project.
				     The different goals must be explicitly provided. -->
				<executions>
					<execution>
						<id>sarl-compiler-init</id>
						<phase>initialize</phase>
						<goals>
							<goal>initialize</goal>
						</goals>
					</execution>
					<execution>
						<id>sarl-compiler-compile</id>
						<phase>compile</phase>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>
					<execution>
						<id>sarl-compiler-clean</id>
						<phase>clean</phase>
						<goals>
							<goal>clean</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<tycho>true</tycho>
					<fixClasspathJdtJse>true</fixClasspathJdtJse>
					<source>${sarl-dsl.min.jdk.version}</source>
					<target>${sarl-dsl.min.jdk.version}</target>
					<encoding>${project.build.sourceEncoding}</encoding>
					<generateInlines>true</generateInlines>
					<generateStorageFiles>true</generateStorageFiles>
					<generateTraceFiles>true</generateTraceFiles>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<configuration>
					<sourceDirectories>
						<sourceDirectory>src/main/sarl</sourceDirectory>
					</sourceDirectories>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<!-- ======================================= -->
	<!-- ==== Release Management === -->
	<!-- ======================================= -->
	<profiles>
		<profile>
			<id>default-profile</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>tycho-source-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>maven-release-of-core-plugin</id>
			<activation>
				<property>
					<name>publicSarlApiModuleSet</name>
					<value>true</value>
				</property>
			</activation>
		</profile>
	</profiles>

</project>
