Build Process Enhancement: Exclude redundant source files from `dists` directory
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- android, python
- Domain
- build-system, mobile
Research direction
Start by locating the assemble_distribution method in SDLGradleBootstrap and the other bootstrap implementations. Trace how the temporary build directory is copied into dists/<dist_name>, then verify that the distribution retains compiled libraries while excluding the redundant jni/ sources and obj/ files. Confirm the change with the project’s available build or distribution checks.
Written by the indexing model from the issue text.
Description
Problem Description
The current assemble_distribution method in the SDLGradleBootstrap (and other bootstraps) copies the entire temporary build directory into the final dists/<dist_name> 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:
- 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.
- Slower Build Times: The file I/O for copying of unnecessary source code adds a small but noticeable delay to the build process.
- 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.
- Dominant language
- Python
- Stars
- 8.9k
- Forks
- 2k
- Avg merge
- 12h 20m
- Merged PRs (30d)
- 9
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from kivy/python-for-android
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
kivy/python-for-android#3335 · 1 comment · 3 reactions ·
-
Documentation easy
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
kivy/python-for-android#3326 · 1 comment ·
-
Documentation easy Priority: Low
Difficulty 1/5 Under an hour Newbie friendliness 88/100
kivy/python-for-android#3299 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
kivy/python-for-android#3382 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
kivy/python-for-android#3381 ·
All issues in kivy/python-for-android
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 90/100