<?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>
    <relativePath>../jbase.parent/pom.xml</relativePath>
    <groupId>net.sf.xtext-jbase</groupId>
    <artifactId>jbase.parent</artifactId>
    <version>0.12.2</version>
  </parent>

  <artifactId>jbase</artifactId>
  <packaging>eclipse-plugin</packaging>

  <properties>
    <sonar.skip>false</sonar.skip>
  </properties>

  <dependencies>
    <!-- This is required only for allowing jbase to be used as a Maven jar 
      with the xtext-maven-plugin -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>jbase.lib</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generateEMFModel</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>java</goal>
            </goals>
            <configuration>
              <mainClass>org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher</mainClass>
              <arguments>
                <argument>/${project.basedir}/src/jbase/GenerateJbaseModelClasses.mwe2</argument>
                <argument>-p</argument>
                <argument>rootPath=/${project.basedir}/..</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>generateLanguage</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>java</goal>
            </goals>
            <configuration>
              <mainClass>org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher</mainClass>
              <arguments>
                <argument>/${project.basedir}/src/jbase/GenerateJbase.mwe2</argument>
                <argument>-p</argument>
                <argument>rootPath=/${project.basedir}/..</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <classpathScope>compile</classpathScope>
          <cleanupDaemonThreads>false</cleanupDaemonThreads>
          <skip>${skipMWE2}</skip>
        </configuration>
      </plugin>
      <!-- Explicitly call xtend-maven-plugin after mwe2 -->
      <plugin>
        <groupId>org.eclipse.xtend</groupId>
        <artifactId>xtend-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

</project>
