Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android, linux] Upgrade to SQLite 3.24.0, compiled to minimize binar…
Browse files Browse the repository at this point in the history
…y size
  • Loading branch information
jfirebaugh committed Aug 10, 2018
1 parent 070f50d commit b500577
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
6 changes: 3 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ step-library:
- &save-mason_packages-cache
save_cache:
name: Save mason_packages cache
key: 'mason_packages/v1/{{ arch }}/{{ checksum "cmake/mason-dependencies.cmake" }}'
key: 'mason_packages/v3/{{ arch }}/{{ checksum "cmake/mason-dependencies.cmake" }}'
paths: [ "mason_packages/.binaries" ]
- &restore-mason_packages-cache
restore_cache:
name: Restore mason_packages cache
keys:
- 'mason_packages/v1/{{ arch }}/{{ checksum "cmake/mason-dependencies.cmake" }}'
- 'mason_packages/v1/{{ arch }}'
- 'mason_packages/v3/{{ arch }}/{{ checksum "cmake/mason-dependencies.cmake" }}'
- 'mason_packages/v3/{{ arch }}'
- &save-ccache
save_cache:
name: Save ccache
Expand Down
4 changes: 2 additions & 2 deletions cmake/mason-dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ mason_use(vector-tile VERSION 1.0.2 HEADER_ONLY)

if(MBGL_PLATFORM STREQUAL "android")
mason_use(jni.hpp VERSION 3.0.0 HEADER_ONLY)
mason_use(sqlite VERSION 3.14.2)
mason_use(sqlite VERSION 3.24.0-min-size)
mason_use(icu VERSION 58.1-min-size)
elseif(MBGL_PLATFORM STREQUAL "ios")
mason_use(icu VERSION 58.1-min-size)
elseif(MBGL_PLATFORM STREQUAL "linux")
mason_use(glfw VERSION 2018-06-27-0be4f3f)
mason_use(sqlite VERSION 3.14.2)
mason_use(sqlite VERSION 3.24.0-min-size)
mason_use(libuv VERSION 1.9.1)
mason_use(libpng VERSION 1.6.25)
mason_use(libjpeg-turbo VERSION 1.5.0)
Expand Down
4 changes: 2 additions & 2 deletions cmake/mason.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ function(mason_detect_platform)
# 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-v7a")
set(MASON_PLATFORM_VERSION "arm-v7-9" PARENT_SCOPE)
set(MASON_PLATFORM_VERSION "arm-v7-14" PARENT_SCOPE)
elseif (ANDROID_ABI STREQUAL "arm64-v8a")
set(MASON_PLATFORM_VERSION "arm-v8-21" PARENT_SCOPE)
elseif (ANDROID_ABI STREQUAL "x86")
set(MASON_PLATFORM_VERSION "x86-9" PARENT_SCOPE)
set(MASON_PLATFORM_VERSION "x86-14" PARENT_SCOPE)
elseif (ANDROID_ABI STREQUAL "x86_64")
set(MASON_PLATFORM_VERSION "x86-64-21" PARENT_SCOPE)
else()
Expand Down
16 changes: 10 additions & 6 deletions test/storage/offline_database.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ TEST(OfflineDatabase, TEST_REQUIRES_WRITE(Invalid)) {

#ifndef __QT__
// Only non-Qt platforms are setting a logger on the SQLite object.
EXPECT_EQ(1u, log.count({ EventSeverity::Info, Event::Database, static_cast<int64_t>(mapbox::sqlite::ResultCode::NotADB),
"statement aborts at 1: [PRAGMA user_version] file is encrypted or is not a database" }, true));
// Checking two possibilities for the error string because it apparently changes between SQLite versions.
EXPECT_EQ(1u,
log.count({ EventSeverity::Info, Event::Database, static_cast<int64_t>(mapbox::sqlite::ResultCode::NotADB),
"statement aborts at 1: [PRAGMA user_version] file is encrypted or is not a database" }, true) +
log.count({ EventSeverity::Info, Event::Database, static_cast<int64_t>(mapbox::sqlite::ResultCode::NotADB),
"statement aborts at 1: [PRAGMA user_version] file is not a database" }, true));
#endif
EXPECT_EQ(1u, log.count({ EventSeverity::Warning, Event::Database, -1, "Removing existing incompatible offline database" }));
EXPECT_EQ(0u, log.uncheckedCount());
Expand Down Expand Up @@ -618,23 +622,23 @@ TEST(OfflineDatabase, BatchInsertionMapboxTileCountExceeded) {
db.setOfflineMapboxTileCountLimit(1);
OfflineRegionDefinition definition { "", LatLngBounds::world(), 0, INFINITY, 1.0 };
OfflineRegion region = db.createRegion(definition, OfflineRegionMetadata());

Response response;
response.data = randomString(1024);
std::list<std::tuple<Resource, Response>> resources;

resources.emplace_back(Resource::style("http://example.com/"), response);
resources.emplace_back(Resource::tile("mapbox://tiles/1", 1.0, 0, 0, 0, Tileset::Scheme::XYZ), response);
resources.emplace_back(Resource::tile("mapbox://tiles/2", 1.0, 0, 0, 0, Tileset::Scheme::XYZ), response);

OfflineRegionStatus status;
try {
db.putRegionResources(region.getID(), resources, status);
EXPECT_FALSE(true);
} catch (const MapboxTileLimitExceededException&) {
// Expected
}

EXPECT_EQ(status.completedTileCount, 1u);
EXPECT_EQ(status.completedResourceCount, 2u);
EXPECT_EQ(db.getRegionCompletedStatus(region.getID()).completedTileCount, 1u);
Expand Down

0 comments on commit b500577

Please sign in to comment.