From 0e25fc01430ae10cc5638d9b0ae9c1784821d2c0 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 16 Jul 2016 21:01:34 +0100 Subject: [PATCH] xcode: add update instruction helpers. --- Library/Homebrew/os/mac/xcode.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 0936806986..65ba50e9e2 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -72,6 +72,19 @@ module OS !prefix.nil? end + def update_instructions + if MacOS.version >= "10.9" && !OS::Mac.prerelease? + <<-EOS.undent + Xcode can be updated from the App Store. + EOS + else + <<-EOS.undent + Xcode can be updated from + https://developer.apple.com/xcode/downloads/ + EOS + end + end + def version # may return a version string # that is guessed based on the compiler, so do not @@ -166,6 +179,20 @@ module OS !!detect_version end + def update_instructions + if MacOS.version >= "10.9" + <<-EOS.undent + Update them from Software Update in the App Store. + EOS + elsif MacOS.version == "10.8" || MacOS.version == "10.7" + <<-EOS.undent + The standalone package can be obtained from + https://developer.apple.com/downloads + or it can be installed via Xcode's preferences. + EOS + end + end + def latest_version case MacOS.version when "10.12" then "800.0.33.1"