<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.7.0</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	<artifactId>OpenPatricianDisplay</artifactId>
	<dependencies>
		<dependency>
			<groupId>ch.sahits</groupId>
			<artifactId>sahitsUtil</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
		</dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
        </dependency>
		<dependency>
			<groupId>commons-cli</groupId>
			<artifactId>commons-cli</artifactId>
		</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>MarvinFXEssentials</artifactId>
			<scope>test</scope>
		</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.hamcrest</groupId>
			<artifactId>hamcrest-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</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</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></os>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>com.zenjava</groupId>
                            <artifactId>javafx-maven-plugin</artifactId>
                            <configuration>
                                <mainClass>ch.sahits.game.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>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>com.zenjava</groupId>
                            <artifactId>javafx-maven-plugin</artifactId>
                            <configuration>
                                <mainClass>ch.sahits.game.OpenPatrician</mainClass>
                                <verbose>true</verbose>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </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.output.dir}" />

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

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

                </plugins>
            </build>

        </profile>

    </profiles>
</project>
