<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>pipeline.device-detection</artifactId>
        <groupId>com.51degrees</groupId>
        <version>4.4.68</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>device-detection.hash.engine.on-premise</artifactId>
    <name>51Degrees :: Device Detection :: Hash :: On Premise</name>
    <url>https://51degrees.com</url>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>device-detection.shared</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- test dependencies -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>device-detection.shared</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
    </dependencies>

    <profiles>
	    <profile>
            <id>WindowsCommon</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
            </activation>
            <properties>
                <script.extension>.bat</script.extension>
				<toolset.version.flag>/t</toolset.version.flag>
				<windows.sdk.version.flag>/w</windows.sdk.version.flag>
            </properties>
        </profile>
		<profile>
            <id>WindowsDefaultToolsetVersion</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
				<property>
				    <name>!platformToolsetVersion</name>
				</property>
            </activation>
            <properties>
				<toolset.version>v142</toolset.version>
            </properties>
        </profile>
		<profile>
            <id>WindowsDefaultSDKVersion</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
				<property>
				    <name>!windowsSDKVersion</name>
				</property>
            </activation>
            <properties>
				<windows.sdk.version>10.0.18362.0</windows.sdk.version>
            </properties>
        </profile>
		<profile>
            <id>WindowsNativeToolsetVersion</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
				<property>
				    <name>platformToolsetVersion</name>
				</property>
            </activation>
            <properties>
				<toolset.version>${platformToolsetVersion}</toolset.version>
            </properties>
        </profile>
		<profile>
            <id>WindowsNativeSDKVersion</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
				<property>
				    <name>windowsSDKVersion</name>
				</property>
            </activation>
            <properties>
				<windows.sdk.version>${windowsSDKVersion}</windows.sdk.version>
            </properties>
        </profile>
        <profile>
            <id>unix</id>
            <activation>
                <os>
                    <family>unix</family>
                </os>
            </activation>
            <properties>
                <script.extension>.sh</script.extension>
            </properties>
        </profile>
    </profiles>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <configuration>
                            <skip>${skipNativeBuild}</skip>
                            <executable>
                                ${project.basedir}/src/main/cxx/PreBuild${script.extension}
                            </executable>
							<arguments>
							    <argument>${toolset.version.flag}</argument>
								<argument>${toolset.version}</argument>
								<argument>${windows.sdk.version.flag}</argument>
								<argument>${windows.sdk.version}</argument>
							</arguments>
                            <successCodes>
                                <successCode>0</successCode>
                            </successCodes>
                        </configuration>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
