Skip to content

Commit 3f29736

Browse files
author
Dirk Jaeckel
committedSep 21, 2011
archetype
0 parents  commit 3f29736

File tree

19 files changed

+599
-0
lines changed

19 files changed

+599
-0
lines changed
 

‎application-it/AndroidManifest.xml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.jaeckel.amdroid.test" android:versionCode="1" android:versionName="1.0-SNAPSHOT">
4+
5+
<application android:icon="@drawable/icon" android:label="@string/app_name">
6+
<uses-library android:name="android.test.runner" />
7+
</application>
8+
9+
<instrumentation android:targetPackage="com.jaeckel.amdroid"
10+
android:name="android.test.InstrumentationTestRunner" />
11+
12+
</manifest>
13+

‎application-it/pom.xml

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>com.jaeckel</groupId>
8+
<artifactId>amdroid-parent</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
</parent>
11+
12+
<groupId>com.jaeckel</groupId>
13+
<artifactId>amdroid-it</artifactId>
14+
<version>1.0-SNAPSHOT</version>
15+
<packaging>apk</packaging>
16+
<name>amdroid - Integration tests</name>
17+
18+
<properties>
19+
<!--
20+
When not running a release, we are deploying the plain artifact (so no classifier)
21+
This is overridden during the release.
22+
-->
23+
<zipaligned-classifier></zipaligned-classifier>
24+
</properties>
25+
26+
<dependencies>
27+
<dependency>
28+
<groupId>com.google.android</groupId>
29+
<artifactId>android</artifactId>
30+
</dependency>
31+
<dependency>
32+
<groupId>com.google.android</groupId>
33+
<artifactId>android-test</artifactId>
34+
</dependency>
35+
<dependency>
36+
<groupId>com.jaeckel</groupId>
37+
<artifactId>amdroid</artifactId>
38+
<type>apk</type>
39+
<version>1.0-SNAPSHOT</version>
40+
<classifier>${zipaligned-classifier}</classifier> <!-- classifier set according to the ran profile -->
41+
</dependency>
42+
<dependency>
43+
<groupId>com.jaeckel</groupId>
44+
<artifactId>amdroid</artifactId>
45+
<type>jar</type>
46+
<version>1.0-SNAPSHOT</version>
47+
</dependency>
48+
</dependencies>
49+
50+
<build>
51+
<plugins>
52+
<plugin>
53+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
54+
<artifactId>maven-android-plugin</artifactId>
55+
<extensions>true</extensions>
56+
</plugin>
57+
</plugins>
58+
</build>
59+
60+
<profiles>
61+
<profile>
62+
<id>release</id>
63+
<properties>
64+
<!--
65+
When running a release, we must deployed the final artifact (signed and zipaligned).
66+
-->
67+
<zipaligned-classifier>aligned</zipaligned-classifier>
68+
</properties>
69+
<build>
70+
<plugins>
71+
<plugin>
72+
<artifactId>maven-jarsigner-plugin</artifactId>
73+
<executions>
74+
<execution>
75+
<id>sign-application-it-apk</id>
76+
<phase>package</phase>
77+
<goals>
78+
<goal>sign</goal>
79+
</goals>
80+
</execution>
81+
</executions>
82+
</plugin>
83+
<plugin>
84+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
85+
<artifactId>maven-android-plugin</artifactId>
86+
<configuration>
87+
<sign>
88+
<debug>false</debug>
89+
</sign>
90+
</configuration>
91+
</plugin>
92+
</plugins>
93+
</build>
94+
</profile>
95+
</profiles>
96+
97+
</project>
4.05 KB
Loading
1.68 KB
Loading
2.51 KB
Loading

‎application-it/res/layout/main.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:orientation="vertical"
4+
android:layout_width="fill_parent"
5+
android:layout_height="fill_parent"
6+
>
7+
<TextView
8+
android:layout_width="fill_parent"
9+
android:layout_height="wrap_content"
10+
android:text="@string/hello"
11+
/>
12+
</LinearLayout>

