Migrate build system to Kotlin DSL, centralize versions, and modernize source files#1171
Migrate build system to Kotlin DSL, centralize versions, and modernize source files#1171Jake-The-Human wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request performs a major build system upgrade, updating the Android Gradle Plugin, Kotlin, Gradle, and CMake versions across all sample modules, while migrating build files to Kotlin DSL and centralizing SDK configurations in the Version Catalog. It also modernizes C++ standard library headers and cleans up deprecated Android APIs. Feedback highlights a potential crash in NativeAudio.java due to unsafe parsing of nullable audio manager properties, and an improper process termination in VulkanActivity.kt that should be replaced with standard activity lifecycle methods.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
* Migrate all Gradle build scripts (build.gradle, settings.gradle) from Groovy to Kotlin DSL (.kts). * Centralize dependency and plugin management using a Version Catalog (libs.versions.toml). * Implement convention plugins in `build-logic` to encapsulate shared Android, NDK, and Kotlin configurations. * Upgrade CMake minimum version to 4.1.0 across all modules. * Update README.md to reflect modern build requirements and Gradle 10 readiness. * Refactor native-midi and hello-vulkan to handle non-final resource IDs and remove deprecated APIs. * Fix template syntax in vectorization benchmark for improved C++ standards compliance.
4d126c9 to
b07a600
Compare
Removed module-specific minSdk overrides to rely on the centralized value defined in the Version Catalog and applied via convention plugins.
* Refactor CameraActivity to use lambdas for UI listeners and fix precision in slider positioning. * Modernize NDKHelper with text blocks and remove deprecated TargetApi annotations. * Remove unused imports across modified Java files for better code health.
* Optimized C++ includes and modernized headers across multiple modules (camera, gles, teapots, vectorization). * Cleaned up unused and redundant Java/Kotlin imports in all sample applications. * Standardized header guards and include patterns for better compilation performance and consistency. * Removed deprecated annotations and unused resource references.
* Applied consistent minSdk and import formatting to teapots and native modules. * Cleaned up remaining Java source inconsistencies in NativeAudio and NDKHelper.
b07a600 to
bcbcb40
Compare
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Sharjeel-Khan
left a comment
There was a problem hiding this comment.
Thanks for cleaning all of this up.
I think it might be a good idea to tell Android Studio that we are doing this so they are not surprised during the next QA for the NDK.
| minSdk = "24" | ||
| ndk = "29.0.14206865" | ||
| cmake = "4.1.2" | ||
| javaTarget = "17" |
There was a problem hiding this comment.
Aside from compileSdk and targetSdk, do we want to make everything minimum? I only mention this because Dan used to say we should make sure the minimum specs we mention works with everything.
The ndk will be bumped to NDK r30 after it releases but the LTS is 27.
There was a problem hiding this comment.
i removed the ndk version line and did a clean build and android studio install 28.2.13676358 on its own. so im not sure what we should do.
15c9f0c to
5519e4e
Compare
Overview
This PR modernizes the build system across the
ndk-samplesrepository by migrating to the Kotlin DSL and centralizing dependency management. It also includes comprehensive cleanups for C++ and Java source files to adhere to modern standards.Key Changes
build.gradlefiles tobuild.gradle.kts(Kotlin DSL) across all sample modules.libs.versions.toml) to manage dependencies and SDK versions centrally.compileSdkandtargetSdkto 37.minSdkto 24.4.1.0in allCMakeLists.txtfiles.<math.h>with<cmath>,<stdlib.h>with<cstdlib>, etc.).README.mdwith new build instructions and Android Studio recommendations.fix_gradle.pyandimplementation_plan.artifact.md.Testing