kivy / kivy/python-for-android
Build Process Enhancement: Exclude redundant source files from `dists` directory
- 主要语言
- Python
- 星标
- 8.9k
- 派生
- 2k
- 平均合并
- 12 小时 20 分钟
- 30 天内合并 PR
- 9
描述
**Problem Description**
The current `assemble_distribution` method in the `SDLGradleBootstrap` (and other bootstraps) copies the entire temporary build directory into the final `dists/` directory.
This process works reliably, but it results in a `dists` directory that contains a large number of redundant files. Specifically, it includes the complete C/C++ source code for all the `BootstrapNDKRecipe` dependencies (like SDL2, SDL2_image, etc.) in the `jni/` subfolder, as well as intermediate object files in `obj/`.
This is unnecessary because these source files have already been compiled by `ndk-build` into the final `.so` libraries located in the `libs/` directory. The subsequent Gradle build step only uses these pre-compiled libraries and does not re-compile the C/C++ source.
This behavior has a few negative consequences:
1. **Increased Disk Usage:** It significantly inflates the size of the distribution, which can be problematic in CI/CD environments or on systems with limited disk space.
2. **Slower Build Times:** The file I/O for copying of unnecessary source code adds a small but noticeable delay to the build process.
3. **Confusing Project Structure:** The presence of the `jni/` sources in the final Gradle project can be misleading, suggesting that Gradle might be compiling them, which it is not. A cleaner project structure would be easier to debug and understand.
**Note:** This issue does **not** affect the final size of the APK, as the Android packaging tools correctly exclude the source code. This is purely an enhancement for the intermediate build process.
贡献指南
调研方向
首先定位 SDLGradleBootstrap 和其他 bootstrap 实现中的 assemble_distribution 方法。跟踪临时 build 目录如何复制到 dists/,然后验证 distribution 是否保留已编译的库,同时排除冗余的 jni/ 源文件和 obj/ 文件。使用项目中可用的 build 或 distribution 检查确认此次更改。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, python
- 领域
- build-system, mobile
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100