From ca1c3127d668202187360f6899e1a612f82ee197 Mon Sep 17 00:00:00 2001 From: "G. Blake Meike" Date: Wed, 20 Mar 2019 16:52:06 -0700 Subject: [PATCH 1/5] Fix Issue #1769: produce version for x86_64 --- android/CouchbaseLite/build.gradle | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/android/CouchbaseLite/build.gradle b/android/CouchbaseLite/build.gradle index 6f61513e4..018e6122f 100644 --- a/android/CouchbaseLite/build.gradle +++ b/android/CouchbaseLite/build.gradle @@ -67,6 +67,14 @@ def getGitHash = { -> return stdout.toString().trim() } +// defining this property in the file ~/.gradle/gradle.properties +// can dramatically reduce your build time. +def buildAbis = null +if (hasProperty("targetAbis")) { + buildAbis = targetAbis.split(',') + println "abis: ${buildAbis}" +} + /** * The android block is where you configure all your Android-specific * build options. @@ -83,7 +91,7 @@ android { project.archivesBaseName = "couchbase-lite-android-${versionName}" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - ndk { abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a' } + if (buildAbis != null) { ndk { abiFilters buildAbis } } externalNativeBuild { cmake { arguments '-DANDROID_STL=c++_static', "-DANDROID_TOOLCHAIN=clang", '-DANDROID_PLATFORM=android-19' From cabf72c43aee1d414a175ef9ecc40ebef44148c0 Mon Sep 17 00:00:00 2001 From: "G. Blake Meike" Date: Thu, 21 Mar 2019 10:52:32 -0700 Subject: [PATCH 2/5] Update Travis to show logcat after failure --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 50a08cf30..00c6153e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,8 +27,11 @@ before_script: - emulator -avd test -no-audio -no-window & - android-wait-for-emulator - adb shell input keyevent 82 & + - adb logcat > logcat.log 2>&1 & script: - touch local.properties - ./gradlew buildCI --console=plain --info after_success: - ./gradlew coverageCI +after_failure: + - cat logcat.log From 55ee4729dccb8bf44d06b46ac375ed9d992d437d Mon Sep 17 00:00:00 2001 From: "G. Blake Meike" Date: Thu, 21 Mar 2019 12:15:59 -0700 Subject: [PATCH 3/5] Update travis to build a single ABI: x86 --- .travis.yml | 5 +++-- android/CouchbaseLite/build.gradle | 9 +++------ java/build.gradle | 6 +++--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 00c6153e5..a5b3bfae4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ android: - android-28 # Android Emulator image: - android-19 - - sys-img-armeabi-v7a-android-19 + - sys-img-x86-android-19 install: - echo y | sdkmanager "ndk-bundle" - echo y | sdkmanager "cmake;3.6.4111459" @@ -30,7 +30,8 @@ before_script: - adb logcat > logcat.log 2>&1 & script: - touch local.properties - - ./gradlew buildCI --console=plain --info + # be sure the targetAbi agrees with the emulator abi + - ./gradlew buildCI -PtargetAbis=x86 --console=plain --info after_success: - ./gradlew coverageCI after_failure: diff --git a/android/CouchbaseLite/build.gradle b/android/CouchbaseLite/build.gradle index 018e6122f..70e0a542a 100644 --- a/android/CouchbaseLite/build.gradle +++ b/android/CouchbaseLite/build.gradle @@ -70,10 +70,7 @@ def getGitHash = { -> // defining this property in the file ~/.gradle/gradle.properties // can dramatically reduce your build time. def buildAbis = null -if (hasProperty("targetAbis")) { - buildAbis = targetAbis.split(',') - println "abis: ${buildAbis}" -} +if (hasProperty("targetAbis")) { buildAbis = targetAbis.split(',') } /** * The android block is where you configure all your Android-specific @@ -459,7 +456,7 @@ coveralls { task smoketest(dependsOn: ['checkstyle', 'lint', 'findbugsHtml', 'pmd', 'testDebugUnitTest']) -task checkLocal(dependsOn: ['checkstyle', 'lint', 'findbugsHtml', 'pmd', 'testDebugUnitTest', 'connectedDebugAndroidTest']) +task checkLocal(dependsOn: ['smoketest', 'connectedDebugAndroidTest']) -task buildCI(dependsOn: ['checkstyle', 'lint', 'findbugsXml', 'pmd', 'check', 'connectedAndroidTest']) +task buildCI(dependsOn: ['checkstyle', 'findbugsXml', 'pmd', 'check', 'connectedAndroidTest']) diff --git a/java/build.gradle b/java/build.gradle index 20cf3aea5..44e83d3ab 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -192,8 +192,8 @@ coveralls { } -task smoketest(dependsOn: ['checkstyle', 'findbugsHtml', 'pmd', 'check', 'test']) +task smoketest(dependsOn: ['checkstyleMain', 'findbugsHtml', 'pmdMain']) -task checkLocal(dependsOn: ['smoketest']) +task checkLocal(dependsOn: ['smoketest', 'test']) -task buildCI(dependsOn: ['checkstyle', 'findbugsXml', 'pmd', 'check', 'test']) +task buildCI(dependsOn: ['checkstyleMain', 'findbugsXml', 'pmdMain', 'test']) From 8f0a5ef0f5b3e5df3d19e4147c50b45a3a02e7f3 Mon Sep 17 00:00:00 2001 From: "G. Blake Meike" Date: Thu, 21 Mar 2019 12:51:24 -0700 Subject: [PATCH 4/5] Force agreement on ABI/API --- .travis.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a5b3bfae4..d9200e3d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,10 @@ language: android jdk: oraclejdk8 sudo: true +env: + global: + - ANDROID_API=android-19 + - ANDROID_ABI=x86 branches: only: - master @@ -14,7 +18,7 @@ android: - android-28 # Android Emulator image: - android-19 - - sys-img-x86-android-19 + - sys-img-${ANDROID_ABI}-${ANDROID_API} install: - echo y | sdkmanager "ndk-bundle" - echo y | sdkmanager "cmake;3.6.4111459" @@ -23,15 +27,14 @@ before_script: # Export NDK HOME: - export ANDROID_NDK_HOME=$ANDROID_HOME/ndk-bundle # Start an emulator: - - echo no | android create avd --force -n test -t android-19 --abi armeabi-v7a + - echo no | android create avd --force -n test -t $ANDROID_API --abi $ANDROID_ABI - emulator -avd test -no-audio -no-window & - android-wait-for-emulator - adb shell input keyevent 82 & - adb logcat > logcat.log 2>&1 & script: - touch local.properties - # be sure the targetAbi agrees with the emulator abi - - ./gradlew buildCI -PtargetAbis=x86 --console=plain --info + - ./gradlew buildCI -PtargetAbis=$ANDROID_ABI --console=plain --info after_success: - ./gradlew coverageCI after_failure: From 1274ee1f5010c6ce6ab1d82efceabfc74394a920 Mon Sep 17 00:00:00 2001 From: "G. Blake Meike" Date: Thu, 21 Mar 2019 13:03:39 -0700 Subject: [PATCH 5/5] Sigh... use an ARM ABI after all --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d9200e3d6..7b48ef3f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ sudo: true env: global: - ANDROID_API=android-19 - - ANDROID_ABI=x86 + - ANDROID_ABI=armeabi-v7a branches: only: - master