‎application-it/res/values/strings.xml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="hello">Hello amdroid!</string>
4+
<string name="app_name">amdroid - tests</string>
5+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.jaeckel.amdroid.test;
2+
3+
import android.test.ActivityInstrumentationTestCase2;
4+
import com.jaeckel.amdroid.*;
5+
6+
public class HelloAndroidActivityTest extends ActivityInstrumentationTestCase2<HelloAndroidActivity> {
7+
8+
public HelloAndroidActivityTest() {
9+
super(HelloAndroidActivity.class);
10+
}
11+
12+
public void testActivity() {
13+
HelloAndroidActivity activity = getActivity();
14+
assertNotNull(activity);
15+
}
16+
}
17+

‎application/AndroidManifest.xml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.jaeckel.amdroid" android:versionCode="1" android:versionName="1.0-SNAPSHOT">
4+
5+
<application android:icon="@drawable/icon" android:label="@string/app_name">
6+
<activity android:name=".HelloAndroidActivity">
7+
<intent-filter>
8+
<action android:name="android.intent.action.MAIN" />
9+
<category android:name="android.intent.category.LAUNCHER" />
10+
</intent-filter>
11+
</activity>
12+
</application>
13+
14+
</manifest>
15+

‎application/pom.xml

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>com.jaeckel</groupId>
8+
<artifactId>amdroid-parent</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
</parent>
11+
12+
<groupId>com.jaeckel</groupId>
13+
<artifactId>amdroid</artifactId>
14+
<version>1.0-SNAPSHOT</version>
15+
<packaging>apk</packaging>
16+
<name>amdroid - Application</name>
17+
18+
<dependencies>
19+
<dependency>
20+
<groupId>com.google.android</groupId>
21+
<artifactId>android</artifactId>
22+
</dependency>
23+
</dependencies>
24+
25+
<build>
26+
<plugins>
27+
<plugin>
28+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
29+
<artifactId>maven-android-plugin</artifactId>
30+
<extensions>true</extensions>
31+
</plugin>
32+
</plugins>
33+
</build>
34+
35+
<profiles>
36+
<profile>
37+
<id>release</id>
38+
<build>
39+
<plugins>
40+
<plugin>
41+
<groupId>com.pyx4me</groupId>
42+
<artifactId>proguard-maven-plugin</artifactId>
43+
<executions>
44+
<execution>
45+
<id>process-classes-with-proguard</id>
46+
<phase>process-classes</phase>
47+
<goals>
48+
<goal>proguard</goal>
49+
</goals>
50+
<configuration>
51+
<proguardVersion>4.4</proguardVersion>
52+
<maxMemory>256m</maxMemory>
53+
<injar>android-classes</injar>
54+
<libs>
55+
<lib>${rt.jar.path}</lib>
56+
<lib>${jsse.jar.path}</lib>
57+
</libs>
58+
<obfuscate>true</obfuscate>
59+
<addMavenDescriptor>false</addMavenDescriptor>
60+
<proguardInclude>${project.basedir}/proguard.conf</proguardInclude>
61+
</configuration>
62+
</execution>
63+
</executions>
64+
<dependencies>
65+
<dependency>
66+
<groupId>net.sf.proguard</groupId>
67+
<artifactId>proguard</artifactId>
68+
<version>4.4</version>
69+
<scope>runtime</scope>
70+
</dependency>
71+
</dependencies>
72+
</plugin>
73+
<plugin>
74+
<artifactId>maven-jarsigner-plugin</artifactId>
75+
<executions>
76+
<execution>
77+
<id>sign-application-apk</id>
78+
<phase>package</phase>
79+
<goals>
80+
<goal>sign</goal>
81+
<goal>verify</goal>
82+
</goals>
83+
</execution>
84+
</executions>
85+
</plugin>
86+
<plugin>
87+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
88+
<artifactId>maven-android-plugin</artifactId>
89+
<executions>
90+
<execution>
91+
<id>zipalign-application-apk</id>
92+
<phase>package</phase>
93+
<goals>
94+
<goal>zipalign</goal>
95+
</goals>
96+
</execution>
97+
</executions>
98+
<configuration>
99+
<zipalign>
100+
<verbose>true</verbose>
101+
<inputApk>${project.build.directory}/${project.artifactId}-${project.version}.apk</inputApk>
102+
<outputApk>${project.build.directory}/${project.artifactId}-${project.version}-signed-aligned.apk</outputApk>
103+
</zipalign>
104+
<sign>
105+
<debug>false</debug>
106+
</sign>
107+
</configuration>
108+
</plugin>
109+
<plugin>
110+
<groupId>org.codehaus.mojo</groupId>
111+
<artifactId>build-helper-maven-plugin</artifactId>
112+
<configuration>
113+
<artifacts>
114+
<artifact>
115+
<file>${project.build.directory}/proguard_map.txt</file>
116+
<type>map</type>
117+
<classifier>release</classifier>
118+
</artifact>
119+
</artifacts>
120+
</configuration>
121+
<executions>
122+
<execution>
123+
<id>attach-signed-aligned</id>
124+
<phase>package</phase>
125+
<goals>
126+
<goal>attach-artifact</goal>
127+
</goals>
128+
</execution>
129+
</executions>
130+
</plugin>
131+
</plugins>
132+
</build>
133+
</profile>
134+
</profiles>
135+
136+
</project>

