fastlane-plugin-appicon 0.11.0 → 0.12.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
  SHA1:
3
- metadata.gz: 9c81b3d62370dcc4305dc4721b91cdd233d22ff3
4
- data.tar.gz: 5f93afda98b4baaba126ecc681311920eeed78a6
3
+ metadata.gz: 638ee204f30b9aa9cea411e2ef03ff371a7b642a
4
+ data.tar.gz: 8d5313d9a5d87b2ae4f27231d35337758eb4be53
5
5
  SHA512:
6
- metadata.gz: 27640fe374e76f86f43395a0761637499864b9c36a50331c57056b5ea6af26151b62299a4985b29ed5e21fdfc9fab3a1da0ce886ee927a529ab258e3fc45cede
7
- data.tar.gz: f39e11cb6a8169eed4475bce75a5e8c72281da5a13d312d58ff78aa2f7fbff93f50c81bf5d52667ea1b1c14ace13574199d53ce6215b6b897ea8aac4c49cfe0e
6
+ metadata.gz: f0058b646b2e9ec09692bba049690f81da92656dd4e7f9bdf8d3381877ed1fd1e280fba4b62035e7e412f032f9511a33ba10b3173205f5ec23583c9c802e500b
7
+ data.tar.gz: df1cfd5369ebd1c956e0ca6357192c29e02babe323c37c8e82385160b65da9c0a44d532be5c7c784278af2f8636fae093439d9f92be4eb992ec2208779bf1b66
data/README.md CHANGED
@@ -49,8 +49,14 @@ end
49
49
  lane :android do
50
50
  android_appicon(
51
51
  appicon_image_file: 'spec/fixtures/Themoji.png',
52
- appicon_devices: [:phone, :tablet],
53
- appicon_path:'app/res/mipmap'
52
+ appicon_icon_types: [:launcher],
53
+ appicon_path: 'app/res/mipmap'
54
+ )
55
+ android_appicon(
56
+ appicon_image_file: 'spec/fixtures/ThemojiNotification.png',
57
+ appicon_icon_types: [:notification],
58
+ appicon_path: 'app/res/drawable',
59
+ appicon_name: 'ic_notification'
54
60
  )
55
61
  end
