From bccd792bbffaf0c219f402d893be4c5c0d284d97 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 5 Nov 2016 10:36:13 -0400 Subject: [PATCH] diagnostic: add checks for minimum Xcode/CLT versions. --- Library/Homebrew/extend/os/mac/diagnostic.rb | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index 0ac95bfd98..883565749a 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -104,6 +104,27 @@ module Homebrew EOS end + def check_xcode_minimum_version + return unless MacOS::Xcode.installed? + return unless MacOS::Xcode.minimum_version? + + <<-EOS.undent + Your Xcode (#{MacOS::Xcode.version}) is too outdated. + Please update to Xcode #{MacOS::Xcode.latest_version} (or delete it). + #{MacOS::Xcode.update_instructions} + EOS + end + + def check_clt_minimum_version + return unless MacOS::CLT.installed? + return unless MacOS::CLT.minimum_version? + + <<-EOS.undent + Your Command Line Tools are too outdated. + #{MacOS::CLT.update_instructions} + EOS + end + def check_for_osx_gcc_installer return unless MacOS.version < "10.7" || ((MacOS::Xcode.version || "0") > "4.1") return unless DevelopmentTools.clang_version == "2.1"