fastlane-plugin-polidea 0.2.1 → 0.2.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
  SHA1:
3
- metadata.gz: 7b52156dd8f28402ee8ab8bf276798d433d62203
4
- data.tar.gz: b711cd901d7ef1541c98e9c8774cb2a9151764ea
3
+ metadata.gz: df273bd2009b658356ce8c168af3878aa2b8c3eb
4
+ data.tar.gz: e376f516c6cf5024956475318aec84a33bbc89af
5
5
  SHA512:
6
- metadata.gz: 5aa57de038b20e8366e57314d25cf81c715f63df760618f28cb13c1a2e1438121ba1f912583e7cc72763d79a4d7efd576f598f2b925d6554e5314cb2fb0d5110
7
- data.tar.gz: 019642974acafd0e6f993fed275f6c4136ad0c0df045d58e46c4607d228d773803b07489e68f15eb51c4bf4bbf7155b6c76de0fda2c30b5f9dd5a998a0aedbf9
6
+ metadata.gz: e03c849c68e5f0334dc19766d1dd53d3da65878c693bba87714aa5de504303769107274e8c90e7d73b52eb8cec4641df134c0e2c4a0c881aaceb8882a43f2fe8
7
+ data.tar.gz: 9c9779c71ab126f7b6f9cbedcb7a6e0251183248dd5cc400cc8e552eb2806106e8f66a0c22e4cef08a28c792af0be820ce90a82be56f60e69165cbd4259135d0
@@ -14,12 +14,14 @@ module Fastlane
14
14
  # Gets icon from ipa/apk
15
15
  icon_file = extract_icon(platform, config)
16
16
 
17
- Actions.lane_context[SharedValues::ICON_OUTPUT_PATH] = icon_output_path
18
- ENV[SharedValues::ICON_OUTPUT_PATH.to_s] = icon_output_path
19
-
20
- UI.success("Successfully extracted app icon file to '#{Actions.lane_context[SharedValues::ICON_OUTPUT_PATH]}'")
21
-
22
- icon_file
17
+ if icon_file
18
+ Actions.lane_context[SharedValues::ICON_OUTPUT_PATH] = icon_output_path
19
+ ENV[SharedValues::ICON_OUTPUT_PATH.to_s] = icon_output_path
20
+ UI.success("Successfully extracted app icon file to '#{Actions.lane_context[SharedValues::ICON_OUTPUT_PATH]}'")
21
+ icon_file
22
+ else
23
+ UI.important("No icon found.")
24
+ end
23
25
  end
24
26
 
25
27
  def self.extract_icon(platform, config)
@@ -41,7 +43,9 @@ module Fastlane
41
43
 
42
44
  def self.extract_icon_from_ipa(ipa_file, icon_output_path)
43
45
  info = FastlaneCore::IpaFileAnalyser.fetch_info_plist_file(ipa_file)
44
- icon_file_name = ipa_icon_files(info).first
46
+ icon_files = ipa_icon_files(info)
47
+ return if icon_files.empty?
48
+ icon_file_name = icon_files.first
45
49
  Zip::File.open(ipa_file) do |zipfile|
46
50
  icon_file = self.largest_ios_icon(zipfile.glob("**/Payload/**/#{icon_file_name}*.png"))
47
51
  return nil unless icon_file
@@ -60,7 +64,7 @@ module Fastlane
60
64
  return primary_icon['CFBundleIconFiles']
61
65
  end
62
66
  end
63
- nil
67
+ []
64
68
  end
65
69
 
66
70
  def self.largest_ios_icon(icons)
@@ -84,6 +88,7 @@ module Fastlane
84
88
  def self.extract_icon_from_apk(apk_file, icon_output_path)
85
89
  apk = Android::Apk.new(apk_file)
86
90
  icon = largest_android_icon(apk)
91
+ return unless icon
87
92
  icon_file = File.open(icon_output_path, 'wb')
88
93
  icon_file.write icon[:data]
89
94
  icon_file
@@ -104,6 +109,8 @@ module Fastlane
104
109
  end
105
110
  end
