<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright 2020 Goldman Sachs

 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">
    <parent>
        <groupId>org.finos.legend.pure</groupId>
        <artifactId>legend-pure-dsl-graph</artifactId>
        <version>5.61.2</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <name>Legend Pure - Base - M2 DSL - Graph - Grammar</name>
    <artifactId>legend-pure-m2-dsl-graph-grammar</artifactId>
    <packaging>jar</packaging>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <configuration>
                            <target>
                                <copy todir="target/antlr">
                                    <fileset dir="../../../legend-pure-core/legend-pure-m4/src/main/antlr4/org/finos/legend/pure/m4/serialization/grammar/core" />
                                </copy>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.antlr</groupId>
                <artifactId>antlr4-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>antlr4</goal>
                        </goals>
                        <configuration>
                            <visitor>true</visitor>
                            <listener>true</listener>
                            <treatWarningsAsErrors>true</treatWarningsAsErrors> <!-- DO NOT CHANGE THIS -->
                            <libDirectory>target/antlr</libDirectory>
                            <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        <plugin>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-maven-generation-par</artifactId>
            <configuration>
                <sourceDirectory>${project.basedir}/src/test/resources</sourceDirectory>
                <purePlatformVersion>${project.version}</purePlatformVersion>
                <extraRepositories>
                    <extraRepository>${project.basedir}/src/test/resources/platform_dsl_graph_test.definition.json
                    </extraRepository>
                </extraRepositories>
            </configuration>
            <executions>
                <execution>
                    <phase>test-compile</phase>
                    <goals>
                        <goal>build-pure-jar</goal>
                    </goals>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>org.finos.legend.pure</groupId>
                    <artifactId>legend-pure-m3-core</artifactId>
                    <version>${project.version}</version>
                </dependency>

                <dependency>
                    <groupId>org.finos.legend.pure</groupId>
                    <artifactId>legend-pure-m2-dsl-graph-pure</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.finos.legend.pure</groupId>
                    <artifactId>legend-pure-m2-dsl-graph-grammar</artifactId>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
        </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-m4</artifactId>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-m3-core</artifactId>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-m2-dsl-graph-pure</artifactId>
        </dependency>

        <dependency>
            <groupId>org.eclipse.collections</groupId>
            <artifactId>eclipse-collections-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.collections</groupId>
            <artifactId>eclipse-collections</artifactId>
        </dependency>

        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>antlr4-runtime</artifactId>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-m3-core</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>