<?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>com.atlassian.pom</groupId>
        <artifactId>public-pom</artifactId>
        <version>6.0.2</version>
    </parent>

    <groupId>com.atlassian.bitbucket.server</groupId>
    <artifactId>bitbucket-mesh-callback</artifactId>
    <version>0.9.3</version>
    <packaging>jar</packaging>

    <scm>
        <connection>scm:git:ssh://git@stash.dev.internal.atlassian.com:7999/MESH/mesh-callback.git</connection>
        <developerConnection>scm:git:ssh://git@stash.dev.internal.atlassian.com:7999/MESH/mesh-callback.git</developerConnection>
        <url>scm:git:http://stash.dev.internal.atlassian.com/git/MESH/mesh-callback.git</url>
        <tag>bitbucket-mesh-callback-0.9.3</tag>
    </scm>

    <licenses>
        <license>
            <name>Atlassian 3.0 End User License Agreement</name>
            <url>https://www.atlassian.com/end-user-agreement/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>copy-darwin-hook</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}/hook-callback/x86_64-darwin</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>../rust/target/x86_64-apple-darwin/release</directory>
                                    <includes>
                                        <include>mesh-callback</include>
                                    </includes>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-linux-hook</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}/hook-callback/x86_64-linux</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>../rust/target/x86_64-unknown-linux-musl/release</directory>
                                    <includes>
                                        <include>mesh-callback</include>
                                    </includes>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-windows-hook</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}/hook-callback/i686-windows</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>../rust/target/i686-pc-windows-msvc/release</directory>
                                    <includes>
                                        <include>mesh-callback.exe</include>
                                    </includes>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
