<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2009-2012. Created by serso aka se.solovyev.
  ~ For more information, please, contact se.solovyev@gmail.com
  ~ or visit http://se.solovyev.org
  -->

<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>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.solovyev.android</groupId>
    <artifactId>android-common</artifactId>
    <version>1.0.2</version>

    <modules>
        <module>preferences</module>
        <module>db</module>
        <module>menu</module>
        <module>core</module>
        <module>view</module>
        <module>list</module>
        <module>ads</module>
        <module>http</module>
        <module>other</module>
        <module>samples</module>
        <module>samples-test</module>
        <module>sherlock</module>
    </modules>
    <name>Android Common Library</name>

    <packaging>pom</packaging>

    <scm>
        <connection>scm:git:git@github.com:serso/android-common.git</connection>
        <developerConnection>scm:git:git@github.com:serso/android-common.git</developerConnection>
        <url>http://github.com/serso/android-common</url>
    <tag>release-1.0.2</tag>
  </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencyManagement>
        <dependencies>

            <!--Own modules-->

            <dependency>
                <groupId>org.solovyev.android</groupId>
                <artifactId>android-common-core</artifactId>
                <version>1.0.2</version>
                <type>apklib</type>
            </dependency>

            <dependency>
                <groupId>org.solovyev.android</groupId>
                <artifactId>android-common-ads</artifactId>
                <version>1.0.2</version>
                <type>apklib</type>
            </dependency>

            <dependency>
                <groupId>org.solovyev.android</groupId>
                <artifactId>android-common-db</artifactId>
                <version>1.0.2</version>
                <type>apklib</type>
            </dependency>

            <dependency>
                <groupId>org.solovyev.android</groupId>
                <artifactId>android-common-http</artifactId>
                <version>1.0.2</version>
                <type>apklib</type>
            </dependency>

            <dependency>
                <groupId>org.solovyev.android</groupId>
                <artifactId>android-common-list</artifactId>
                <version>1.0.2</version>
                <type>apklib</type>
            </dependency>

            <dependency>
                <groupId>org.solovyev.android</groupId>
                <artifactId>android-common-menu</artifactId>
                <version>1.0.2</version>
                <type>apklib</type>
            </dependency>

            <dependency>
                <groupId>org.solovyev.android</groupId>
                <artifactId>android-common-other</artifactId>
                <version>1.0.2</version>
                <type>apklib</type>
            </dependency>

            <dependency>
                <groupId>org.solovyev.android</groupId>
                <artifactId>android-common-preferences</artifactId>
                <version>1.0.2</version>
                <type>apklib</type>
            </dependency>

            <dependency>
                <groupId>org.solovyev.android</groupId>
                <artifactId>android-common-samples</artifactId>
                <version>1.0.2</version>
                <type>apk</type>
            </dependency>

            <dependency>
                <groupId>org.solovyev.android</groupId>
                <artifactId>android-common-samples</artifactId>
                <version>1.0.2</version>
                <type>jar</type>
            </dependency>

            <dependency>
                <groupId>org.solovyev.android</groupId>
                <artifactId>android-common-samples-test</artifactId>
                <version>1.0.2</version>
                <type>apklib</type>
            </dependency>

            <dependency>
                <groupId>org.solovyev.android</groupId>
                <artifactId>android-common-sherlock</artifactId>
                <version>1.0.2</version>
                <type>apklib</type>
            </dependency>

            <dependency>
                <groupId>org.solovyev.android</groupId>
                <artifactId>android-common-view</artifactId>
                <version>1.0.2</version>
                <type>apklib</type>
            </dependency>

            <!-- Other -->

            <dependency>
                <groupId>com.google.android</groupId>
                <artifactId>android-test</artifactId>
                <version>4.0.1.2</version>
            </dependency>

            <dependency>
                <groupId>com.google.android</groupId>
                <artifactId>android</artifactId>
                <version>4.0.1.2</version>
            </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.9</version>
            </dependency>


        </dependencies>
    </dependencyManagement>

    <dependencies>

        <!-- OWN -->

        <dependency>
            <groupId>org.solovyev</groupId>
            <artifactId>common-core</artifactId>
            <version>1.0.0</version>
        </dependency>

        <!-- OTHER -->

        <dependency>
            <groupId>com.intellij</groupId>
            <artifactId>annotations</artifactId>
            <version>11.1.2</version>
        </dependency>

        <!-- TESTS -->

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>

        <plugins>
            <plugin>
                <groupId>com.electriccloud</groupId>
                <artifactId>javac2-maven-plugin</artifactId>
                <version>1.0.1</version>
                <executions>
                    <execution>
                        <id>@NotNull Instrumentation</id>
                        <goals>
                            <goal>instrument</goal>
                        </goals>
                        <!--compile phase instead of process-classes because of proguard.
                        @NotNull instrumentation will be done now after compilation and before proguard-->
                        <phase>compile</phase>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <tagNameFormat>release-@{project.version}</tagNameFormat>
                </configuration>
            </plugin>

        </plugins>

        <pluginManagement>
            <plugins>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jarsigner-plugin</artifactId>
                    <version>1.2</version>
                </plugin>

                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.4.3</version>
                    <configuration>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                    <artifactId>android-maven-plugin</artifactId>
                    <version>3.3.2</version>
                    <configuration>
                        <test>
                            <skip>true</skip>
                        </test>

                        <sourceDirectories>
                            <sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
                        </sourceDirectories>

                        <sdk>
                            <platform>15</platform>
                        </sdk>

                        <emulator>
                            <avd>Default</avd>
                            <wait>10000</wait>
                            <!--<options>-no-skin</options>-->
                        </emulator>

                        <zipalign>
                            <verbose>true</verbose>
                        </zipalign>

                        <undeployBeforeDeploy>true</undeployBeforeDeploy>

                    </configuration>

                </plugin>

                <plugin>
                    <groupId>com.pyx4me</groupId>
                    <artifactId>proguard-maven-plugin</artifactId>
                    <version>2.0.4</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.5</version>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>


    <profiles>

        <profile>
            <!-- the standard profile runs the instrumentation tests -->
            <id>standard</id>
        </profile>


        <profile>
            <!-- the release profile does sign, proguard, zipalign  -->
            <!-- NOTE: release profile doesn't run instrumentation tests as apk file is signed -->
            <id>release</id>
            <!-- via this activation the profile is automatically used when the release is done with the maven release
            plugin -->
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>

        </profile>
    </profiles>

</project>