[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
This commit is contained in:
Tobrun
2018-03-15 13:07:46 +01:00
committed by Tobrun
parent cce72e2d36
commit 60505b0317
11 changed files with 34 additions and 35 deletions

View File

@@ -480,12 +480,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)
@@ -626,7 +624,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

View File

@@ -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:
@@ -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:

View File

@@ -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()

View File

@@ -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
}

View File

@@ -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'
}
}

View File

@@ -10,7 +10,7 @@ set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> ruT <TARGET> <LINK_FLAGS> <OBJECTS>")
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}")

View File

@@ -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.1',
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}",

View File

@@ -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

View File

@@ -1,6 +1,7 @@
#include "bitmap.hpp"
#include <android/bitmap.h>
#include <mbgl/util/logging.hpp>
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");
}
}

View File

@@ -5,6 +5,7 @@
#include <mbgl/util/thread.hpp>
#include <mbgl/util/timer.hpp>
#include <mbgl/actor/scheduler.hpp>
#include <mbgl/util/event.hpp>
#include <android/looper.h>
@@ -17,6 +18,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <mbgl/util/logging.hpp>
#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);

View File

@@ -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 <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>