Maven build

This commit is contained in:
Sergey Solovyev 2012-03-04 22:29:06 +04:00
parent 617725d165
commit 1b8d787737
2 changed files with 44 additions and 429 deletions

View File

@ -1,114 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:a="http://schemas.android.com/apk/res/android"
package="org.solovyev.android.calculator"
a:installLocation="auto"
a:versionCode="33"
a:versionName="1.2.33">
<uses-permission a:name="android.permission.VIBRATE"/>
<uses-permission a:name="android.permission.INTERNET"/>
<uses-permission a:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission a:name="com.android.vending.BILLING"/>
<uses-sdk a:minSdkVersion="4"
a:targetSdkVersion="8"/>
<application a:icon="@drawable/icon"
a:hardwareAccelerated="false"
a:label="@string/c_app_name"
a:name=".CalculatorApplication">
<activity a:name=".CalculatorActivity"
a:windowSoftInputMode="adjustPan"
a:label="@string/c_app_name">
<intent-filter>
<action a:name="android.intent.action.MAIN"/>
<category a:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!--NOTE: a:configChanges="orientation|keyboardHidden" is needed to correct work of dialog windows (not to close them on orientation change) -->
<activity a:name=".CalculatorPreferencesActivity"
a:label="@string/c_app_settings"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".history.CalculatorHistoryTabActivity"
a:label="@string/c_app_history"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".history.HistoryActivityTab"
a:label="@string/c_history"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".history.SavedHistoryActivityTab"
a:label="@string/c_saved_history"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".about.CalculatorAboutTabActivity"
a:label="@string/c_about"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".about.CalculatorAboutActivity"
a:label="@string/c_about"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".about.CalculatorReleaseNotesActivity"
a:label="@string/c_about"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".help.CalculatorHelpTabActivity"
a:label="@string/c_help"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".help.HelpFaqActivity"
a:label="@string/c_help"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".help.HelpHintsActivity"
a:label="@string/c_help"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".help.HelpScreensActivity"
a:label="@string/c_help"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".math.edit.CalculatorFunctionsTabActivity"
a:label="@string/c_functions"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".math.edit.CalculatorFunctionsActivity"
a:label="@string/c_functions"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".math.edit.CalculatorOperatorsActivity"
a:label="@string/c_operators"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".math.edit.CalculatorVarsTabActivity"
a:label="@string/c_vars_and_constants"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".math.edit.CalculatorVarsActivity"
a:label="@string/c_vars_and_constants"
a:configChanges="orientation|keyboardHidden"/>
<activity a:name=".plot.CalculatorPlotActivity"
a:label="@string/c_plot_graph"/>
<activity a:name="com.google.ads.AdActivity"
a:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<service a:name="net.robotmedia.billing.BillingService"/>
<receiver a:name="net.robotmedia.billing.BillingReceiver">
<intent-filter>
<action a:name="com.android.vending.billing.IN_APP_NOTIFY"/>
<action a:name="com.android.vending.billing.RESPONSE_CODE"/>
<action a:name="com.android.vending.billing.PURCHASE_STATE_CHANGED"/>
</intent-filter>
</receiver>
</application>
</manifest>

359
pom.xml
View File

