fastlane-plugin-match_keystore 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02c4f28a1cdddaa21db5cc775e6e13b18317043120db76d70ef935d7947ad4e3
4
- data.tar.gz: 81e444d74c3ffdc4ae3abb799ab449d2d3be0f66070d72826eec33e9223795ad
3
+ metadata.gz: f1078f38dbd52c6280d7c2324cb3d286ffe3792462797bf9f9eadb130cf5ae1c
4
+ data.tar.gz: 06e54a20de90f151ee42f796c40b7f33ffc102697136656ff15f8684e5926ae1
5
5
  SHA512:
6
- metadata.gz: 1dd9655b85a8744dc702d0208e9644cc6ecac754dc56759a46bd17c851c23b22e0f95d439d74e6d4f49b2e3b4229d39bbec89caf90329dd1014b9aefb7ae469e
7
- data.tar.gz: 7ba84196c4c15b18ab5e4868fc8f85191bb0828973c35c64c431ae613fa66776cc543fb091ed78ec9795bb053b09461c335da18dd37749b8cec7cb193e5591a8
6
+ metadata.gz: de5fc0acdd46b143953957646016be3df6fbb0238157332f949fee5ca137e73e9f9bc0d636031d50df2fd2ba0c2d442ad4c0a93e12c223904c29a058222c3439
7
+ data.tar.gz: 203b48b2df41b4e8acc2f97c68cc5a694e1dcaa543039a2bfac2c38ba2706281d6717de2aaf51e1fa57245cbf593c6ee30c39a8876adc209e08e585794e6d2dc
data/README.md CHANGED
@@ -16,6 +16,22 @@ Easily sync your Android keystores across your team
16
16
 
17
17
  **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
18
18
 
19
+ ## How to use
20
+
21
+ ```ruby
22
+ lane :release_and_sign do |options|
23
+
24
+ gradle(task: "clean")
25
+ gradle(task: 'assemble', build_type: 'Release')
26
+
27
+ match_keystore(
28
+ git_url: "https://github.com/<GITHUB_USERNAME>/keystores.git",
29
+ package_name: "com.your.package.name",
30
+ apk_path: "/app/build/outputs/apk/app-release.apk"
31
+ )
32
+ end
33
+ ```
34
+
19
35
  ## Example
20
36
 
21
37
  Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
@@ -76,7 +76,7 @@ module Fastlane
76
76
  if zip_align == true
77
77
  apk_path_aligned = apk_path.gsub(".apk", "-aligned.apk")
78
78
  puts `rm -f #{apk_path_aligned}`
79
- puts `#{build_tools_path}zipalign -v 4 #{apk_path} #{apk_path_aligned}`
79
+ puts `#{build_tools_path}zipalign 4 #{apk_path} #{apk_path_aligned}`
80
80
  else
81
81
  apk_path_aligned = apk_path
82
82
  end
@@ -92,6 +92,20 @@ module Fastlane
92
92
  apk_path_signed
93
93
  end
94
94
 
95
+ def self.resolve_apk_path(apk_path)
96
+ if !apk_path.to_s.end_with?(".apk")
97
+ pattern = File.join(apk_path, '*.apk')
98
+ files = Dir[pattern]
99
+ for file in files
100
+ if file.to_s.end_with?(".apk") && !file.to_s.end_with?("-signed.apk")
101
+ apk_path = file
102
+ break
103
+ end
104
+ end
105
+ end
106
+ apk_path
107
+ end
108
+
95
109
  def self.run(params)
96
110
 
97
111
  git_url = params[:git_url]
@@ -218,9 +232,13 @@ module Fastlane
218
232
  Actions.lane_context[SharedValues::MATCH_KEYSTORE_ALIAS_NAME] = alias_name
219
233
  Actions.lane_context[SharedValues::MATCH_KEYSTORE_ALIAS_PASSWORD] = alias_password
220
234
 
235
+ output_signed_apk = ''
236
+ apk_path = self.resolve_apk_path(apk_path)
237
+ UI.message("APK to sign: " + apk_path)
238
+
221
239
  if File.file?(keystore_path)
222
240
  UI.message("Signing the APK...")
223
- self.sign_apk(
241
+ output_signed_apk = self.sign_apk(
224
242
  apk_path,
225
243
  keystore_path,
226
244
  key_password,
@@ -230,6 +248,8 @@ module Fastlane
230
248
  )
231
249
  end
232
250
 
251
+ output_signed_apk
252
+
233
253
  end
234
254
 
235
255
  def self.description
@@ -272,7 +292,7 @@ module Fastlane
272
292
  type: String),
273
293
  FastlaneCore::ConfigItem.new(key: :apk_path,
274
294
  env_name: "MATCH_KEYSTORE_APK_PATH",
275
- description: "Path of the APK file ot sign with Keystore",
295
+ description: "Path of the APK file to sign",
276
296
  optional: false,
277
297
  type: String),
278
298
  FastlaneCore::ConfigItem.new(key: :override_keystore,
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module MatchKeystore
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-match_keystore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher NEY