Create method for accessing Xcode version.

This commit is contained in:
Mike McQuaid 2011-05-18 16:10:31 +01:00
parent dae5a4477b
commit f8127143cf
2 changed files with 6 additions and 2 deletions

View File

@ -18,8 +18,7 @@ module Homebrew extend self
end
def xcode_version
`xcodebuild -version 2>&1` =~ /Xcode (\d(\.\d)*)/
$1
@xcode_version || MacOS.xcode_version
end
def llvm_recommendation

View File

@ -271,6 +271,11 @@ module MacOS extend self
end
end
def xcode_version
`xcodebuild -version 2>&1` =~ /Xcode (\d(\.\d)*)/
$1
end
def llvm_build_version
unless xcode_prefix.to_s.empty?
llvm_gcc_path = xcode_prefix/"usr/bin/llvm-gcc"