blob: a5f078c6290ccbdcf0a38bf5b342e61c51e16604 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
require "requirement"
class XcodeRequirement < Requirement
fatal true
satisfy(build_env: false) { xcode_installed_version }
def initialize(tags = [])
@version = tags.find { |tag| tags.delete(tag) if tag =~ /(\d\.)+\d/ }
super
end
def xcode_installed_version
return false unless MacOS::Xcode.installed?
return true unless @version
MacOS::Xcode.version >= @version
end
def message
version = " #{@version}" if @version
message = <<~EOS
A full installation of Xcode.app#{version} is required to compile this software.
Installing just the Command Line Tools is not sufficient.
EOS
if MacOS.version >= :lion
message + <<~EOS
Xcode can be installed from the App Store.
EOS
else
message + <<~EOS
Xcode can be installed from #{Formatter.url("https://developer.apple.com/download/more/")}.
EOS
end
end
def inspect
"#<#{self.class.name}: #{name.inspect} #{tags.inspect} version=#{@version.inspect}>"
end
end
|