Tag Xcode and CLT requirements as build-time
This way they can be skipped when installing bottles.
This commit is contained in:
parent
620c063f8c
commit
e05a509fb6
@ -229,6 +229,7 @@ class Requirement
|
||||
|
||||
def initialize(*tags)
|
||||
@tags = tags.flatten.compact
|
||||
@tags << :build if self.class.build
|
||||
end
|
||||
|
||||
# The message to show when the requirement is not met.
|
||||
@ -287,6 +288,10 @@ class Requirement
|
||||
val.nil? ? @fatal : @fatal = val
|
||||
end
|
||||
|
||||
def build(val=nil)
|
||||
val.nil? ? @build : @build = val
|
||||
end
|
||||
|
||||
def satisfy(options={}, &block)
|
||||
@satisfied ||= Requirement::Satisfier.new(options, &block)
|
||||
end
|
||||
|
||||
@ -204,6 +204,7 @@ end
|
||||
|
||||
class XcodeDependency < Requirement
|
||||
fatal true
|
||||
build true
|
||||
|
||||
satisfy(:build_env => false) { MacOS::Xcode.installed? }
|
||||
|
||||
@ -274,6 +275,7 @@ end
|
||||
|
||||
class CLTDependency < Requirement
|
||||
fatal true
|
||||
build true
|
||||
|
||||
def satisfied?
|
||||
MacOS::CLT.installed?
|
||||
|
||||
@ -87,4 +87,9 @@ class RequirementTests < Test::Unit::TestCase
|
||||
|
||||
req.modify_build_environment
|
||||
end
|
||||
|
||||
def test_dsl_build
|
||||
req = Class.new(Requirement) { build true }.new
|
||||
assert req.build?
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user