souyuz 0.9.0 → 0.10.2

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: 4bb7b108c2de8a9ac1fc828f99ff7b5dc086ead257486db17fd34a368f61af0e
4
- data.tar.gz: 3d23185bfc0b53b98afcb555115ac5849970775c89697be8699eed7c9ad36863
3
+ metadata.gz: e7ea0c9d52b6af5f2fd6468747e611508d37cf167ff96816ed87866a236f97db
4
+ data.tar.gz: 554b217d665c712bdbcab105b395ca180f300e677fe713426f4b08de5295abc5
5
5
  SHA512:
6
- metadata.gz: 145975b20e3e7e6c09ea80a37c7c008686934adcf6c188f8de64f044dab9660bc5cc296ed003d0991d0261cb1fdde3eefc2475860893cd8590e8f40bae527ba5
7
- data.tar.gz: a64838989893a8af1ac9f55107221c076f4202ca634b1df41dcbbff2c9cd6f0c8b6f01d0183f43306237f355afedd0523fb14b54fbdaa703c23a81a73f9fb8d0
6
+ metadata.gz: cab7180ec9c8887b22c9c6d592bd69f323db88f2079cdffb73845acd370bd67ca72e1310325cdb39bb28ad16881343130259002407e6f8bdda99847153a1ca96
7
+ data.tar.gz: d01677b6e7d8ab5f5f924e818707b671dbf38ecca7c7881a86a9c01aed9fc70173cee2b830bf75f50cd2eb61753311a3637528111dc7111da68cf96aba2e37b5
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 \"#{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.0"
3
+ VERSION = "0.10.2"
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.0
4
+ version: 0.10.2
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-11-27 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