<?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.227</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.codenameone</groupId>
    <artifactId>codenameone-android</artifactId>
    <version>7.0.227</version>
    <packaging>jar</packaging>

    <name>Codename One Android Port</name>
    
    <dependencies>
        <dependency>
            <groupId>com.codenameone</groupId>
            <artifactId>codenameone-core</artifactId>

        </dependency>
       
        
    </dependencies>
    <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>src/main/java</src.dir>
        <real.src.dir>../../Ports/Android/src</real.src.dir>
        <codename1.src.dir>../../CodenameOne/src</codename1.src.dir>
		<android.sdk.version>25.3.0</android.sdk.version>
    </properties>

    <build>
        <sourceDirectory>${src.dir}</sourceDirectory>
        <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/Android/spotbugs-exclude.xml</excludeFilterFile>
                </configuration>
                <executions>
                    <execution>
                        <id>spotbugs</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>spotbugs</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    
    <profiles>
        <profile>
            <activation>
                <file><exists>${real.src.dir}</exists></file>
            </activation>
            <id>bundle-android</id>

            <build>




                <plugins>
                    <plugin>

                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <mkdir dir="${project.build.outputDirectory}/com/codename1/android"/>
                                        <zip destfile="${project.build.outputDirectory}/com/codename1/android/android_port_sources.jar">
                                            <fileset dir="${real.src.dir}" />
                                            <fileset dir="${codename1.src.dir}"/>
                                        </zip>
                                    </target>
                                </configuration>
                            </execution>


                        </executions>
                    </plugin>
                </plugins>
            </build>

        </profile>
        <profile>
            <!-- This profile is not build by default.  It builds an uber artifact with all of the android
                 dependencies that can be added to android native modules to add sanity check, autocompletion
                 etc...

                 To build you need to do:

                 Clone the cn1-binaries repo at https://github.com/codenameone/cn1-binaries

                 mvn install -Dcn1.binaries=/path/to/cn1-binaries

            -->


            <id>compile-android</id>
            <activation>
                <file><exists>${cn1.binaries}</exists></file>
                <property><name>cn1.binaries</name></property>
            </activation>
            <properties>
                <src.dir>../../Ports/Android/src</src.dir>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>android-support-v7-appcompat</artifactId>
                    <version>${project.version}</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/android-support-v7-appcompat.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>android-support-v7-cardview</artifactId>
                    <version>${project.version}</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/android-support-v7-cardview.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>android-support-v7-gridlayout</artifactId>
                    <version>${project.version}</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/android-support-v7-gridlayout.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>google-services</artifactId>
                    <version>3.0.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/google-services-3.0.0.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>android-billing</artifactId>
                    <version>4.0.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/android-billing-4.0.0.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>play-services-auth</artifactId>
                    <version>12.0.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/play-services-auth-12.0.0.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>play-services-base</artifactId>
                    <version>12.0.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/play-services-base-12.0.0.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>play-services-basement</artifactId>
                    <version>12.0.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/play-services-basement-12.0.0.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>play-services-location</artifactId>
                    <version>12.0.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/play-services-location-12.0.0.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>android</artifactId>
                    <version>${project.version}</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/android.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>facebook</artifactId>
                    <version>${project.version}</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/facebook.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>google-play-services</artifactId>
                    <version>${project.version}</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/google-play-services.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>zooz_iap</artifactId>
                    <version>${project.version}</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/zooz_iap.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>support-v4</artifactId>
                    <version>26.1.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/support-v4-26.1.0.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>support-compat-v4</artifactId>
                    <version>26.1.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/support-compat-v4-26.1.0.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>support-media-compat</artifactId>
                    <version>26.1.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/support-media-compat-26.1.0.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>support-core-utils</artifactId>
                    <version>26.1.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/support-core-utils-26.1.0.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>support-annotations</artifactId>
                    <version>26.1.0-alpha1</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/support-annotations-26.0.0-alpha1.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>support-core-ui</artifactId>
                    <version>26.1.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/support-core-ui-26.1.0.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>support-fragment</artifactId>
                    <version>26.1.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/support-fragment-26.1.0.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.codenameone.cn1binaries</groupId>
                    <artifactId>play-services-tasks</artifactId>
                    <version>12.0.0</version>
                    <scope>system</scope>
                    <systemPath>${cn1.binaries}/android/play-services-tasks-12.0.0.jar</systemPath>
                </dependency>
            </dependencies>

            <build>


                    <resources>
                        <resource>
                            <directory>${src.dir}</directory>
                        </resource>
                    </resources>


                <plugins>

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

                            <configuration>
                            <descriptors>
                              <descriptor>src/main/assembly/distribution.xml</descriptor>
                            </descriptors>
                          </configuration>

                        <executions>
                            <execution>
                                <id>make-assembly</id>
                                <phase>package</phase> 
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    
</project>
