Class: XcodeRequirement Private

Inherits:
Requirement show all
Defined in:
requirements/xcode_requirement.rb,
extend/os/linux/requirements/xcode_requirement.rb

Overview

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

A requirement on Xcode.

Constant Summary collapse

Cache =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

type_template { { fixed: T::Hash[String, T.untyped] } }

Constants included from Dependable

Dependable::KEEP_BUT_PRUNE_RECURSIVE_DEPS, Dependable::PRUNE, Dependable::RESERVED_TAGS, Dependable::SKIP

Instance Attribute Summary collapse

Attributes inherited from Requirement

#cask, #download, #name, #tags

Instance Method Summary collapse

Methods inherited from Requirement

cask, download, #env, env, #env_proc, expand, fatal, #fatal?, inherited, #mktemp, #modify_build_environment, #option_names, prune?, #satisfied?, #satisfied_result_parent, satisfy, #tap, #which

Methods included from BuildEnvironment::DSL

#env, #inherited

Methods included from Cachable

#cache, #clear_cache

Methods included from Utils::Output::Mixin

#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_install_status, #pretty_installed, #pretty_outdated, #pretty_uninstalled, #pretty_upgradable

Methods included from Dependable

#build?, #implicit?, #no_linkage?, #option_names, #option_tags, #optional?, #options, #prune_from_option?, #prune_if_build_and_not_dependent?, #recommended?, #required?, #tags, #test?

Constructor Details

#initialize(tags = []) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:



24
25
26
27
28
# File 'requirements/xcode_requirement.rb', line 24

def initialize(tags = [])
  version = tags.shift if tags.first.to_s.match?(/(\d\.)+\d/)
  @version = T.let(version&.to_s, T.nilable(String))
  super
end

Instance Attribute Details

#versionString? (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



16
17
18
# File 'requirements/xcode_requirement.rb', line 16

def version
  @version
end

Instance Method Details

#display_sString

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



65
66
67
68
69
# File 'requirements/xcode_requirement.rb', line 65

def display_s
  return "#{name.capitalize} (on macOS)" unless @version

  "#{name.capitalize} >= #{@version} (on macOS)"
end

#messageString

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'requirements/xcode_requirement.rb', line 39

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 @version && Version.new(MacOS::Xcode.latest_version) < Version.new(@version)
    message + <<~EOS

      Xcode#{version} cannot be installed on macOS #{MacOS.version}.
      You must upgrade your version of macOS.
    EOS
  else
    message + <<~EOS

      Xcode can be installed from the App Store.
    EOS
  end
end

#xcode_installed_version!Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Boolean)


8
9
10
# File 'extend/os/linux/requirements/xcode_requirement.rb', line 8

def xcode_installed_version!
  true
end