gradle-native
gradle-native copied to clipboard
Provide Xcode/iOS/macOS compare and merge tasks
Comparing Xcode workspace/project, macOS and iOS files can be a daunting task. Although the models are usually text-based, they don't allow for easy editing/comparison. It's especially true when merging these files during a merge conflict. Given we are introducing a lot of modelling code for some of those files, we could/should provide convenient tasks to compare and merge those files. It's important that we integrate with the user's compare/merge tools. We won't provide any diff/merge tools.
We should implement the following process:
- Normalize the left and right files. It ensures both files are as closely related as possible.
- Use the normalized files in the diff/merge tools. At this point, the diff and merge tools will work as normally intended on text files.
- Reconcile the left/right files (for diff) or the merge file (for merge). During the reconciliation, we map the files back to their original format with the added/removed/modified content.
In theory, diff/merge should be much easier as all the formatting will be taken out of the equation. For some files (say xcodeproj
) we can validate the resulting files don't have any invalid internal pointers. In the cases where the resulting files are invalid, we can point the user to some FYI information to solve the issue or revert back.
The UX would be something like this:
$ ./gradlew diff --left=../master-work-tree/Foo.xcodeproj --right=Foo.xcodeproj
We will have to deal with the rich console which may or may not be an issue. Ideally, it should feel pretty close to using a normal diff/merge tool with the exception that we launch a Gradle task to perform the required modification.