<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2011 The Open Source Research Group,
                   University of Erlangen-Nürnberg

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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.1</version>
  </parent>

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

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

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

  <!-- ==[ Properties ]===================================================== -->

  <properties>

    <sweble-wikitext.basedir>${project.parent.basedir}</sweble-wikitext.basedir>

  </properties>

  <!-- ==[ 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>

  <!-- ==[ Dependency Management ]========================================== -->

  <dependencyManagement>
  </dependencyManagement>

  <build>

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

    <!--
      see parent: <resources>
    -->

    <!-- ==[ 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</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <!-- I assume the configuration is inherited from the parent -->
          <excludes>
            <!-- These excludes should be the same as in the parent project -->
            <exclude>**/*.log</exclude>
            <exclude>**/.gitignore</exclude>
            <exclude>**/LICENSE</exclude>
            <exclude>**/NOTICE</exclude>
            <exclude>src/site/site.xml</exclude>
            <exclude>src/site/changes.xml</exclude>
            <exclude>src/site/resources/css/site.css</exclude>
            <exclude>swc-*/</exclude>

            <!-- Extra excludes for this project -->
            <exclude>src/test/resources/**/NOTICE</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>
          </excludes>
        </configuration>
      </plugin>

    </plugins>

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

    <pluginManagement>
    </pluginManagement>

    <!-- ==[ Build Element Set ]============================================ -->

    <!--
      see parent: <sourceDirectory>
                  <scriptSourceDirectory>
                  <testSourceDirectory>
                  <outputDirectory>
                  <testOutputDirectory>
                  <extensions>
    -->

  </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>
    <tag>sweble-wikitext-1.1.1</tag>
  </scm>

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

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

  <profiles>

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

          <!-- Generate Jar with dependencies -->
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <inherited>false</inherited>
            <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>
