mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-24 04:46:05 +08:00
add warning message
This commit is contained in:
@@ -73,20 +73,32 @@ module Motion; module Project
|
||||
|
||||
def xcode_dir
|
||||
@xcode_dir ||= begin
|
||||
xcode_dot_app_path = '/Applications/Xcode.app/Contents/Developer'
|
||||
|
||||
# First, honor /usr/bin/xcode-select
|
||||
xcodeselect = '/usr/bin/xcode-select'
|
||||
if File.exist?(xcodeselect)
|
||||
path = `#{xcodeselect} -print-path`.strip
|
||||
if path != xcode_dot_app_path and File.exist?(xcode_dot_app_path)
|
||||
@xcode_error_printed ||= false
|
||||
$stderr.puts(<<EOS) unless @xcode_error_printed
|
||||
===============================================================================
|
||||
It appears that you have a version of Xcode installed in /Applications that has
|
||||
not been set as the default version. It is possible that RubyMotion may be
|
||||
using old versions of certain tools which could eventually cause issues.
|
||||
|
||||
To fix this problem, you can type the following command in the terminal:
|
||||
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
|
||||
===============================================================================
|
||||
EOS
|
||||
@xcode_error_printed = true
|
||||
end
|
||||
return path if File.exist?(path)
|
||||
end
|
||||
|
||||
# Since xcode-select is borked, we assume the user installed Xcode
|
||||
# as an app (new in Xcode 4.3).
|
||||
path = '/Applications/Xcode.app'
|
||||
if File.exist?(path)
|
||||
path = File.join(path, 'Contents/Developer')
|
||||
return path if File.exist?(path)
|
||||
end
|
||||
return xcode_dot_app_path if File.exist?(xcode_dot_app_path)
|
||||
|
||||
App.fail "Can't locate any version of Xcode on the system."
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user