Class: Pod::BuildType
- Inherits:
-
Object
- Object
- Pod::BuildType
- Defined in:
- lib/cocoapods-core/build_type.rb
Constant Summary collapse
- KNOWN_PACKAGING_OPTIONS =
Returns known packaging options.
%i(library framework).freeze
- KNOWN_LINKAGE_OPTIONS =
Returns known linking options.
%i(static dynamic).freeze
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#linkage ⇒ Symbol
readonly
The linkage for this build type, one of #KNOWN_LINKAGE_OPTIONS.
-
#packaging ⇒ Symbol
readonly
The packaging for this build type, one of #KNOWN_PACKAGING_OPTIONS.
Class Method Summary collapse
-
.dynamic_framework ⇒ BuildType
The build type for a dynamic framework.
-
.dynamic_library ⇒ BuildType
The build type for a dynamic library.
-
.static_framework ⇒ BuildType
The build type for a static framework.
-
.static_library ⇒ BuildType
The build type for a static library.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#dynamic? ⇒ Boolean
Whether the target is built dynamically.
-
#dynamic_framework? ⇒ Boolean
Whether the target is built as a dynamic framework.
-
#dynamic_library? ⇒ Boolean
Whether the target is built as a dynamic library.
-
#framework? ⇒ Boolean
Whether the target is built as a framework.
-
#initialize(linkage: :static, packaging: :library) ⇒ BuildType
constructor
A new instance of BuildType.
- #inspect ⇒ Object
-
#library? ⇒ Boolean
Whether the target is built as a library.
-
#static? ⇒ Boolean
Whether the target is built statically.
-
#static_framework? ⇒ Boolean
Whether the target is built as a static framework.
-
#static_library? ⇒ Boolean
Whether the target is built as a static library.
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(linkage: :static, packaging: :library) ⇒ BuildType
Returns a new instance of BuildType.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/cocoapods-core/build_type.rb', line 21 def initialize(linkage: :static, packaging: :library) unless KNOWN_LINKAGE_OPTIONS.include?(linkage) raise ArgumentError, "Invalid linkage option #{linkage.inspect}, valid options are #{KNOWN_LINKAGE_OPTIONS.inspect}" end unless KNOWN_PACKAGING_OPTIONS.include?(packaging) raise ArgumentError, "Invalid packaging option #{packaging.inspect}, valid options are #{KNOWN_PACKAGING_OPTIONS.inspect}" end @packaging = packaging @linkage = linkage @hash = packaging.hash ^ linkage.hash end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
19 20 21 |
# File 'lib/cocoapods-core/build_type.rb', line 19 def hash @hash end |
#linkage ⇒ Symbol (readonly)
Returns the linkage for this build type, one of #KNOWN_LINKAGE_OPTIONS.
17 18 19 |
# File 'lib/cocoapods-core/build_type.rb', line 17 def linkage @linkage end |
#packaging ⇒ Symbol (readonly)
Returns the packaging for this build type, one of #KNOWN_PACKAGING_OPTIONS.
13 14 15 |
# File 'lib/cocoapods-core/build_type.rb', line 13 def packaging @packaging end |
Class Method Details
.dynamic_framework ⇒ BuildType
Returns the build type for a dynamic framework.
46 47 48 |
# File 'lib/cocoapods-core/build_type.rb', line 46 def self.dynamic_framework new(:linkage => :dynamic, :packaging => :framework) end |
.dynamic_library ⇒ BuildType
Returns the build type for a dynamic library.
34 35 36 |
# File 'lib/cocoapods-core/build_type.rb', line 34 def self.dynamic_library new(:linkage => :dynamic, :packaging => :library) end |
.static_framework ⇒ BuildType
Returns the build type for a static framework.
52 53 54 |
# File 'lib/cocoapods-core/build_type.rb', line 52 def self.static_framework new(:linkage => :static, :packaging => :framework) end |
.static_library ⇒ BuildType
Returns the build type for a static library.
40 41 42 |
# File 'lib/cocoapods-core/build_type.rb', line 40 def self.static_library new(:linkage => :static, :packaging => :library) end |
Instance Method Details
#==(other) ⇒ Object
116 117 118 119 |
# File 'lib/cocoapods-core/build_type.rb', line 116 def ==(other) linkage == other.linkage && packaging == other.packaging end |
#dynamic? ⇒ Boolean
Returns whether the target is built dynamically.
58 59 60 |
# File 'lib/cocoapods-core/build_type.rb', line 58 def dynamic? linkage == :dynamic end |
#dynamic_framework? ⇒ Boolean
Returns whether the target is built as a dynamic framework.
82 83 84 |
# File 'lib/cocoapods-core/build_type.rb', line 82 def dynamic_framework? dynamic? && framework? end |
#dynamic_library? ⇒ Boolean
Returns whether the target is built as a dynamic library.
88 89 90 |
# File 'lib/cocoapods-core/build_type.rb', line 88 def dynamic_library? dynamic? && library? end |
#framework? ⇒ Boolean
Returns whether the target is built as a framework.
70 71 72 |
# File 'lib/cocoapods-core/build_type.rb', line 70 def framework? packaging == :framework end |
#inspect ⇒ Object
112 113 114 |
# File 'lib/cocoapods-core/build_type.rb', line 112 def inspect "#<#{self.class} linkage=#{linkage} packaging=#{packaging}>" end |
#library? ⇒ Boolean
Returns whether the target is built as a library.
76 77 78 |
# File 'lib/cocoapods-core/build_type.rb', line 76 def library? packaging == :library end |
#static? ⇒ Boolean
Returns whether the target is built statically.
64 65 66 |
# File 'lib/cocoapods-core/build_type.rb', line 64 def static? linkage == :static end |
#static_framework? ⇒ Boolean
Returns whether the target is built as a static framework.
94 95 96 |
# File 'lib/cocoapods-core/build_type.rb', line 94 def static_framework? static? && framework? end |
#static_library? ⇒ Boolean
Returns whether the target is built as a static library.
100 101 102 |
# File 'lib/cocoapods-core/build_type.rb', line 100 def static_library? static? && library? end |
#to_hash ⇒ Object
108 109 110 |
# File 'lib/cocoapods-core/build_type.rb', line 108 def to_hash { :linkage => linkage, :packaging => packaging } end |
#to_s ⇒ Object
104 105 106 |
# File 'lib/cocoapods-core/build_type.rb', line 104 def to_s "#{linkage} #{packaging}" end |