<?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 POM: Sweble Wikitext Components -->

  <parent>
    <groupId>org.sweble.wikitext</groupId>
    <artifactId>sweble-wikitext</artifactId>
    <version>1.1.0</version>
  </parent>

  <!-- This POM: Sweble Wikitext Components - Lazy Wikitext Parser -->

  <groupId>org.sweble.wikitext</groupId>
  <artifactId>swc-parser-lazy</artifactId>
  <version>1.1.0</version>
  <packaging>jar</packaging>

  <name>SWC - Sweble Lazy Wikitext Parser</name>
  <url>http://sweble.org/doc/site/tooling/sweble/sweble-wikitext/swc-parser-lazy</url>
  <inceptionYear>2010</inceptionYear>
  <description>
    A lazy parser for MediaWiki's Wikitext.
  </description>

  <!-- ==[ Dependencies ]=================================================== -->

  <dependencies>

    <!-- Apache Commons -->
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>

    <!-- NEVER RELEASE/DEPLOY THIS DEPENDENCY!
         IT'S A GPL LIBRARY!
    <dependency>
      <groupId>xtc</groupId>
      <artifactId>rats</artifactId>
      <version>1.15.0</version>
    </dependency>
     -->

    <!-- Parser Toolkit - Common -->
    <dependency>
      <groupId>de.fau.cs.osr.ptk</groupId>
      <artifactId>ptk-common</artifactId>
    </dependency>

    <!--
      Testing
    -->

    <!-- JUnit -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>

  </dependencies>

  <build>

    <!-- ==[ Plugin Configuration ]========================================= -->

    <plugins>

      <!-- Add various source directories -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/main/autogen</source>
                <source>target/generated-sources/jflex</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Generate JFlex lexers -->
      <plugin>
        <groupId>de.jflex</groupId>
        <artifactId>maven-jflex-plugin</artifactId>
        <configuration>
          <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
          <lexDefinitions>
            <lexDefinition>${project.basedir}/src/main/autogen</lexDefinition>
          </lexDefinitions>
        </configuration>
      </plugin>

      <!-- Generate Rats! parsers -->
      <plugin>
        <groupId>de.fau.cs.osr.maven.plugins</groupId>
        <artifactId>maven-rats-plugin</artifactId>
        <configuration>
          <baseDir>${project.basedir}/src/main/autogen</baseDir>
          <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
          <ratsInputFiles>
            <ratsInputFile>org/sweble/wikitext/lazy/parser/Grammar.rats</ratsInputFile>
            <ratsInputFile>org/sweble/wikitext/lazy/preprocessor/Grammar.rats</ratsInputFile>
          </ratsInputFiles>
        </configuration>
      </plugin>

      <!-- Generate Ast Nodes -->
      <plugin>
        <groupId>de.fau.cs.osr.ptk</groupId>
        <artifactId>ptk-nodegen-maven-plugin</artifactId>
        <configuration>
          <baseDir>${project.basedir}/src/main/autogen</baseDir>
          <outputDir>${project.build.directory}/generated-sources</outputDir>
          <ratsInputFiles>
            <ratsInputFile>org/sweble/wikitext/lazy</ratsInputFile>
          </ratsInputFiles>
        </configuration>
      </plugin>

      <!-- Generate Ast Printers -->
      <plugin>
        <groupId>de.fau.cs.osr.ptk</groupId>
        <artifactId>ptk-printergen-maven-plugin</artifactId>
        <configuration>
          <baseDir>${project.basedir}/src/main/autogen</baseDir>
          <outputDir>${project.build.directory}/generated-sources</outputDir>
          <aptInputFiles>
            <aptInputFile>org/sweble/wikitext/lazy</aptInputFile>
          </aptInputFiles>
        </configuration>
      </plugin>

      <!-- Check and format license headers -->
      <plugin>
        <groupId>com.mycila.maven-license-plugin</groupId>
        <artifactId>maven-license-plugin</artifactId>
        <configuration>
          <header>../etc/license-header.txt</header>
          <mapping>
             <rats>JAVADOC_STYLE</rats>
             <jflex>JAVADOC_STYLE</jflex>
             <apt>PTK_APT_STYLE</apt>
          </mapping>
          <headerDefinitions>
            <headerDefinition>../etc/license-header-apt-style.xml</headerDefinition>
          </headerDefinitions>
          <excludes>
            <exclude>doc/ast.txt</exclude>
            <exclude>src/test/resources/**/*.disabled</exclude>
            <exclude>src/test/resources/**/*.wikitext</exclude>
            <exclude>src/test/resources/**/*.ast</exclude>
            <exclude>src/test/resources/**/*.txt</exclude>
            <exclude>src/test/resources/**/NOTICE</exclude>
            <exclude>src/site/site.xml</exclude>
            <exclude>src/site/changes.xml</exclude>
            <exclude>src/site/resources/css/site.css</exclude>
            <exclude>**/.gitignore</exclude>
            <exclude>dependencies</exclude>
            <exclude>LICENSE</exclude>
            <exclude>NOTICE</exclude>
          </excludes>
        </configuration>
      </plugin>

      <!-- Make Git information available as properties -->
      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
        <executions>
          <!-- Disabled until problem
            https://github.com/ktoso/maven-git-commit-id-plugin/issues/19
            is resolved -->
          <execution>
            <id>git-commit-info-disabled</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>

      <!-- Maven site generation -->
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <reportPlugins>

            <plugin>
              <artifactId>maven-project-info-reports-plugin</artifactId>
            </plugin>

            <!-- >>> ADDITIONAL REPORT PLUGINS >>> -->
            <plugin>
              <artifactId>maven-javadoc-plugin</artifactId>
              <configuration>
                <quiet>true</quiet>
              </configuration>
              <reportSets>
                <reportSet>
                  <id>site-javadoc</id>
                  <reports>
                    <report>javadoc</report>
                  </reports>
                </reportSet>
              </reportSets>
            </plugin>

            <plugin>
              <artifactId>maven-surefire-report-plugin</artifactId>
            </plugin>

            <plugin>
              <artifactId>maven-jxr-plugin</artifactId>
              <reportSets>
                <reportSet>
                  <id>src-xref</id>
                  <reports>
                    <report>jxr</report>
                  </reports>
                </reportSet>
              </reportSets>
            </plugin>

            <plugin>
              <artifactId>maven-pmd-plugin</artifactId>
              <version>2.7.1</version>
              <configuration>
                <targetJdk>${version.java}</targetJdk>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>cobertura-maven-plugin</artifactId>
            </plugin>

            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>taglist-maven-plugin</artifactId>
              <configuration>
                <encoding>UTF-8</encoding>
                <sourceFileLocale>en</sourceFileLocale>
                <emptyComments>true</emptyComments>
                <tagListOptions>
                  <tagClasses>
                    <tagClass>
                      <displayName>Code Work</displayName>
                      <tags>
                        <tag>
                          <matchString>fixme</matchString>
                          <matchType>ignoreCase</matchType>
                        </tag>
                        <tag>
                          <matchString>todo</matchString>
                          <matchType>ignoreCase</matchType>
                        </tag>
                        <tag>
                          <matchString>@todo</matchString>
                          <matchType>ignoreCase</matchType>
                        </tag>
                      </tags>
                    </tagClass>
                  </tagClasses>
                </tagListOptions>
              </configuration>
            </plugin>

            <plugin>
              <artifactId>maven-changes-plugin</artifactId>
              <configuration>
                <xmlPath>${basedir}/src/site/changes.xml</xmlPath>
              </configuration>
              <reportSets>
                <reportSet>
                  <reports>
                    <report>changes-report</report>
                  </reports>
                </reportSet>
              </reportSets>
            </plugin>
            <!-- <<< ADDITIONAL REPORT PLUGINS <<< -->

          </reportPlugins>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <!-- ==[ Reporting ]====================================================== -->

  <!--
    see parent: <reporting>
  -->

  <!-- ==[ More Project Information ]======================================= -->

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

  <!--
    see parent: <organization>
                <developers>
                <contributors>
  -->

  <!-- ==[ Environment Settings ]=========================================== -->

  <!--
    see parent: <issueManagement>
                <ciManagement>
                <mailingLists>
  -->

  <scm>
    <connection>scm:git://sweble.org/git/sweble-wikitext.git</connection>
    <developerConnection>scm:git:ssh://gitosis@sweble.org/sweble-wikitext.git</developerConnection>
    <url>http://sweble.org/gitweb/?p=sweble-wikitext.git;a=summary</url>
  </scm>

  <!--
    see parent: <distributionManagement>
                <repositories>
                <pluginRepositories>
  -->

  <!-- ==[ Profiles ]======================================================= -->

  <profiles>

    <profile>
      <id>quick</id>
      <build>
        <plugins>

          <!-- Don't check and format license headers -->
          <plugin>
            <groupId>com.mycila.maven-license-plugin</groupId>
            <artifactId>maven-license-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>

          <!-- Don't run tests -->
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <skipTests>true</skipTests>
            </configuration>
          </plugin>

          <!-- Only generate minimal site -->
          <plugin>
            <artifactId>maven-site-plugin</artifactId>
            <configuration>
              <reportPlugins>
                <plugin>
                  <artifactId>maven-project-info-reports-plugin</artifactId>
                  <reportSets>
                    <reportSet>
                      <reports>
                        <!-- cim, dependencies, dependency-convergence -->
                        <report>dependency-management</report>
                        <report>distribution-management</report>
                        <report>index</report>
                        <report>issue-tracking</report>
                        <report>license</report>
                        <report>mailing-list</report>
                        <report>modules</report>
                        <report>plugin-management</report>
                        <report>plugins</report>
                        <report>project-team</report>
                        <report>scm</report>
                        <report>summary</report>
                      </reports>
                    </reportSet>
                  </reportSets>
                </plugin>
              </reportPlugins>
            </configuration>
          </plugin>

        </plugins>
      </build>
    </profile>

    <profile>
      <id>build-aggregates</id>
      <build>
        <plugins>

          <!-- Generate Jar with dependencies -->
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
              <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
              </descriptorRefs>
            </configuration>
            <executions>
              <execution>
                <id>make-assembly</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>
    </profile>

  </profiles>
</project>
