ReviewOS

also looking at this

craft-native/craft

feat(maps): add key-free native Android maps and shared map controls

#363
Merged chris wants to merge codex/wildloop-native-map-providers into main
28 files +1857 -481

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

.github/workflows/mobile-e2e.ymlmodified+4-8
Changes to .github/workflows/mobile-e2e.yml
@@ -657,16 +657,11 @@ jobs:
657657 echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
658658 sudo udevadm control --reload-rules
659659 sudo udevadm trigger --name-match=kvm
660 - uses: reactivecircus/android-emulator-runner@v2
660 - name: Run native acceptance on the SDK-owned emulator
661661 env:
662662 CRAFT_NATIVE_TEST_PROJECT: ${{ steps.native-project.outputs.project }}
663 with:
664 api-level: ${{ matrix.api-level }}
665 arch: x86_64
666 profile: pixel_6
667 emulator-options: -no-window -no-snapshot-save -gpu swiftshader_indirect -noaudio -no-boot-anim
668 disable-animations: false
669 script: bash packages/android/scripts/run-native-navigation-device.sh
663 CRAFT_ANDROID_NATIVE_API: ${{ matrix.api-level }}
664 run: bun scripts/run-native-android-acceptance.ts
670665 - name: Require the selected Android suite to pass without skips
671666 run: |
672667 python3 - <<'PY'
@@ -688,6 +683,7 @@ jobs:
688683 name: android-navigation-recovery-api${{ matrix.api-level }}
689684 path: |
690685 artifacts/android-navigation/**/app/build/outputs/androidTest-results/**
686 artifacts/android-navigation/emulator/**
691687 artifacts/android-navigation/**/app/build/reports/androidTests/**
692688 artifacts/android-navigation/**/app/build/outputs/connected_android_test_additional_output/**
693689 artifacts/android-navigation/launcher-*.txt
scripts/run-native-android-acceptance.tsadded+29-0
Changes to scripts/run-native-android-acceptance.ts
@@ -0,0 +1,29 @@
1import { dirname, resolve } from 'node:path'
2import { createAndroidEmulator } from '../packages/android/src/emulator'
3
4// The SDK owns startup and disposal; acceptance still requires a responsive
5// native launcher and rejects every platform ANR/crash before and after tests.
6const api = process.env.CRAFT_ANDROID_NATIVE_API
7if (!['34', '35'].includes(api ?? '')) throw new Error('Select a maintained Android native acceptance API: 34 or 35')
8if (!process.env.CRAFT_NATIVE_TEST_PROJECT) throw new Error('Compile the native fixture before booting Android')
9const sdkRoot = process.env.ANDROID_HOME ?? process.env.ANDROID_SDK_ROOT
10const sdkmanager = Bun.which('sdkmanager')
11const avdmanager = Bun.which('avdmanager')
12if (!sdkRoot || !sdkmanager || !avdmanager) throw new Error('Install the normal Android SDK command-line tools first')
13const abi = process.arch === 'arm64' ? 'arm64-v8a' : 'x86_64'
14const session = await createAndroidEmulator({
15 sdkRoot, sdkmanager, avdmanager, image: `system-images;android-${api};default;${abi}`,
16 acceleration: 'hardware', acceptLicenses: true,
17 artifactsDirectory: resolve('artifacts/android-navigation/emulator'),
18})
19try {
20 const test = Bun.spawn(['bash', 'packages/android/scripts/run-native-navigation-device.sh'], {
21 env: { ...session.env, PATH: `${dirname(session.adb)}:${session.env.PATH ?? ''}` },
22 stdout: 'inherit', stderr: 'inherit',
23 })
24 const code = await test.exited
25 if (code !== 0) throw new Error(`Native Android acceptance failed with exit ${code}`)
26}
27finally {
28 await session.dispose()
29}