Skip to content

Commit e4105e5

Browse files
Merge branch 'main' into alasram/android_tile_lod_controls
2 parents 0e42ed1 + a32eca0 commit e4105e5

File tree

753 files changed

+11366
-44892
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

753 files changed

+11366
-44892
lines changed

.bazelignore

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
# ignore .git, but make sure we can get commit hash
2-
!.git/HEAD
3-
!.git/refs
4-
!.git/refs/heads
5-
!.git/packed-refs
6-
.git/*
7-
1+
.git
82
node_modules
93
bazel-out
104
bazel-bin
@@ -13,3 +7,5 @@ bazel-testlogs
137
.idea
148
.vscode
159
.cxx
10+
build-*
11+
build

.github/renovate.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@
66
"groupName": "bazel"
77
}
88
],
9-
"schedule": "* * 1,15 * *"
9+
"ignoreDeps": ["cxx.rs"],
10+
"schedule": "* * 1,15 * *",
11+
"dependencyDashboard": true
1012
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
validate_version() {
4+
local version="$1"
5+
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-pre.*)?$ ]]; then
6+
echo "::error::Invalid version '$version' in $(realpath VERSION). Expected: X.Y.Z or X.Y.Z-pre*"
7+
return 1
8+
fi
9+
return 0
10+
}
11+
12+
version=$(cat VERSION 2>/dev/null)
13+
if [ -z "$version" ]; then
14+
echo "::error::No VERSION file found or empty in $PWD"
15+
exit 1
16+
fi
17+
18+
if validate_version "$version"; then
19+
echo "Version validation successful: $version"
20+
if [[ -n "${GITHUB_ENV:-}" ]]; then
21+
echo "version=$version" >> "$GITHUB_ENV"
22+
fi
23+
fi

.github/scripts/windows-ci_configure_wrapper.ps1

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ switch ($env:RENDERER)
99
'opengl' { $compile_flags += '-DMLN_WITH_OPENGL=ON'; break; }
1010
'egl' { $compile_flags += '-DMLN_WITH_EGL=ON' ; break; }
1111
'vulkan' { $compile_flags += @('-DMLN_WITH_VULKAN=ON', '-DMLN_WITH_OPENGL=OFF'); break; }
12-
'osmesa' { $compile_flags += '-DMLN_WITH_OSMESA=ON'; break; }
13-
}
14-
15-
switch ($env:RENDERING_MODE)
16-
{
17-
'legacy' { $compile_flags += '-DMLN_LEGACY_RENDERER=ON' ; break; }
18-
'drawable' { $compile_flags += '-DMLN_DRAWABLE_RENDERER=ON'; break; }
1912
}
2013

2114
Write-Host 'Compile flags: ' $compile_flags

.github/workflows/android-ci.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Get all Android files that have changed
3131
if: github.event_name != 'workflow_dispatch'
3232
id: changed-files
33-
uses: tj-actions/changed-files@v45
33+
uses: tj-actions/changed-files@v46
3434
with:
3535
files_yaml_from_source_file: .github/changed-files.yml
3636

@@ -46,12 +46,14 @@ jobs:
4646
BUILDTYPE: Debug
4747
IS_LOCAL_DEVELOPMENT: false
4848
MLN_ANDROID_STL: c++_static
49+
outputs:
50+
make_release: ${{ steps.make_release.outputs.make_release }}
4951
steps:
5052
- name: Free Disk Space (Ubuntu)
5153
if: startsWith(runner.name, 'GitHub Actions')
5254
uses: jlumbroso/free-disk-space@main
5355
with:
54-
tool-cache: false
56+
tool-cache: true
5557
android: false
5658
dotnet: true
5759
haskell: true
@@ -64,6 +66,10 @@ jobs:
6466
submodules: recursive
6567
fetch-depth: 0
6668

69+
- name: Validate VERSION
70+
run: ../../.github/scripts/validate-version.sh
71+
working-directory: platform/android
72+
6773
- run: echo "cmake.dir=$(dirname "$(dirname "$(command -v cmake)")")" >> local.properties
6874

6975
- uses: actions/setup-java@v4
@@ -187,9 +193,9 @@ jobs:
187193

188194
- name: Build Instrumentation Tests, copy to platform/android
189195
run: |
190-
./gradlew assembleLegacyDebug assembleLegacyDebugAndroidTest -PtestBuildType=debug
191-
cp MapLibreAndroidTestApp/build/outputs/apk/legacy/debug/MapLibreAndroidTestApp-legacy-debug.apk InstrumentationTestApp.apk
192-
cp MapLibreAndroidTestApp/build/outputs/apk/androidTest/legacy/debug/MapLibreAndroidTestApp-legacy-debug-androidTest.apk InstrumentationTests.apk
196+
./gradlew assembleDrawableDebug assembleDrawableDebugAndroidTest -PtestBuildType=debug
197+
cp MapLibreAndroidTestApp/build/outputs/apk/drawable/debug/MapLibreAndroidTestApp-drawable-debug.apk InstrumentationTestApp.apk
198+
cp MapLibreAndroidTestApp/build/outputs/apk/androidTest/drawable/debug/MapLibreAndroidTestApp-drawable-debug-androidTest.apk InstrumentationTests.apk
193199
194200
- name: Upload android-ui-test
195201
uses: actions/upload-artifact@v4
@@ -200,6 +206,17 @@ jobs:
200206
platform/android/InstrumentationTestApp.apk
201207
platform/android/InstrumentationTests.apk
202208
209+
- name: VERSION file changed
210+
id: version-file-android-changed
211+
uses: tj-actions/changed-files@v46
212+
with:
213+
files: platform/android/VERSION
214+
215+
- name: Should make release?
216+
id: make_release
217+
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && steps.version-file-android-changed.outputs.any_changed == 'true'
218+
run: echo make_release=true >> "$GITHUB_OUTPUT"
219+
203220
android-build-cpp-test:
204221
runs-on: ubuntu-24.04
205222

@@ -327,6 +344,19 @@ jobs:
327344
- android-build-cpp-test
328345
- android-build-render-test
329346
steps:
347+
- name: Set success=true
348+
if: needs.android-build.result == 'success' && needs.android-build-cpp-test.result == 'success' && needs.android-build-render-test.result == 'success'
349+
run: echo success=true > "$GITHUB_ENV"
350+
330351
- name: Mark result as failed
331-
if: needs.android-build.result != 'success'
352+
if: env.success != 'true'
332353
run: exit 1
354+
355+
- uses: actions/checkout@v4
356+
if: needs.android-build.outputs.make_release == 'true' && env.success
357+
358+
- name: Trigger release
359+
if: needs.android-build.outputs.make_release == 'true' && env.success
360+
run: gh workflow run android-release.yml --ref ${{ github.sha }}
361+
env:
362+
GH_TOKEN: ${{ github.token }}

.github/workflows/android-device-test.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ jobs:
2020
testFile: RenderTests-opengl.apk,
2121
appFile: RenderTestsApp-opengl.apk,
2222
name: "Android Render Tests (OpenGL)",
23-
# Google Pixel 7 Pro
24-
devicePool: "arn:aws:devicefarm:us-west-2:373521797162:devicepool:20687d72-0e46-403e-8f03-0941850665bc/9692fe7f-86a9-4ecc-908f-175600968564"
23+
# Pixel 4a Android 12, Pixel 7 Pro Android 13
24+
devicePool: "arn:aws:devicefarm:us-west-2:373521797162:devicepool:20687d72-0e46-403e-8f03-0941850665bc/55db2b56-930a-4485-bdc0-03409a5a6060",
25+
testSpecArn: "arn:aws:devicefarm:us-west-2:373521797162:upload:20687d72-0e46-403e-8f03-0941850665bc/c1fc7d3e-dfe3-4a31-9ee0-7b0f71b08872"
2526
},
2627
{
2728
artifactName: android-render-tests-vulkan,
2829
testFile: RenderTests-vulkan.apk,
2930
appFile: RenderTestsApp-vulkan.apk,
3031
name: "Android Render Tests (Vulkan)",
31-
# Google Pixel 7 Pro
32-
devicePool: "arn:aws:devicefarm:us-west-2:373521797162:devicepool:20687d72-0e46-403e-8f03-0941850665bc/9692fe7f-86a9-4ecc-908f-175600968564",
32+
# Pixel 4a Android 12, Pixel 7 Pro Android 13
33+
devicePool: "arn:aws:devicefarm:us-west-2:373521797162:devicepool:20687d72-0e46-403e-8f03-0941850665bc/55db2b56-930a-4485-bdc0-03409a5a6060",
3334
# android-render-test.yml
3435
# see https://github.com/maplibre/ci-runners/tree/main/aws-device-farm/custom-test-envs
3536
testSpecArn: "arn:aws:devicefarm:us-west-2:373521797162:upload:20687d72-0e46-403e-8f03-0941850665bc/c1fc7d3e-dfe3-4a31-9ee0-7b0f71b08872"
@@ -76,7 +77,7 @@ jobs:
7677

7778
- id: parent_workflow
7879
run: |
79-
conclusion=$(curl ${{ github.event.workflow_run.jobs_url }} | jq -r '.jobs[] | select(.name == "android-build").conclusion')
80+
conclusion=$(curl --retry 5 ${{ github.event.workflow_run.jobs_url }} | jq -r '.jobs[] | select(.name == "android-build").conclusion')
8081
was_skipped=$([[ "$conclusion" = "skipped" || "$conclusion" = "cancelled" ]] && echo "true" || echo "false")
8182
echo "was_skipped=$was_skipped" >> "$GITHUB_OUTPUT"
8283
@@ -137,6 +138,7 @@ jobs:
137138
role-duration-seconds: 14400
138139

139140
- name: Run ${{ matrix.test.name }} on AWS Device Farm
141+
if: env.run_device_test == 'true'
140142
run: |
141143
export name="${{ matrix.test.name }}"
142144
export appType=ANDROID_APP
@@ -150,7 +152,16 @@ jobs:
150152
export testSpecArn="${{ matrix.test.testSpecArn }}"
151153
export wait_for_completion=true
152154
153-
echo run_arn="$(./scripts/aws-device-farm/aws-device-farm-run.sh)" > "$GITHUB_ENV"
155+
set +e
156+
157+
run_arn="$(./scripts/aws-device-farm/aws-device-farm-run.sh)"
158+
exit_status=$?
159+
echo "run_arn=$run_arn" >> "$GITHUB_ENV"
160+
161+
# make sure workflow fails
162+
if [ $exit_status -ne 0 ]; then
163+
exit $exit_status
164+
fi
154165
155166
- name: Store Test Artifacts
156167
if: (matrix.test.name == 'Android Benchmark' || failure()) && env.run_device_test == 'true'
@@ -159,6 +170,8 @@ jobs:
159170
results_dir="$(mktemp -d)"
160171
echo results_dir="$results_dir" >> "$GITHUB_ENV"
161172
node scripts/aws-device-farm/store-test-artifacts.mjs --runArn ${{ env.run_arn }} --outputDir "$results_dir"
173+
# unzip and delete .zip files so we don't have nested .zip
174+
find "$results_dir" -type f -name '*.zip' -exec sh -c 'unzip -o -d "$(dirname "$1")" "$1" && rm "$1"' _ {} \;
162175
zip -r test_artifacts.zip "$results_dir"
163176
164177
- name: Store Benchmark Results

.github/workflows/android-release.yml

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,43 +30,30 @@ jobs:
3030
cmakeVersion: 3.24.1
3131
ninjaVersion: latest
3232

33-
- name: Ensure source code revision
34-
run: scripts/ensure-code-revision.sh
35-
working-directory: platform/android
36-
shell: bash
37-
3833
- name: npm install
3934
run: npm install --ignore-scripts
40-
working-directory: platform/android
4135

4236
- name: Android nitpick
4337
run: make run-android-nitpick
4438

45-
- name: Update version name
46-
run: |
47-
RELEASE_VERSION="$( git describe --tags --match=android-v*.*.* --abbrev=0 | sed 's/^android-v//' )"
48-
echo version="$RELEASE_VERSION" >> "$GITHUB_ENV"
49-
echo "Latest version from tag: $RELEASE_VERSION"
50-
if [ -n "$RELEASE_VERSION" ]; then
51-
sed -i -e "s/^VERSION_NAME=.*/VERSION_NAME=${RELEASE_VERSION}/" MapLibreAndroid/gradle.properties
52-
echo "MapLibreAndroid/gradle.properties:"
53-
cat MapLibreAndroid/gradle.properties
54-
fi
55-
shell: bash
39+
- name: Validate and set version
40+
run: ../../.github/scripts/validate-version.sh
5641

