<?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>OpenPatrician</artifactId>
        <groupId>ch.sahits.game</groupId>
        <version>0.9.1</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>OpenPatricianStandalone</artifactId>
    <description>Module for the OpenPatrician standalone application</description>
    <dependencies>
        <dependency>
            <groupId>ch.sahits.game</groupId>
            <artifactId>OpenPatricianDisplay</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <!-- Ease development - e.g. with autorestart, see https://spring.io/blog/2015/06/17/devtools-in-spring-boot-1-3 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                        <configuration>
                            <mainClass>
                                ch.sahits.game.openpatrician.standalone.OpenPatricianApplication
                            </mainClass>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>Linux</id>
            <activation>
                <os>
                    <family>unix</family>
                    <name>Linux</name>
                </os>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>build-deb</id>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <phase>install</phase>
                                <configuration>
                                    <executable>javapackager</executable>
                                    <arguments>
                                        <argument>-deploy</argument>
                                        <argument>-native</argument>
                                        <argument>deb</argument>
                                        <argument>-Bcategory=Game</argument>
                                        <argument>-BjvmOptions=-Xmx2048m</argument>
                                        <argument>-BappVerion=${project.version}</argument>
                                        <argument>-Bicon=package/linux/trade-icon.png</argument>
                                        <!--<argument>-BlicenseType="Apache License V2.0 + Creative Commons Attribution Non-Commercial License V2.0"</argument>-->
                                        <!--<argument>-BlicenseFile=package/Apache-LICENSE-2.0.txt</argument>-->
                                        <argument>-outdir</argument>
                                        <argument>target/native</argument>
                                        <argument>-outfile</argument>
                                        <argument>OpenPatrician</argument>
                                        <argument>-srcdir</argument>
                                        <argument>target</argument>
                                        <argument>-srcfiles</argument>
                                        <argument>${project.build.finalName}.jar</argument>
                                        <argument>-appclass</argument>
                                        <argument>org.springframework.boot.loader.JarLauncher</argument>
                                        <argument>-name</argument>
                                        <argument>${project.parent.artifactId}</argument>
                                        <argument>-title</argument>
                                        <argument>"OpenPatrician"</argument>
                                        <argument>-vendor</argument>
                                        <argument>"Sahits"</argument>
                                        <argument>--add-modules</argument>
                                        <argument>java.xml.ws</argument>
                                        <argument>-v</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>build-rpm</id>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <phase>install</phase>
                                <configuration>
                                    <executable>javapackager</executable>
                                    <arguments>
                                        <argument>-deploy</argument>
                                        <argument>-native</argument>
                                        <argument>rpm</argument>
                                        <argument>-Bcategory=Game</argument>
                                        <argument>-BjvmOptions=-Xmx2048m</argument>
                                        <argument>-BappVerion=${project.version}</argument>
                                        <argument>-Bicon=package/linux/trade-icon.png</argument>
                                        <!--<argument>-BlicenseFile=package/Apache-LICENSE-2.0.txt</argument>-->
                                        <!--<argument>-BlicenseType="Apache License V2.0 + Creative Commons Attribution Non-Commercial License V2.0"</argument>-->
                                        <argument>-outdir</argument>
                                        <argument>target/native</argument>
                                        <argument>-outfile</argument>
                                        <argument>OpenPatrician</argument>
                                        <argument>-srcdir</argument>
                                        <argument>target</argument>
                                        <argument>-srcfiles</argument>
                                        <argument>${project.build.finalName}.jar</argument>
                                        <argument>-appclass</argument>
                                        <argument>org.springframework.boot.loader.JarLauncher</argument>
                                        <argument>-name</argument>
                                        <argument>${project.parent.artifactId}</argument>
                                        <argument>-title</argument>
                                        <argument>"OpenPatrician"</argument>
                                        <argument>-vendor</argument>
                                        <argument>"Sahits"</argument>
                                        <argument>--add-modules</argument>
                                        <argument>java.xml.ws</argument>
                                        <argument>-v</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>osx_profile</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>build-pkg</id>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <phase>install</phase>
                                <configuration>
                                    <executable>javapackager</executable>
                                    <arguments>
                                        <argument>-deploy</argument>
                                        <argument>-native</argument>
                                        <argument>pkg</argument>
                                        <argument>-BjvmOptions=-Xmx2048m</argument>
                                        <argument>-BappVerion=${project.version}</argument>
                                        <argument>-Bicon=package/macosx/trade-icon.icns</argument>
                                        <!-- Version must be larger than 0
                                        <argument>-Bmac.CFBundleVersion=${project.version}</argument> -->
                                        <!--<argument>-BlicenseFile=package/Apache-LICENSE-2.0.txt</argument>-->
                                        <argument>-outdir</argument>
                                        <argument>target/native</argument>
                                        <argument>-outfile</argument>
                                        <argument>OpenPatrician</argument>
                                        <argument>-srcdir</argument>
                                        <argument>target</argument>
                                        <argument>-srcfiles</argument>
                                        <argument>${project.build.finalName}.jar</argument>
                                        <argument>-appclass</argument>
                                        <argument>org.springframework.boot.loader.JarLauncher</argument>
                                        <argument>-name</argument>
                                        <argument>${project.parent.artifactId}</argument>
                                        <argument>-title</argument>
                                        <argument>"OpenPatrician"</argument>
                                        <argument>-vendor</argument>
                                        <argument>"Sahits"</argument>
                                        <argument>--add-modules</argument>
                                        <argument>java.xml.ws</argument>
                                        <argument>-v</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>build-dmg</id>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <phase>install</phase>
                                <configuration>
                                    <executable>javapackager</executable>
                                    <arguments>
                                        <argument>-deploy</argument>
                                        <argument>-native</argument>
                                        <argument>dmg</argument>
                                        <argument>-BjvmOptions=-Xmx2048m</argument>
                                        <argument>-BappVerion=${project.version}</argument>
                                        <argument>-Bicon=package/macosx/trade-icon.icns</argument>
                                        <!-- version must be larger than 0
                                         <argument>-Bmac.CFBundleVersion=${project.version}</argument>-->
                                         <!--<argument>-BlicenseFile=package/Apache-LICENSE-2.0.txt</argument>-->
                                        <argument>-outdir</argument>
                                        <argument>target/native</argument>
                                        <argument>-outfile</argument>
                                        <argument>OpenPatrician</argument>
                                        <argument>-srcdir</argument>
                                        <argument>target</argument>
                                        <argument>-srcfiles</argument>
                                        <argument>${project.build.finalName}.jar</argument>
                                        <argument>-appclass</argument>
                                        <argument>org.springframework.boot.loader.JarLauncher</argument>
                                        <argument>-name</argument>
                                        <argument>${project.parent.artifactId}</argument>
                                        <argument>-title</argument>
                                        <argument>"OpenPatrician"</argument>
                                        <argument>-vendor</argument>
                                        <argument>"Sahits"</argument>
                                        <argument>--add-modules</argument>
                                        <argument>java.xml.ws</argument>
                                        <argument>-v</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>build-app</id>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <phase>install</phase>
                                <configuration>
                                    <executable>javapackager</executable>
                                    <arguments>
                                        <argument>-deploy</argument>
                                        <argument>-native</argument>
                                        <argument>image</argument>
                                        <argument>-BjvmOptions=-Xmx2048m</argument>
                                        <argument>-Bmac.categor=simulation</argument>
                                        <argument>-BappVerion=${project.version}</argument>
                                        <argument>-Bicon=package/macosx/trade-icon.icns</argument>
                                        <!-- Version must be larger than 0
                                        <argument>-Bmac.CFBundleVersion=${project.version}</argument> -->
                                        <!--<argument>-BlicenseFile=package/Apache-LICENSE-2.0.txt</argument>-->
                                        <argument>-outdir</argument>
                                        <argument>target/native</argument>
                                        <argument>-outfile</argument>
                                        <argument>OpenPatrician</argument>
                                        <argument>-srcdir</argument>
                                        <argument>target</argument>
                                        <argument>-srcfiles</argument>
                                        <argument>${project.build.finalName}.jar</argument>
                                        <argument>-appclass</argument>
                                        <argument>org.springframework.boot.loader.JarLauncher</argument>
                                        <argument>-name</argument>
                                        <argument>${project.parent.artifactId}</argument>
                                        <argument>-title</argument>
                                        <argument>"OpenPatrician"</argument>
                                        <argument>-vendor</argument>
                                        <argument>"Sahits"</argument>
                                        <argument>--add-modules</argument>
                                        <argument>java.xml.ws</argument>
                                        <argument>-v</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>windows</id>
            <activation>
                <os><family>windows</family></os>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>build-exe</id>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <phase>install</phase>
                                <configuration>
                                    <executable>javapackager</executable>
                                    <arguments>
                                        <argument>-deploy</argument>
                                        <argument>-native</argument>
                                        <argument>exe</argument>
                                        <argument>-BjvmOptions=-Xmx2048m</argument>
                                        <argument>-BappVerion=${project.version}</argument>
                                        <argument>-BinstalldirChooser=true</argument>
                                        <argument>-Bicon=package/windows/trade-icon.ico</argument>
                                        <!--<argument>-BlicenseFile=classes/Apache-LICENSE-2.0.txt</argument>-->
                                        <argument>-BsystemWide=true</argument>
                                        <argument>-Bwin.menuGroup=games</argument>
                                        <argument>-outdir</argument>
                                        <argument>target/native</argument>
                                        <argument>-outfile</argument>
                                        <argument>OpenPatrician</argument>
                                        <argument>-srcdir</argument>
                                        <argument>target</argument>
                                        <argument>-srcfiles</argument>
                                        <argument>${project.build.finalName}.jar</argument>
                                        <argument>-appclass</argument>
                                        <argument>org.springframework.boot.loader.JarLauncher</argument>
                                        <argument>-name</argument>
                                        <argument>${project.parent.artifactId}</argument>
                                        <argument>-title</argument>
                                        <argument>"OpenPatrician"</argument>
                                        <argument>-vendor</argument>
                                        <argument>"Sahits"</argument>
                                        <argument>--add-modules</argument>
                                        <argument>java.xml.ws</argument>
                                        <argument>-v</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>build-msi</id>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <phase>install</phase>
                                <configuration>
                                    <executable>javapackager</executable>
                                    <arguments>
                                        <argument>-deploy</argument>
                                        <argument>-native</argument>
                                        <argument>msi</argument>
                                        <argument>-BjvmOptions=-Xmx2048m</argument>
                                        <argument>-BappVerion=${project.version}</argument>
                                        <argument>-Bicon=package/windows/trade-icon.ico</argument>
                                        <argument>-BinstalldirChooser=true</argument>
                                        <!--<argument>-BlicenseFile=classes/Apache-LICENSE-2.0.txt</argument>-->
                                        <argument>-BsystemWide=true</argument>
                                        <argument>-Bwin.menuGroup=games</argument>
                                        <argument>-outdir</argument>
                                        <argument>target/native</argument>
                                        <argument>-outfile</argument>
                                        <argument>OpenPatrician</argument>
                                        <argument>-srcdir</argument>
                                        <argument>target</argument>
                                        <argument>-srcfiles</argument>
                                        <argument>${project.build.finalName}.jar</argument>
                                        <argument>-appclass</argument>
                                        <argument>org.springframework.boot.loader.JarLauncher</argument>
                                        <argument>-name</argument>
                                        <argument>${project.parent.artifactId}</argument>
                                        <argument>-title</argument>
                                        <argument>"OpenPatrician"</argument>
                                        <argument>-vendor</argument>
                                        <argument>"Sahits"</argument>
                                        <argument>--add-modules</argument>
                                        <argument>java.xml.ws</argument>
                                        <argument>-v</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>