From 536a49dd8e13274db9f25201c84f53f81cf22fc7 Mon Sep 17 00:00:00 2001 From: Tobrun Date: Thu, 15 Mar 2018 13:07:46 +0100 Subject: [android] - remove mips and armeabi as supported ABIs [android] - bump CI image to NDK 17 compatible [core] - remove setting edgeDistance to 0, comparison 'const short' > 32767 is always false [android] - remove throwing in desructor, undefined behaviour [android] - bump dependency versions of project --- Makefile | 6 ++---- circle.yml | 6 +++--- cmake/mason.cmake | 8 +------- platform/android/MapboxGLAndroidSDK/build.gradle | 12 ++++++++---- platform/android/build.gradle | 2 +- platform/android/config.cmake | 2 +- platform/android/gradle/dependencies.gradle | 22 ++++++++++------------ .../gradle/wrapper/gradle-wrapper.properties | 3 ++- platform/android/src/bitmap.cpp | 3 ++- platform/android/src/run_loop.cpp | 6 ++++-- src/mbgl/util/http_header.cpp | 1 + 11 files changed, 35 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index 576312cabf..8cb649c7d0 100644 --- a/Makefile +++ b/Makefile @@ -473,12 +473,10 @@ test-node-recycle-map: node #### Android targets ########################################################### -MBGL_ANDROID_ABIS = arm-v5;armeabi -MBGL_ANDROID_ABIS += arm-v7;armeabi-v7a +MBGL_ANDROID_ABIS = arm-v7;armeabi-v7a MBGL_ANDROID_ABIS += arm-v8;arm64-v8a MBGL_ANDROID_ABIS += x86;x86 MBGL_ANDROID_ABIS += x86-64;x86_64 -MBGL_ANDROID_ABIS += mips;mips MBGL_ANDROID_LOCAL_WORK_DIR = /data/local/tmp/core-tests MBGL_ANDROID_LIBDIR = lib$(if $(filter arm-v8 x86-64,$1),64) @@ -619,7 +617,7 @@ run-android-unit-test-%: platform/android/gradle/configuration.gradle # Builds a release package of the Android SDK .PHONY: apackage apackage: platform/android/gradle/configuration.gradle - make android-lib-arm-v5 && make android-lib-arm-v7 && make android-lib-arm-v8 && make android-lib-x86 && make android-lib-x86-64 && make android-lib-mips + make android-lib-arm-v7 && make android-lib-arm-v8 && make android-lib-x86 && make android-lib-x86-64 cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=all assemble$(BUILDTYPE) # Build test app instrumentation tests apk and test app apk for all abi's diff --git a/circle.yml b/circle.yml index d2232e9106..53cc6e9c7b 100644 --- a/circle.yml +++ b/circle.yml @@ -305,7 +305,7 @@ jobs: # ------------------------------------------------------------------------------ android-debug-arm-v7: docker: - - image: mbgl/7d2403f42e:android-ndk-r16b + - image: mbgl/feb0443038:android-ndk-r17 resource_class: large working_directory: /src environment: @@ -358,7 +358,7 @@ jobs: gcloud firebase test android run --type instrumentation \ --app platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk/debug/MapboxGLAndroidSDKTestApp-debug.apk \ --test platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk/androidTest/debug/MapboxGLAndroidSDKTestApp-debug-androidTest.apk \ - --device-ids sailfish --os-version-ids 26 --locales en --orientations portrait --timeout 20m + --device-ids sailfish --os-version-ids 26 --locales en --orientations portrait --timeout 20m - store_artifacts: path: platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk/debug destination: . @@ -378,7 +378,7 @@ jobs: # ------------------------------------------------------------------------------ android-release-all: docker: - - image: mbgl/7d2403f42e:android-ndk-r16b + - image: mbgl/feb0443038:android-ndk-r17 resource_class: large working_directory: /src environment: diff --git a/cmake/mason.cmake b/cmake/mason.cmake index bc31feeb5f..6116067080 100644 --- a/cmake/mason.cmake +++ b/cmake/mason.cmake @@ -23,9 +23,7 @@ function(mason_detect_platform) if(NOT MASON_PLATFORM_VERSION) # Android Studio only passes ANDROID_ABI, but we need to adjust that to the Mason if(MASON_PLATFORM STREQUAL "android" AND NOT MASON_PLATFORM_VERSION) - if (ANDROID_ABI STREQUAL "armeabi") - set(MASON_PLATFORM_VERSION "arm-v5-9" PARENT_SCOPE) - elseif (ANDROID_ABI STREQUAL "armeabi-v7a") + if (ANDROID_ABI STREQUAL "armeabi-v7a") set(MASON_PLATFORM_VERSION "arm-v7-9" PARENT_SCOPE) elseif (ANDROID_ABI STREQUAL "arm64-v8a") set(MASON_PLATFORM_VERSION "arm-v8-21" PARENT_SCOPE) @@ -33,10 +31,6 @@ function(mason_detect_platform) set(MASON_PLATFORM_VERSION "x86-9" PARENT_SCOPE) elseif (ANDROID_ABI STREQUAL "x86_64") set(MASON_PLATFORM_VERSION "x86-64-21" PARENT_SCOPE) - elseif (ANDROID_ABI STREQUAL "mips") - set(MASON_PLATFORM_VERSION "mips-9" PARENT_SCOPE) - elseif (ANDROID_ABI STREQUAL "mips64") - set(MASON_PLATFORM_VERSION "mips-64-9" PARENT_SCOPE) else() message(FATAL_ERROR "Unknown ANDROID_ABI '${ANDROID_ABI}'.") endif() diff --git a/platform/android/MapboxGLAndroidSDK/build.gradle b/platform/android/MapboxGLAndroidSDK/build.gradle index c43bc9112b..21ed25e2c2 100644 --- a/platform/android/MapboxGLAndroidSDK/build.gradle +++ b/platform/android/MapboxGLAndroidSDK/build.gradle @@ -1,9 +1,13 @@ apply plugin: 'com.android.library' dependencies { - api dependenciesList.mapboxAndroidTelemetry + api (dependenciesList.mapboxAndroidTelemetry) { + exclude group: 'com.android.support', module: 'appcompat-v7' + } api dependenciesList.mapboxJavaGeoJSON - api dependenciesList.mapboxAndroidGestures + api (dependenciesList.mapboxAndroidGestures) { + exclude group: 'com.android.support', module: 'appcompat-v7' + } implementation dependenciesList.supportAnnotations implementation dependenciesList.supportFragmentV4 implementation dependenciesList.timber @@ -87,7 +91,7 @@ android { if (abi != 'all') { abiFilters abi.split(' ') } else { - abiFilters "armeabi", "armeabi-v7a", "mips", "x86", "arm64-v8a", "x86_64" + abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } } } @@ -111,7 +115,7 @@ android { } lintOptions { - disable 'MissingTranslation', 'TypographyQuotes', 'ObsoleteLintCustomCheck', 'MissingPermission' + disable 'MissingTranslation', 'TypographyQuotes', 'ObsoleteLintCustomCheck', 'MissingPermission', 'WrongThreadInterprocedural' checkAllWarnings true warningsAsErrors false } diff --git a/platform/android/build.gradle b/platform/android/build.gradle index 6cd9505447..455a7f8572 100644 --- a/platform/android/build.gradle +++ b/platform/android/build.gradle @@ -5,7 +5,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:3.1.2' } } diff --git a/platform/android/config.cmake b/platform/android/config.cmake index 77074dc82c..c25e48de05 100644 --- a/platform/android/config.cmake +++ b/platform/android/config.cmake @@ -10,7 +10,7 @@ set(CMAKE_C_ARCHIVE_APPEND " ruT ") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections") -if ((ANDROID_ABI STREQUAL "armeabi") OR (ANDROID_ABI STREQUAL "armeabi-v7a") OR (ANDROID_ABI STREQUAL "arm64-v8a") OR +if ((ANDROID_ABI STREQUAL "armeabi-v7a") OR (ANDROID_ABI STREQUAL "arm64-v8a") OR (ANDROID_ABI STREQUAL "x86") OR (ANDROID_ABI STREQUAL "x86_64")) # Use Identical Code Folding on platforms that support the gold linker. set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=gold -Wl,--icf=safe ${CMAKE_EXE_LINKER_FLAGS}") diff --git a/platform/android/gradle/dependencies.gradle b/platform/android/gradle/dependencies.gradle index d50f6cef08..8886b2657e 100644 --- a/platform/android/gradle/dependencies.gradle +++ b/platform/android/gradle/dependencies.gradle @@ -2,24 +2,23 @@ ext { androidVersions = [ minSdkVersion : 14, - targetSdkVersion : 25, - compileSdkVersion: 25, - buildToolsVersion: '26.0.3' + targetSdkVersion : 27, + compileSdkVersion: 27, + buildToolsVersion: '27.0.3' ] versions = [ mapboxServices : '3.1.0', mapboxTelemetry: '3.1.0', mapboxGestures : '0.2.0', - supportLib : '25.4.0', - espresso : '3.0.1', - testRunner : '1.0.1', - leakCanary : '1.5.1', - lost : '3.0.4', + supportLib : '27.1.1', + espresso : '3.0.2', + testRunner : '1.0.2', + leakCanary : '1.5.4', junit : '4.12', - mockito : '2.10.0', - robolectric : '3.5.1', - timber : '4.5.1', + mockito : '2.18.3', + robolectric : '3.8', + timber : '4.7.0', okhttp : '3.10.0' ] @@ -48,7 +47,6 @@ ext { supportDesign : "com.android.support:design:${versions.supportLib}", supportRecyclerView : "com.android.support:recyclerview-v7:${versions.supportLib}", - lost : "com.mapzen.android:lost:${versions.lost}", gmsLocation : 'com.google.android.gms:play-services-location:11.0.4', timber : "com.jakewharton.timber:timber:${versions.timber}", okhttp3 : "com.squareup.okhttp3:okhttp:${versions.okhttp}", diff --git a/platform/android/gradle/wrapper/gradle-wrapper.properties b/platform/android/gradle/wrapper/gradle-wrapper.properties index bf1b63c346..84af82d181 100644 --- a/platform/android/gradle/wrapper/gradle-wrapper.properties +++ b/platform/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Mon May 14 12:12:39 CEST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip diff --git a/platform/android/src/bitmap.cpp b/platform/android/src/bitmap.cpp index 46e7253050..0d3670b666 100644 --- a/platform/android/src/bitmap.cpp +++ b/platform/android/src/bitmap.cpp @@ -1,6 +1,7 @@ #include "bitmap.hpp" #include +#include namespace mbgl { namespace android { @@ -17,7 +18,7 @@ public: ~PixelGuard() { const int result = AndroidBitmap_unlockPixels(&env, jni::Unwrap(*bitmap)); if (result != ANDROID_BITMAP_RESULT_SUCCESS) { - throw std::runtime_error("bitmap decoding: could not unlock pixels"); + Log::Warning(mbgl::Event::General, "Bitmap decoding: could not unlock pixels"); } } diff --git a/platform/android/src/run_loop.cpp b/platform/android/src/run_loop.cpp index 34366d836a..f655f13ea8 100644 --- a/platform/android/src/run_loop.cpp +++ b/platform/android/src/run_loop.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include @@ -17,6 +18,7 @@ #include #include +#include #define PIPE_OUT 0 #define PIPE_IN 1 @@ -119,11 +121,11 @@ RunLoop::Impl::~Impl() { alarm.reset(); if (ALooper_removeFd(loop, fds[PIPE_OUT]) != 1) { - throw std::runtime_error("Failed to remove file descriptor from Looper."); + Log::Error(mbgl::Event::General, "Failed to remove file descriptor from Looper"); } if (close(fds[PIPE_IN]) || close(fds[PIPE_OUT])) { - throw std::runtime_error("Failed to close file descriptor."); + Log::Error(mbgl::Event::General, "Failed to close file descriptor."); } ALooper_release(loop); diff --git a/src/mbgl/util/http_header.cpp b/src/mbgl/util/http_header.cpp index 5921edfb14..8048dfe84a 100644 --- a/src/mbgl/util/http_header.cpp +++ b/src/mbgl/util/http_header.cpp @@ -8,6 +8,7 @@ #pragma GCC diagnostic ignored "-Wshadow" #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wshorten-64-to-32" +#pragma clang diagnostic ignored "-Wtautological-constant-compare" #include #include #include -- cgit v1.2.1