5742
- name: Build package
5843
run: |
5944
RENDERER=vulkan make apackage
45+
BUILDTYPE=Debug RENDERER=vulkan make apackage
6046
RENDERER=drawable make apackage
47+
BUILDTYPE=Debug RENDERER=drawable make apackage
6148
6249
# create github release
6350
- name: Prepare release
6451
id: prepare_release
6552
run: |
6653
RELEASE_NOTES_PATH="${PWD}/release_notes.txt"
67-
node scripts/release-notes.mjs > "${RELEASE_NOTES_PATH}"
54+
node scripts/release-notes.mjs ${{ env.version }} > "${RELEASE_NOTES_PATH}"
6855
echo release_notes="${RELEASE_NOTES_PATH}" >> "$GITHUB_OUTPUT"
69-
echo version_tag="$( git describe --tags --match=android-v*.*.* --abbrev=0 )" >> "$GITHUB_OUTPUT"
56+
echo version_tag=android-v${{ env.version }} >> "$GITHUB_OUTPUT"
7057
shell: bash
7158

7259
- name: Check if version is pre-release
@@ -81,6 +68,26 @@ jobs:
8168
echo "prerelease=true" >> "$GITHUB_ENV"
8269
fi
8370
71+
- name: Create tag if it does not exist
72+
run: |
73+
git config user.name "MapLibre Team"
74+
git config user.email "[email protected]"
75+
tag="android-v${{ env.version }}"
76+
77+
if git rev-parse "$tag" >/dev/null 2>&1; then
78+
tag_sha=$(git rev-parse "$tag^{commit}")
79+
if [ "$tag_sha" = "${{ github.sha }}" ]; then
80+
echo "✅ Tag $tag exists and matches current commit SHA."
81+
exit 0
82+
else
83+
echo "::error::❌ Tag $tag exists but points to a different commit. Aborting."
84+
exit 1
85+
fi
86+
else
87+
git tag -a "$tag" -m "Publish $tag" ${{ github.sha }}
88+
git push origin "$tag"
89+
fi
90+
8491
- name: Create release
8592
id: create_release
8693
uses: actions/create-release@v1
@@ -103,6 +110,16 @@ jobs:
103110
asset_name: MapLibreAndroid-release.aar
104111
asset_content_type: application/zip
105112