‎application/proguard.conf

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Configuration for ProGuard
2+
# From http://proguard.sourceforge.net/index.html#/manual/examples.html#androidapplication
3+
4+
-dontpreverify
5+
-repackageclasses ''
6+
-optimizations !code/simplification/arithmetic
7+
-keepattributes *Annotation*
8+
9+
-keep public class * extends android.app.Activity
10+
-keep public class * extends android.app.Application
11+
-keep public class * extends android.app.Service
12+
-keep public class * extends android.content.BroadcastReceiver
13+
-keep public class * extends android.content.ContentProvider
14+
15+
-keep public class * extends android.view.View {
16+
public <init>(android.content.Context);
17+
public <init>(android.content.Context, android.util.AttributeSet);
18+
public <init>(android.content.Context, android.util.AttributeSet, int);
19+
public void set*(...);
20+
}
21+
22+
-keepclasseswithmembers class * {
23+
public <init>(android.content.Context, android.util.AttributeSet);
24+
}
25+
26+
-keepclasseswithmembers class * {
27+
public <init>(android.content.Context, android.util.AttributeSet, int);
28+
}
29+
30+
-keepclassmembers class * implements android.os.Parcelable {
31+
static android.os.Parcelable$Creator CREATOR;
32+
}
33+
34+
-keepclassmembers class **.R$* {
35+
public static <fields>;
36+
}
37+
38+
-keep public interface com.android.vending.licensing.ILicensingService
39+
40+
-keepclasseswithmembernames class * {
41+
native <methods>;
42+
}
43+
44+
-keepclassmembers class * extends java.lang.Enum {
45+
public static **[] values();
46+
public static ** valueOf(java.lang.String);
47+
}
48+
49+
# Removes all calls to Log. Delete the methods you want to keep.
50+
-assumenosideeffects class android.util.Log {
51+
public static int v(...);
52+
public static int d(...);
53+
public static int i(...);
54+
public static int w(...);
55+
public static int e(...);
56+
public static int wtf(...);
57+
}
5.95 KB
Loading
2.69 KB
Loading
3.63 KB
Loading

‎application/res/layout/main.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:orientation="vertical"
4+
android:layout_width="fill_parent"
5+
android:layout_height="fill_parent"
6+
>
7+
<TextView
8+
android:layout_width="fill_parent"
9+
android:layout_height="wrap_content"
10+
android:text="@string/hello"
11+
/>
12+
</LinearLayout>

