Context: this is needed for demos such as PR #3770, which include ProGuard/R8 rules and native code.
ProGuard/R8 rules
If a demo contains proguard-rules.pro, copy it to
mas-app-android/app/proguard-rules.pro before building the APK.
Ensure demos that rely on ProGuard/R8 are built with the release build type, because the current workflow uses assembleDebug, which does not apply the release proguardFiles configuration or minification.
The workflow should produce the corresponding release APK when release-specific behavior is required.
Native libraries
If a demo contains native source files or CMake configuration, copy them into the Android app before building.
Support at least:
- CMakeLists.txt
- *.c
- *.cc
- *.cpp
- *.h
- *.hpp
Copy them to: mas-app-android/app/src/main/cpp/
The workflow should also support demo-specific Gradle native build configuration through build.gradle.kts.sections, for example externalNativeBuild, ndkVersion, and ABI filters.
Generic APK validation for native demos
For demos using CMakeLists.txt, it might be possible to add a generic validation step after building the APK.
The validation should parse native library names from add_library( SHARED ...) entries in CMakeLists.txt and verify that the generated APK contains the corresponding shared library:
lib/<abi>/lib<name>.so
If parsing CMakeLists.txt is considered too fragile, skip this validation and only ensure the files are copied and the build succeeds.
Acceptance criteria
- Demos with proguard-rules.pro have those rules copied into the base Android app before the build.
- Demos that require ProGuard/R8 can be built as release APKs.
- Demos with CMakeLists.txt and native source files have those files copied to app/src/main/cpp/.
- Demos can inject native Gradle configuration using build.gradle.kts.sections.
- Native demo builds generate APKs containing the expected .so files without hardcoded library names.
- Existing Android demos without ProGuard or native code continue to build as before.
Context: this is needed for demos such as PR #3770, which include ProGuard/R8 rules and native code.
ProGuard/R8 rules
If a demo contains
proguard-rules.pro, copy it tomas-app-android/app/proguard-rules.probefore building the APK.Ensure demos that rely on ProGuard/R8 are built with the release build type, because the current workflow uses assembleDebug, which does not apply the release proguardFiles configuration or minification.
The workflow should produce the corresponding release APK when release-specific behavior is required.
Native libraries
If a demo contains native source files or CMake configuration, copy them into the Android app before building.
Support at least:
Copy them to:
mas-app-android/app/src/main/cpp/The workflow should also support demo-specific Gradle native build configuration through build.gradle.kts.sections, for example externalNativeBuild, ndkVersion, and ABI filters.
Generic APK validation for native demos
For demos using CMakeLists.txt, it might be possible to add a generic validation step after building the APK.
The validation should parse native library names from add_library( SHARED ...) entries in CMakeLists.txt and verify that the generated APK contains the corresponding shared library:
lib/<abi>/lib<name>.soIf parsing CMakeLists.txt is considered too fragile, skip this validation and only ensure the files are copied and the build succeeds.
Acceptance criteria