<?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>
    <groupId>org.febit.wit</groupId>
    <artifactId>parent</artifactId>
    <version>2.6.0</version>
  </parent>
  <artifactId>wit-core</artifactId>
  <packaging>jar</packaging>
  <name>wit-core</name>

  <dependencies>
    <!-- provided -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging-api</artifactId>
      <optional>true</optional>
    </dependency>

    <!-- test -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <excludePackageNames>org.febit.wit_shaded</excludePackageNames>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>de.jflex</groupId>
        <artifactId>jflex-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/generated-sources/lexer</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-parser</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>java</goal>
            </goals>
            <configuration>
              <additionalClasspathElements>
                <additionalClasspathElement>src/main/cup/java_cup_wit-20171014.jar</additionalClasspathElement>
              </additionalClasspathElements>
              <includeProjectDependencies>false</includeProjectDependencies>
              <mainClass>java_cup.Main</mainClass>
              <arguments>
                <argument>-exception</argument>
                <argument>ParseException</argument>
                <argument>-destdir</argument>
                <argument>${project.build.directory}/generated-sources/parser/org/febit/wit/core</argument>
                <argument>-destresdir</argument>
                <argument>${project.build.directory}/generated-resources/parser/org/febit/wit/core</argument>
                <argument>${basedir}/src/main/cup/Parser.cup</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
              <goal>add-resource</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/parser</source>
              </sources>
              <resources>
                <resource>
                  <directory>${project.build.directory}/generated-resources/parser</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgument> -Xlint:unchecked </compilerArgument>
          <showWarnings>true</showWarnings>
          <debug>false</debug>
          <optimize>true</optimize>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
