Skip to content

Commit

Permalink
Migrate to gradle (#9)
Browse files Browse the repository at this point in the history
* -migrate to gradle;
-remove android-studio, cukeulator-test, cucumber-android-test subpojects, #5 fix sample;
-make compatible with cucumber 4.0.0
-#3 fix reported duration time

* Make gradle script executable

* Add gradle build dirs to .gitignore

* Fix caching for gradle

* Add android components for sdk 27

* Run unit tests before starting emulator

* Try some stuff

* Try more

* More trying

* Try louder

* With more tools

* Try this image

* Jak shaving

* Start the engines

* Install more stuff

* Work around

* Downgrade target sdk to 24

* Run build as part of install

* Back to 27

* gradle 4.10

* add clean before build

* run tests with spoon

* enable debug logging in spoon

* specify android.components in .travis.yml

* restore sdkmanager commands

* specify build-tools and android-24 in android.components

* try emulator for sdk 26 (googlemaps/android-maps-utils#371)

* try emulator x86

* try emulator 21 arm

* print error from logcat

* adb logcat

* added sdcard to emulator

* specify emulator skin
  • Loading branch information
lsuski authored and mpkorstanje committed Sep 12, 2018
1 parent 10a0894 commit c99afcc
Show file tree
Hide file tree
Showing 100 changed files with 520 additions and 2,167 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Created by .ignore support plugin (hsz.mobi)
.idea
*.iml
local.properties
.gradle
/cucumber-android/build/

47 changes: 28 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,42 @@ language: android
jdk: oraclejdk8
sudo: false

cache:
directories:
- "$HOME/.m2"

before_cache:
- rm -rf $HOME/.m2/repository/io/cucumber

android:
components:
- tools
- platform-tools
- tools
- build-tools-26.0.0
- android-21
- sys-img-armeabi-v7a-android-21
- build-tools-28.0.2
- android-21

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache

before_install:
- echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a
- emulator -avd test -no-skin -no-audio -no-window &
- yes | sdkmanager tools
- yes | sdkmanager "platform-tools"
- yes | sdkmanager "emulator"
- yes | sdkmanager "build-tools;28.0.2"
- yes | sdkmanager "system-images;android-21;default;armeabi-v7a"
- echo no | avdmanager create avd --force -n test -k "system-images;android-21;default;armeabi-v7a" -c 200M
- $ANDROID_HOME/emulator/emulator -avd test -skin 1920x1080 -no-audio -no-window -no-boot-anim &

install:
- mvn -q install --also-make --projects android,picocontainer -DskipTests=true
-Dmaven.javadoc.skip=true
- ./gradlew clean build

before_script:
- android-wait-for-emulator
- adb shell input keyevent 82
- adb logcat *:e &

script:
- mvn install --activate-profiles android-examples --projects examples/android
--also-make-dependents -Dandroid.device=test
- ./gradlew runInstrumentationTests

deploy:
provider: script
script: ./gradlew publish
on:
branch: master
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## 4.0.0-SNAPSHOT

### Changed
* migrate everything to Gradle

### Removed
* android-studio sample - now [cukeulator](https://github.com/cucumber/cucumber-android/tree/master/cukeulator) is the only valid sample (for Gradle and Android Studio)
* cukeulator-test and cucumber-android-test

### Fixed
* [#5](https://github.com/cucumber/cucumber-android/issues/5) - Sample Does Not Work
* [#4](https://github.com/cucumber/cucumber-android/issues/4) - Support for parallel cukes
* [#3](https://github.com/cucumber/cucumber-android/issues/3) - Reported duration time of scenario is about 0ms on Android
23 changes: 3 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Taken from the [maven-android-plugin](https://code.google.com/p/maven-android-pl
1. JDK 1.6+ installed as required for Android development
2. [Android SDK](http://developer.android.com/sdk/index.html) (r21 or later, latest is best supported) installed, preferably with all platforms.

Integration-tests are in `examples/android/android-test/cucumber-test/`.
Integration-tests are in `cukeulator/src/androidTest`.

### Building

```sh
mvn package -pl android -am
./gradlew assemble
```

### Setting up the dependency
Expand Down Expand Up @@ -66,24 +66,7 @@ Please read [the Android documentation on debugging](https://developer.android.c

### Examples

To *build* all android example modules with maven:

```
mvn package -pl examples/android -am -amd -P android,android-examples
```

To *clean* all android example modules with maven:

```
mvn clean -pl examples/android -amd -P android-examples
```

The example projects depend on the current (unreleased) Cucumber-JVM modules.
If any of the examples fail to build, just build the android module and its dependencies once first:

```
mvn clean install -pl android -am
```
Currently there is one example in subproject [cukeulator](https://github.com/cucumber/cucumber-android/tree/master/cukeulator)

To create a virtual device and start an [Android emulator](https://developer.android.com/tools/devices/index.html):

Expand Down
28 changes: 0 additions & 28 deletions android-studio/Cukeulator/.gitignore

This file was deleted.

73 changes: 0 additions & 73 deletions android-studio/Cukeulator/README.md

This file was deleted.

1 change: 0 additions & 1 deletion android-studio/Cukeulator/app/.gitignore

This file was deleted.

17 changes: 0 additions & 17 deletions android-studio/Cukeulator/app/proguard-rules.pro

This file was deleted.

19 changes: 0 additions & 19 deletions android-studio/Cukeulator/app/src/main/AndroidManifest.xml

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit c99afcc

Please sign in to comment.