<?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>ai.wanaku</groupId>
        <artifactId>providers</artifactId>
        <version>${wanaku-version}</version>
    </parent>

    <artifactId>wanaku-provider-${name.toLowerCase()}</artifactId>
    <name>Wanaku :: Services :: Providers :: ${name}</name>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>${quarkus.platform.artifact-id}</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
#if ( $wanaku-capability-type == "camel")
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>quarkus-camel-bom</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
#end
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>ai.wanaku</groupId>
            <artifactId>core-exchange</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>ai.wanaku</groupId>
            <artifactId>wanaku-capabilities-base</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>ai.wanaku</groupId>
            <artifactId>wanaku-capabilities-provider</artifactId>
            <version>${project.version}</version>
        </dependency>

#if ( $wanaku-capability-type == "camel")
        <dependency>
            <groupId>ai.wanaku</groupId>
            <artifactId>wanaku-capabilities-runtime-camel</artifactId>
            <version>${project.version}</version>
        </dependency>
#end

        <dependency>
            <groupId>ai.wanaku</groupId>
            <artifactId>core-service-discovery</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-grpc</artifactId>
        </dependency>

#if ( $wanaku-capability-type == "camel")
        <dependency>
            <groupId>org.apache.camel.quarkus</groupId>
            <artifactId>camel-quarkus-core</artifactId>
        </dependency>
#end

        <!-- For building containers -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-container-image-jib</artifactId>
        </dependency>

        <!-- Tool dependencies go here -->

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <version>${quarkus.platform.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                            <goal>generate-code</goal>
                            <goal>generate-code-tests</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>native</id>
            <activation>
                <property>
                    <name>native-services</name>
                </property>
            </activation>
            <properties>
                <skipITs>false</skipITs>
                <quarkus.native.enabled>true</quarkus.native.enabled>
            </properties>
        </profile>
        <profile>
            <id>dist</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>${maven-assembly-plugin.version}</version>
                        <configuration>
                            <attach>false</attach>
                            <appendAssemblyId>false</appendAssemblyId>
                            <outputDirectory>${distribution.directory}</outputDirectory>
                            <workDirectory>${project.build.directory}/assembly/work</workDirectory>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-distribution</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                                <configuration>
                                    <finalName>${project.artifactId}-${project.version}</finalName>
                                    <descriptors>
                                        <descriptor>src/main/assembly/assembly.xml</descriptor>
                                    </descriptors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>