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

Android libraries vendorization #13712

Merged
merged 4 commits into from
Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,12 @@
[submodule "vendor/eternal"]
path = vendor/eternal
url = https://github.com/mapbox/eternal.git
[submodule "platform/android/vendor/mapbox-gestures-android"]
path = platform/android/vendor/mapbox-gestures-android
url = https://github.com/mapbox/mapbox-gestures-android.git
[submodule "platform/android/vendor/mapbox-java"]
path = platform/android/vendor/mapbox-java
url = https://github.com/mapbox/mapbox-java.git
[submodule "platform/android/vendor/mapbox-events-android"]
path = platform/android/vendor/mapbox-events-android
url = https://github.com/mapbox/mapbox-events-android.git
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,14 @@ android-style-code:
node platform/android/scripts/generate-style-code.js
style-code: android-style-code

# Vendor submodules configuration for Android.
.PHONY: platform/android/vendor
platform/android/vendor:
git submodule update --init --recursive platform/android/vendor

# Configuration file for running CMake from Gradle within Android Studio.
platform/android/gradle/configuration.gradle:
@echo "ext {\n node = '`command -v node || command -v nodejs`'\n npm = '`command -v npm`'\n ccache = '`command -v ccache`'\n}" > $@
platform/android/gradle/configuration.gradle: platform/android/vendor
@printf "ext {\n node = '`command -v node || command -v nodejs`'\n npm = '`command -v npm`'\n ccache = '`command -v ccache`'\n}" > $@

define ANDROID_RULES
# $1 = arm-v7 (short arch)
Expand Down Expand Up @@ -719,7 +724,7 @@ android-check : android-checkstyle android-lint-sdk android-lint-test-app
# Runs checkstyle on the Android code
.PHONY: android-checkstyle
android-checkstyle: platform/android/gradle/configuration.gradle
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none checkstyle
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:checkstyle :MapboxGLAndroidSDKTestApp:checkstyle

# Runs lint on the Android SDK code
.PHONY: android-lint-sdk
Expand Down Expand Up @@ -758,9 +763,14 @@ endif
android-configuration: platform/android/gradle/configuration.gradle
cat platform/android/gradle/configuration.gradle

# Updates Android's vendor submodules
.PHONY: android-update-vendor
android-update-vendor: platform/android/gradle/configuration.gradle
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none updateVendorSubmodules

# Creates a dependency graph using Graphviz
.PHONY: android-graph
android-graph:
android-graph: platform/android/gradle/configuration.gradle
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:generateDependencyGraphMapboxLibraries

#### Miscellaneous targets #####################################################
Expand Down
9 changes: 5 additions & 4 deletions platform/android/MapboxGLAndroidSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ apply plugin: 'kotlin-android'

dependencies {
lintChecks project(":MapboxGLAndroidSDKLint")
api dependenciesList.mapboxAndroidTelemetry
api dependenciesList.mapboxJavaGeoJSON
api dependenciesList.mapboxAndroidGestures
implementation dependenciesList.mapboxJavaTurf
api project(":libcore")
api project(":libtelemetry")
api project(":MapboxAndroidGestures")
api project(":services-geojson")
implementation project(":services-turf")
implementation dependenciesList.supportAppcompatV7
implementation dependenciesList.supportAnnotations
implementation dependenciesList.supportFragmentV4
Expand Down
4 changes: 2 additions & 2 deletions platform/android/MapboxGLAndroidSDKTestApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ android {
dependencies {
implementation dependenciesList.kotlinLib

implementation(project(':MapboxGLAndroidSDK'))
implementation(dependenciesList.mapboxJavaTurf)
implementation project(':MapboxGLAndroidSDK')
implementation project(":services-turf")

implementation dependenciesList.supportAppcompatV7
implementation dependenciesList.supportRecyclerView
Expand Down
1 change: 1 addition & 0 deletions platform/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
buildscript {
apply from: "${rootDir}/gradle/gradle-update-vendor-modules.gradle"
apply from: "${rootDir}/gradle/dependencies.gradle"

repositories {
Expand Down
11 changes: 0 additions & 11 deletions platform/android/gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ ext {
]

versions = [
mapboxServices : '4.3.0',
mapboxTelemetry : '4.1.1',
mapboxGestures : '0.3.0',
supportLib : '27.1.1',
constraintLayout: '1.1.2',
espresso : '3.0.2',
Expand All @@ -29,14 +26,6 @@ ext {
]

dependenciesList = [
mapboxJavaServices : "com.mapbox.mapboxsdk:mapbox-sdk-services:${versions.mapboxServices}",
mapboxJavaGeoJSON : "com.mapbox.mapboxsdk:mapbox-sdk-geojson:${versions.mapboxServices}",
mapboxAndroidTelemetry : "com.mapbox.mapboxsdk:mapbox-android-telemetry:${versions.mapboxTelemetry}",
mapboxAndroidGestures : "com.mapbox.mapboxsdk:mapbox-android-gestures:${versions.mapboxGestures}",

// for testApp
mapboxJavaTurf : "com.mapbox.mapboxsdk:mapbox-sdk-turf:${versions.mapboxServices}",

junit : "junit:junit:${versions.junit}",
mockito : "org.mockito:mockito-core:${versions.mockito}",
mockk : "io.mockk:mockk:${versions.mockk}",
Expand Down
3 changes: 3 additions & 0 deletions platform/android/gradle/gradle-update-vendor-modules.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
task updateVendorSubmodules {
"git submodule update --init --recursive vendor".execute()
}
8 changes: 7 additions & 1 deletion platform/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
include ':MapboxGLAndroidSDK', ':MapboxGLAndroidSDKTestApp', ':MapboxGLAndroidSDKLint'
include ':MapboxGLAndroidSDK', ':MapboxGLAndroidSDKTestApp', ':MapboxGLAndroidSDKLint', ':MapboxAndroidGestures', ':services-core', ':services-geojson', ':services-turf', ':libtelemetry', ':libcore'
project(':MapboxAndroidGestures').projectDir = new File('vendor/mapbox-gestures-android/library')
project(':services-core').projectDir = new File('vendor/mapbox-java/services-core')
project(':services-geojson').projectDir = new File('vendor/mapbox-java/services-geojson')
project(':services-turf').projectDir = new File('vendor/mapbox-java/services-turf')
project(':libtelemetry').projectDir = new File('vendor/mapbox-events-android/libtelemetry')
project(':libcore').projectDir = new File('vendor/mapbox-events-android/libcore')
1 change: 1 addition & 0 deletions platform/android/vendor/mapbox-events-android
Submodule mapbox-events-android added at 1e733b
1 change: 1 addition & 0 deletions platform/android/vendor/mapbox-gestures-android
1 change: 1 addition & 0 deletions platform/android/vendor/mapbox-java
Submodule mapbox-java added at 0791fa