Class: Souyuz::JavaSignCommandGenerator
- Inherits:
-
Object
- Object
- Souyuz::JavaSignCommandGenerator
- Defined in:
- lib/souyuz/generators/java_sign_command_generator.rb
Overview
Responsible for building the jarsigner command
Class Method Summary collapse
- .detect_jarsigner_executable ⇒ Object
- .generate ⇒ Object
- .options ⇒ Object
- .pipe ⇒ Object
- .prefix ⇒ Object
Class Method Details
.detect_jarsigner_executable ⇒ Object
24 25 26 27 28 |
# File 'lib/souyuz/generators/java_sign_command_generator.rb', line 24 def detect_jarsigner_executable jarsigner = ENV['JAVA_HOME'] ? File.join(ENV['JAVA_HOME'], 'bin', 'jarsigner') : 'jarsigner' jarsigner end |
.generate ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/souyuz/generators/java_sign_command_generator.rb', line 6 def generate build_apk_path = Souyuz.cache[:build_apk_path] Souyuz.cache[:signed_apk_path] = "#{build_apk_path}-unaligned" parts = prefix parts << detect_jarsigner_executable parts += parts << build_apk_path parts << Souyuz.config[:keystore_alias] parts += pipe parts end |
.options ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/souyuz/generators/java_sign_command_generator.rb', line 30 def config = Souyuz.config = [] << "-verbose" if $verbose << "-sigalg MD5withRSA" << "-digestalg SHA1" << "-storepass \"#{config[:keystore_password]}\"" << "-keystore \"#{config[:keystore_path]}\"" << "-tsa #{config[:keystore_tsa]}" << "-signedjar \"#{Souyuz.cache[:signed_apk_path]}\"" end |
.pipe ⇒ Object
45 46 47 48 49 |
# File 'lib/souyuz/generators/java_sign_command_generator.rb', line 45 def pipe pipe = [] pipe end |
.prefix ⇒ Object
20 21 22 |
# File 'lib/souyuz/generators/java_sign_command_generator.rb', line 20 def prefix ["set -o pipefail &&"] end |