Fix iOS build to respect cleanup_exclude_files config#2
Open
billythekid wants to merge 2 commits intoNativePHP:mainfrom
Open
Fix iOS build to respect cleanup_exclude_files config#2billythekid wants to merge 2 commits intoNativePHP:mainfrom
billythekid wants to merge 2 commits intoNativePHP:mainfrom
Conversation
The iOS build's removeUnnecessaryFiles() method was using a hardcoded list of directories to remove, ignoring the user-configurable 'cleanup_exclude_files' setting in config/nativephp.php. This caused issues when users had large directories that should be excluded from the bundle, resulting in the zip process timing out. This change brings the iOS build in line with the Android build, which already respects the cleanup_exclude_files config via PreparesBuild. Also handles null config values gracefully with null coalescing.
The cleanup_exclude_files config option is documented as supporting both files and folders, but the previous implementation only processed them as directories. This update properly checks each path and handles it appropriately - using File::deleteDirectory() for directories and unlink() for files.
simonhamp
approved these changes
Feb 23, 2026
5 tasks
Author
|
I'd defer to the subsequent PRs you've linked here. I have a gut feeling there was another thing I missed in this I meant to return to and never did that bit me again. Happy to have this closed as a wontfix/favoured other PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The iOS build's
removeUnnecessaryFiles()method was using a hardcoded list of directories to remove, ignoring the user-configurablecleanup_exclude_filessetting inconfig/nativephp.php.Problem
This caused issues when users had large directories that should be excluded from the bundle, resulting in the zip process timing out during
native:run ios.Solution
This change:
cleanup_exclude_filesconfig option, bringing the iOS build in line with the Android build which already respects this config viaPreparesBuild.File::deleteDirectory()for directories andunlink()for files.?? []).Changes
src/Commands/BuildIosAppCommand.php: UpdatedremoveUnnecessaryFiles()to read fromconfig('nativephp.cleanup_exclude_files')and handle both files and directoriestests/Feature/IosBuildCleanupTest.php: Added 7 tests covering the cleanup behaviorTests
All 7 new tests pass: