<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2022-2023 Open Text.

    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.github.fileanalysissuite.adaptersdk.schema</groupId>
        <artifactId>adaptersdk-schema-aggregator</artifactId>
        <version>1.1.0-152</version>
    </parent>

    <artifactId>adaptersdk-schema-dotnet</artifactId>
    <packaging>pom</packaging>

    <properties>
        <nugetOutputFolder>${project.build.directory}</nugetOutputFolder>
    </properties>

    <build>
        <directory>artifacts</directory>
        <sourceDirectory>src</sourceDirectory>
        <testSourceDirectory>tests</testSourceDirectory>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <configuration>
                        <excludes combine.children="append">
                            <exclude>*.sln</exclude>
                            <exclude>.vs/**</exclude>
                            <exclude>artifacts/**</exclude>
                        </excludes>
                        <mapping>
                            <config>XML_STYLE</config>
                            <csproj>XML_STYLE</csproj>
                            <manifest>XML_STYLE</manifest>
                            <props>XML_STYLE</props>
                        </mapping>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <configuration>
                    <environmentVariables>
                        <VERSION>${project.version}</VERSION>
                    </environmentVariables>
                </configuration>
                <executions>
                    <execution>
                        <id>exec-dotnet-restore</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>dotnet</executable>
                            <arguments>
                                <argument>restore</argument>
                                <argument>--verbosity</argument>
                                <argument>normal</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>exec-dotnet-build</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>dotnet</executable>
                            <arguments>
                                <argument>build</argument>
                                <argument>--configuration</argument>
                                <argument>Release</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>exec-dotnet-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>dotnet</executable>
                            <arguments>
                                <argument>test</argument>
                                <argument>--configuration</argument>
                                <argument>Release</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>exec-dotnet-pack</id>
                        <phase>package</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>dotnet</executable>
                            <arguments>
                                <argument>pack</argument>
                                <argument>--configuration</argument>
                                <argument>Release</argument>
                                <argument>--no-build</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>exec-dotnet-pack-for-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>dotnet</executable>
                            <arguments>
                                <argument>pack</argument>
                                <argument>--configuration</argument>
                                <argument>Release</argument>
                                <argument>--no-build</argument>
                                <argument>--output</argument>
                                <argument>${nugetOutputFolder}</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
