<?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">
    <parent>
        <artifactId>teamapps</artifactId>
        <groupId>org.teamapps</groupId>
        <version>0.9.208</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>teamapps-ui-api</artifactId>

    <name>TeamApps UI API</name>
    <description>TeamApps UI API</description>
    <url>https://github.com/teamapps-org/teamapps</url>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Matthias Bernstein</name>
            <email>matthias.bernstein@teamapps.org</email>
            <id>matthias-bernstein</id>
        </developer>
        <developer>
            <name>Yann Massard</name>
            <email>yann.massard@teamapps.org</email>
            <id>yamass</id>
        </developer>
    </developers>

    <dependencies>
        <dependency>
            <groupId>org.teamapps</groupId>
            <artifactId>teamapps-ui-dsl</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ibm.icu</groupId>
            <artifactId>icu4j</artifactId>
            <version>76.1</version>
        </dependency>

    </dependencies>


    <build>
        <plugins>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.4.0</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>../../teamapps-client/ts/generated</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <id>generate DTOs</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <mainClass>org.teamapps.dto.generate.TeamAppsJavaDtoGenerator</mainClass>
                            <commandlineArgs>"${project.basedir}/src/main/dto" "${project.basedir}/target/generated-sources/dto" org.teamapps.dto</commandlineArgs>
                            <classpathScope>test</classpathScope>
                        </configuration>
                    </execution>
                    <execution>
                        <id>generate TypeScript</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <mainClass>org.teamapps.dto.generate.TeamAppsTypeScriptGenerator</mainClass>
                            <commandlineArgs>"${project.basedir}/src/main/dto" "${project.basedir}/../teamapps-client/ts/generated"</commandlineArgs>
                            <classpathScope>test</classpathScope>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/dto</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>