Skip to content

Instantly share code, notes, and snippets.

@alloy
Created April 24, 2020 17:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alloy/7cd9001b104bf5049849c57a612c868a to your computer and use it in GitHub Desktop.
Save alloy/7cd9001b104bf5049849c57a612c868a to your computer and use it in GitHub Desktop.
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