56
62
  ```
@@ -3,36 +3,27 @@ module Fastlane
3
3
  class AndroidAppiconAction < Action
4
4
  def self.needed_icons
5
5
  {
6
- phone: {
7
- 'ldpi' => ['36x36'],
8
- 'mdpi' => ['48x48'],
9
- 'hdpi' => ['72x72'],
10
- 'xhdpi' => ['96x96']
6
+ launcher: {
7
+ :ldpi => ['36x36'],
8
+ :mdpi => ['48x48'],
9
+ :hdpi => ['72x72'],
10
+ :xhdpi => ['96x96'],
11
+ :xxhdpi => ['144x144'],
12
+ :xxxhdpi => ['192x192']
11
13
  },
12
- tablet: {
13
- 'xxhdpi' => ['144x144'],
14
- 'xxxhdpi' => ['192x192']
14
+ notification: {
15
+ :ldpi => ['18x18'],
16
+ :mdpi => ['24x24'],
17
+ :hdpi => ['36x36'],
18
+ :xhdpi => ['48x48'],
19
+ :xxhdpi => ['72x72'],
20
+ :xxxhdpi => ['96x96'],
15
21
  }
16
22
  }
17
23
  end
18
-
19
- def self.notification_icons(path, filename)
20
- return {} if !path || !filename
21
-
22
- {
23
- "#{path}-ldpi/#{filename}" => '36x36',
24
- "#{path}-mdpi/#{filename}" => '24x24',
25
- "#{path}-hdpi/#{filename}" => '36x36',
26
- "#{path}-xhdpi/#{filename}" => '48x48',
27
- "#{path}-xxhdpi/#{filename}" => '72x72',
28
- "#{path}-xxxhdpi/#{filename}" => '96x96',
29
- }
30
- end
31
24
 
32
25
  def self.run(params)
33
26
  fname = params[:appicon_image_file]
34
- notification_icon_path = params[:appicon_notification_icon_path]
35
- notification_icon_filename = params[:appicon_notification_icon_filename]
36
27
  custom_sizes = params[:appicon_custom_sizes]
37
28
 
38
29
  require 'mini_magick'
@@ -42,11 +33,8 @@ module Fastlane
42
33
 
43
34
  # Convert image to png
44
35
  image.format 'png'
45
-
46
- # Merge notification icons into customer sizes as they are handled thes same way
47
- custom_sizes = self.notification_icons(notification_icon_path, notification_icon_filename).merge(custom_sizes)
48
36
 
49
- icons = Helper::AppiconHelper.get_needed_icons(params[:appicon_devices], self.needed_icons, true, custom_sizes)
37
+ icons = Helper::AppiconHelper.get_needed_icons(params[:appicon_icon_types], self.needed_icons, true, custom_sizes)
50
38
  icons.each do |icon|
51
39
  width = icon['width']
52
40
  height = icon['height']
@@ -54,7 +42,7 @@ module Fastlane
54
42
  # Custom icons will have basepath and filename already defined
55
43
  if icon.has_key?('basepath') && icon.has_key?('filename')
56
44
  basepath = Pathname.new(icon['basepath'])
57
- filename = icon['filename']
45
+ filename = icon['filename']
58
46
  else
59
47
  basepath = Pathname.new("#{params[:appicon_path]}-#{icon['scale']}")
60
48
  filename = "#{params[:appicon_filename]}.png"
@@ -67,9 +55,9 @@ module Fastlane
67
55
 
68
56
  UI.success("Successfully stored launcher icons at '#{params[:appicon_path]}'")
69
57
  end
70
-
58
+
71
59
  def self.get_custom_sizes(image, custom_sizes)
72
-
60
+
73
61
  end
74
62
 
75
63
  def self.description
@@ -87,15 +75,15 @@ module Fastlane
87
75
  description: "Path to a square image file, at least 512x512",
88
76
  optional: false,
89
77
  type: String),
90
- FastlaneCore::ConfigItem.new(key: :appicon_devices,
91
- env_name: "APPICON_DEVICES",
92
- default_value: [:phone],
78
+ FastlaneCore::ConfigItem.new(key: :appicon_icon_types,
79
+ env_name: "APPICON_ICON_TYPES",
80
+ default_value: [:launcher],
93
81
  description: "Array of device types to generate icons for",
94
82
  optional: true,
95
83
  type: Array),
96
84
  FastlaneCore::ConfigItem.new(key: :appicon_path,
97
85
  env_name: "APPICON_PATH",
98
- default_value: 'app/res/mipmap/',
86
+ default_value: 'app/res/mipmap',
99
87
  description: "Path to res subfolder",
100
88
  optional: true,
101
89
  type: String),
@@ -105,20 +93,9 @@ module Fastlane
105
93
  description: "The output filename of each image",
106
94
  optional: true,
107
95
  type: String),
108
- FastlaneCore::ConfigItem.new(key: :appicon_notification_icon_path,
109
- env_name: "APPICON_NOTIFICATION_ICON_PATH",
110
- default_value: 'app/res/drawable/',
111
- description: "Path to res subfolder",
112
- optional: true,
113
- type: String),
114
- FastlaneCore::ConfigItem.new(key: :appicon_notification_icon_filename,
115
- env_name: "APPICON_NOTIFICATION_ICON_FILENAME",
116
- default_value: 'ic_stat_onesignal_default',
117
- description: "File name for notification icons",
118
- optional: true,
119
- type: String),
120
96
  FastlaneCore::ConfigItem.new(key: :appicon_custom_sizes,
121
97
  description: "Hash of custom sizes - {'path/icon.png' => '256x256'}",
98
+ default_value: {},
122
99
  optional: true,
123
100
  type: Hash)
124
101
  ]
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Appicon
3
- VERSION = "0.11.0"
3
+ VERSION = "0.12.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-appicon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Bügling
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-11 00:00:00.000000000 Z
11
+ date: 2018-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_magick
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  version: '0'
156
156
  requirements: []
157
157
  rubyforge_project:
158
- rubygems_version: 2.6.8
158
+ rubygems_version: 2.6.10
159
159
  signing_key:
160
160
  specification_version: 4
161
161
  summary: Generate required icon sizes and iconset from a master application icon.