Class: BetaBuilder::Tasks::Configuration

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/beta_builder.rb

Instance Method Summary collapse

Instance Method Details

#app_file_nameObject

Raises:

  • (ArgumentError)


62
63
64
65
66
67
68
69
# File 'lib/beta_builder.rb', line 62

def app_file_name
  raise ArgumentError, "app_name or target must be set in the BetaBuilder configuration block" if app_name.nil? && target.nil?
  if app_name
    "#{app_name}.app"
  else
    "#{target}.app"
  end
end

#archive_nameObject



58
59
60
# File 'lib/beta_builder.rb', line 58

def archive_name
  app_name || target
end

#build_argumentsObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/beta_builder.rb', line 43

def build_arguments
  args = ""
  if workspace_path
    raise "A scheme is required if building from a workspace" unless scheme
    args << "-workspace '#{workspace_path}' -scheme '#{scheme}' -configuration '#{configuration}'"
  else
    args = "-target '#{target}' -configuration '#{configuration}' -sdk iphoneos"
    args << " -project #{project_file_path}" if project_file_path
  end

  args << " -arch \"#{arch}\"" unless arch.nil?

  args
end

#built_app_dsym_pathObject



92
93
94
# File 'lib/beta_builder.rb', line 92

def built_app_dsym_path
  "#{built_app_path}.dSYM"
end

#built_app_pathObject



79
80
81
82
83
84
85
# File 'lib/beta_builder.rb', line 79

def built_app_path
  if build_dir == :derived
    "#{derived_build_dir_from_build_output}/#{configuration}-iphoneos/#{app_file_name}"
  else
    "#{build_dir}/#{configuration}-iphoneos/#{app_file_name}"
  end
end

#deploy_using(strategy_name, &block) ⇒ Object



104
105
106
107
108
109
110
111
# File 'lib/beta_builder.rb', line 104

def deploy_using(strategy_name, &block)
  if DeploymentStrategies.valid_strategy?(strategy_name.to_sym)
    self.deployment_strategy = DeploymentStrategies.build(strategy_name, self)
    self.deployment_strategy.configure(&block)
  else
    raise "Unknown deployment strategy '#{strategy_name}'."
  end
end

#derived_build_dir_from_build_outputObject



87
88
89
90
# File 'lib/beta_builder.rb', line 87

def derived_build_dir_from_build_output
  output = BuildOutputParser.new(File.read("build.output"))
  output.build_output_dir
end

#dist_pathObject



96
97
98
# File 'lib/beta_builder.rb', line 96

def dist_path
  File.join("pkg/dist")
end

#ipa_nameObject



71
72
73
74
75
76
77
# File 'lib/beta_builder.rb', line 71

def ipa_name
  if app_name
    "#{app_name}.ipa"
  else
    "#{target}.ipa"
  end
end

#ipa_pathObject



100
101
102
# File 'lib/beta_builder.rb', line 100

def ipa_path
  File.join(dist_path, ipa_name)
end

#release_notes_textObject



39
40
41
42
# File 'lib/beta_builder.rb', line 39

def release_notes_text
  return release_notes.call if release_notes.is_a? Proc
  release_notes
end