Created
April 24, 2020 17:29
-
-
Save alloy/7cd9001b104bf5049849c57a612c868a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'xcodeproj' | |
require 'pp' | |
unless (project_path = ARGV[0]) && (target_name = ARGV[1]) | |
raise "Usage: ruby #{__FILE__} path/to/the.xcodeproj target-name [diff-base-config]" | |
end | |
project = Xcodeproj::Project.open(project_path) | |
target = project.targets.find { |t| t.name == target_name } | |
if diff_base_config = ARGV[2] | |
require 'hashdiff' | |
base_config = target.build_configurations.find { |c| c.name == diff_base_config } | |
target.build_configurations.each do |config| | |
next if config.name == base_config.name | |
puts "=" * 80 | |
puts config.name | |
puts "=" * 80 | |
pp Hashdiff.diff(base_config.build_settings, config.build_settings) | |
puts | |
end | |
else | |
target.build_configurations.each do |config| | |
puts "=" * 80 | |
puts config.name | |
puts "=" * 80 | |
pp config.build_settings | |
puts | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment