souyuz 0.9.1 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4338c8ba87321f5f72216ebc892cfb198e69b46a7bbe9fb987d0f7b481ad0925
4
- data.tar.gz: edcecde20aa0c0a21907166013fa047d8c6601e94806ec744aeb373190747e65
3
+ metadata.gz: 1e220206e25541589dda5230b47d77324e2dca9e90a617901c6d902a30501ae3
4
+ data.tar.gz: 8cb0863e48ab03d84e03b3e941dfec830473ef677f9636e4c4386d0e411e0227
5
5
  SHA512:
6
- metadata.gz: 2a68a6311b8293791e22ed5d68c5eec2c9e08dc73cef2973996ac80484425cf17c1549bb4381e89f4de0e605bafd9fa08a801f102e7fb5e22150dddb2b8e8a65
7
- data.tar.gz: 2e4b0a2423213c5f694411ebc6165771ca9b0f964ee04f76f90983bf41ac1eff2da0f0fd422730260fe11cfb586c4039f4f285f0fa5e7f0eed9a256ff3e12119
6
+ metadata.gz: edce7ce36c5f520b68a8f86344a6b1dcfea67c14c9b5426a529724caa85ccd6f19e75a29c4e1db7a27c303228b7532f4e89a80425bcc1f94439a99e3f7a6e660
7
+ data.tar.gz: b9d36c35beecb77c8f53cce3db76bb57f718f1ae21a97ea663724f000344a0fa261decf3795b17db756cb11be1a3020bf3b6e2c6dffd7d0224c8f2512d4f7e87
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # Souyuz
2
2
 
