Skip to content

Commit

Permalink
Make ClassDescendants behave deterministically (#220)
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 authored Sep 24, 2020
1 parent 7043538 commit 66486c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/xcake/core_ext/class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module ClassDescendants
# Returns all descendants of a class
#
def descendants
ObjectSpace.each_object(singleton_class).select { |klass| klass < self }
ObjectSpace.each_object(singleton_class).select { |klass| klass < self }.sort_by(&:to_s)
end
end
end
Expand Down

0 comments on commit 66486c8

Please sign in to comment.