<?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.diirt</groupId>
        <artifactId>pvmanager-all</artifactId>
        <version>3.1.7</version>
    </parent>
    <artifactId>datasource-formula</artifactId>
    <name>org.diirt.datasource.formula</name>
    <description>An extensible formula language suitable for real-time calculation.</description>
    <dependencies>
        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>antlr-runtime</artifactId>
            <version>${antlr.runtime.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>datasource-vtype</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>datasource-test</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.5.3</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <instructions>
                        <!-- antlr does not have a Manifest, so BND is
                             unable to find the version. -->
                        <Require-Bundle>org.antlr.runtime;bundle-version="[$(version;==;${antlr.runtime.version}),$(version;+;${antlr.runtime.version}))"</Require-Bundle>
                        <Import-Package>*</Import-Package>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.antlr</groupId>
                <artifactId>antlr3-maven-plugin</artifactId>
                <version>${antlr.runtime.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>antlr</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- The serviceloader-maven-plugin will look for all the implementations of
                 FormulaFunctionSet and properly register them using the ServiceLoader.
                 This makes adding/refactoring functions and function set easy, as the
                 new names will be automatically picked up. -->
            <plugin>
                <groupId>eu.somatik.serviceloader-maven-plugin</groupId>
                <artifactId>serviceloader-maven-plugin</artifactId>
                <version>${serviceloader.maven.plugin.version}</version>
                <configuration>
                    <services>
                        <param>org.diirt.datasource.formula.FormulaFunctionSet</param>
                    </services>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
