Skip to content

Commit 3529375

Browse files
committed
Created parent module for android examples.
1 parent c1f1034 commit 3529375

File tree

16 files changed

+114
-50
lines changed

16 files changed

+114
-50
lines changed

examples/android-test/README.md

-27
This file was deleted.

examples/android-test/project.properties

-3
This file was deleted.

examples/android/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
To *build* all android example modules with maven:
2+
3+
`mvn package -pl examples/android -am -amd -P android,android-examples`
4+
5+
To *clean* all android example modules with maven:
6+
7+
`mvn clean -pl examples/android -P android,android-examples`
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
This maven module contains an Android project with integration tests for cucumber-android.
2+
It uses the [maven-android-plugin](https://code.google.com/p/maven-android-plugin).
3+
4+
To execute the tests you need the [Android SDK](https://developer.android.com/sdk/index.html) and a running
5+
[emulator](http://developer.android.com/tools/devices/emulator.html) or an attached physcial device. Please
6+
consider `AndroidManifest.xml` for min- and target-sdk versions.
7+
8+
**Using maven (recommended only for cucumber developers):**
9+
10+
`mvn install -pl examples/android/android-test -am -P android,android-examples`
11+
12+
**Using [adb](https://developer.android.com/tools/testing/testing_otheride.html#AMSyntax) on the commandline:**
13+
14+
`mvn package -pl examples/android/android-test -am -P android,android-examples`
15+
16+
`adb install -r examples/android/android-test/target/cucumber-android-test-*.apk`
17+
18+
`adb shell am instrument -w -r cucumber.android.test/cucumber.api.android.CucumberInstrumentation`
19+
20+
**Using ant (recommended for users of cucumber):**
21+
22+
Please read ["Testing from Other IDEs"](https://developer.android.com/tools/testing/testing_otheride.html).
23+
24+
`TODO: provide standard ant buildfile and custom script for dependency downloading`
25+
26+
**Using an IDE:**
27+
28+
[Set up your IDE](https://developer.android.com/sdk/installing/index.html) and import this directory as a
29+
new Android test-project. You will also need to create a new run-configuration with `CucumberInstrumentation`.
30+
Please also refer to ["Testing from Eclipse with ADT"](https://developer.android.com/tools/testing/testing_eclipse.html).

examples/android/android-test/pom.xml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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>info.cukes.android-examples</groupId>
8+
<artifactId>android-examples</artifactId>
9+
<relativePath>../pom.xml</relativePath>
10+
<version>1.1.5-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>cucumber-android-test</artifactId>
14+
<packaging>apk</packaging>
15+
<name>Examples: Android-Test</name>
16+
17+
<!--<dependencies>-->
18+
<!--<dependency>-->
19+
<!--<groupId>com.google.android</groupId>-->
20+
<!--<artifactId>android</artifactId>-->
21+
<!--<scope>provided</scope>-->
22+
<!--</dependency>-->
23+
<!--<dependency>-->
24+
<!--<groupId>com.google.android</groupId>-->
25+
<!--<artifactId>android-test</artifactId>-->
26+
<!--<scope>provided</scope>-->
27+
<!--</dependency>-->
28+
<!--<dependency>-->
29+
<!--<groupId>info.cukes</groupId>-->
30+
<!--<artifactId>cucumber-android</artifactId>-->
31+
<!--<version>${project.version}</version>-->
32+
<!--<type>apklib</type>-->
33+
<!--</dependency>-->
34+
<!--<dependency>-->
35+
<!--<groupId>info.cukes</groupId>-->
36+
<!--<artifactId>cucumber-core</artifactId>-->
37+
<!--</dependency>-->
38+
<!--<dependency>-->
39+
<!--<groupId>info.cukes</groupId>-->
40+
<!--<artifactId>cucumber-java</artifactId>-->
41+
<!--</dependency>-->
42+
<!--</dependencies>-->
43+
44+
<build>
45+
<sourceDirectory>src</sourceDirectory>
46+
<plugins>
47+
<plugin>
48+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
49+
<artifactId>android-maven-plugin</artifactId>
50+
<extensions>true</extensions>
51+
</plugin>
52+
</plugins>
53+
</build>
54+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
target=android-8
2+
android.library=false
3+
android.library.reference.1=../../../android

examples/android-test/pom.xml renamed to examples/android/pom.xml

+18-18
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@
1010
<version>1.1.5-SNAPSHOT</version>
1111
</parent>
1212

13-
<artifactId>cucumber-android-test</artifactId>
14-
<packaging>apk</packaging>
15-
<name>Examples: Android-Test</name>
13+
<groupId>info.cukes.android-examples</groupId>
14+
<artifactId>android-examples</artifactId>
15+
<version>1.1.5-SNAPSHOT</version>
16+
<packaging>pom</packaging>
17+
<name>Examples: Android</name>
18+
19+
<modules>
20+
<module>android-test</module>
21+
</modules>
1622

1723
<properties>
1824
<android.device>emulator</android.device>
25+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1926
</properties>
2027

2128
<dependencies>
@@ -46,29 +53,22 @@
4653
</dependencies>
4754

4855
<build>
49-
<sourceDirectory>src</sourceDirectory>
5056
<pluginManagement>
5157
<plugins>
5258
<plugin>
5359
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
5460
<artifactId>android-maven-plugin</artifactId>
5561
<version>${android-maven-plugin.version}</version>
56-
<extensions>true</extensions>
62+
<configuration>
63+
<sdk>
64+
<!-- api level 8 = platform 2.2.1 -->
65+
<platform>8</platform>
66+
</sdk>
67+
<undeployBeforeDeploy>true</undeployBeforeDeploy>
68+
</configuration>
5769
</plugin>
5870
</plugins>
5971
</pluginManagement>
60-
<plugins>
61-
<plugin>
62-
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
63-
<artifactId>android-maven-plugin</artifactId>
64-
<configuration>
65-
<sdk>
66-
<!-- api level 8 = platform 2.2.1 -->
67-
<platform>8</platform>
68-
</sdk>
69-
<undeployBeforeDeploy>true</undeployBeforeDeploy>
70-
</configuration>
71-
</plugin>
72-
</plugins>
7372
</build>
73+
7474
</project>

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
</dependency>
162162
<dependency>
163163
<groupId>info.cukes</groupId>
164-
<artifactId>cucumber-android-test</artifactId>
164+
<artifactId>android-examples</artifactId>
165165
<version>${project.version}</version>
166166
</dependency>
167167

@@ -473,7 +473,7 @@
473473
<profile>
474474
<id>android-examples</id>
475475
<modules>
476-
<module>examples/android-test</module>
476+
<module>examples/android</module>
477477
</modules>
478478
</profile>
479479

0 commit comments

Comments
 (0)