<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright 2025 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/maven-v4_0_0.xsd">
    <parent>
        <groupId>org.finos.legend.engine</groupId>
        <artifactId>legend-engine-xts-python</artifactId>
        <version>4.108.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>legend-engine-xt-python-reversePCT-legendQL</artifactId>
    <packaging>jar</packaging>
    <name>Legend Engine - XT - Python - Reverse PCT - Legend QL</name>

    <build>
        <plugins>
            <plugin>
                <groupId>org.finos.legend.pure</groupId>
                <artifactId>legend-pure-maven-generation-par</artifactId>
                <configuration>
                    <sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory>
                    <purePlatformVersion>${legend.pure.version}</purePlatformVersion>
                    <repositories>
                        <repository>core_external_python_reverse_pct_legend_ql</repository>
                    </repositories>
                    <extraRepositories>
                        <extraRepository>${project.basedir}/src/main/resources/core_external_python_reverse_pct_legend_ql.definition.json</extraRepository>
                    </extraRepositories>
                </configuration>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>build-pure-jar</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.finos.legend.engine</groupId>
                        <artifactId>legend-engine-pure-code-compiled-core</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.finos.legend.engine</groupId>
                        <artifactId>legend-engine-pure-code-reversePCT</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.finos.legend.engine</groupId>
                        <artifactId>legend-engine-xt-python-functions-execution-pure</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.finos.legend.pure</groupId>
                <artifactId>legend-pure-maven-generation-java</artifactId>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>build-pure-compiled-jar</goal>
                        </goals>
                        <configuration>
                            <generateSources>true</generateSources>
                            <preventJavaCompilation>true</preventJavaCompilation>
                            <generationType>modular</generationType>
                            <useSingleDir>true</useSingleDir>
                            <repositories>
                                <repository>core_external_python_reverse_pct_legend_ql</repository>
                            </repositories>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.finos.legend.engine</groupId>
                        <artifactId>legend-engine-pure-code-compiled-core</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.finos.legend.engine</groupId>
                        <artifactId>legend-engine-pure-code-reversePCT</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.finos.legend.engine</groupId>
                        <artifactId>legend-engine-xt-python-functions-execution-runtime-java-extension-compiled</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <useSystemClassLoader>false</useSystemClassLoader>
                    <excludes>
                        <exclude>**/Test_External_PythonLegendQL*_Reverse_PCT*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>python-test</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludes>
                                <exclude>NOTHING_EXCLUDED</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.finos.legend.pure</groupId>
                        <artifactId>legend-pure-maven-generation-pct</artifactId>
                        <configuration>
                            <mode>Compiled</mode>
                            <targetDir>${project.build.directory}/classes/pct-reports/</targetDir>
                            <PCTTestSuites>
                                <PCTTestSuite>org.finos.legend.engine.external.python.Test_External_PythonLegendQL_EssentialFunctions_Reverse_PCT</PCTTestSuite>
                                <PCTTestSuite>org.finos.legend.engine.external.python.Test_External_PythonLegendQL_GrammarFunctions_Reverse_PCT</PCTTestSuite>
                                <PCTTestSuite>org.finos.legend.engine.external.python.Test_External_PythonLegendQL_RelationFunctions_Reverse_PCT</PCTTestSuite>
                                <PCTTestSuite>org.finos.legend.engine.external.python.Test_External_PythonLegendQL_StandardFunctions_Reverse_PCT</PCTTestSuite>
                                <PCTTestSuite>org.finos.legend.engine.external.python.Test_External_PythonLegendQL_UnclassifiedFunctions_Reverse_PCT</PCTTestSuite>
                                <PCTTestSuite>org.finos.legend.engine.external.python.Test_External_PythonLegendQL_VariantFunctions_Reverse_PCT</PCTTestSuite>
                            </PCTTestSuites>
                        </configuration>
                        <executions>
                            <execution>
                                <id>PCT-Generation</id>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>generate-pct-report</goal>
                                </goals>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.finos.legend.engine</groupId>
                                <artifactId>legend-engine-pure-code-compiled-core</artifactId>
                                <version>${project.version}</version>
                            </dependency>
                            <dependency>
                                <groupId>org.finos.legend.engine</groupId>
                                <artifactId>legend-engine-pure-code-reversePCT</artifactId>
                                <version>${project.version}</version>
                            </dependency>
                            <dependency>
                                <groupId>org.finos.legend.engine</groupId>
                                <artifactId>legend-engine-xt-python-functions-execution-runtime-java-extension-compiled</artifactId>
                                <version>${project.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <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-runtime-java-engine-compiled</artifactId>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-platform-java</artifactId>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-runtime-java-extension-compiled-functions-unclassified</artifactId>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-code-reversePCT</artifactId>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-python-functions-execution-runtime-java-extension-compiled</artifactId>
        </dependency>

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

        <!-- TEST -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-test-framework</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-functions-relation-pure</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-functions-standard-pure</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-functions-unclassified-pure</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-functions-variant-pure</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-m3-core</artifactId>
            <scope>test</scope>
            <type>test-jar</type>
        </dependency>
    </dependencies>
</project>