113+
- name: Upload aar (OpenGL, Debug)
114+
uses: actions/upload-release-asset@v1
115+
env:
116+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
with:
118+
upload_url: ${{ steps.create_release.outputs.upload_url }}
119+
asset_path: platform/android/MapLibreAndroid/build/outputs/aar/MapLibreAndroid-drawable-debug.aar
120+
asset_name: MapLibreAndroid-debug.aar
121+
asset_content_type: application/zip
122+
106123
- name: Upload aar (Vulkan)
107124
uses: actions/upload-release-asset@v1
108125
env:
@@ -113,6 +130,16 @@ jobs:
113130
asset_name: MapLibreAndroid-release-vulkan.aar
114131
asset_content_type: application/zip
115132

133+
- name: Upload aar (Vulkan, Debug)
134+
uses: actions/upload-release-asset@v1
135+
env:
136+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
with:
138+
upload_url: ${{ steps.create_release.outputs.upload_url }}
139+
asset_path: platform/android/MapLibreAndroid/build/outputs/aar/MapLibreAndroid-vulkan-debug.aar
140+
asset_name: MapLibreAndroid-debug-vulkan.aar
141+
asset_content_type: application/zip
142+
116143
- name: Upload debug symbols (OpenGL)
117144
uses: actions/upload-release-asset@v1
118145
env:

.github/workflows/core-release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,24 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- name: Create maplibre-native-headers.tar.gz
16-
run: tar czf maplibre-native-headers.tar.gz include
15+
with:
16+
submodules: recursive
1717

18+
- name: Create maplibre-native-headers.tar.gz
19+
run: |
20+
tar czf maplibre-native-headers.tar.gz \
21+
include \
22+
vendor/maplibre-native-base/include \
23+
vendor/maplibre-native-base/deps/variant/include \
24+
vendor/maplibre-native-base/deps/geometry.hpp/include
1825
- name: Create Release
1926
run: |
2027
gh release create core-${{ github.sha }} \
2128
--draft=false \
2229
--prerelease=false \
2330
--latest=false \
2431
--title "core-${{ github.sha }}" \
25-
maplibre-native-headers.tar.gz
32+
maplibre-native-headers.tar.gz LICENSES.core.md
2633
env:
2734
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2835

0 commit comments

Comments
 (0)