xcode_requirement: require macOS 10.14.4 for Xcode 10.2.
See discussion in https://github.com/Homebrew/brew/pull/5940.
This commit is contained in:
		
							parent
							
								
									55b4522099
								
							
						
					
					
						commit
						da392cd9e8
					
				@ -13,6 +13,7 @@ class XcodeRequirement < Requirement
 | 
				
			|||||||
  def xcode_installed_version
 | 
					  def xcode_installed_version
 | 
				
			||||||
    return false unless MacOS::Xcode.installed?
 | 
					    return false unless MacOS::Xcode.installed?
 | 
				
			||||||
    return true unless @version
 | 
					    return true unless @version
 | 
				
			||||||
 | 
					    return true if xcode_swift_compatability?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    MacOS::Xcode.version >= @version
 | 
					    MacOS::Xcode.version >= @version
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
@ -20,16 +21,24 @@ class XcodeRequirement < Requirement
 | 
				
			|||||||
  def message
 | 
					  def message
 | 
				
			||||||
    version = " #{@version}" if @version
 | 
					    version = " #{@version}" if @version
 | 
				
			||||||
    message = <<~EOS
 | 
					    message = <<~EOS
 | 
				
			||||||
      A full installation of Xcode.app#{version} is required to compile this software.
 | 
					      A full installation of Xcode.app#{version} is required to compile
 | 
				
			||||||
      Installing just the Command Line Tools is not sufficient.
 | 
					      this software. Installing just the Command Line Tools is not sufficient.
 | 
				
			||||||
    EOS
 | 
					    EOS
 | 
				
			||||||
 | 
					    unless xcode_swift_compatability?
 | 
				
			||||||
 | 
					      message += <<~EOS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Xcode >=10.2 requires macOS >=10.14.4 to build many formulae.
 | 
				
			||||||
 | 
					      EOS
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    if @version && Version.new(MacOS::Xcode.latest_version) < Version.new(@version)
 | 
					    if @version && Version.new(MacOS::Xcode.latest_version) < Version.new(@version)
 | 
				
			||||||
      message + <<~EOS
 | 
					      message + <<~EOS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Xcode#{version} cannot be installed on macOS #{MacOS.version}.
 | 
					        Xcode#{version} cannot be installed on macOS #{MacOS.version}.
 | 
				
			||||||
        You must upgrade your version of macOS.
 | 
					        You must upgrade your version of macOS.
 | 
				
			||||||
      EOS
 | 
					      EOS
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      message + <<~EOS
 | 
					      message + <<~EOS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Xcode can be installed from the App Store.
 | 
					        Xcode can be installed from the App Store.
 | 
				
			||||||
      EOS
 | 
					      EOS
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@ -38,4 +47,15 @@ class XcodeRequirement < Requirement
 | 
				
			|||||||
  def inspect
 | 
					  def inspect
 | 
				
			||||||
    "#<#{self.class.name}: #{tags.inspect} version=#{@version.inspect}>"
 | 
					    "#<#{self.class.name}: #{tags.inspect} version=#{@version.inspect}>"
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  private
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # TODO: when 10.14.4 and 10.2 have been around for long enough remove this
 | 
				
			||||||
 | 
					  # method in favour of requiring 10.14.4 and 10.2.
 | 
				
			||||||
 | 
					  def xcode_swift_compatability?
 | 
				
			||||||
 | 
					    return true if MacOS::Xcode.version < "10.2"
 | 
				
			||||||
 | 
					    return true if MacOS::Xcode.version >= "10.14.4"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    MacOS.version < "10.14"
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user