Skip to content

1.0.0

Latest

Choose a tag to compare

@chiahsien chiahsien released this 14 Feb 14:14

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 removedsort-Xcode-project-file.pl is gone. Use sort-Xcode-project-file.py instead.
  • Python 3.9+ required — ships with Xcode Command Line Tools on macOS Monterey through Sequoia.

✨ New Features

  • Stdin/stdout support (-) — pipe project.pbxproj content through stdin and receive sorted output on stdout. Supports --check mode for CI pipelines.
  • Recursive directory search (-r / --recursive) — find and sort all project.pbxproj files under a directory tree.
  • Expanded known-file detectionLICENSE, Makefile, Podfile, Gemfile, Cartfile, Dangerfile, Fastfile, Brewfile, Rakefile, Procfile, Dockerfile, and Vagrantfile are now correctly classified as files (not directories) during sorting.
  • --check mode — exit 0 if already sorted, exit 1 if not. No file modification.
  • --version flag — prints version and exits.
  • -w / --no-warnings flag — suppress warning messages.

🛡️ Improvements

  • Atomic file writes — uses tempfile.mkstemp() + os.replace() to ensure .pbxproj files 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.).