<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>antlr4-master</artifactId>
    <groupId>me.sunlan</groupId>
    <version>4.13.2.13</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>antlr4-runtime</artifactId>
  <packaging>bundle</packaging>
  <name>ANTLR 4 Runtime (Optimized)</name>
  <description>The ANTLR 4 Runtime (Optimized)</description>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <testSourceDirectory>test</testSourceDirectory>
    <resources>
      <resource>
        <directory>resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>test</directory>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgs>
            <compilerArg>-processor</compilerArg>
            <compilerArg>org.antlr.v4.runtime.misc.NullUsageProcessor</compilerArg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.tunnelvisionlabs</groupId>
        <artifactId>antlr4-maven-plugin</artifactId>
        <version>4.7.2</version>
        <executions>
          <execution>
            <goals>
              <goal>antlr4</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <sourceDirectory>src</sourceDirectory>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.4.1</version>
        <executions>
          <execution>
            <id>shade-hppc</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <shadedArtifactAttached>false</shadedArtifactAttached>
              <minimizeJar>true</minimizeJar>
              <artifactSet>
                <includes>
                  <include>com.carrotsearch:hppc</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>${hppc.package}</pattern>
                  <shadedPattern>${hppc.shaded.package}</shadedPattern>
                </relocation>
              </relocations>
              <filters>
                <filter>
                  <artifact>com.carrotsearch:hppc</artifact>
                  <excludes>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>module-info.class</exclude>
                    <exclude>META-INF/versions/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>verify-shaded-hppc</id>
            <phase>verify</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <property />
                <fail>
                  <condition>
                    <not>
                      <available />
                    </not>
                  </condition>
                </fail>
                <exec>
                  <arg />
                  <arg />
                </exec>
                <echo />
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <configuration>
          <instructions>
            <Import-Package>!com.carrotsearch.hppc*,
                            *</Import-Package>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>jacoco</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.11</version>
            <executions>
              <execution>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>report</id>
                <phase>test</phase>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>sonatype-oss-release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>us.bryon</groupId>
            <artifactId>graphviz-maven-plugin</artifactId>
            <version>1.0</version>
            <executions>
              <execution>
                <goals>
                  <goal>dot</goal>
                </goals>
                <configuration>
                  <dot>${dot.path}</dot>
                  <destdir>${project.build.directory}/apidocs</destdir>
                  <output>svg</output>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <includeDependencySources>true</includeDependencySources>
              <dependencySourceIncludes>
                <dependencySourceInclude>org.antlr:*</dependencySourceInclude>
              </dependencySourceIncludes>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-shade-plugin</artifactId>
            <version>3.4.1</version>
            <executions>
              <execution>
                <id>shade-complete</id>
                <phase>package</phase>
                <goals>
                  <goal>shade</goal>
                </goals>
                <configuration>
                  <minimizeJar>false</minimizeJar>
                  <createDependencyReducedPom>false</createDependencyReducedPom>
                  <shadedArtifactAttached>true</shadedArtifactAttached>
                  <createSourcesJar>true</createSourcesJar>
                  <shadedClassifierName>complete</shadedClassifierName>
                  <artifactSet>
                    <includes>
                      <include>me.sunlan:antlr4-annotations</include>
                    </includes>
                  </artifactSet>
                </configuration>
              </execution>
            </executions>
            <inherited>false</inherited>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>me.sunlan</groupId>
      <artifactId>antlr4-annotations</artifactId>
      <version>4.13.2.13</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <properties>
    <hppc.package>com.carrotsearch.hppc</hppc.package>
    <hppc.version>0.9.1</hppc.version>
    <dot.path>dot</dot.path>
    <hppc.shaded.package>org.antlr.v4.runtime.shaded.com.carrotsearch.hppc</hppc.shaded.package>
  </properties>
</project>
