<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>
        <artifactId>OpenPatrician</artifactId>
		<groupId>ch.sahits.game</groupId>
		<version>0.9.0</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	<artifactId>OpenPatricianDisplay</artifactId>
    <properties>
        <toolsjar>${java.home}/../lib/tools.jar</toolsjar>
    </properties>
	<dependencies>
		<dependency>
			<groupId>ch.sahits</groupId>
			<artifactId>sahitsUtil</artifactId>
		</dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
        </dependency>
		<dependency>
			<groupId>commons-cli</groupId>
			<artifactId>commons-cli</artifactId>
		</dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>

		<!-- Module dependencies -->
		<dependency>
			<groupId>ch.sahits.game</groupId>
			<artifactId>OpenPatricianImage</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>ch.sahits.game</groupId>
			<artifactId>OpenPatricianData</artifactId>
		</dependency>
		<dependency>
			<groupId>ch.sahits.game</groupId>
			<artifactId>OpenPatricianSound</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>ch.sahits.game</groupId>
			<artifactId>OpenPatricianJavaFX</artifactId>
		</dependency>

		<dependency>
			<groupId>ch.sahits.game</groupId>
			<artifactId>OpenPatricianServer</artifactId>
		</dependency>
		<dependency>
			<groupId>ch.sahits.game</groupId>
			<artifactId>OpenPatricianSound</artifactId>
		</dependency>


		<!-- Test -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
		<dependency>
            <groupId>ch.sahits.game</groupId>
            <artifactId>OpenPatricianTestUtilities</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.sahits.game</groupId>
            <artifactId>MarvinFXEssentials</artifactId>
        </dependency>
        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
        </dependency>
	</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>ch.sahits.game.openpatrician.display.OpenPatrician</mainClass>
                        <addClasspath>true</addClasspath>
                    </manifest>
                </archive>
            </configuration>
        </plugin>

        <plugin>
            <groupId>com.zenjava</groupId>
            <artifactId>javafx-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>
<profiles>
    <profile>
        <id>unix</id>
        <activation>
            <os>
                <family>unix</family>
                <name>Linux</name>
            </os>
        </activation>
        <properties>
            <native.target>${project.build.directory}/jfx/native/${project.build.finalName}</native.target>
            <executable.jar>${native.target}/app</executable.jar>
        </properties>
        <build>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>com.zenjava</groupId>
                        <artifactId>javafx-maven-plugin</artifactId>
                        <configuration>
                            <mainClass>ch.sahits.game.openpatrician.display.OpenPatrician</mainClass>
                            <verbose>true</verbose>
                            <bundler>linux.app</bundler>
                        </configuration>
                    </plugin>
                </plugins>
            </pluginManagement>
        </build>
    </profile>
    <profile>
        <id>windows</id>
        <activation>
            <os><family>windows</family></os>
        </activation>
        <properties>
            <native.target>${project.build.directory}/jfx/native/${project.build.finalName}</native.target>
            <executable.jar>${native.target}/app</executable.jar>
        </properties>
        <build>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>com.zenjava</groupId>
                        <artifactId>javafx-maven-plugin</artifactId>
                        <configuration>
                            <mainClass>ch.sahits.game.openpatrician.display.OpenPatrician</mainClass>
                            <verbose>true</verbose>
                        </configuration>
                    </plugin>
                </plugins>
            </pluginManagement>
        </build>
    </profile>
    <profile>
        <id>osx_profile</id>
        <activation>
            <os>
                <family>mac</family>
            </os>
        </activation>
        <properties>
            <native.target>${project.build.directory}/jfx/native/${project.build.finalName}.app</native.target>
            <executable.jar>${project.build.directory}/jfx/app</executable.jar>
        </properties>
        <build>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>com.zenjava</groupId>
                        <artifactId>javafx-maven-plugin</artifactId>
                        <configuration>
                            <mainClass>ch.sahits.game.openpatrician.display.OpenPatrician</mainClass>
                            <verbose>true</verbose>
                        </configuration>
                    </plugin>
                </plugins>
            </pluginManagement>
        </build>
        <!--<properties>-->
        <!--<toolsjar>${java.home}/../Classes/classes.jar</toolsjar>-->
        <!--</properties>-->
    </profile>
    <profile>
        <id>build-installer</id>
        <properties>
            <native.output.dir>${project.build.directory}/jfx/native/${project.build.finalName}</native.output.dir>
            <native.output.dir.app>${native.output.dir}/app</native.output.dir.app>
            <native.app.jar>${native.output.dir.app}/${project.build.finalName}-jfx.jar</native.app.jar>
        </properties>
        <dependencies>
            <dependency>
                <groupId>ch.sahits.game</groupId>
                <artifactId>OpenPatricianDisplay</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
        <build>

            <plugins>

                <plugin>
                    <groupId>com.zenjava</groupId>
                    <artifactId>javafx-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>native</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.7</version>
                    <executions>
                        <execution>
                            <id>create zip archive</id>
                            <phase>install</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                                <target>

                                    <echo>Creating self-contained zip native</echo>
                                    <zip destfile="${project.build.directory}/OpenPatrician-${project.version}-[OS]64.zip" basedir="${native.target}" />

                                    <echo>Creating self-contained executable jar</echo>
                                    <zip destfile="${project.build.directory}/OpenPatrician-${project.version}.zip" basedir="${executable.jar}" />

                                </target>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </build>
    </profile>

        </profiles>
</project>
