Skip to content

Commit

Permalink
Merge branch 'saudi/fix-xcode-determinism' into 'main'
Browse files Browse the repository at this point in the history
Fix XCode generation determinism issues in ProjectItems

See merge request Sharpmake/sharpmake!549
  • Loading branch information
jspelletier committed Sep 6, 2024
2 parents 6184106 + 01a326a commit 8091c7e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Sharpmake.Generators/Apple/XCodeProj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ private void WriteSection<ProjectItemType>(Project.Configuration configuration,
{
if (projectItems.Any(p => p is ProjectFolder))
{
// TODO those transformations should probably be made during PrepareSections()
List<ProjectFileSystemItem> emptyProjectFolders = new List<ProjectFileSystemItem>();
GetEmptyProjectFolders(projectItems, emptyProjectFolders);
// clean empty node
Expand All @@ -1303,10 +1304,8 @@ private void WriteSection<ProjectItemType>(Project.Configuration configuration,
RemoveFromFileSystem(c);
}
}
else
{
projectItems = projectItems.OrderBy(item => item.Uid, StringComparer.Ordinal);
}

projectItems = projectItems.OrderBy(item => item.Uid, StringComparer.Ordinal);

ProjectItem firstItem = projectItems.First();
using (fileGenerator.Declare("item", firstItem))
Expand Down Expand Up @@ -1657,7 +1656,7 @@ public override string ToString()

public bool Equals(ProjectItem other)
{
return _hashCode == other._hashCode;
return _uid == other._uid;
}

public int CompareTo(ProjectItem other)
Expand Down

0 comments on commit 8091c7e

Please sign in to comment.