Skip to content

Commit 7699bbe

Browse files
Add maven setup for espresso
1 parent 9952a75 commit 7699bbe

18 files changed

+439
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.octo.android.sample.espresso.test"
4+
android:versionCode="1"
5+
android:versionName="0.0.1-SNAPSHOT" >
6+
7+
<uses-sdk
8+
android:minSdkVersion="8"
9+
android:targetSdkVersion="17" />
10+
11+
<application>
12+
<uses-library android:name="android.test.runner" />
13+
</application>
14+
15+
<instrumentation
16+
android:name="com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner"
17+
android:targetPackage="com.octo.android.sample" />
18+
19+
</manifest>
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project name="android-sample-ui-tests" default="help">
3+
4+
<!-- The local.properties file is created and updated by the 'android' tool.
5+
It contains the path to the SDK. It should *NOT* be checked into
6+
Version Control Systems. -->
7+
<property file="local.properties" />
8+
9+
<!-- The ant.properties file can be created by you. It is only edited by the
10+
'android' tool to add properties to it.
11+
This is the place to change some Ant specific build properties.
12+
Here are some properties you may want to change/update:
13+
14+
source.dir
15+
The name of the source directory. Default is 'src'.
16+
out.dir
17+
The name of the output directory. Default is 'bin'.
18+
19+
For other overridable properties, look at the beginning of the rules
20+
files in the SDK, at tools/ant/build.xml
21+
22+
Properties related to the SDK location or the project target should
23+
be updated using the 'android' tool with the 'update' action.
24+
25+
This file is an integral part of the build system for your
26+
application and should be checked into Version Control Systems.
27+
28+
-->
29+
<property file="ant.properties" />
30+
31+
<!-- if sdk.dir was not set from one of the property file, then
32+
get it from the ANDROID_HOME env var.
33+
This must be done before we load project.properties since
34+
the proguard config can use sdk.dir -->
35+
<property environment="env" />
36+
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
37+
<isset property="env.ANDROID_HOME" />
38+
</condition>
39+
40+
<!-- The project.properties file is created and updated by the 'android'
41+
tool, as well as ADT.
42+
43+
This contains project specific properties such as project target, and library
44+
dependencies. Lower level build properties are stored in ant.properties
45+
(or in .classpath for Eclipse projects).
46+
47+
This file is an integral part of the build system for your
48+
application and should be checked into Version Control Systems. -->
49+
<loadproperties srcFile="project.properties" />
50+
51+
<!-- quick check on sdk.dir -->
52+
<fail
53+
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
54+
unless="sdk.dir"
55+
/>
56+
57+
<!--
58+
Import per project custom build rules if present at the root of the project.
59+
This is the place to put custom intermediary targets such as:
60+
-pre-build
61+
-pre-compile
62+
-post-compile (This is typically used for code obfuscation.
63+
Compiled code location: ${out.classes.absolute.dir}
64+
If this is not done in place, override ${out.dex.input.absolute.dir})
65+
-post-package
66+
-post-build
67+
-pre-clean
68+
-->
69+
<import file="custom_rules.xml" optional="true" />
70+
71+
<!-- Import the actual build file.
72+
73+
To customize existing targets, there are two options:
74+
- Customize only one target:
75+
- copy/paste the target into this file, *before* the
76+
<import> task.
77+
- customize it to your needs.
78+
- Customize the whole content of build.xml
79+
- copy/paste the content of the rules files (minus the top node)
80+
into this file, replacing the <import> task.
81+
- customize to your needs.
82+
83+
***********************
84+
****** IMPORTANT ******
85+
***********************
86+
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
87+
in order to avoid having your file be overridden by tools such as "android update project"
88+
-->
89+
<!-- version-tag: VERSION_TAG -->
90+
<import file="${sdk.dir}/tools/ant/uibuild.xml" />
91+
92+
</project>
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
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.octo.android</groupId>
8+
<artifactId>android-sample-parent</artifactId>
9+
<version>0.0.1-SNAPSHOT</version>
10+
</parent>
11+
12+
<artifactId>android-sample-espresso-tests</artifactId>
13+
<packaging>apk</packaging>
14+
<name>android-sample-espresso-tests</name>
15+
16+
<properties>
17+
<build-helper-maven-plugin.version>1.8</build-helper-maven-plugin.version>
18+
</properties>
19+
20+
<repositories>
21+
<!--other repositories if any -->
22+
<repository>
23+
<id>project.local</id>
24+
<name>project</name>
25+
<url>file:${project.basedir}/repo</url>
26+
</repository>
27+
</repositories>
28+
29+
<dependencies>
30+
<dependency>
31+
<groupId>android</groupId>
32+
<artifactId>android</artifactId>
33+
</dependency>
34+
<dependency>
35+
<groupId>android.support</groupId>
36+
<artifactId>compatibility-v4</artifactId>
37+
<scope>provided</scope>
38+
</dependency>
39+
<dependency>
40+
<groupId>com.octo.android</groupId>
41+
<artifactId>android-sample</artifactId>
42+
<version>${project.version}</version>
43+
<type>jar</type>
44+
<scope>provided</scope>
45+
</dependency>
46+
<dependency>
47+
<groupId>com.octo.android</groupId>
48+
<artifactId>android-sample</artifactId>
49+
<version>${project.version}</version>
50+
<type>apk</type>
51+
<scope>provided</scope>
52+
</dependency>
53+
54+
<dependency>
55+
<groupId>com.google.android</groupId>
56+
<artifactId>android-espresso</artifactId>
57+
<version>1.0-SNAPSHOT</version>
58+
</dependency>
59+
</dependencies>
60+
61+
<build>
62+
<plugins>
63+
<plugin>
64+
<extensions>true</extensions>
65+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
66+
<artifactId>android-maven-plugin</artifactId>
67+
</plugin>
68+
69+
<plugin>
70+
<artifactId>maven-compiler-plugin</artifactId>
71+
</plugin>
72+
<plugin>
73+
<groupId>org.codehaus.mojo</groupId>
74+
<artifactId>build-helper-maven-plugin</artifactId>
75+
<executions>
76+
<execution>
77+
<id>add-source</id>
78+
<phase>generate-sources</phase>
79+
<goals>
80+
<goal>add-source</goal>
81+
</goals>
82+
<configuration>
83+
<sources>
84+
<source>${project.build.directory}/generated-sources/annotations/</source>
85+
</sources>
86+
</configuration>
87+
</execution>
88+
</executions>
89+
</plugin>
90+
<plugin>
91+
<artifactId>maven-compiler-plugin</artifactId>
92+
<configuration>
93+
<source>${java.version}</source>
94+
<target>${java.version}</target>
95+
</configuration>
96+
</plugin>
97+
<plugin>
98+
<artifactId>maven-pmd-plugin</artifactId>
99+
<configuration>
100+
<skip>true</skip>
101+
</configuration>
102+
</plugin>
103+
</plugins>
104+
</build>
105+
106+
107+
<profiles>
108+
<profile>
109+
<id>emma</id>
110+
<dependencies>
111+
<dependency>
112+
<groupId>emma</groupId>
113+
<artifactId>emma</artifactId>
114+
</dependency>
115+
</dependencies>
116+
<build>
117+
<plugins>
118+
<plugin>
119+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
120+
<artifactId>android-maven-plugin</artifactId>
121+
<configuration>
122+
<test>
123+
<coverage>true</coverage>
124+
<createReport>true</createReport>
125+
</test>
126+
</configuration>
127+
<extensions>true</extensions>
128+
<executions>
129+
<execution>
130+
<id>pull-coverage</id>
131+
<phase>post-integration-test</phase>
132+
<goals>
133+
<goal>pull</goal>
134+
</goals>
135+
<configuration>
136+
<pullSource>/data/data/com.octo.android.sample/files/coverage.ec</pullSource>
137+
<pullDestination>${project.basedir}/../android-sample/target/emma/coverage.ec</pullDestination>
138+
</configuration>
139+
</execution>
140+
</executions>
141+
</plugin>
142+
</plugins>
143+
</build>
144+
</profile>
145+
<profile>
146+
<id>spoon</id>
147+
<build>
148+
<plugins>
149+
<plugin>
150+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
151+
<artifactId>android-maven-plugin</artifactId>
152+
<extensions>true</extensions>
153+
<configuration>
154+
<testSkip>true</testSkip>
155+
</configuration>
156+
</plugin>
157+
158+
<plugin>
159+
<groupId>com.squareup.spoon</groupId>
160+
<artifactId>spoon-maven-plugin</artifactId>
161+
<version>${spoon.version}</version>
162+
<configuration>
163+
<title>Spoon Sample App</title>
164+
<debug>true</debug>
165+
</configuration>
166+
<executions>
167+
<execution>
168+
<phase>integration-test</phase>
169+
<goals>
170+
<goal>run</goal>
171+
</goals>
172+
</execution>
173+
</executions>
174+
</plugin>
175+
</plugins>
176+
</build>
177+
</profile>
178+
<profile>
179+
<id>jacoco</id>
180+
<build>
181+
<plugins>
182+
<plugin>
183+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
184+
<artifactId>android-maven-plugin</artifactId>
185+
<configuration>
186+
<dex>
187+
<!-- Required for EMMA -->
188+
<noLocals>true</noLocals>
189+
</dex>
190+
<test>
191+
<coverage>true</coverage>
192+
<createReport>true</createReport>
193+
</test>
194+
</configuration>
195+
<executions>
196+
<execution>
197+
<id>pull-coverage</id>
198+
<phase>post-integration-test</phase>
199+
<goals>
200+
<goal>pull</goal>
201+
</goals>
202+
<configuration>
203+
<pullSource>/data/data/com.octo.android.sample/files/coverage.ec</pullSource>
204+
<pullDestination>${project.basedir}/../android-sample/target/jacoco-it.exec</pullDestination>
205+
</configuration>
206+
</execution>
207+
</executions>
208+
</plugin>
209+
</plugins>
210+
</build>
211+
</profile>
212+
</profiles>
213+
214+
</project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system edit
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
#
10+
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11+
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12+
13+
# Project target.
14+
target=android-17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
44ad9229c39418a729fe5adfe2511e7b
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2566c88b5eba4fa5c3d8577aefd3306913f38bf5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.google.android</groupId>
6+
<artifactId>android-espresso</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3cd9200bc6ded975ef56948ccbe82ce5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ab2afc662e38c62be46082f94e86fd0b6d3b7a95

0 commit comments

Comments
 (0)