Class: Ognivo::Build

Inherits:
Object
  • Object
show all
Includes:
CLIHelpers
Defined in:
lib/ognivo/build.rb

Constant Summary collapse

OPTIONS =
[:destination_dir, :workspace, :project, :scheme, :verbose,
:build_configuration, :append_version]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CLIHelpers

#error_and_abort

Constructor Details

#initialize(opts = {}) ⇒ Build

Returns a new instance of Build.



8
9
10
11
# File 'lib/ognivo/build.rb', line 8

def initialize(opts = {})
  OPTIONS.each { |v| instance_variable_set("@#{v}", opts[v]) }
  @project = nil if @workspace
end

Instance Attribute Details

#zip_fileObject (readonly)

Returns the value of attribute zip_file.



24
25
26
# File 'lib/ognivo/build.rb', line 24

def zip_file
  @zip_file
end

Instance Method Details

#buildObject



13
14
15
16
17
18
# File 'lib/ognivo/build.rb', line 13

def build
  collect_settings
  error_and_abort('Build failed') unless system(xcodebuild_cmd)
  package_app
  say_ok 'App has been successfully built'
end

#build_versionObject



20
21
22
# File 'lib/ognivo/build.rb', line 20

def build_version
  @build_version ||= Agvtool.marketing_version.to_s
end