Skip to content

Commit

Permalink
Make ClassDescendants behave deterministically
Browse files Browse the repository at this point in the history
Sort descendants by class name.  This ensures that generators are run in
a deterministic order.

(With this, plus changes to `xcodeproj`, plus manually calling
`predictabilize_uuids` in my Cakefile, I can get the same
project.pbxproj output across multiple runs.)
  • Loading branch information
comex committed Sep 23, 2020
1 parent 7043538 commit e001f87
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/xcake/core_ext/class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module ClassDescendants
#
def descendants
ObjectSpace.each_object(singleton_class).select { |klass| klass < self }
.sort_by { |klass| klass.to_s }
end
end
end
Expand Down

0 comments on commit e001f87

Please sign in to comment.