Skip to content

Commit

Permalink
Add .travis.yml. Implements #417
Browse files Browse the repository at this point in the history
This also changes the version code to be based on commit count in the current branch rather than master. Apparently Travis doesn't fetch the master which caused this to fail.
Since we only publish master builds this should not have any unwanted side effects. Yet we spread the version code to allow inserting version numbers if necessary.
  • Loading branch information
dmfs committed Oct 18, 2017
1 parent 79e9658 commit 18ff286
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: android
sudo: false

android:
components:
- tools
- platform-tools
- build-tools-25.0.3
- android-25
- extra-android-m2repository
- sys-img-armeabi-v7a-android-22

# Emulator Management: Create, Start and Wait
before_script:
- echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
- emulator -avd test -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &

script:
- android list target
- ./gradlew connectedAndroidTest
4 changes: 2 additions & 2 deletions opentasks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'com.android.application'
def gitCommitNo = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', '--count', 'master'
commandLine 'git', 'rev-list', '--count', 'HEAD'
standardOutput = stdout
}
return Integer.parseInt(stdout.toString().trim())
Expand All @@ -17,7 +17,7 @@ android {
applicationId "org.dmfs.tasks"
minSdkVersion MIN_SDK_VERSION.toInteger()
targetSdkVersion TARGET_SDK_VERSION.toInteger()
versionCode gitCommitNo()
versionCode gitCommitNo() * 10 // spread version code to allow inserting versions if necessary
versionName version
}
buildTypes {
Expand Down

0 comments on commit 18ff286

Please sign in to comment.