Rename Gradle targets Android (#2226)

This commit is contained in:
Bart Louwers
2024-04-02 23:15:50 +02:00
committed by GitHub
parent 37170ed61c
commit 9f8ae7a98b
1081 changed files with 132 additions and 370 deletions

View File

@@ -114,7 +114,7 @@ jobs:
run: |
MAPLIBRE_DEVELOPER_CONFIG_XML='${{ secrets.MAPLIBRE_DEVELOPER_CONFIG_XML }}'
if [ -n "${MAPLIBRE_DEVELOPER_CONFIG_XML}" ]; then
echo "${MAPLIBRE_DEVELOPER_CONFIG_XML}" > MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml
echo "${MAPLIBRE_DEVELOPER_CONFIG_XML}" > MapLibreAndroidTestApp/src/main/res/values/developer-config.xml
else
echo "No secrets.MAPLIBRE_DEVELOPER_CONFIG_XML variable set, not copying..."
fi
@@ -122,8 +122,8 @@ jobs:
- name: Build Benchmark, copy to platform/android
run: |
./gradlew assembleDrawableRelease assembleDrawableReleaseAndroidTest -PtestBuildType=release
cp MapboxGLAndroidSDKTestApp/build/outputs/apk/drawable/release/MapboxGLAndroidSDKTestApp-drawable-release.apk .
cp MapboxGLAndroidSDKTestApp/build/outputs/apk/androidTest/drawable/release/MapboxGLAndroidSDKTestApp-drawable-release-androidTest.apk .
cp MapLibreAndroidTestApp/build/outputs/apk/drawable/release/MapLibreAndroidTestApp-drawable-release.apk .
cp MapLibreAndroidTestApp/build/outputs/apk/androidTest/drawable/release/MapLibreAndroidTestApp-drawable-release-androidTest.apk .
- name: Create artifact for benchmark APKs
uses: actions/upload-artifact@v4
@@ -131,8 +131,8 @@ jobs:
if-no-files-found: error
name: benchmarkAPKs
path: |
platform/android/MapboxGLAndroidSDKTestApp-drawable-release.apk
platform/android/MapboxGLAndroidSDKTestApp-drawable-release-androidTest.apk
platform/android/MapLibreAndroidTestApp-drawable-release.apk
platform/android/MapLibreAndroidTestApp-drawable-release-androidTest.apk
- if: github.event_name == 'pull_request'
uses: ./.github/actions/save-pr-number
@@ -159,7 +159,7 @@ jobs:
id: upload-android-app
with:
project_arn: ${{ vars.AWS_DEVICE_FARM_PROJECT_ARN }}
name: MapboxGLAndroidSDKTestApp-debug.apk
name: MapLibreAndroidTestApp-debug.apk
type: ANDROID_APP
- name: Create upload
@@ -168,14 +168,14 @@ jobs:
id: upload-android-test
with:
project_arn: ${{ vars.AWS_DEVICE_FARM_PROJECT_ARN }}
name: MapboxGLAndroidSDKTestApp-debug-androidTest.apk
name: MapLibreAndroidTestApp-debug-androidTest.apk
type: INSTRUMENTATION_TEST_PACKAGE
- name: Upload Android UI test
if: github.ref == 'refs/heads/main'
run: |
curl -T MapboxGLAndroidSDKTestApp/build/outputs/apk/legacy/debug/MapboxGLAndroidSDKTestApp-legacy-debug.apk '${{ steps.upload-android-app.outputs.url }}'
curl -T MapboxGLAndroidSDKTestApp/build/outputs/apk/androidTest/legacy/debug/MapboxGLAndroidSDKTestApp-legacy-debug-androidTest.apk '${{ steps.upload-android-test.outputs.url }}'
curl -T MapLibreAndroidTestApp/build/outputs/apk/legacy/debug/MapLibreAndroidTestApp-legacy-debug.apk '${{ steps.upload-android-app.outputs.url }}'
curl -T MapLibreAndroidTestApp/build/outputs/apk/androidTest/legacy/debug/MapLibreAndroidTestApp-legacy-debug-androidTest.apk '${{ steps.upload-android-test.outputs.url }}'
- name: Write uploads.env
if: github.ref == 'refs/heads/main'
@@ -196,13 +196,13 @@ jobs:
with:
name: debug-artifacts
path: |
MapboxGLAndroidSDKTestApp/build/outputs/apk/debug
MapboxGLAndroidSDK/build/reports/lint-results.html
MapboxGLAndroidSDK/lint-baseline.xml
MapboxGLAndroidSDKTestApp/build/reports/lint-results.html
MapboxGLAndroidSDKTestApp/build/reports/lint-results.xml
MapboxGLAndroidSDKTestApp/lint-baseline.xml
MapboxGLAndroidSDK/build/intermediates/cmake/debug/obj
MapLibreAndroidTestApp/build/outputs/apk/debug
MapLibreAndroid/build/reports/lint-results.html
MapLibreAndroid/lint-baseline.xml
MapLibreAndroidTestApp/build/reports/lint-results.html
MapLibreAndroidTestApp/build/reports/lint-results.xml
MapLibreAndroidTestApp/lint-baseline.xml
MapLibreAndroid/build/intermediates/cmake/debug/obj
android-build-render-test:
runs-on: ubuntu-latest

View File

@@ -22,8 +22,8 @@ jobs:
},
{
artifactName: benchmarkAPKs,
testFile: "MapboxGLAndroidSDKTestApp-drawable-release-androidTest.apk",
appFile: "MapboxGLAndroidSDKTestApp-drawable-release.apk",
testFile: "MapLibreAndroidTestApp-drawable-release-androidTest.apk",
appFile: "MapLibreAndroidTestApp-drawable-release.apk",
name: "Android Benchmark",
testFilter: "org.maplibre.android.benchmark.Benchmark",
# top devices, query with `aws list-device-pools --arn <project_arn>`

View File

@@ -89,9 +89,9 @@ jobs:
RELEASE_VERSION="$( git describe --tags --match=android-v*.*.* --abbrev=0 | sed 's/^android-v//' )"
echo "Latest version from tag: $RELEASE_VERSION"
if [ -n "$RELEASE_VERSION" ]; then
sed -i -e "s/^VERSION_NAME=.*/VERSION_NAME=${RELEASE_VERSION}/" MapboxGLAndroidSDK/gradle.properties
echo "MapboxGLAndroidSDK/gradle.properties:"
cat MapboxGLAndroidSDK/gradle.properties
sed -i -e "s/^VERSION_NAME=.*/VERSION_NAME=${RELEASE_VERSION}/" MapLibreAndroid/gradle.properties
echo "MapLibreAndroid/gradle.properties:"
cat MapLibreAndroid/gradle.properties
fi
shell: bash
@@ -102,7 +102,7 @@ jobs:
run: |
MAPLIBRE_DEVELOPER_CONFIG_XML='${{ secrets.MAPLIBRE_DEVELOPER_CONFIG_XML }}'
if [ -n "${MAPLIBRE_DEVELOPER_CONFIG_XML}" ]; then
echo "${MAPLIBRE_DEVELOPER_CONFIG_XML}" > MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml
echo "${MAPLIBRE_DEVELOPER_CONFIG_XML}" > MapLibreAndroidTestApp/src/main/res/values/developer-config.xml
make android
else
echo "No secrets.MAPLIBRE_DEVELOPER_CONFIG_XML variable set, skipping apk build..."
@@ -138,8 +138,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: platform/android/MapboxGLAndroidSDK/build/outputs/aar/MapboxGLAndroidSDK-drawable-release.aar
asset_name: MapboxGLAndroidSDK-release.aar
asset_path: platform/android/MapLibreAndroid/build/outputs/aar/MapLibreAndroid-drawable-release.aar
asset_name: MapLibreAndroid-release.aar
asset_content_type: application/zip
- name: Clean release

View File

@@ -20,5 +20,5 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: gh-pages
folder: platform/android/MapboxGLAndroidSDK/build/dokka/html
folder: platform/android/MapLibreAndroid/build/dokka/html
target-folder: android/api/

18
.gitignore vendored
View File

@@ -1,20 +1,20 @@
/mapbox-gl-native-android/MapboxGLAndroidSDK/mapbox-gl-native
/mapbox-gl-native-android/MapboxGLAndroidSDKTestApp/mapbox-gl-native
/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml
/mapbox-gl-native-android/MapLibreAndroid/mapbox-gl-native
/mapbox-gl-native-android/MapLibreAndroidTestApp/mapbox-gl-native
/platform/android/MapLibreAndroidTestApp/src/main/res/values/developer-config.xml
/platform/android/local.properties
/platform/android/gradle/configuration.gradle
/platform/android/arm64-v8a
/platform/android/armeabi-v7a
/platform/android/MapboxGLAndroidSDK/.cxx
/platform/android/MapboxGLAndroidSDK/build
/platform/android/MapboxGLAndroidSDKTestApp/.cxx
/platform/android/MapboxGLAndroidSDKTestApp/build
/platform/android/MapLibreAndroid/.cxx
/platform/android/MapLibreAndroid/build
/platform/android/MapLibreAndroidTestApp/.cxx
/platform/android/MapLibreAndroidTestApp/build
/platform/android/.gradle
/platform/android/x86
/platform/android/x86_64
/cmake-build-debug
/platform/android/build
/platform/android/MapboxGLAndroidSDK/src/main/assets/sdk_versions/com.mapbox.mapboxsdk
/platform/android/MapLibreAndroid/src/main/assets/sdk_versions/com.mapbox.mapboxsdk
/platform/ios/platform/ios/Mapbox.playground/build/
/platform/windows/vendor/mesa3d/
*.code-workspace
@@ -24,7 +24,7 @@
compile_commands.json
/build
**/.idea
/platform/android/MapboxGLAndroidSDKTestApp/local.properties
/platform/android/MapLibreAndroidTestApp/local.properties
/new_offline.db
*.gpg
/.vscode

View File

@@ -41,7 +41,7 @@ Then add markers to the map with GeoJSON:
It is used to add annotations to the map instance.
```kotlin
{{#include ../../../../platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/JsonApiActivity.kt:top}}
{{#include ../../../../platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/JsonApiActivity.kt:top}}
```
4. Call `mapview.getMapSync()` in order to get a `MapboxMap` object.
@@ -49,14 +49,14 @@ Then add markers to the map with GeoJSON:
to make a HTTP request and transform data into the map annotations.
```kotlin
{{#include ../../../../platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/JsonApiActivity.kt:mapAsync}}
{{#include ../../../../platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/JsonApiActivity.kt:mapAsync}}
```
5. Define a function `getEarthQuakeDataFromUSGS()` to fetch GeoJSON data from a public API.
If we successfully get the response, call `addMarkersToMap()` on the UI thread.
```kotlin
{{#include ../../../../platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/JsonApiActivity.kt:getEarthquakes}}
{{#include ../../../../platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/JsonApiActivity.kt:getEarthquakes}}
```
6. Now it is time to add markers into the map.
@@ -66,7 +66,7 @@ Then add markers to the map with GeoJSON:
- Finally, move the camera to the bounds of the newly added markers
```kotlin
{{#include ../../../../platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/JsonApiActivity.kt:addMarkers}}
{{#include ../../../../platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/JsonApiActivity.kt:addMarkers}}
```
7. Here is the final result. For the full contents of `JsonApiActivity`, please visit source code of [Test APP]
@@ -76,7 +76,7 @@ Then add markers to the map with GeoJSON:
</div>
[Marker]: https://maplibre.org/maplibre-native/android/api/-map-libre%20-native%20for%20-android/com.mapbox.mapboxsdk.annotations/-marker/index.html
[provided image]: https://github.com/maplibre/maplibre-native/blob/main/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/maplibre_marker_icon_default.png
[provided image]: https://github.com/maplibre/maplibre-native/blob/main/platform/android/MapLibreAndroid/src/main/res/drawable-xxxhdpi/maplibre_marker_icon_default.png
[Polyline]: https://maplibre.org/maplibre-native/android/api/-map-libre%20-native%20for%20-android/com.mapbox.mapboxsdk.annotations/-polyline/index.html
[Polygon]: https://maplibre.org/maplibre-native/android/api/-map-libre%20-native%20for%20-android/com.mapbox.mapboxsdk.annotations/-polygon/index.html
[marker image]: https://raw.githubusercontent.com/maplibre/maplibre-native/main/test/fixtures/sprites/default_marker.png
@@ -86,4 +86,4 @@ Then add markers to the map with GeoJSON:
[mvn]: https://mvnrepository.com/artifact/org.maplibre.gl/android-plugin-annotation-v9
[Android Developer Documentation]: https://developer.android.com/topic/libraries/architecture/coroutines
[MarkerOptions]: https://maplibre.org/maplibre-native/android/api/-map-libre%20-native%20for%20-android/com.mapbox.mapboxsdk.annotations/-marker-options/index.html
[Test App]: https://github.com/maplibre/maplibre-native/tree/main/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/JsonApiActivity.kt
[Test App]: https://github.com/maplibre/maplibre-native/tree/main/platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/JsonApiActivity.kt

View File

@@ -26,7 +26,7 @@ This guide will demonstrate how to utilize the [LocationComponent] to represent
- At the end of the `onCreate()` method, call `checkPermissions(`) to ensure that the application can access the user's location.
```kotlin
{{#include ../../../../platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/BasicLocationPulsingCircleActivity.kt:top}}
{{#include ../../../../platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/location/BasicLocationPulsingCircleActivity.kt:top}}
```
3. In the `checkPermissions()` method, the [PermissionManager] is used to request location permissions at runtime and handle the callbacks for permission granting or rejection.
@@ -36,7 +36,7 @@ This guide will demonstrate how to utilize the [LocationComponent] to represent
If the permissions are granted, call `mapView.getMapAsync(this)` to register the activity as a listener for onMapReady event.
```kotlin
{{#include ../../../../platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/BasicLocationPulsingCircleActivity.kt:permission}}
{{#include ../../../../platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/location/BasicLocationPulsingCircleActivity.kt:permission}}
```
4. In the `onMapReady()` method, first set the style and then handle the user's location using the [LocationComponent].
@@ -55,7 +55,7 @@ This guide will demonstrate how to utilize the [LocationComponent] to represent
- `locationComponent!!.forceLocationUpdate(lastLocation)` updates the the user's last known location.
```kotlin
{{#include ../../../../platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/BasicLocationPulsingCircleActivity.kt:onMapReady}}
{{#include ../../../../platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/location/BasicLocationPulsingCircleActivity.kt:onMapReady}}
```
5. [LocationComponentActivationOptions] is used to hold the style, [LocationComponentOptions] and other locating behaviors.
@@ -64,7 +64,7 @@ This guide will demonstrate how to utilize the [LocationComponent] to represent
- For more information, please visit the [documentation page][LocationComponentActivationOptions].
```kotlin
{{#include ../../../../platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/BasicLocationPulsingCircleActivity.kt:LocationComponentActivationOptions}}
{{#include ../../../../platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/location/BasicLocationPulsingCircleActivity.kt:LocationComponentActivationOptions}}
```
6. For further customization, you can also utilize the `foregroundTintColor()` and `pulseColor()` methods on the [LocationComponentOptions] builder:
@@ -96,5 +96,5 @@ val locationComponentOptions =
[predefined styles]: https://github.com/maplibre/maplibre-native/tree/main/src/mbgl/util/tile_server_options.cpp
[LocationComponentActivationOptions]: https://maplibre.org/maplibre-native/android/api/-map-libre%20-native%20for%20-android/com.mapbox.mapboxsdk.location/-location-component-activation-options/index.html
[LocationEngine]: https://maplibre.org/maplibre-native/android/api/-map-libre%20-native%20for%20-android/com.mapbox.mapboxsdk.location.engine/-location-engine/index.html
[Test APP]: https://github.com/maplibre/maplibre-native/tree/main/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/BasicLocationPulsingCircleActivity.kt
[Test APP]: https://github.com/maplibre/maplibre-native/tree/main/platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/location/BasicLocationPulsingCircleActivity.kt
[camera modes]: https://maplibre.org/maplibre-native/android/api/-map-libre%20-native%20for%20-android/com.mapbox.mapboxsdk.location.modes/-camera-mode/index.html

