Class: XcodeBuilder

Inherits:
Object
  • Object
show all
Includes:
EnvParser
Defined in:
lib/cocoapods-pack/xcode_builder.rb

Defined Under Namespace

Classes: BuildError

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from EnvParser

#parse_env

Constructor Details

#initialize(xcodeproject_path, xcodebuild_opts, xcodebuild_outdir, user_interface, verbose = false) ⇒ XcodeBuilder

Returns a new instance of XcodeBuilder.



29
30
31
32
33
34
35
# File 'lib/cocoapods-pack/xcode_builder.rb', line 29

def initialize(xcodeproject_path, xcodebuild_opts, xcodebuild_outdir, user_interface, verbose = false)
  @xcodeproject_path = xcodeproject_path
  @xcodebuild_opts = xcodebuild_opts
  @xcodebuild_outdir = xcodebuild_outdir
  @user_interface = user_interface
  @verbose = verbose
end

Instance Attribute Details

#xcodebuild_outdirObject (readonly)

Returns the value of attribute xcodebuild_outdir.



24
25
26
# File 'lib/cocoapods-pack/xcode_builder.rb', line 24

def xcodebuild_outdir
  @xcodebuild_outdir
end

#xcodeproject_pathObject (readonly)

Returns the value of attribute xcodeproject_path.



24
25
26
# File 'lib/cocoapods-pack/xcode_builder.rb', line 24

def xcodeproject_path
  @xcodeproject_path
end

Instance Method Details

#build(platform, target, xcodebuild_args = nil) ⇒ Object



37
38
39
40
41
42
43
44
# File 'lib/cocoapods-pack/xcode_builder.rb', line 37

def build(platform, target, xcodebuild_args = nil)
  return build_ios(target, xcodebuild_args) if platform == :ios
  return build_osx(target, xcodebuild_args) if platform == :osx
  return build_watchos(target, xcodebuild_args) if platform == :watchos
  return build_tvos(target, xcodebuild_args) if platform == :tvos

  raise "Unknown platform: '#{platform}'"
end

#build_settings(platform, target, type = nil) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/cocoapods-pack/xcode_builder.rb', line 46

def build_settings(platform, target, type = nil)
  return build_ios_settings(target, type) if platform == :ios
  return build_watchos_settings(target, type) if platform == :watchos
  return build_tvos_settings(target, type) if platform == :tvos

  build_osx_settings(target) if platform == :osx
end