@ -6,207 +6,45 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.solovyev.android</groupId> <groupId>org.solovyev.android</groupId>
<artifactId>calculatorpp</artifactId> <artifactId>calculatorpp-parent</artifactId>
<packaging>apk</packaging> <packaging>pom</packaging>
<version>1.1.4</version> <version>1.1.4</version>
<modules> <modules>
<module>../android_common</module> <module>../android_common</module>
<module>android-calculator-app</module>
</modules> </modules>
<properties> <dependencyManagement>
<additionalLibs>${basedir}/src/misc/lib</additionalLibs> <dependencies>
</properties> <dependency>
<groupId>junit</groupId>
<repositories> <artifactId>junit</artifactId>
<repository> <version>4.8.1</version>
<id>congrace.de</id> </dependency>
<name>releases</name> <dependency>
<url>http://nexus.congrace.de/nexus/content/repositories/releases/</url> <groupId>com.google.android</groupId>
<layout>default</layout> <artifactId>android</artifactId>
</repository> <version>2.3.3</version>
</repositories> <scope>provided</scope>
</dependency>
<dependencies> <dependency>
<groupId>com.google.android</groupId>
<dependency> <artifactId>android-test</artifactId>
<groupId>com.google.android</groupId> <version>2.3.1</version>
<artifactId>android</artifactId> </dependency>
<version>2.3.1</version> </dependencies>
</dependency> </dependencyManagement>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.solovyev</groupId>
<artifactId>common</artifactId>
<version>0.3</version>
</dependency>
<dependency>
<groupId>org.solovyev.android</groupId>
<artifactId>common</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>org.solovyev</groupId>
<artifactId>jscl</artifactId>
<version>0.0.1</version>
<exclusions>
<exclusion>
<artifactId>xercesImpl</artifactId>
<groupId>xerces</groupId>
</exclusion>
</exclusions>
<!-- <scope>system</scope>
<systemPath>${additionalLibs}/jscl.jar</systemPath>-->
</dependency>
<dependency>
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.simpleframework</groupId>
<artifactId>simple-xml</artifactId>
<version>2.6.1</version>
<exclusions>
<exclusion>
<artifactId>stax-api</artifactId>
<groupId>stax</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>achartengine</groupId>
<artifactId>achartengine</artifactId>
<version>0.7.0</version>
<scope>system</scope>
<systemPath>${additionalLibs}/achartengine-0.7.0.jar</systemPath>
</dependency>
<dependency>
<groupId>admob</groupId>
<artifactId>admob</artifactId>
<version>4.3.1</version>
<scope>system</scope>
<systemPath>${additionalLibs}/GoogleAdMobAdsSdk-4.3.1.jar</systemPath>
</dependency>
<dependency>
<groupId>org.solovyev.android</groupId>
<artifactId>billing</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>com.intellij</groupId>
<artifactId>annotations</artifactId>
<version>7.0.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
</dependency>
</dependencies>
<build> <build>
<!-- specifying the resources: e.g. layout.xml, strings.xml etc-->
<resources>
<!-- a pair definition for resource filtering of xml files only (not binary files since they get mangled -->
<resource>
<directory>${project.basedir}/res</directory>
<filtering>true</filtering>
<targetPath>${project.build.directory}/filtered-res</targetPath>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>${project.basedir}/res</directory>
<filtering>false</filtering>
<targetPath>${project.build.directory}/filtered-res</targetPath>
<excludes>
<exclude>**/*.xml</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<resourceDirectory>${project.build.directory}/filtered-res</resourceDirectory>
<manifest>
<debuggable>true</debuggable>
</manifest>
</configuration>
<executions>
<execution>
<id>manifestUpdate</id>
<phase>process-resources</phase>
<goals>
<goal>manifest-update</goal>
</goals>
</execution>
<execution>
<id>alignApk</id>
<phase>package</phase>
<goals>
<goal>zipalign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${basedir}/src/misc/env/jarsigner.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement> <pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-jarsigner-plugin</artifactId> <artifactId>maven-jarsigner-plugin</artifactId>
<version>1.2</version> <version>1.2</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version> <version>2.4.3</version>
@ -220,36 +58,48 @@
<artifactId>android-maven-plugin</artifactId> <artifactId>android-maven-plugin</artifactId>
<version>3.1.1</version> <version>3.1.1</version>
<configuration> <configuration>
<sourceDirectories>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
</sourceDirectories>
<sdk> <sdk>
<platform>9</platform> <platform>15</platform>
</sdk> </sdk>
<emulator>
<!-- <emulator>
<avd>23</avd> <avd>23</avd>
<wait>10000</wait> <wait>10000</wait>
<!--<options>-no-skin</options>--> &lt;!&ndash;<options>-no-skin</options>&ndash;&gt;
</emulator> </emulator>-->
<zipalign> <zipalign>
<verbose>true</verbose> <verbose>true</verbose>
</zipalign> </zipalign>
<undeployBeforeDeploy>true</undeployBeforeDeploy> <undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>com.pyx4me</groupId> <groupId>com.pyx4me</groupId>
<artifactId>proguard-maven-plugin</artifactId> <artifactId>proguard-maven-plugin</artifactId>
<version>2.0.4</version> <version>2.0.4</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId> <artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version> <version>1.5</version>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
</build> </build>
<profiles> <profiles>
<profile> <profile>
<!-- the standard profile runs the instrumentation tests --> <!-- the standard profile runs the instrumentation tests -->
<id>standard</id> <id>standard</id>
@ -257,30 +107,8 @@
<activeByDefault>true</activeByDefault> <activeByDefault>true</activeByDefault>
</activation> </activation>
</profile> </profile>
<profile>
<id>development</id>
<!-- using this since activeByDefault does not work well with multiple profiles -->
<activation>
<property>
<name>environment</name>
<value>!production</value>
</property>
</activation>
<properties>
<deployment.stage>In Development</deployment.stage>
</properties>
</profile>
<profile>
<id>production</id>
<properties>
<deployment.stage>In Production</deployment.stage>
</properties>
</profile>
<profile> <profile>
<!-- the release profile does sign, proguard, zipalign ... but does not run instrumentation tests -->
<id>release</id> <id>release</id>
<!-- via this activation the profile is automatically used when the release is done with the maven release <!-- via this activation the profile is automatically used when the release is done with the maven release
plugin --> plugin -->
@ -290,108 +118,9 @@
<value>true</value> <value>true</value>
</property> </property>
</activation> </activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<executions>
<execution>
<id>signing</id>
<goals>
<goal>sign</goal>
<goal>verify</goal>
</goals>
<phase>package</phase>
<inherited>true</inherited>
<configuration>
<removeExistingSignatures>true</removeExistingSignatures>
<archiveDirectory/>
<includes>
<include>${project.build.directory}/${project.artifactId}.apk</include>
</includes>
<keystore>${sign.keystore}</keystore>
<alias>${sign.alias}</alias>
<storepass>${sign.storepass}</storepass>
<keypass>${sign.keypass}</keypass>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
<!-- the signed apk then needs to be zipaligned and we activate proguard and we run the manifest
update -->
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<sign>
<debug>false</debug>
</sign>
<zipalign>
<verbose>true</verbose>
<inputApk>${project.build.directory}/${project.artifactId}.apk</inputApk>
<outputApk>${project.build.directory}/${project.artifactId}-signed-aligned.apk
</outputApk>
</zipalign>
<manifest>
<debuggable>false</debuggable>
<versionCodeAutoIncrement>true</versionCodeAutoIncrement>
</manifest>
<proguard>
<skip>false</skip>
</proguard>
</configuration>
<executions>
<execution>
<id>manifestUpdate</id>
<phase>process-resources</phase>
<goals>
<goal>manifest-update</goal>
</goals>
</execution>
<execution>
<id>alignApk</id>
<phase>package</phase>
<goals>
<goal>zipalign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<configuration>
<artifacts>
<artifact>
<file>${project.build.directory}/${project.artifactId}-signed-aligned.apk</file>
<type>apk</type>
<classifier>signed-aligned</classifier>
</artifact>
<artifact>
<file>${project.build.directory}/proguard/mapping.txt</file>
<type>map</type>
<classifier>release</classifier>
</artifact>
</artifacts>
</configuration>
<executions>
<execution>
<id>attach-signed-aligned</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile> </profile>
</profiles> </profiles>
</project> </project>