<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2024 Craig Motlin
  ~
  ~ 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>
        <groupId>io.liftwizard</groupId>
        <artifactId>liftwizard-reladomo</artifactId>
        <version>2.1.32</version>
    </parent>

    <artifactId>liftwizard-reladomo-simulated-sequence</artifactId>

    <name>Liftwizard Reladomo Simulated Sequence</name>

    <dependencies>

        <dependency>
            <groupId>com.goldmansachs.reladomo</groupId>
            <artifactId>reladomo</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.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

    </dependencies>

    <build>
        <plugins>

            <!--region Phase 3: generate-sources-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>

                <dependencies>

                    <dependency>
                        <groupId>com.goldmansachs.reladomo</groupId>
                        <artifactId>reladomogen</artifactId>
                        <version>18.0.0</version>
                    </dependency>

                    <dependency>
                        <groupId>com.goldmansachs.reladomo</groupId>
                        <artifactId>reladomo-gen-util</artifactId>
                        <version>18.0.0</version>
                    </dependency>

                </dependencies>

                <executions>
                    <execution>
                        <id>generateMithra</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <target>
                                <property name="plugin_classpath" refid="maven.plugin.classpath" />

                                <!--region spotless:off -->
                                <taskdef name="gen-reladomo" classpath="plugin_classpath" classname="com.gs.fw.common.mithra.generator.MithraGenerator" />

                                <gen-reladomo xml="${project.basedir}/src/main/resources/reladomo/ObjectSequenceClassList.xml" generateEcListMethod="true" generatedDir="${project.build.directory}/generated-sources/reladomo" nonGeneratedDir="${project.build.sourceDirectory}" generateConcreteClasses="true" />
                                <!--endregion spotless:on -->
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--endregion Phase 3: generate-sources-->

            <!--region Phase 4: process-sources-->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.6.0</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <phase>process-sources</phase>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/reladomo/</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--endregion Phase 4: process-sources-->

        </plugins>
    </build>
</project>
