Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made some grammar and block indentation changes #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@ xUnique
=======

*xUnique*, is a pure Python script to regenerate ``project.pbxproj``,
a.k.a the Xcode project file, and make it unique and same on any
a.k.a the Xcode project file, and make it unique and the same on any
machine.

As you may know, the UUID generated by Xcode (a.k.a
`rfc4122 <http://www.ietf.org/rfc/rfc4122.txt>`__) in the file is not
unique for the same added file( or other entries like groups,build
phases,etc.) on different machines, which makes it a developer's
unique for the same added file (or other entries like groups, build
phases, etc.) on different machines, which makes it a developer's
nightmare to merge and resolve conflicts in ``project.pbxproj``.

*xUnique* convert all the 96bits ``UUID``\ (24 alphanumeric chars) to
MD5 hex digest(32 hex chars), and Xcode do recognize these MD5 digests.
*xUnique* converts all the 96bits ``UUID`` (24 alphanumeric chars) to
MD5 hex digest (32 hex chars); Xcode recognizes these MD5 digests.

What it does & How it works
---------------------------

#. convert ``project.pbxproj`` to JSON format
#. Convert ``project.pbxproj`` to JSON format
#. Iterate all ``objects`` in JSON and give every UUID an absolute path,
and create a new UUID using MD5 hex digest of the path

- All elements in this json object is actually connected as a tree
- All elements in this JSON object are actually connected as a tree.
- We give a path attribute to every node of the tree using its
unique attribute; this path is the absolute path to the root node,
- Apply MD5 hex digest to the path for the node
unique attribute; this path is the absolute path to the root node.
- Apply MD5 hex digest to the path for the node.

#. Replace all old UUIDs with the MD5 hex digest and also remove unused
UUIDs that are not in the current node tree and UUIDs in wrong format
#. Sort the project file inlcuding ``children``, ``files``,
UUIDs that are not in the current node tree and any UUIDs with the wrong format.
#. Sort the project file including ``children``, ``files``,
``PBXFileReference`` and ``PBXBuildFile`` list and remove all
duplicated entries in these lists
duplicated entries in these lists.

- see ``sort_pbxproj`` method in xUnique.py if you want to know the
implementation;
Expand Down Expand Up @@ -161,11 +161,11 @@ Use options in xUnique:

$ xunique [options] "path_to/YourProject.xcodeproj/or_project.pbxproj"

-v print verbose output, and generate ``debug_result.json`` file for debug.
-u uniquify project file, that is, replace UUID to MD5 digest.
-s sort project file including ``children``, ``files``, ``PBXFileReference`` and ``PBXBuildFile`` list and remove all duplicated entries in these lists. Supports both original and uniquified project file.
-p sort ``PBXFileReference`` and ``PBXBuildFile`` sections in project file ordered by file names. Only works with ``-s``. Before v4.0.0, this was hard-coded in ``-s`` option and cannot be turned off. Starting from v4.0.0, without this option along with ``-s``, xUnique will sort these two types by MD5 digests, the same as Xcode does.
-c When project file was modified, xUnique quit with non-zero status. Without this option, the status code would be zero if so. This option is usually used in Git hook to submit xUnique result combined with your original new commit.
-v print verbose output, and generate ``debug_result.json`` file for debug.
-u uniquify project file, that is, replace UUID to MD5 digest.
-s sort project file including ``children``, ``files``, ``PBXFileReference`` and ``PBXBuildFile`` list and remove all duplicated entries in these lists. Supports both original and uniquified project file.
-p sort ``PBXFileReference`` and ``PBXBuildFile`` sections in project file ordered by file names. Only works with ``-s``. Before v4.0.0, this was hard-coded in ``-s`` option and cannot be turned off. Starting from v4.0.0, without this option along with ``-s``, xUnique will sort these two types by MD5 digests, the same as Xcode does.
-c When project file was modified, xUnique quit with non-zero status. Without this option, the status code would be zero if so. This option is usually used in Git hook to submit xUnique result combined with your original new commit.

**Note**: If neither ``-u`` nor ``-s`` exists, ``-u -s`` will be appended to existing option list.

Expand Down