<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.janusproject.sre</groupId>
		<artifactId>io.janusproject</artifactId>
		<version>0.10.0</version>
	</parent>

	<groupId>io.janusproject</groupId>
	<artifactId>io.janusproject.plugin</artifactId>
	<packaging>eclipse-plugin</packaging>
	<name>Janus Project</name>
	<url>${janusUrl}</url>
	<inceptionYear>2008</inceptionYear>

	<properties>
		<jkernel.version>2.${project.version}</jkernel.version>
		<cliRunnerMainClass>io.janusproject.Boot</cliRunnerMainClass>
		<bootstrap>io.janusproject.Bootstrap</bootstrap>
	</properties>

	<build>
		<plugins>
 			<plugin>
 				<groupId>org.eclipse.tycho</groupId>
 				<artifactId>tycho-source-plugin</artifactId>
 			</plugin>

			<plugin>
				<groupId>com.google.code.maven-replacer-plugin</groupId>
				<artifactId>replacer</artifactId>
				<executions>
					<execution>
						<id>prepare-constants-class</id>
						<phase>process-sources</phase>
						<goals>
							<goal>replace</goal>
						</goals>
						<configuration>
							<encoding>${project.build.sourceEncoding}</encoding>
							<file>${project.basedir}/src/io/janusproject/JanusVersion.java</file>
							<regexFlags><regexFlag>MULTILINE</regexFlag></regexFlags>
							<replacements>
								<replacement>
									<token>(JANUS_RELEASE_VERSION *= *")([^"]+)(";)</token>
									<value>$1${janus.release_version}$3</value>
								</replacement>
								<replacement>
									<token>(IS_STABLE *= *)([^;]+)(;)</token>
									<value>$1${sarl.is_stable_version}$3</value>
								</replacement>
							</replacements>
						</configuration>
					</execution>
					<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>io.sarl.maven.sre</artifactId>
				<configuration>
					<sreName>JANUS</sreName>
					<standaloneSRE>false</standaloneSRE>
					<commandLineOptions>
						<hideInfo>--log=warning</hideInfo>
						<hideLogo>--nologo</hideLogo>
						<showInfo>--log=info</showInfo>
						<showLogo></showLogo>
						<defaultContextId>--worldid</defaultContextId>
						<randomContextId>--randomid</randomContextId>
						<bootAgentContextId>--bootid</bootAgentContextId>
						<offline>--offline</offline>
						<embedded>--embedded</embedded>
						<noMoreOption>--</noMoreOption>
					</commandLineOptions>
					<mainClass>${cliRunnerMainClass}</mainClass>
					<bootstrap>${bootstrap}</bootstrap>
				</configuration>

				<executions>
					<execution>
						<goals>
							<goal>updatemanifest</goal>
							<goal>addbootstrap</goal>
						</goals>
					</execution>
				</executions>

			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<configuration>
					<sourceDirectories>
						<sourceDirectory>src</sourceDirectory>
					</sourceDirectories>
				</configuration>
			</plugin>

		</plugins>
	</build>

	<!-- ======================================= -->
	<!-- ==== Release Management === -->
	<!-- ======================================= -->
	<profiles>
		<profile>
			<id>maven-release-of-janus-sre</id>
			<activation>
				<property>
					<name>publicSarlApiModuleSet</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.arakhne.afc.maven</groupId>
							<artifactId>tag-replacer</artifactId>
							<configuration>
								<sources>
									<source>${project.basedir}/src</source>
									<source>${project.basedir}/src-gen</source>
								</sources>
							</configuration>
						</plugin>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-javadoc-plugin</artifactId>
							<configuration>
								<sourcepath>${project.build.directory}/generated-sources/java</sourcepath>
							</configuration>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
			<dependencies>
				<!-- The following dependencies have been added for enabling Javadoc to
					find classes that are indirectly used. -->
				<dependency>
					<groupId>org.apache.maven.shared</groupId>
					<artifactId>maven-shared-utils</artifactId>
				</dependency>
				<dependency>
					<groupId>com.google.code.findbugs</groupId>
					<artifactId>jsr305</artifactId>
				</dependency>
				<dependency>
					<groupId>com.google.errorprone</groupId>
					<artifactId>error_prone_annotations</artifactId>
				</dependency>
			</dependencies>
		</profile>
	</profiles>

</project>
