Class: Souyuz::BuildCommandGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/souyuz/generators/build_command_generator.rb

Overview

Responsible for building the fully working xbuild command

Class Method Summary collapse

Class Method Details

.build_targetsObject



36
37
38
# File 'lib/souyuz/generators/build_command_generator.rb', line 36

def build_targets
  Souyuz.config[:build_target].map! { |t| "/t:#{t}" }
end

.generateObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/souyuz/generators/build_command_generator.rb', line 6

def generate
  parts = prefix
  parts << "xbuild"
  parts += options
  parts += targets
  parts += project
  parts += pipe

  parts
end

.optionsObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/souyuz/generators/build_command_generator.rb', line 21

def options
  config = Souyuz.config

  options = []
  options << "/p:Configuration=#{config[:build_configuration]}" if config[:build_configuration]
  options << "/p:Platform=#{config[:build_platform]}" if Souyuz.project.ios? and config[:build_platform]
  options << "/p:BuildIpa=true" if Souyuz.project.ios?
  if (config[:solution_path])
    solution_dir = File.dirname(config[:solution_path])
    options << "/p:SolutionDir=#{solution_dir}/"
  end

  options
end

.pipeObject



57
58
59
60
61
# File 'lib/souyuz/generators/build_command_generator.rb', line 57

def pipe
  pipe = []

  pipe
end

.prefixObject



17
18
19
# File 'lib/souyuz/generators/build_command_generator.rb', line 17

def prefix
  ["set -o pipefail &&"]
end

.projectObject



48
49
50
51
52
53
54
55
# File 'lib/souyuz/generators/build_command_generator.rb', line 48

def project
  path = []

  path << Souyuz.config[:project_path] if Souyuz.project.android?
  path << Souyuz.config[:solution_path] if Souyuz.project.ios? or Souyuz.project.osx?

  path
end

.targetsObject



40
41
42
43
44
45
46
# File 'lib/souyuz/generators/build_command_generator.rb', line 40

def targets
  targets = []
  targets += build_targets
  targets << "/t:SignAndroidPackage" if Souyuz.project.android?

  targets
end