<?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">
    <!--
    Artifacts:

    1. codenameone-ios-7.0.jar
        The src directory compiled. (no dependencies)
    2. codenameone-ios-jar-with-dependencies-7.0.jar
        Includes compiled classes and all java dependencies.  (Basically equivalent of old iOSPort.jar).
    3. codenameone-ios-bundle-7.0.jar
        Zip file with 2 jar files in root: iOSPort.jar and nativeios.jar
        This file is a depenedency of the codenameone-maven-plugin because it is used by the iOSBuilder to load iOSPort.jar
        and nativeios.jar from the classpath.
    -->
    <parent>
        <groupId>com.codenameone</groupId>
        <artifactId>codenameone</artifactId>
        <version>7.0.227</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.codenameone</groupId>
    <artifactId>codenameone-ios</artifactId>
    <version>7.0.227</version>
    <packaging>jar</packaging>

    <name>Codename One iOS Port</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>6</maven.compiler.source>
        <maven.compiler.target>6</maven.compiler.target>
        <src.dir>../../Ports/iOSPort/src</src.dir>
        <codename1.nativeios.dir>../../Ports/iOSPort/nativeSources</codename1.nativeios.dir>
    </properties>


    <dependencies>
        <dependency>
            <groupId>com.codenameone</groupId>
            <artifactId>codenameone-core</artifactId>

        </dependency>

    </dependencies>
    <build>
        <sourceDirectory>${src.dir}</sourceDirectory>
        <resources>
            <resource>
                <directory>${src.dir}</directory>
                <excludes><exclude>**/*.java</exclude></excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>4.7.3.4</version>
                <configuration>
                    <effort>Max</effort>
                    <threshold>Low</threshold>
                    <failOnError>false</failOnError>
                    <xmlOutput>true</xmlOutput>
                    <xmlOutputDirectory>${project.build.directory}</xmlOutputDirectory>
                    <excludeFilterFile>${project.basedir}/../../Ports/iOSPort/spotbugs-exclude.xml</excludeFilterFile>
                </configuration>
                <executions>
                    <execution>
                        <id>spotbugs</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>spotbugs</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.3.0</version>



                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptorRefs>
                                <descriptorRef>jar-with-dependencies</descriptorRef>
                            </descriptorRefs>
                        </configuration>
                    </execution>

                </executions>
            </plugin>
            <plugin>

                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <mkdir dir="${project.build.outputDirectory}/codenameone/iosport-bundle"/>

                                <zip destfile="${project.build.directory}/codenameone/iosport-bundle/nativeios.jar">
                                    <fileset dir="${codename1.nativeios.dir}" />
                                </zip>
                                <copy file="${project.build.directory}/${project.build.finalName}-jar-with-dependencies.jar" tofile="${project.build.directory}/codenameone/iosport-bundle/iOSPort.jar" overwrite="true"/>
                                <zip destfile="${project.build.directory}/${project.build.finalName}-bundle.jar">
                                    <fileset dir="${project.build.directory}/codenameone/iosport-bundle"/>
                                </zip>

                            </target>
                        </configuration>
                    </execution>


                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.build.directory}/${project.build.finalName}-bundle.jar</file>
                                    <type>jar</type>
                                    <classifier>bundle</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    

    
</project>
