<?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>
        <groupId>com.codenameone</groupId>
        <artifactId>codenameone</artifactId>
        <version>7.0.243</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>codenameone-javase</artifactId>
    <version>7.0.243</version>
    <packaging>jar</packaging>
    <description>JavaSE port for Codename One</description>
    <name>codenameone-javase</name>
    <url>https://www.codenameone.com</url>

    <licenses>
        <license>
            <name>GPL v2 With Classpath Exception</name>
            <url>https://openjdk.java.net/legal/gplv2+ce.html</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>shai</id>
            <name>Shai Almog</name>
            <email>shai.almog@codenameone.com</email>
            <timezone>+4</timezone>
        </developer>
        <developer>
            <id>chen</id>
            <name>Chen Fishbein</name>
            <email>chen.fishbein@codenameone.com</email>
            <timezone>+4</timezone>
        </developer>
        <developer>
            <id>shannah</id>
            <name>Steve Hannah</name>
            <email>steve.hannah@codenameone.com</email>
            <timezone>-8</timezone>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/codenameone/CodenameOne</url>
        <connection>scm:git:git@github.com:codenameone/CodenameOne.git</connection>
    </scm>
    <profiles>
        <profile>
            <id>local-dev-javase</id>
            <activation>
                <property>
                    <name>codename1.platform</name>
                    <value>javase</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.codenameone</groupId>
                    <artifactId>jfxrt</artifactId>
                    <version>8</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/jfxrt.jar</systemPath>
                    <optional>true</optional>
                </dependency>
                <dependency>
                    <groupId>com.codenameone</groupId>
                    <artifactId>jcef</artifactId>
                    <version>6.0.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/javase/jcef.jar</systemPath>
                    <optional>true</optional>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>com.codenameone</groupId>
            <artifactId>codenameone-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.codenameone</groupId>
            <artifactId>sqlite-jdbc</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.jhlabs</groupId>
            <artifactId>filters</artifactId>
            <version>2.0.235-1</version>
        </dependency>
        <dependency>
            <groupId>javax.media</groupId>
            <artifactId>jmf</artifactId>
            <version>2.1.1e</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <src.dir>../../Ports/JavaSE/src</src.dir>

    </properties>
    <build>
        <sourceDirectory>${src.dir}</sourceDirectory>
        <resources>
            <resource>
                <directory>${src.dir}</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <!-- The parent pom pins surefire to 2.21.0 which lacks the
                     JUnit Jupiter provider this module's tests rely on (the
                     pre-existing CSSWatcherTest and the MavenUtilsTest added
                     alongside the CSSWatcher live-reload fixes). Bump to a
                     surefire version with native Jupiter discovery so these
                     tests actually execute. -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.2.5</version>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>build-skins</id>
                        <phase>process-resources</phase>
                        <configuration>
                            <target>
                                <echo>Installing iPhoneX.skin</echo>
                                <mkdir dir="${project.build.directory}/skins"/>
                                <get src="https://github.com/codenameone/codenameone-skins/archive/master.zip" dest="${project.build.directory}/skins/master.zip" skipexisting="true"/>
                                <unzip src="${project.build.directory}/skins/master.zip" dest="${project.build.directory}/skins"/>
                                <move file="${project.build.directory}/skins/codenameone-skins-master" tofile="${project.build.directory}/skins/codenameone-skins" />
                                <ant dir="${project.build.directory}/skins/codenameone-skins" inheritAll="false" useNativeBasedir="true">
                                    <property name="cn1.path" location="${project.basedir}/../.."/>
                                </ant>
                                <copy file="${project.build.directory}/skins/codenameone-skins/OTA/iPhoneX.skin" todir="${project.build.outputDirectory}"/>
                                <!-- Bundle every shipped native theme into the
                                     simulator fat jar so JavaSEPort.loadSkinFile can
                                     load the right .res based on the current skin's
                                     platformName (or the Simulator "Native Theme"
                                     menu override). failonerror=false lets the
                                     simulator still build if
                                     scripts/build-native-themes.sh hasn't produced
                                     the modern .res files yet. -->
                                <copy todir="${project.build.outputDirectory}" failonerror="false">
                                    <fileset dir="${project.basedir}/../../Themes">
                                        <include name="iOSModernTheme.res"/>
                                        <include name="AndroidMaterialTheme.res"/>
                                        <include name="iPhoneTheme.res"/>
                                        <include name="iOS7Theme.res"/>
                                        <include name="androidTheme.res"/>
                                        <include name="android_holo_light.res"/>
                                    </fileset>
                                </copy>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>com.codename1.impl.javase.Simulator</mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>