3
- [![Build Status](https://travis-ci.org/voydz/souyuz.svg?branch=master)](https://travis-ci.org/voydz/souyuz)
4
-
5
3
  A fastlane component to make Xamarin builds a breeze. Souyuz is now avaialbe as an **Fastlane plugin** see [fastlane-plugin-souyuz](fastlane-plugin-souyuz) for details.
6
4
 
7
5
  *NOTE: While souyuz should continue working with your existing configuration just fine, consider using the Fastlane plugin.*
@@ -24,6 +24,7 @@ module Souyuz
24
24
 
25
25
  detect_output_path doc_csproj
26
26
  detect_manifest doc_csproj
27
+ detect_build_tools
27
28
  detect_info_plist
28
29
  detect_assembly_name doc_csproj # we can only do that for android *after* we detected the android manitfest
29
30
 
@@ -78,6 +79,20 @@ module Souyuz
78
79
  Souyuz.config[:manifest_path] = abs_project_path doc_node.text
79
80
  end
80
81
 
82
+ def self.detect_build_tools
83
+ return if Souyuz.config[:buildtools_path]
84
+
85
+ UI.user_error! "Please ensure that the Android SDK is installed and the ANDROID_HOME variable is set correctly" unless ENV['ANDROID_HOME']
86
+
87
+ # determine latest buildtool version
88
+ buildtools = File.join(ENV['ANDROID_HOME'], 'build-tools')
89
+ version = Dir.entries(buildtools).sort.last
90
+
91
+ UI.success "Using Buildtools Version: #{version}..."
92
+
93
+ Souyuz.config[:buildtools_path] = File.join(buildtools, version)
94
+ end
95
+
81
96
  def self.detect_info_plist
82
97
  return if Souyuz.config[:plist_path] or Souyuz.config[:platform] != Platform::IOS
83
98
 
@@ -0,0 +1,47 @@
1
+ module Souyuz
2
+ # Responsible for building the apksigner command
3
+ class ApkSignCommandGenerator
4
+ class << self
5
+ def generate
6
+ build_apk_path = Souyuz.cache[:build_apk_path]
7
+ Souyuz.cache[:signed_apk_path] = "#{build_apk_path}-signed"
8
+
9
+ parts = prefix
10
+ parts << detect_apksigner_executable
11
+ parts += options
12
+ parts << Souyuz.cache[:aligned_apk_path]
13
+ parts += pipe
14
+
15
+ parts
16
+ end
17
+
18
+ def prefix
19
+ [""]
20
+ end
21
+
22
+ def detect_apksigner_executable
23
+ apksigner = File.join(Souyuz.config[:buildtools_path], 'apksigner')
24
+
25
+ apksigner
26
+ end
27
+
28
+ def options
29
+ options = []
30
+ options << "sign"
31
+ options << "--verbose" if $verbose
32
+ options << "--ks \"#{Souyuz.config[:keystore_path]}\""
33
+ options << "--ks-pass \"pass:#{Souyuz.config[:keystore_password]}\""
34
+ options << "--ks-key-alias \"#{Souyuz.config[:keystore_alias]}\""
35
+ options << "--out \"#{Souyuz.cache[:signed_apk_path]}\""
36
+
37
+ options
38
+ end
39
+
40
+ def pipe
41
+ pipe = []
42
+
43
+ pipe
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,45 @@
1
+ module Souyuz
2
+ # Responsible for building the zipalign command
3
+ class ZipalignCommandGenerator
4
+ class << self
5
+ def generate
6
+ build_apk_path = Souyuz.cache[:build_apk_path]
7
+ Souyuz.cache[:aligned_apk_path] = "#{build_apk_path}-aligned"
8
+
9
+ parts = prefix
10
+ parts << zipalign_apk
11
+ parts += options
12
+ parts << build_apk_path
13
+ parts << Souyuz.cache[:aligned_apk_path]
14
+ parts += pipe
15
+
16
+ parts
17
+ end
18
+
19
+ def zipalign_apk
20
+ zipalign = File.join(Souyuz.config[:buildtools_path], 'zipalign')
21
+
22
+ zipalign
23
+ end
24
+
25
+ def options
26
+ options = []
27
+ options << "-v" if $verbose
28
+ options << "-f"
29
+ options << "4"
30
+
31
+ options
32
+ end
33
+
34
+ def prefix
35
+ [""]
36
+ end
37
+
38
+ def pipe
39
+ pipe = []
40
+
41
+ pipe
42
+ end
43
+ end
44
+ end
45
+ end
@@ -58,6 +58,10 @@ module Souyuz
58
58
  env_name: "SOUYUZ_ANDROID_MANIFEST_PATH",
59
59
  description: "Path to the android manifest (xml) file",
60
60
  optional: true),
61
+ FastlaneCore::ConfigItem.new(key: :buildtools_path,
62
+ env_name: "SOUYUZ_ANDROID_BUILDTOOLS_PATH",
63
+ description: "Path to the android build tools",
64
+ optional: true),
61
65
  FastlaneCore::ConfigItem.new(key: :plist_path,
62
66
  env_name: "SOUYUZ_IOS_PLIST_PATH",
63
67
  description: "Path to the iOS plist file",
@@ -77,7 +81,7 @@ module Souyuz
77
81
  FastlaneCore::ConfigItem.new(key: :keystore_tsa,
78
82
  default_value: 'http://timestamp.digicert.com',
79
83
  env_name: "SOUYUZ_ANDROID_KEYSTORE_TSA",
80
- description: "TSA for jarsigner",
84
+ description: "TSA for apksigner",
81
85
  optional: true)
82
86
  ]
83
87
  end
data/lib/souyuz/runner.rb CHANGED
@@ -15,9 +15,7 @@ module Souyuz
15
15
  elsif Souyuz.project.android?
16
16
  path = apk_file
17
17
  if config[:keystore_path] && config[:keystore_alias]
18
- UI.success "Jar it, sign it, zip it..."
19
-
20
- jarsign_and_zipalign
18
+ apksign_and_zipalign
21
19
  end
22
20
 
23
21
  path
@@ -44,18 +42,20 @@ module Souyuz
44
42
  "#{build_path}/#{assembly_name}.apk"
45
43
  end
46
44
 
47
- def jarsign_and_zipalign
48
- command = JavaSignCommandGenerator.generate
45
+ def apksign_and_zipalign
46
+ UI.success "Start signing process..."
47
+
48
+ command = ZipalignCommandGenerator.generate
49
49
  FastlaneCore::CommandExecutor.execute(command: command,
50
- print_all: false,
50
+ print_all: true,
51
51
  print_command: !Souyuz.config[:silent])
52
52
 
53
- UI.success "Successfully signed apk #{Souyuz.cache[:build_apk_path]}"
54
-
55
- command = AndroidZipalignCommandGenerator.generate
53
+ command = ApkSignCommandGenerator.generate
56
54
  FastlaneCore::CommandExecutor.execute(command: command,
57
- print_all: true,
55
+ print_all: false,
58
56
  print_command: !Souyuz.config[:silent])
57
+
58
+ UI.success "Successfully signed apk #{Souyuz.cache[:build_apk_path]}"
59
59
  end
60
60
 
61
61
  #
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Souyuz
3
- VERSION = "0.9.1"
3
+ VERSION = "0.10.3"
4
4
  DESCRIPTION = "A fastlane component to make Xamarin builds a breeze"
5
5
  end
data/lib/souyuz.rb CHANGED
@@ -2,8 +2,8 @@ require 'souyuz/version'
2
2
  require 'souyuz/platform'
3
3
  require 'souyuz/manager'
4
4
  require 'souyuz/generators/build_command_generator'
5
- require 'souyuz/generators/android_zipalign_command_generator'
6
- require 'souyuz/generators/java_sign_command_generator'
5
+ require 'souyuz/generators/zipalign_command_generator'
6
+ require 'souyuz/generators/apk_sign_command_generator'
7
7
  require 'souyuz/generators/zip_dsym_command_generator'
8
8
  require 'souyuz/runner'
9
9
  require 'souyuz/options'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souyuz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Rudat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-02 00:00:00.000000000 Z
11
+ date: 2021-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane
@@ -135,10 +135,10 @@ files:
135
135
  - lib/souyuz.rb
136
136
  - lib/souyuz/commands_generator.rb
137
137
  - lib/souyuz/detect_values.rb
138
- - lib/souyuz/generators/android_zipalign_command_generator.rb
138
+ - lib/souyuz/generators/apk_sign_command_generator.rb
139
139
  - lib/souyuz/generators/build_command_generator.rb
140
- - lib/souyuz/generators/java_sign_command_generator.rb
141
140
  - lib/souyuz/generators/zip_dsym_command_generator.rb
141
+ - lib/souyuz/generators/zipalign_command_generator.rb
142
142
  - lib/souyuz/manager.rb
143
143
  - lib/souyuz/msbuild/project.rb
144
144
  - lib/souyuz/msbuild/solution.rb
@@ -1,55 +0,0 @@
1
- module Souyuz
2
- # Responsible for building the zipalign command
3
- class AndroidZipalignCommandGenerator
4
- class << self
5
- def generate
6
- parts = prefix
7
- parts << zipalign_apk
8
- parts += options
9
- parts << Souyuz.cache[:signed_apk_path]
10
- parts << Souyuz.cache[:build_apk_path]
11
- parts += pipe
12
-
13
- parts
14
- end
15
-
16
- def detect_build_tools
17
- UI.user_error! "Please ensure that the Android SDK is installed and the ANDROID_HOME variable is set correctly" unless ENV['ANDROID_HOME']
18
-
19
- # determine latest buildtool version
20
- buildtools = File.join(ENV['ANDROID_HOME'], 'build-tools')
21
- version = Dir.entries(buildtools).sort.last
22
-
23
- UI.success "Using Buildtools Version: #{version}..."
24
-
25
- [buildtools, version]
26
- end
27
-
28
- def zipalign_apk
29
- buildtools, version = detect_build_tools
30
- zipalign = ENV['ANDROID_HOME'] ? File.join(buildtools, version, 'zipalign') : 'zipalign'
31
-
32
- zipalign
33
- end
34
-
35
- def options
36
- options = []
37
- options << "-v" if $verbose
38
- options << "-f"
39
- options << "4"
40
-
41
- options
42
- end
43
-
44
- def prefix
45
- [""]
46
- end
47
-
48
- def pipe
49
- pipe = []
50
-
51
- pipe
52
- end
53
- end
54
- end
55
- end
@@ -1,51 +0,0 @@
1
- module Souyuz
2
- # Responsible for building the jarsigner command
3
- class JavaSignCommandGenerator
4
- class << self
5
- def generate
6
- build_apk_path = Souyuz.cache[:build_apk_path]
7
- Souyuz.cache[:signed_apk_path] = "#{build_apk_path}-unaligned"
8
-
9
- parts = prefix
10
- parts << detect_jarsigner_executable
11
- parts += options
12
- parts << build_apk_path
13
- parts << Souyuz.config[:keystore_alias]
14
- parts += pipe
15
-
16
- parts
17
- end
18
-
19
- def prefix
20
- [""]
21
- end
22
-
23
- def detect_jarsigner_executable
24
- jarsigner = ENV['JAVA_HOME'] ? File.join(ENV['JAVA_HOME'], 'bin', 'jarsigner') : 'jarsigner'
25
-
26
- jarsigner
27
- end
28
-
29
- def options
30
- config = Souyuz.config
31
-
32
- options = []
33
- options << "-verbose" if $verbose
34
- options << "-sigalg MD5withRSA"
35
- options << "-digestalg SHA1"
36
- options << "-storepass \"#{config[:keystore_password]}\""
37
- options << "-keystore \"#{config[:keystore_path]}\""
38
- options << "-tsa #{config[:keystore_tsa]}"
39
- options << "-signedjar \"#{Souyuz.cache[:signed_apk_path]}\""
40
-
41
- options
42
- end
43
-
44
- def pipe
45
- pipe = []
46
-
47
- pipe
48
- end
49
- end
50
- end
51
- end