Class: Souyuz::ZipalignCommandGenerator

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

Overview

Responsible for building the zipalign command

Class Method Summary collapse

Class Method Details

.generateObject



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

def generate
  build_apk_path = Souyuz.cache[:build_apk_path]
  Souyuz.cache[:aligned_apk_path] = "#{build_apk_path}-aligned"

  parts = prefix
  parts << zipalign_apk
  parts += options
  parts << build_apk_path
  parts << Souyuz.cache[:aligned_apk_path]
  parts += pipe

  parts
end

.optionsObject



25
26
27
28
29
30
31
32
# File 'lib/souyuz/generators/zipalign_command_generator.rb', line 25

def options
  options = []
  options << "-v" if $verbose
  options << "-f"
  options << "4"

  options
end

.pipeObject



38
39
40
41
42
# File 'lib/souyuz/generators/zipalign_command_generator.rb', line 38

def pipe
  pipe = []

  pipe
end

.prefixObject



34
35
36
# File 'lib/souyuz/generators/zipalign_command_generator.rb', line 34

def prefix
  [""]
end

.zipalign_apkObject



19
20
21
22
23
# File 'lib/souyuz/generators/zipalign_command_generator.rb', line 19

def zipalign_apk
  zipalign = File.join(Souyuz.config[:buildtools_path], 'zipalign')

  zipalign
end