View File

@@ -96,9 +96,9 @@ This version is identical to 10.0.2.
- 💥 Breaking: the `LocationEngine` implemented with Google Location Services has been removed to make MapLibre Native for Android fully FLOSS ([#379](https://github.com/maplibre/maplibre-native/issues/379)).
> To migrate:
> Include the source code of the removed [`GoogleLocationEngineImpl`](https://github.com/maplibre/maplibre-native/blob/4a34caab7593f4f1b6d8c09c06a5e25d7c6cfc43/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/GoogleLocationEngineImpl.java) in your source tree.
> Include the source code of the removed [`GoogleLocationEngineImpl`](https://github.com/maplibre/maplibre-native/blob/4a34caab7593f4f1b6d8c09c06a5e25d7c6cfc43/platform/android/MapLibreAndroid/src/main/java/com/mapbox/mapboxsdk/location/engine/GoogleLocationEngineImpl.java) in your source tree.
>
> Pass an instance of `LocationEngine` based on `GoogleLocationEngineImpl` to `LocationComponentActivationOptions.Builder.locationEngine` (this was done in a now removed [`LocationEngineProvider`](https://github.com/maplibre/maplibre-native/blob/68d58d6f6f453d5c6cc0fa92fcc6c6cfe0cf967f/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineProvider.java#L59) class):
> Pass an instance of `LocationEngine` based on `GoogleLocationEngineImpl` to `LocationComponentActivationOptions.Builder.locationEngine` (this was done in a now removed [`LocationEngineProvider`](https://github.com/maplibre/maplibre-native/blob/68d58d6f6f453d5c6cc0fa92fcc6c6cfe0cf967f/platform/android/MapLibreAndroid/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineProvider.java#L59) class):
>
> ```kotlin
> val locationEngine = LocationEngineProxy<Any>(GoogleLocationEngineImpl(context))
@@ -108,7 +108,7 @@ This version is identical to 10.0.2.
- 💥 Breaking: The static `LocationEngineResult.extractResult` can no longer extract a `LocationEngineResult` from a Google Play intent.
> To migrate, include and use the [previous implementation](https://github.com/maplibre/maplibre-native/blob/ea234edf67bb3aec75f077e15c1c30c99756b926/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineResult.java#L97) in your source tree.
> To migrate, include and use the [previous implementation](https://github.com/maplibre/maplibre-native/blob/ea234edf67bb3aec75f077e15c1c30c99756b926/platform/android/MapLibreAndroid/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineResult.java#L97) in your source tree.
- Improve Kotlinification of LatLng ([#742](https://github.com/maplibre/maplibre-native/issues))
- Increment minSdkVersion from 14 to 21, as it covers 99.2%% of the newer devices since 2014 and lessens the backward compatibility burden ([#630](https://github.com/maplibre/maplibre-native/pull/630))

View File

@@ -23,11 +23,11 @@ Open the `platform/android` directory to get started.
_The test application (used for development purposes) uses MapTiler vector tiles, which require a MapTiler account and API key._
With the first Gradle invocation, Gradle will take the value of the `MLN_API_KEY` environment variable and save it to `MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml`. If the environment variable wasn't set, you can edit `developer-config.xml` manually and add your API key to the `api_key` resource.
With the first Gradle invocation, Gradle will take the value of the `MLN_API_KEY` environment variable and save it to `MapLibreAndroidTestApp/src/main/res/values/developer-config.xml`. If the environment variable wasn't set, you can edit `developer-config.xml` manually and add your API key to the `api_key` resource.
## Running the TestApp
Run the configuration for the `MapboxGLAndroidSDKTestApp` module and select a device or emulator to deploy on.
Run the configuration for the `MapLibreAndroidTestApp` module and select a device or emulator to deploy on.
<p align="left">
<img src="https://github.com/maplibre/maplibre-native/assets/649392/5494925e-8cbb-4d5d-8033-8a2f141ede3c" alt="Android TestApp menu" width="15%"> <img src="https://github.com/maplibre/maplibre-native/assets/649392/f169db51-615d-4fca-b297-ac6197bec674" alt="Android TestApp showing Demotiles" width="15%">
@@ -41,7 +41,7 @@ More information on working on the render tests can be found [in the wiki](https
## Instrumentation Tests
To run the instrumentatin tests, find the `MapboxGLAndroidSDKTestApp` project in the sidebar, go to `src > androidTest`, right click and select "Run 'All Tests'".
To run the instrumentatin tests, find the `MapLibreAndroidTestApp` project in the sidebar, go to `src > androidTest`, right click and select "Run 'All Tests'".
<img width="246" alt="image" src="https://github.com/maplibre/maplibre-native/assets/649392/d9daf630-cb7f-4035-b426-fc496081fed9">

View File

@@ -41,8 +41,8 @@ MLN_ANDROID_LOCAL_BENCHMARK_DIR = /data/local/tmp/benchmark
MLN_ANDROID_LIBDIR = lib$(if $(filter arm-v8 x86-64,$1),64)
MLN_ANDROID_DALVIKVM = dalvikvm$(if $(filter arm-v8 x86-64,$1),64,32)
MLN_ANDROID_APK_SUFFIX = $(if $(filter Release,$(BUILDTYPE)),release,debug)
MLN_ANDROID_CORE_TEST_DIR = MapboxGLAndroidSDK/.externalNativeBuild/cmake/$(buildtype)/$2/core-tests
MLN_ANDROID_BENCHMARK_DIR = MapboxGLAndroidSDK/.externalNativeBuild/cmake/$(buildtype)/$2/benchmark
MLN_ANDROID_CORE_TEST_DIR = MapLibreAndroid/.externalNativeBuild/cmake/$(buildtype)/$2/core-tests
MLN_ANDROID_BENCHMARK_DIR = MapLibreAndroid/.externalNativeBuild/cmake/$(buildtype)/$2/benchmark
MLN_ANDROID_STL ?= c++_static
SOCKET_TIMEOUT = 360000
CONNECTION_TIMEOUT = 360000
@@ -61,28 +61,28 @@ define ANDROID_RULES
.PHONY: android-test-lib-$1
android-test-lib-$1:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 -Pmapbox.with_test=true :MapboxGLAndroidSDKTestApp:assemble$(BUILDTYPE)
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 -Pmapbox.with_test=true :MapLibreAndroidTestApp:assemble$(BUILDTYPE)
.PHONY: android-benchmark-$1
android-benchmark-$1:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 -Pmapbox.with_benchmark=true :MapboxGLAndroidSDKTestApp:assemble$(BUILDTYPE)
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 -Pmapbox.with_benchmark=true :MapLibreAndroidTestApp:assemble$(BUILDTYPE)
# Build SDK for for specified abi
.PHONY: android-lib-$1
android-lib-$1:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDK:assemble$(BUILDTYPE)
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapLibreAndroid:assemble$(BUILDTYPE)
# Build test app and SDK for for specified abi
.PHONY: android-$1
android-$1:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:assemble$(BUILDTYPE)
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapLibreAndroidTestApp:assemble$(BUILDTYPE)
# Build the core test for specified abi
.PHONY: android-core-test-$1
android-core-test-$1: android-test-lib-$1
# Compile main sources and extract the classes (using the test app to get all transitive dependencies in one place)
mkdir -p $(MLN_ANDROID_CORE_TEST_DIR)
unzip -o MapboxGLAndroidSDKTestApp/build/outputs/apk/$(buildtype)/MapboxGLAndroidSDKTestApp-$(MLN_ANDROID_APK_SUFFIX).apk classes.dex -d $(MLN_ANDROID_CORE_TEST_DIR)
unzip -o MapLibreAndroidTestApp/build/outputs/apk/$(buildtype)/MapLibreAndroidTestApp-$(MLN_ANDROID_APK_SUFFIX).apk classes.dex -d $(MLN_ANDROID_CORE_TEST_DIR)
run-android-core-test-$1-%: android-core-test-$1
# Ensure clean state on the device
@@ -90,10 +90,10 @@ run-android-core-test-$1-%: android-core-test-$1
# Push all needed files to the device
adb push $(MLN_ANDROID_CORE_TEST_DIR)/classes.dex $(MLN_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1
adb push MapboxGLAndroidSDK/build/intermediates/intermediate-jars/$(buildtype)/jni/$2/libmaplibre.so $(MLN_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1
adb push MapLibreAndroid/build/intermediates/intermediate-jars/$(buildtype)/jni/$2/libmaplibre.so $(MLN_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1
adb push test/fixtures $(MLN_ANDROID_LOCAL_WORK_DIR)/test > /dev/null 2>&1
adb push scripts/style-spec-reference/v8.json $(MLN_ANDROID_LOCAL_WORK_DIR)/scripts/style-spec-reference > /dev/null 2>&1
adb push MapboxGLAndroidSDK/build/intermediates/cmake/$(buildtype)/obj/$2/mbgl-test $(MLN_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1
adb push MapLibreAndroid/build/intermediates/cmake/$(buildtype)/obj/$2/mbgl-test $(MLN_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1
# Create gtest filter for skipped tests.
$(eval SKIPPED_TESTS := -$(shell sed -n '/#\|^$$/!p' tests/skipped.txt | sed ':a;$!N;s/\n/:/g;ta'))
@@ -117,17 +117,17 @@ run-android-benchmark-$1: run-android-benchmark-$1-*
run-android-benchmark-$1-%: android-benchmark-$1
mkdir -p $(MLN_ANDROID_BENCHMARK_DIR)
unzip -o MapboxGLAndroidSDKTestApp/build/outputs/apk/$(buildtype)/MapboxGLAndroidSDKTestApp-$(MLN_ANDROID_APK_SUFFIX).apk classes.dex -d $(MLN_ANDROID_BENCHMARK_DIR)
unzip -o MapLibreAndroidTestApp/build/outputs/apk/$(buildtype)/MapLibreAndroidTestApp-$(MLN_ANDROID_APK_SUFFIX).apk classes.dex -d $(MLN_ANDROID_BENCHMARK_DIR)
# Delete old test folder and create new one
adb shell "rm -Rf $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) && mkdir -p $(MLN_ANDROID_LOCAL_BENCHMARK_DIR)/benchmark && mkdir -p $(MLN_ANDROID_LOCAL_BENCHMARK_DIR)/test"
# Push compiled java sources, test data and executable to device
adb push $(MLN_ANDROID_BENCHMARK_DIR)/classes.dex $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) > /dev/null 2>&1
adb push MapboxGLAndroidSDK/build/intermediates/intermediate-jars/$(buildtype)/jni/$2/libmaplibre.so $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) > /dev/null 2>&1
adb push MapLibreAndroid/build/intermediates/intermediate-jars/$(buildtype)/jni/$2/libmaplibre.so $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) > /dev/null 2>&1
adb push benchmark/fixtures $(MLN_ANDROID_LOCAL_BENCHMARK_DIR)/benchmark > /dev/null 2>&1
adb push test/fixtures $(MLN_ANDROID_LOCAL_BENCHMARK_DIR)/test > /dev/null 2>&1
adb push MapboxGLAndroidSDK/build/intermediates/cmake/$(buildtype)/obj/$2/mbgl-benchmark $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) > /dev/null 2>&1
adb push MapLibreAndroid/build/intermediates/cmake/$(buildtype)/obj/$2/mbgl-benchmark $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) > /dev/null 2>&1
# Run benchmark. Number of benchmark iterations can be set by run-android-benchmark-N parameter.
adb shell "export LD_LIBRARY_PATH=$(MLN_ANDROID_LOCAL_BENCHMARK_DIR) && cd $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) && chmod +x mbgl-benchmark && ./mbgl-benchmark --class_path=$(MLN_ANDROID_LOCAL_BENCHMARK_DIR)/classes.dex --benchmark_repetitions=$$* --benchmark_format=json --benchmark_out=results.json"
@@ -140,28 +140,28 @@ run-android-benchmark-$1-%: android-benchmark-$1
.PHONY: run-android-$1
run-android-$1:
-adb uninstall org.maplibre.testapp 2> /dev/null
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:install$(BUILDTYPE) && adb shell am start -n org.maplibre.testapp/.activity.FeatureOverviewActivity
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapLibreAndroidTestApp:install$(BUILDTYPE) && adb shell am start -n org.maplibre.testapp/.activity.FeatureOverviewActivity
# Build test app instrumentation tests apk and test app apk for specified abi
.PHONY: android-ui-test-$1
android-ui-test-$1:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:assembleDebug :MapboxGLAndroidSDKTestApp:assembleAndroidTest
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapLibreAndroidTestApp:assembleDebug :MapLibreAndroidTestApp:assembleAndroidTest
# Run test app instrumentation tests on a connected android device or emulator with specified abi
.PHONY: run-android-ui-test-$1
run-android-ui-test-$1:
-adb uninstall org.maplibre.testapp 2> /dev/null
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapLibreAndroidTestApp:connectedAndroidTest
# Run Java Instrumentation tests on a connected android device or emulator with specified abi and test filter
run-android-ui-test-$1-%:
-adb uninstall org.maplibre.testapp 2> /dev/null
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="$$*"
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapLibreAndroidTestApp:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="$$*"
# Symbolicate native stack trace with the specified abi
.PHONY: android-ndk-stack-$1
android-ndk-stack-$1:
adb logcat | ndk-stack -sym MapboxGLAndroidSDK/build/intermediates/cmake/debug/obj/$2/
adb logcat | ndk-stack -sym MapLibreAndroid/build/intermediates/cmake/debug/obj/$2/
# Run render tests with pixelmatch
.PHONY: run-android-render-test-$1
@@ -170,17 +170,17 @@ run-android-render-test-$1: $(BUILD_DEPS)
# delete old test results
rm -rf build/render-test/maplibre/
# copy test definitions & ignore file to test app assets folder, clear old ones first
rm -rf MapboxGLAndroidSDKTestApp/src/main/assets/integration
cp -r metrics/integration MapboxGLAndroidSDKTestApp/src/main/assets
cp platform/node/test/ignores.json MapboxGLAndroidSDKTestApp/src/main/assets/integration/ignores.json
rm -rf MapLibreAndroidTestApp/src/main/assets/integration
cp -r metrics/integration MapLibreAndroidTestApp/src/main/assets
cp platform/node/test/ignores.json MapLibreAndroidTestApp/src/main/assets/integration/ignores.json
# run RenderTest.java to generate static map images
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="org.maplibre.testapp.render.RenderTest"
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapLibreAndroidTestApp:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="org.maplibre.testapp.render.RenderTest"
# pull generated images from the device
adb pull "`adb shell 'printenv EXTERNAL_STORAGE' | tr -d '\r'`/maplibre/render" build/render-test
# copy expected result and run pixelmatch
python scripts/run-render-test.py
# remove test definitions from assets
rm -rf MapboxGLAndroidSDKTestApp/src/main/assets/integration
rm -rf MapLibreAndroidTestApp/src/main/assets/integration
endef
@@ -211,9 +211,9 @@ run-android-ui-test-%: run-android-ui-test-arm-v7-%
# Run Java Unit tests on the JVM of the development machine executing this
.PHONY: run-android-unit-test
run-android-unit-test:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:testLegacyDebugUnitTest --info
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapLibreAndroid:testLegacyDebugUnitTest --info
run-android-unit-test-%:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:testLegacyDebugUnitTest --info --tests "$*"
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapLibreAndroid:testLegacyDebugUnitTest --info --tests "$*"
# Builds a release package of the Android SDK
.PHONY: apackage
@@ -224,17 +224,17 @@ apackage:
# Build test app instrumentation tests apk and test app apk for all abi's
.PHONY: android-ui-test
android-ui-test:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=all :MapboxGLAndroidSDKTestApp:assembleDebug :MapboxGLAndroidSDKTestApp:assembleAndroidTest
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=all :MapLibreAndroidTestApp:assembleDebug :MapLibreAndroidTestApp:assembleAndroidTest
#Run instrumentations tests on MicroSoft App Center, ${devices} can be "xiaomi","huawei","OnePlus","htc"
.PHONY: run-android-test-app-center
run-android-test-app-center:
appcenter test run espresso --app "MapLibre-mobile/Maps-sdk" --devices "MapLibre-mobile/${devices}" --app-path MapboxGLAndroidSDKTestApp/build/outputs/apk/debug/MapboxGLAndroidSDKTestApp-debug.apk --test-series "master" --locale "en_US" --build-dir MapboxGLAndroidSDKTestApp/build/outputs/apk/androidTest/debug --token ${APPCENTER_ACCESS_TOKEN}
appcenter test run espresso --app "MapLibre-mobile/Maps-sdk" --devices "MapLibre-mobile/${devices}" --app-path MapLibreAndroidTestApp/build/outputs/apk/debug/MapLibreAndroidTestApp-debug.apk --test-series "master" --locale "en_US" --build-dir MapLibreAndroidTestApp/build/outputs/apk/androidTest/debug --token ${APPCENTER_ACCESS_TOKEN}
# Uploads the compiled Android SDK to Maven Central Staging
.PHONY: run-android-publish
run-android-publish:
$(MLN_ANDROID_GRADLE_SINGLE_JOB)-Pmapbox.abis=all :MapboxGLAndroidSDK:publishReleasePublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository
$(MLN_ANDROID_GRADLE_SINGLE_JOB)-Pmapbox.abis=all :MapLibreAndroid:publishReleasePublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository
# Dump system graphics information for the test app
.PHONY: android-gfxinfo
@@ -248,7 +248,7 @@ android-check : android-ktlint android-checkstyle android-lint-sdk android-lint-
# Runs checkstyle on the java code
.PHONY: android-checkstyle
android-checkstyle:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:checkstyle :MapboxGLAndroidSDKTestApp:checkstyle
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapLibreAndroid:checkstyle :MapLibreAndroidTestApp:checkstyle
# Runs checkstyle on the kotlin code
.PHONY: android-ktlint
@@ -258,22 +258,22 @@ android-ktlint:
# Runs lint on the Android SDK java code
.PHONY: android-lint-sdk
android-lint-sdk:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:lint
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapLibreAndroid:lint
# Runs lint on the Android test app java code
.PHONY: android-lint-test-app
android-lint-test-app:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDKTestApp:lint
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapLibreAndroidTestApp:lint
# Generates javadoc from the Android SDK
.PHONY: android-javadoc
android-javadoc:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:javadocrelease
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapLibreAndroid:javadocrelease
# Generates LICENSE.md file based on all Android project dependencies
.PHONY: android-license
android-license:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:licenseReleaseReport
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapLibreAndroid:licenseReleaseReport
python scripts/generate-license.py
# Symbolicate ndk stack traces for the arm-v7 abi
@@ -293,7 +293,7 @@ run-android-nitpick: android-update-vendor
# Creates a dependency graph using Graphviz
.PHONY: android-graph
android-graph:
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:generateDependencyGraphMapboxLibraries
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapLibreAndroid:generateDependencyGraphMapboxLibraries
# Lists tasks
.PHONY: list-tasks
@@ -304,9 +304,9 @@ list-tasks:
.PHONY: clean
clean:
-rm -rf ./MapboxGLAndroidSDK/build \
./MapboxGLAndroidSDK/.externalNativeBuild \
./MapboxGLAndroidSDKTestApp/build \
./MapboxGLAndroidSDKTestApp/src/androidTest/java/org/maplibre/android/testapp/activity/gen \
./MapboxGLAndroidSDK/src/main/assets \
./MapboxGLAndroidSDKTestApp/src/main/assets/integration
-rm -rf ./MapLibreAndroid/build \
./MapLibreAndroid/.externalNativeBuild \
./MapLibreAndroidTestApp/build \
./MapLibreAndroidTestApp/src/androidTest/java/org/maplibre/android/testapp/activity/gen \
./MapLibreAndroid/src/main/assets \
./MapLibreAndroidTestApp/src/main/assets/integration

View File

@@ -11,7 +11,7 @@ apply plugin: 'kotlin-android'
apply from: "${rootDir}/gradle/native-build.gradle"
dependencies {
lintChecks project(":MapboxGLAndroidSDKLint")
lintChecks project(":MapLibreAndroidLint")
api dependenciesList.mapboxJavaGeoJSON
api dependenciesList.mapboxAndroidGestures

Some files were not shown because too many files have changed in this diff Show More