106
111
  { name: selected_icon[0], data: selected_icon[1] } if selected_icon
112
+ rescue
113
+ nil
107
114
  end
108
115
 
109
116
  ######## common
@@ -103,9 +103,9 @@ module Fastlane
103
103
  def self.inline_images(options)
104
104
  base_path = "#{__dir__}/../templates/images"
105
105
  options[:inline] = [
106
- qr_code(options[:installation_link]),
107
- File.new(options[:app_icon])
106
+ qr_code(options[:installation_link])
108
107
  ]
108
+ options[:inline] << File.new(options[:app_icon]) if options[:app_icon]
109
109
  images = [
110
110
  "polidea-facebook-icon.png",
111
111
  "polidea-github-icon.png",
@@ -139,7 +139,7 @@ module Fastlane
139
139
  author: Actions.git_author_email,
140
140
  last_commit: Actions.last_git_commit_message,
141
141
  is_android: Actions.lane_context[Actions::SharedValues::PLATFORM_NAME] == :android,
142
- app_icon: File.basename(options[:app_icon]),
142
+ app_icon: options[:app_icon] ? File.basename(options[:app_icon]) : nil,
143
143
  app_name: options[:app_name],
144
144
  app_version: options[:app_version],
145
145
  build_number: options[:build_number],
@@ -144,7 +144,7 @@ module Fastlane
144
144
  app_name = params[:app_name] || info['CFBundleName']
145
145
  app_identifier = params[:bundle_id] || info['CFBundleIdentifier']
146
146
  version = params[:bundle_version] || info['CFBundleShortVersionString']
147
- href = "itms-services://?action=download-manifest&url=#{CGI.escape(params[:plist_url])}"
147
+ href = itms_href(params[:plist_url])
148
148
  url_scheme = get_url_scheme(info)
149
149
  when :android
150
150
  manifest = Android::Apk.new(params[:apk]).manifest
@@ -225,7 +225,7 @@ module Fastlane
225
225
  private_class_method :create_request
226
226
 
227
227
  def self.itms_href(plist_url)
228
- "itms-services://?action=download-manifest&url=#{plist_url}"
228
+ "itms-services://?action=download-manifest&url=#{CGI.escape(plist_url)}"
229
229
  end
230
230
  private_class_method :itms_href
231
231
 
@@ -358,12 +358,6 @@ module Fastlane
358
358
  s3_path = directory_name + file
359
359
  obj = bucket.objects[s3_path]
360
360
  obj.write(file: local_path, content_type: content_type_for_file(local_path), acl: "public_read")
361
- if obj.exists?
362
- next
363
- end
364
-
365
- result = "Error while uploading file #{local_path}"
366
- return result
367
361
  end
368
362
  end
369
363
 
@@ -426,6 +420,7 @@ module Fastlane
426
420
  end
427
421
 
428
422
  def self.upload_icon(icon_path, url_part, bucket, acl)
423
+ return unless icon_path
429
424
  icon_file_basename = File.basename(icon_path)
430
425
  icon_file = File.open(icon_path)
431
426
  icon_file_name = "#{url_part}#{icon_file_basename}"
@@ -20,7 +20,7 @@
20
20
  <div class="installation-panel">
21
21
  <div class="row">
22
22
  <div class="small-2 medium-2 columns inner-element">
23
- <% if app_icon != nil %>
23
+ <% if app_icon %>
24
24
  <img src="<%= app_icon %>" class="no-resize icon-margin"/>
25
25
  <% else %>
26
26
  <object type="image/svg+xml" data="installation-page/img/logo_square.svg"
@@ -1018,7 +1018,7 @@ img.polidea-logo {
1018
1018
  <table class="two columns">
1019
1019
  <tr>
1020
1020
  <td>
1021
- <% if app_icon != nil %>
1021
+ <% if app_icon %>
1022
1022
  <img src="cid:<%= app_icon %>" class="app-icon"/>
1023
1023
  <% else %>
1024
1024
  <img src="cid:icon-placeholder.png" class="app-icon logo-decoration"/>
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Polidea
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-polidea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotrek Dubiel