souyuz 0.9.1 → 0.10.0

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: cfcbc75e52ece5af9c4eb049045525f607d7d3454189ad822727b6750185a659
4
+ data.tar.gz: 62b4b6f607e33b87b6253c67e96f55f39cdb0d0638ec05c2e27a7942543861a8
5
5
  SHA512:
6
- metadata.gz: 2a68a6311b8293791e22ed5d68c5eec2c9e08dc73cef2973996ac80484425cf17c1549bb4381e89f4de0e605bafd9fa08a801f102e7fb5e22150dddb2b8e8a65
7
- data.tar.gz: 2e4b0a2423213c5f694411ebc6165771ca9b0f964ee04f76f90983bf41ac1eff2da0f0fd422730260fe11cfb586c4039f4f285f0fa5e7f0eed9a256ff3e12119
6
+ metadata.gz: b445291e8406244c2f99e150fe402766111847ade4e32a308343bc5ffa120c0794d4e10ea57a083d43a27eceaa156942f54bd89f66aa009d06b5998d64b53507
7
+ data.tar.gz: eef32d0a9beb2f68852ddfefa0ef9c480067de86a57cd404a640297c2fb0b4c0561048f893b87b02aeb36ad325a8adcb9826fa0fa2873a4ac25ae4d39c871011
@@ -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}-unaligned"
8
+
9
+ parts = prefix
10
+ parts << detect_apksigner_executable
11
+ parts += options
12
+ parts << build_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" if $verbose
31
+ options << "--verbose" if $verbose
32
+ options << "--ks \"#{Souyuz.config[:keystore_path]}\""
33
+ options << "--ks-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
@@ -1,6 +1,6 @@
1
1
  module Souyuz
2
2
  # Responsible for building the zipalign command
3
- class AndroidZipalignCommandGenerator
3
+ class ZipalignCommandGenerator
4
4
  class << self
5
5
  def generate
6
6
  parts = prefix
@@ -13,21 +13,8 @@ module Souyuz
13
13
  parts
14
14
  end
15
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
16
  def zipalign_apk
29
- buildtools, version = detect_build_tools
30
- zipalign = ENV['ANDROID_HOME'] ? File.join(buildtools, version, 'zipalign') : 'zipalign'
17
+ zipalign = File.join(Souyuz.config[:buildtools_path], 'zipalign')
31
18
 
32
19
  zipalign
33
20
  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.0"
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.0
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,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