‎application/res/values/strings.xml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="hello">Hello amdroid!</string>
4+
<string name="app_name">amdroid</string>
5+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.jaeckel.amdroid;
2+
3+
import android.app.Activity;
4+
import android.os.Bundle;
5+
import android.util.Log;
6+
7+
public class HelloAndroidActivity extends Activity {
8+
9+
private static String TAG = "amdroid";
10+
11+
/**
12+
* Called when the activity is first created.
13+
* @param savedInstanceState If the activity is being re-initialized after
14+
* previously being shut down then this Bundle contains the data it most
15+
* recently supplied in onSaveInstanceState(Bundle). <b>Note: Otherwise it is null.</b>
16+
*/
17+
@Override
18+
public void onCreate(Bundle savedInstanceState) {
19+
super.onCreate(savedInstanceState);
20+
Log.i(TAG, "onCreate");
21+
setContentView(R.layout.main);
22+
}
23+
24+
}
25+

‎pom.xml

+205
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.jaeckel</groupId>
7+
<artifactId>amdroid-parent</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
<packaging>pom</packaging>
10+
<name>amdroid - Parent</name>
11+
12+
<modules>
13+
<module>application</module>
14+
<module>application-it</module>
15+
</modules>
16+
17+
<dependencyManagement>
18+
<dependencies>
19+
<dependency>
20+
<groupId>com.google.android</groupId>
21+
<artifactId>android</artifactId>
22+
<version>2.2.1</version>
23+
<scope>provided</scope>
24+
</dependency>
25+
<dependency>
26+
<groupId>com.google.android</groupId>
27+
<artifactId>android-test</artifactId>
28+
<version>2.2.1</version>
29+
<scope>provided</scope>
30+
</dependency>
31+
</dependencies>
32+
</dependencyManagement>
33+
34+
<build>
35+
<pluginManagement>
36+
<plugins>
37+
<plugin>
38+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
39+
<artifactId>maven-android-plugin</artifactId>
40+
<version>2.8.3</version>
41+
<inherited>true</inherited>
42+
<configuration>
43+
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
44+
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
45+
<resourceDirectory>${project.basedir}/res</resourceDirectory>
46+
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
47+
<sdk>
48+
<platform>7</platform>
49+
</sdk>
50+
<deleteConflictingFiles>true</deleteConflictingFiles>
51+
<undeployBeforeDeploy>true</undeployBeforeDeploy>
52+
</configuration>
53+
</plugin>
54+
<plugin>
55+
<artifactId>maven-compiler-plugin</artifactId>
56+
<version>2.3.2</version>
57+
<inherited>true</inherited>
58+
<configuration>
59+
<source>1.5</source>
60+
<target>1.5</target>
61+
</configuration>
62+
</plugin>
63+
<plugin>
64+
<artifactId>maven-enforcer-plugin</artifactId>
65+
<version>1.0</version>
66+
</plugin>
67+
<plugin>
68+
<artifactId>maven-release-plugin</artifactId>
69+
<version>2.1</version>
70+
<configuration>
71+
<autoVersionSubmodules>true</autoVersionSubmodules>
72+
</configuration>
73+
</plugin>
74+
<plugin>
75+
<artifactId>maven-jarsigner-plugin</artifactId>
76+
<version>1.2</version>
77+
<inherited>true</inherited>
78+
<configuration>
79+
<removeExistingSignatures>true</removeExistingSignatures>
80+
<archiveDirectory />
81+
<archive>${project.build.directory}/${project.build.finalName}.${project.packaging}</archive>
82+
<verbose>true</verbose>
83+
<certs>true</certs>
84+
<keystore>${sign.keystore}</keystore>
85+
<alias>${sign.alias}</alias>
86+
<storepass>${sign.storepass}</storepass>
87+
<keypass>${sign.keypass}</keypass>
88+
</configuration>
89+
</plugin>
90+
<plugin>
91+
<groupId>com.pyx4me</groupId>
92+
<artifactId>proguard-maven-plugin</artifactId>
93+
<version>2.0.4</version>
94+
<dependencies>
95+
<dependency>
96+
<groupId>net.sf.proguard</groupId>
97+
<artifactId>proguard</artifactId>
98+
<version>4.4</version>
99+
<scope>runtime</scope>
100+
</dependency>
101+
</dependencies>
102+
<configuration>
103+
<proguardVersion>4.4</proguardVersion>
104+
</configuration>
105+
</plugin>
106+
</plugins>
107+
</pluginManagement>
108+
</build>
109+
110+
<profiles>
111+
<profile>
112+
<id>release</id>
113+
<activation>
114+
<property>
115+
<name>performRelease</name>
116+
<value>true</value>
117+
</property>
118+
</activation>
119+
<build>
120+
<plugins>
121+
<plugin>
122+
<artifactId>maven-enforcer-plugin</artifactId>
123+
<executions>
124+
<execution>
125+
<id>enforce-signing-properties</id>
126+
<goals>
127+
<goal>enforce</goal>
128+
</goals>
129+
<configuration>
130+
<rules>
131+
<requireProperty>
132+
<property>sign.keystore</property>
133+
<message>The 'sign.keystore' property is missing. It must contain the path to the keystore used to sign the application.</message>
134+
</requireProperty>
135+
<requireFilesExist>
136+
<files>
137+
<file>${sign.keystore}</file>
138+
</files>
139+
<message>The 'sign.keystore' property does not point to a file. It must contain the path to the keystore used to sign the application.</message>
140+
</requireFilesExist>
141+
<requireProperty>
142+
<property>sign.alias</property>
143+
<message>The 'sign.alias' property is missing. It must contain the key alias used to sign the application.</message>
144+
</requireProperty>
145+
<requireProperty>
146+
<property>sign.storepass</property>
147+
<message>The 'sign.storepass' property is missing. It must contain the password of the keystore used to sign the application.
148+
</message>
149+
</requireProperty>
150+
<requireProperty>
151+
<property>sign.keypass</property>
152+
<message>The 'sign.keypass' property is missing. It must contain the password of the key used to sign the application.</message>
153+
</requireProperty>
154+
</rules>
155+
</configuration>
156+
</execution>
157+
</executions>
158+
</plugin>
159+
</plugins>
160+
</build>
161+
</profile>
162+
<profile>
163+
<id>linux</id>
164+
<activation>
165+
<os>
166+
<family>unix</family>
167+
</os>
168+
</activation>
169+
<properties>
170+
<rt.jar.path>${java.home}/jre/lib/rt.jar</rt.jar.path>
171+
<jsse.jar.path>${java.home}/jre/lib/jsse.jar</jsse.jar.path>
172+
</properties>
173+
</profile>
174+
<!-- mac profile has to be after unix since running on mac will trigger
175+
both -->
176+
<profile>
177+
<id>mac</id>
178+
<activation>
179+
<os>
180+
<family>mac</family>
181+
</os>
182+
</activation>
183+
<properties>
184+
<!-- absolute path -->
185+
<!--<rt.jar.path>/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/classes.jar</rt.jar.path> -->
186+
<!-- or with JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/ -->
187+
<rt.jar.path>${java.home}/../Classes/classes.jar</rt.jar.path>
188+
<jsse.jar.path>${java.home}/../Classes/jsse.jar</jsse.jar.path>
189+
</properties>
190+
</profile>
191+
<profile>
192+
<id>windows</id>
193+
<activation>
194+
<os>
195+
<family>windows</family>
196+
</os>
197+
</activation>
198+
<properties>
199+
<rt.jar.path>${java.home}/jre/lib/rt.jar</rt.jar.path>
200+
<jsse.jar.path>${java.home}/jre/lib/jsse.jar</jsse.jar.path>
201+
</properties>
202+
</profile>
203+
</profiles>
204+
205+
</project>

‎test-key.keystore

1.23 KB
Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.