<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright (c) 2011, 2019 Red Hat, Inc. and others.

   All rights reserved. This program and the accompanying materials
   are made available under the terms of the Eclipse Public License 2.0
   which accompanies this distribution, and is available at
   https://www.eclipse.org/legal/epl-2.0/

   SPDX-License-Identifier: EPL-2.0
-->
<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>

  <parent>
    <artifactId>org.eclipse.tracecompass.ctf-parent</artifactId>
    <groupId>org.eclipse.tracecompass</groupId>
    <version>7.0.0-SNAPSHOT</version>
  </parent>

  <name>Trace Compass CTF Parser Plug-in</name>
  <artifactId>org.eclipse.tracecompass.ctf.parser</artifactId>
  <version>1.0.6-SNAPSHOT</version>
  <packaging>eclipse-plugin</packaging>

  <build>
    <plugins>
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-source-plugin</artifactId>
      </plugin>
      <!-- Do not delete the existing .java parser files in target/ -->
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <excludeDefaultDirectories>true</excludeDefaultDirectories>
          <filesets>
            <fileset>
              <directory>target</directory>
              <followSymlinks>false</followSymlinks>
              <includes>
                <include>*/**</include>
              </includes>
              <excludes>
                <exclude>generated-sources/antlr3/org/eclipse/tracecompass/ctf/parser/CTFLexer.java</exclude>
                <exclude>generated-sources/antlr3/org/eclipse/tracecompass/ctf/parser/CTFParser.java</exclude>
              </excludes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <!-- Only rebuild the CTF grammar files if the ctf-grammar profile is active -->
  <profiles>
    <profile>
      <id>ctf-grammar</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.antlr</groupId>
            <artifactId>antlr3-maven-plugin</artifactId>
            <version>3.5.2</version>
            <executions>
              <execution>
                <goals>
                  <goal>antlr</goal>
                </goals>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>org.antlr</groupId>
                <artifactId>antlr-runtime</artifactId>
                <version>3.5.2</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
