Release Notes: v1.0.0
Highlights
sort-Xcode-project-file has been fully rewritten from Perl to Python 3, with zero external dependencies. The Python version produces identical sorting results to the original Perl script while adding new features, a comprehensive test suite, and atomic file writes for safety.
⚠️ Breaking Changes
- Perl script removed —
sort-Xcode-project-file.plis gone. Usesort-Xcode-project-file.pyinstead. - Python 3.9+ required — ships with Xcode Command Line Tools on macOS Monterey through Sequoia.
✨ New Features
- Stdin/stdout support (
-) — pipeproject.pbxprojcontent through stdin and receive sorted output on stdout. Supports--checkmode for CI pipelines. - Recursive directory search (
-r/--recursive) — find and sort allproject.pbxprojfiles under a directory tree. - Expanded known-file detection —
LICENSE,Makefile,Podfile,Gemfile,Cartfile,Dangerfile,Fastfile,Brewfile,Rakefile,Procfile,Dockerfile, andVagrantfileare now correctly classified as files (not directories) during sorting. --checkmode — exit 0 if already sorted, exit 1 if not. No file modification.--versionflag — prints version and exits.-w/--no-warningsflag — suppress warning messages.
🛡️ Improvements
- Atomic file writes — uses
tempfile.mkstemp()+os.replace()to ensure.pbxprojfiles are never left in a corrupted state. - Natural sort — human-friendly alphanumeric sorting (e.g.,
file2<file10), with proper leading-zero handling. - Duplicate removal — automatically deduplicates array entries (first occurrence kept).
- PBXFrameworksBuildPhase preserved — framework link order is never modified.
🧪 Testing
- 70 unit and integration tests covering natural sort, directory detection, deduplication, filename extraction, project sorting, and CLI behavior.
- 17 fixture files including edge cases for SPM packages, nested groups, special characters, multiple framework targets, and empty arrays.
- Validated against real-world Xcode projects from large open-source repositories (Alamofire, WordPress, Firefox, Signal, Wikipedia, etc.).