<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>

	<groupId>io.sarl.lang</groupId>
	<artifactId>compiler</artifactId>
	<version>0.13.0</version>
	<name>SARL Compiler</name>
	<description>Main implementation of the SARL compiler</description>
	<packaging>jar</packaging>
	<url>http://www.sarl.io</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<manifest.file>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifest.file>
	</properties>

	<dependencies>
		<dependency>
			<groupId>io.sarl.lang</groupId>
			<artifactId>core</artifactId>
		</dependency>
		<dependency>
		    <groupId>org.eclipse.xtext</groupId>
		    <artifactId>org.eclipse.xtext.builder.standalone</artifactId>
		    <exclusions>
				<!-- This JSR implementation is not a valid Jar file (see Tycho target platform error).
				     io.sarl.lang:core provides a valid JSR implementation -->
				<exclusion>
					<groupId>javax.inject</groupId>
					<artifactId>javax.inject</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
		    <groupId>org.eclipse.xtend</groupId>
		    <artifactId>org.eclipse.xtend.core</artifactId>
		</dependency>
	</dependencies>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>io.sarl.bom</groupId>
				<artifactId>sarl-lang-bom</artifactId>
				<version>${project.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>io.sarl.bom</groupId>
				<artifactId>sarl-compiler-bom</artifactId>
				<version>${project.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<extensions>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-webdav-jackrabbit</artifactId>
				<version>3.5.3</version>
			</extension>
		</extensions>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.3.1</version>
				<executions>
					<execution>
						<id>copy-sarl-grammar-files</id>
						<phase>process-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.outputDirectory}/io/sarl/lang</outputDirectory>
							<resources>
								<resource>
									<directory>${project.basedir}/src/main/java/io/sarl/lang</directory>
									<filtering>false</filtering>
									<includes>
										<include>SARL.xtext</include>
									</includes>
								</resource>
								<resource>
									<directory>${project.basedir}/src/main/xtext-gen/io/sarl/lang</directory>
									<filtering>false</filtering>
									<includes>
										<include>SARL.xtextbin</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>copy-sarl-model-files</id>
						<phase>process-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.outputDirectory}/model</outputDirectory>
							<resources>          
								<resource>
									<directory>${project.basedir}/model</directory>
									<filtering>false</filtering>
									<includes>
										<include>SARL.ecore</include>
										<include>SARL.genmodel</include>
									</includes>
								</resource>
							</resources>    
						</configuration>
					</execution>
					<execution>
						<id>copy-sarl-lexer-files</id>
						<phase>process-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.outputDirectory}/io/sarl/lang/parser/antlr/internal</outputDirectory>
							<resources>          
								<resource>
									<directory>${project.basedir}/src/main/xtext-gen/io/sarl/lang/parser/antlr/internal</directory>
									<filtering>false</filtering>
									<includes>
										<include>*.g</include>
										<include>*.tokens</include>
									</includes>
								</resource>
							</resources>    
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.google.code.maven-replacer-plugin</groupId>
				<artifactId>replacer</artifactId>
				<version>1.5.3</version>
				<executions>
					<execution>
						<id>prepare-osgi-aboutbox</id>
						<phase>process-resources</phase>
						<goals>
							<goal>replace</goal>
						</goals>
						<configuration>
							<encoding>${project.build.sourceEncoding}</encoding>
							<file>${project.basedir}/src/main/resources/OSGI-INF/l10n/bundle.properties</file>
							<regexFlags><regexFlag>MULTILINE</regexFlag></regexFlags>
							<replacements>
								<replacement>
									<token>^(Bundle-Vendor *= *)(.*)$</token>
									<value>$1${sarl.vendor}</value>
								</replacement>
							</replacements>
						</configuration>
					</execution>
					<execution>
						<id>prepare-bundle-description</id>
						<phase>process-resources</phase>
						<goals>
							<goal>replace</goal>
						</goals>
						<configuration>
							<encoding>${project.build.sourceEncoding}</encoding>
							<file>${project.basedir}/src/main/resources/plugin.properties</file>
							<regexFlags><regexFlag>MULTILINE</regexFlag></regexFlags>
							<replacements>
								<replacement>
									<token>^(providerName *= *)(.*)$</token>
									<value>$1${sarl.vendor}</value>
								</replacement>
							</replacements>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.11.0</version>
				<configuration>
					<generatedSourcesDirectory>src/main/xtext-gen</generatedSourcesDirectory>
					<source>${sarl-dsl.min.jdk.version}</source>
					<target>${sarl-dsl.min.jdk.version}</target>
					<encoding>${project.build.sourceEncoding}</encoding>
					<showDeprecation>false</showDeprecation>
					<showWarnings>false</showWarnings>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>3.4.0</version>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>initialize</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/main/xtext-gen</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.3.0</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<phase>verify</phase>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>biz.aQute.bnd</groupId>
				<artifactId>bnd-maven-plugin</artifactId>
				<version>6.4.0</version>
				<extensions>true</extensions>
				<executions>
					<execution>
						<id>bundle-manifest</id>
						<!-- MJAVADOC-770: Javadoc cannot handler un-named modules properly.
						     A workaround is to force Javadoc to be run before Bnd.
						     https://issues.apache.org/jira/projects/MJAVADOC/issues/MJAVADOC-770 -->
						<phase>prepare-package</phase>
						<goals>
							<goal>bnd-process</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<bnd>
						Bundle-SymbolicName: ${project.groupId}.${project.artifactId};singleton:=true
						Automatic-Module-Name: ${project.groupId}.${project.artifactId}
						Bundle-Vendor: ${sarl.vendor}
						Export-Package: !io.sarl.lang.core.*, io.sarl.lang.*
						# Version of Google Guice are forced because BND plugin does not compute the correct version for the
						# imported packages from Guice
						Import-Package: \
							com.google.inject.*;version=!, \
							*
					</bnd>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.3.0</version>
				<configuration>
					<archive>
						<manifestFile>${manifest.file}</manifestFile>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>properties-maven-plugin</artifactId>
				<version>1.1.0</version>
				<executions>
					<execution>
						<id>read-properties</id>
						<phase>initialize</phase>
						<goals>
							<goal>read-project-properties</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<urls>
						<url>classpath:/sarl-lang.properties</url>
					</urls>
				</configuration> 
				<dependencies>
					<dependency>
						<groupId>io.sarl.bom</groupId>
						<artifactId>sarl-properties</artifactId>
						<version>${project.version}</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>release-tasks</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.1.0</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>3.5.0</version>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<!-- MJAVADOC-770: Javadoc cannot handler un-named modules properly.
								     A workaround is to force Javadoc to be run before Bnd.
								     https://issues.apache.org/jira/projects/MJAVADOC/issues/MJAVADOC-770 -->
								<phase>process-classes</phase>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<docencoding>${project.build.sourceEncoding}</docencoding>
							<encoding>${project.build.sourceEncoding}</encoding>
							<charset>${project.build.sourceEncoding}</charset>
							<show>protected</show>
							<detectJavaApiLink>true</detectJavaApiLink>
							<docfilessubdirs>true</docfilessubdirs>
							<excludePackageNames></excludePackageNames>
							<nohelp>true</nohelp>
							<notree>true</notree>
							<bottom>&lt;small&gt;Copyright &amp;copy; ${sarl.inception.year}-${sarl.last.yearyear} ${sarl.copyrighters}.</bottom>
							<tags>
								<tag>
									<name>mavengroupid</name>
									<placement>pt</placement>
									<head>Maven Group Id:</head>
								</tag>
								<tag>
									<name>mavenartifactid</name>
									<placement>pt</placement>
									<head>Maven Artifact Id:</head>
								</tag>
								<tag>
									<name>ExcludeFromApidoc</name>
									<placement>X</placement>
								</tag>
								<tag>
									<name>generated</name>
									<placement>a</placement>
									<head>Generated</head>
								</tag>
								<tag>
									<name>model</name>
									<placement>a</placement>
									<head>Model</head>
								</tag>
								<tag>
									<name>ordered</name>
									<placement>a</placement>
									<head>Ordered</head>
								</tag>
							</tags>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<distributionManagement>
		<repository>
			<id>io.sarl.maven.upload</id>
			<url>${MAVENSARLIO_URL}</url>
			<name>SARL Maven Repository</name>
		</repository>
		<snapshotRepository>
			<id>io.sarl.maven.upload</id>
			<url>${MAVENSARLIO_URL}</url>
			<name>SARL Maven Repository</name>
		</snapshotRepository>
	</distributionManagement>
	<scm>
		<connection>scm:git:git@github.com:sarl/sarl.git</connection>
		<developerConnection>scm:git:git@github.com:sarl/sarl.git</developerConnection>
		<url>git@github.com:sarl/sarl.git</url>
	</scm>

	<developers>
		<developer>
			<id>sgalland</id>
			<name>St&amp;eacute;phane Galland</name>
			<email>stephane.galland@utbm.fr</email>
			<url>http://www.ciad-lab.fr/stephane_galland</url>
			<organization>Universit&amp;eacute; de Technologie de Belfort-Montb&amp;eacute;liard.</organization>
			<organizationUrl>http://www.ciad-lab.fr</organizationUrl>
			<roles>
				<role>Co-founder</role>
				<role>Architect</role>
				<role>Developer</role>
			</roles>
		</developer>
		<developer>
			<id>ngaud</id>
			<name>Nicolas Gaud</name>
			<email>nicolas.gaud@utbm.fr</email>
			<url>http://www.ciad-lab.fr/nicolas_gaud</url>
			<organization>Universit&amp;eacute; de Technologie de Belfort-Montb&amp;eacute;liard.</organization>
			<organizationUrl>http://www.ciad-lab.fr</organizationUrl>
			<roles>
				<role>Co-founder</role>
				<role>Architect</role>
				<role>Developer</role>
			</roles>
		</developer>
		<developer>
			<id>alombard</id>
			<name>Alexandre Lombard</name>
			<email>alexandre.lombard@utbm.fr</email>
			<url>http://www.sarl.io/alexandre_lombard</url>
			<organization>Universit&amp;eacute; de Technologie de Belfort-Montb&amp;eacute;liard.</organization>
			<organizationUrl>http://www.ciad-lab.fr</organizationUrl>
			<roles>
				<role>Developer</role>
			</roles>
		</developer>
		<developer>
			<id>srodriguez</id>
			<name>Sebastian Rodriguez</name>
			<email>sebastian.rodriguez@rmit.edu.au</email>
			<url>http://www.sebastianrodriguez.com.ar/</url>
			<organization>Royal Melbourne Institute of Technology</organization>
			<organizationUrl>http://www.rmit.edu.au/</organizationUrl>
			<roles>
				<role>Co-founder</role>
				<role>Architect</role>
				<role>Developer</role>
			</roles>
		</developer>
	</developers>
	<contributors>
		<contributor>
			<name>Mohamed Ezzat</name>
			<email>mohamed.ezzat@devfactory.com</email>
			<url>https://github.com/m-ezzat</url>
			<roles>
				<role>Code cleaning and optimization</role>
			</roles>
		</contributor>
		<contributor>
			<name>Thomas Piotrowski</name>
			<email>thomas.piotrowski@utbm.fr</email>
			<url>https://github.com/tpiotrow</url>
			<roles>
				<role>Maven Configuration</role>
			</roles>
		</contributor>
	</contributors>

	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

</project>
