Add an xcodebuild helper and deprecate system "xcodebuild"

In the future we can remove the ENV munging branch from Formula#system.

Closes Homebrew/homebrew#27081.
This commit is contained in:
Jack Nagel 2014-02-27 21:47:38 -06:00
parent 4928b4e02c
commit c72f9a469d
2 changed files with 8 additions and 0 deletions

View File

@ -90,4 +90,11 @@ module FileUtils extend self
def ruby *args def ruby *args
system RUBY_PATH, *args system RUBY_PATH, *args
end end
def xcodebuild *args
removed = ENV.remove_cc_etc
system "xcodebuild", *args
ensure
ENV.update(removed)
end
end end

View File

@ -565,6 +565,7 @@ class Formula
ohai "#{cmd} #{pretty_args*' '}".strip ohai "#{cmd} #{pretty_args*' '}".strip
if cmd.to_s.start_with? "xcodebuild" if cmd.to_s.start_with? "xcodebuild"
opoo %{system "xcodebuild" is deprecated, use the xcodebuild method instead}
removed_ENV_variables.update(ENV.remove_cc_etc) removed_ENV_variables.update(ENV.remove_cc_etc)
end end