fastlane-plugin-appicon 0.12.0 → 0.16.0
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 +5 -5
- data/README.md +59 -4
- data/lib/fastlane/plugin/appicon/actions/android_appicon_action.rb +97 -13
- data/lib/fastlane/plugin/appicon/actions/appicon_action.rb +101 -12
- data/lib/fastlane/plugin/appicon/helper/appicon_helper.rb +26 -9
- data/lib/fastlane/plugin/appicon/version.rb +1 -1
- metadata +19 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 34a5a40f00f66babf8d35487344ed174c6413cb93a7436a4b2b1db448d1f139d
|
4
|
+
data.tar.gz: cbd32bd140fca377d4da0d05616234a51e9b4765fcb90b4d0f09c6b965dc4320
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6188bd3df216a12c1d075f47005362f47519f0214355b87af6bae097f232048aed91901dff69635120d7b010d042f5d368f31bd5f4be6c0dc01c59a248219095
|
7
|
+
data.tar.gz: 55a65329ca48a57857a0db29c9ea9967fa909e65f2cd4f69d95e47f7bf87cdeb6b1523756fe91cb0cb1b2a57bac6e8ed7d8b0eff7062f9eca64fd9d146f82ffa
|
data/README.md
CHANGED
@@ -12,6 +12,20 @@ This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To ge
|
|
12
12
|
fastlane add_plugin appicon
|
13
13
|
```
|
14
14
|
|
15
|
+
|
16
|
+
Please note that this plugin uses [minimagick](https://github.com/minimagick/minimagick), which requires either GraphicsMagick or ImageMagick library. If you have neither, you can install either via Homebrew:
|
17
|
+
|
18
|
+
|
19
|
+
```
|
20
|
+
brew install graphicsmagick
|
21
|
+
```
|
22
|
+
or
|
23
|
+
```
|
24
|
+
brew install imagemagick
|
25
|
+
```
|
26
|
+
|
27
|
+
The default CLI for the `mini_magick` gem is set to auto pick. It will first try to use `GraphicsMagick` (if you have it installed) otherwise it will use `ImageMagick`. If you want to be explicit about which CLI you use, set the `minimagick_cli` option to `graphicsmagick` or `imagemagick`. Not specifying this option will set `MiniMagick` to use auto which will choose what's available.
|
28
|
+
|
15
29
|
## About appicon
|
16
30
|
|
17
31
|
Generate required icon sizes and iconset from a master application icon.
|
@@ -22,9 +36,20 @@ Since many apps use a single 1024x1024 icon to produce all the required sizes fr
|
|
22
36
|
|
23
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`.
|
24
38
|
|
25
|
-
Just specify the source image using the `appicon_image_file`. Optionally specify the devices
|
39
|
+
Just specify the source image using the `appicon_image_file`. Optionally specify the devices using `appicon_devices` and the destination path using `appicon_path`.
|
40
|
+
|
41
|
+
We recommend storing the full-size picture at `fastlane/metadata/app_icon.png` so it can be picked up by _deliver_, as well as this plugin.
|
42
|
+
|
43
|
+
If you want to use this plugin to generate a app icon for Messages(sticker) extension, set `messages_extension` to `true` and add `messages` to the `appicon_devices`.
|
26
44
|
|
27
45
|
```ruby
|
46
|
+
lane :basic do
|
47
|
+
appicon(
|
48
|
+
appicon_devices: [:ipad, :iphone, :ios_marketing],
|
49
|
+
appicon_path: "MajorKey/Assets.xcassets"
|
50
|
+
)
|
51
|
+
end
|
52
|
+
|
28
53
|
lane :test1 do
|
29
54
|
appicon(appicon_image_file: 'spec/fixtures/Themoji.png',
|
30
55
|
appicon_devices: [:ipad, :iphone, :ios_marketing])
|
@@ -39,11 +64,34 @@ end
|
|
39
64
|
lane :test3 do
|
40
65
|
# `appicon_image_file` defaults to "fastlane/metadata/app_icon.png"
|
41
66
|
appicon(
|
42
|
-
appicon_devices: [:iphone],
|
67
|
+
appicon_devices: [:iphone],
|
43
68
|
appicon_path: 'wwdcfamily/Images.xcassets' # output path
|
44
69
|
)
|
45
70
|
end
|
46
71
|
|
72
|
+
lane :test4 do
|
73
|
+
appicon(appicon_image_file: 'spec/fixtures/Themoji.png',
|
74
|
+
appicon_devices: [:macos])
|
75
|
+
end
|
76
|
+
|
77
|
+
lane :splash_screen do
|
78
|
+
appicon(
|
79
|
+
appicon_image_file: 'spec/fixtures/splash_screen.png',
|
80
|
+
appicon_devices: [:universal],
|
81
|
+
appicon_path: "ios/App/App/Assets.xcassets",
|
82
|
+
appicon_name: 'Splash.imageset'
|
83
|
+
)
|
84
|
+
end
|
85
|
+
|
86
|
+
lane :messages_extension do
|
87
|
+
appicon(
|
88
|
+
appicon_image_file: "fastlane/metadata/iMessageAppIcon.png",
|
89
|
+
appicon_devices: [:iphone, :ipad, :ios_marketing, :messages],
|
90
|
+
appicon_path: 'iMessageStickers/Stickers.xcassets',
|
91
|
+
messages_extension: true
|
92
|
+
)
|
93
|
+
end
|
94
|
+
|
47
95
|
# or
|
48
96
|
|
49
97
|
lane :android do
|
@@ -56,7 +104,14 @@ lane :android do
|
|
56
104
|
appicon_image_file: 'spec/fixtures/ThemojiNotification.png',
|
57
105
|
appicon_icon_types: [:notification],
|
58
106
|
appicon_path: 'app/res/drawable',
|
59
|
-
|
107
|
+
appicon_filename: 'ic_notification',
|
108
|
+
generate_rounded: true
|
109
|
+
)
|
110
|
+
android_appicon(
|
111
|
+
appicon_image_file: 'spec/fixtures/splash_base_image.png',
|
112
|
+
appicon_icon_types: [:splash_port, :splash_land],
|
113
|
+
appicon_path: 'app/res/drawable',
|
114
|
+
appicon_filename: 'splash'
|
60
115
|
)
|
61
116
|
end
|
62
117
|
```
|
@@ -84,7 +139,7 @@ If you have trouble using plugins, check out the [Plugins Troubleshooting](https
|
|
84
139
|
|
85
140
|
## Using `fastlane` Plugins
|
86
141
|
|
87
|
-
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://
|
142
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
88
143
|
|
89
144
|
## About `fastlane`
|
90
145
|
|
@@ -1,6 +1,9 @@
|
|
1
|
+
require 'mini_magick'
|
2
|
+
|
1
3
|
module Fastlane
|
2
4
|
module Actions
|
3
5
|
class AndroidAppiconAction < Action
|
6
|
+
|
4
7
|
def self.needed_icons
|
5
8
|
{
|
6
9
|
launcher: {
|
@@ -18,26 +21,38 @@ module Fastlane
|
|
18
21
|
:xhdpi => ['48x48'],
|
19
22
|
:xxhdpi => ['72x72'],
|
20
23
|
:xxxhdpi => ['96x96'],
|
24
|
+
},
|
25
|
+
splash_land: {
|
26
|
+
'land-ldpi' => ['320x200'],
|
27
|
+
'land-mdpi' => ['480x320'],
|
28
|
+
'land-hdpi' => ['800x480'],
|
29
|
+
'land-xhdpi' => ['1280x720'],
|
30
|
+
'land-xxhdpi' => ['1600x960'],
|
31
|
+
'land-xxxhdpi' => ['1920x1280']
|
32
|
+
},
|
33
|
+
splash_port: {
|
34
|
+
'port-ldpi' => ['200x320'],
|
35
|
+
'port-mdpi' => ['320x480'],
|
36
|
+
'port-hdpi' => ['480x800'],
|
37
|
+
'port-xhdpi' => ['720x1280'],
|
38
|
+
'port-xxhdpi' => ['960x1600'],
|
39
|
+
'port-xxxhdpi' => ['1280x1920']
|
21
40
|
}
|
22
41
|
}
|
23
42
|
end
|
24
43
|
|
25
44
|
def self.run(params)
|
26
|
-
fname = params[:appicon_image_file]
|
27
|
-
custom_sizes = params[:appicon_custom_sizes]
|
28
|
-
|
29
|
-
require 'mini_magick'
|
30
|
-
image = MiniMagick::Image.open(fname)
|
31
45
|
|
32
|
-
Helper::AppiconHelper.
|
46
|
+
Helper::AppiconHelper.set_cli(params[:minimagick_cli])
|
33
47
|
|
34
|
-
|
35
|
-
|
48
|
+
fname = params[:appicon_image_file]
|
49
|
+
custom_sizes = params[:appicon_custom_sizes]
|
36
50
|
|
37
51
|
icons = Helper::AppiconHelper.get_needed_icons(params[:appicon_icon_types], self.needed_icons, true, custom_sizes)
|
38
52
|
icons.each do |icon|
|
39
|
-
|
40
|
-
|
53
|
+
image = MiniMagick::Image.open(fname)
|
54
|
+
|
55
|
+
Helper::AppiconHelper.check_input_image_size(image, 1024, 1024)
|
41
56
|
|
42
57
|
# Custom icons will have basepath and filename already defined
|
43
58
|
if icon.has_key?('basepath') && icon.has_key?('filename')
|
@@ -47,15 +62,71 @@ module Fastlane
|
|
47
62
|
basepath = Pathname.new("#{params[:appicon_path]}-#{icon['scale']}")
|
48
63
|
filename = "#{params[:appicon_filename]}.png"
|
49
64
|
end
|
50
|
-
FileUtils.mkdir_p(basepath)
|
51
65
|
|
52
|
-
|
66
|
+
width_height = [icon['width'], icon['height']].map(&:to_i)
|
67
|
+
width, height = width_height
|
68
|
+
max = width_height.max
|
69
|
+
|
70
|
+
image.format 'png'
|
71
|
+
image.resize "#{max}x#{max}"
|
72
|
+
|
73
|
+
unless width == height
|
74
|
+
offset =
|
75
|
+
if width > height
|
76
|
+
"+0+#{(width - height) / 2}"
|
77
|
+
elsif height > width
|
78
|
+
"+#{(height - width) / 2}+0"
|
79
|
+
end
|
80
|
+
|
81
|
+
image.crop "#{icon['size']}#{offset}"
|
82
|
+
end
|
83
|
+
|
84
|
+
FileUtils.mkdir_p(basepath)
|
53
85
|
image.write basepath + filename
|
86
|
+
|
87
|
+
if basepath.to_s.match("port-")
|
88
|
+
default_portrait_path = basepath.to_s.gsub("port-","")
|
89
|
+
FileUtils.mkdir_p(default_portrait_path)
|
90
|
+
image.write default_portrait_path + '/' + filename
|
91
|
+
end
|
92
|
+
|
93
|
+
if params[:generate_rounded]
|
94
|
+
rounded_image = MiniMagick::Image.open(fname)
|
95
|
+
rounded_image.format 'png'
|
96
|
+
rounded_image.resize "#{width}x#{height}"
|
97
|
+
rounded_image = round(rounded_image)
|
98
|
+
rounded_image.write basepath + filename.gsub('.png', '_round.png')
|
99
|
+
end
|
54
100
|
end
|
55
101
|
|
56
102
|
UI.success("Successfully stored launcher icons at '#{params[:appicon_path]}'")
|
57
103
|
end
|
58
104
|
|
105
|
+
def self.round(img)
|
106
|
+
require 'mini_magick'
|
107
|
+
img.format 'png'
|
108
|
+
|
109
|
+
width = img[:width]-2
|
110
|
+
radius = width/2
|
111
|
+
|
112
|
+
mask = ::MiniMagick::Image.open img.path
|
113
|
+
mask.format 'png'
|
114
|
+
|
115
|
+
mask.combine_options do |m|
|
116
|
+
m.alpha 'transparent'
|
117
|
+
m.background 'none'
|
118
|
+
m.fill 'white'
|
119
|
+
m.draw 'roundrectangle 1,1,%s,%s,%s,%s' % [width, width, radius, radius]
|
120
|
+
end
|
121
|
+
|
122
|
+
masked = img.composite(mask, 'png') do |i|
|
123
|
+
i.alpha "set"
|
124
|
+
i.compose 'DstIn'
|
125
|
+
end
|
126
|
+
|
127
|
+
return masked
|
128
|
+
end
|
129
|
+
|
59
130
|
def self.get_custom_sizes(image, custom_sizes)
|
60
131
|
|
61
132
|
end
|
@@ -97,7 +168,20 @@ module Fastlane
|
|
97
168
|
description: "Hash of custom sizes - {'path/icon.png' => '256x256'}",
|
98
169
|
default_value: {},
|
99
170
|
optional: true,
|
100
|
-
type: Hash)
|
171
|
+
type: Hash),
|
172
|
+
FastlaneCore::ConfigItem.new(key: :generate_rounded,
|
173
|
+
description: "Generate round icons?",
|
174
|
+
default_value: false,
|
175
|
+
type: Boolean),
|
176
|
+
FastlaneCore::ConfigItem.new(key: :minimagick_cli,
|
177
|
+
env_name: "APPICON_MINIMAGICK_CLI",
|
178
|
+
description: "Set MiniMagick CLI (auto picked by default). Values are: graphicsmagick, imagemagick",
|
179
|
+
optional: true,
|
180
|
+
type: String,
|
181
|
+
verify_block: proc do |value|
|
182
|
+
av = %w(graphicsmagick imagemagick)
|
183
|
+
UI.user_error!("Unsupported minimagick cli '#{value}', must be: #{av}") unless av.include?(value)
|
184
|
+
end)
|
101
185
|
]
|
102
186
|
end
|
103
187
|
|
@@ -1,8 +1,16 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'mini_magick'
|
3
|
+
|
1
4
|
module Fastlane
|
2
5
|
module Actions
|
3
6
|
class AppiconAction < Action
|
4
7
|
def self.needed_icons
|
5
8
|
{
|
9
|
+
universal: {
|
10
|
+
'1x' => ['2732x2732'],
|
11
|
+
'2x' => ['2732x2732'],
|
12
|
+
'3x' => ['2732x2732']
|
13
|
+
},
|
6
14
|
iphone: {
|
7
15
|
'2x' => ['20x20', '29x29', '40x40', '60x60'],
|
8
16
|
'3x' => ['20x20', '29x29', '40x40', '60x60']
|
@@ -15,11 +23,44 @@ module Fastlane
|
|
15
23
|
'1x' => ['1024x1024']
|
16
24
|
},
|
17
25
|
:watch => {
|
18
|
-
'2x' => [
|
26
|
+
'2x' => [
|
27
|
+
['24x24', 'notificationCenter', '38mm'],
|
28
|
+
['27.5x27.5', 'notificationCenter', '42mm'],
|
29
|
+
['29x29', 'companionSettings'],
|
30
|
+
['40x40', 'appLauncher', '38mm'],
|
31
|
+
['44x44', 'appLauncher', '40mm'],
|
32
|
+
['50x50', 'appLauncher', '44mm'],
|
33
|
+
['86x86', 'quickLook', '38mm'],
|
34
|
+
['98x98', 'quickLook', '42mm'],
|
35
|
+
['108x108', 'quickLook', '44mm']
|
36
|
+
],
|
19
37
|
'3x' => [['29x29', 'companionSettings']]
|
20
38
|
},
|
21
39
|
:watch_marketing => {
|
22
40
|
'1x' => ['1024x1024']
|
41
|
+
},
|
42
|
+
:macos => {
|
43
|
+
'1x' => ['16x16', '32x32', '128x128', '256x256', '512x512'],
|
44
|
+
'2x' => ['16x16', '32x32', '128x128', '256x256', '512x512'],
|
45
|
+
}
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.needed_icons_messages_extension
|
50
|
+
{
|
51
|
+
iphone: {
|
52
|
+
'2x' => ['60x45'],
|
53
|
+
'3x' => ['60x45']
|
54
|
+
},
|
55
|
+
ipad: {
|
56
|
+
'2x' => ['67x50', '74x55']
|
57
|
+
},
|
58
|
+
messages: {
|
59
|
+
'2x' => ['27x20', '32x24'],
|
60
|
+
'3x' => ['27x20', '32x24']
|
61
|
+
},
|
62
|
+
ios_marketing: {
|
63
|
+
'1x' => ['1024x768']
|
23
64
|
}
|
24
65
|
}
|
25
66
|
end
|
@@ -27,12 +68,19 @@ module Fastlane
|
|
27
68
|
def self.run(params)
|
28
69
|
fname = params[:appicon_image_file]
|
29
70
|
basename = File.basename(fname, File.extname(fname))
|
30
|
-
basepath = Pathname.new(File.join(params[:appicon_path], params[:appicon_name]))
|
31
71
|
|
32
|
-
|
72
|
+
Helper::AppiconHelper.set_cli(params[:minimagick_cli])
|
73
|
+
|
74
|
+
is_messages_extension = params[:messages_extension]
|
75
|
+
basepath = Pathname.new(File.join(params[:appicon_path], is_messages_extension ? params[:appicon_messages_name] : params[:appicon_name]))
|
76
|
+
|
33
77
|
image = MiniMagick::Image.open(fname)
|
34
78
|
|
35
|
-
|
79
|
+
if is_messages_extension
|
80
|
+
Helper::AppiconHelper.check_input_image_size(image, 1024, 768)
|
81
|
+
else
|
82
|
+
Helper::AppiconHelper.check_input_image_size(image, 1024, 1024)
|
83
|
+
end
|
36
84
|
|
37
85
|
# Convert image to png
|
38
86
|
image.format 'png'
|
@@ -42,19 +90,25 @@ module Fastlane
|
|
42
90
|
image.alpha 'remove'
|
43
91
|
end
|
44
92
|
|
45
|
-
#
|
93
|
+
# Recreate the base path
|
94
|
+
FileUtils.rm_rf(basepath)
|
46
95
|
FileUtils.mkdir_p(basepath)
|
47
96
|
|
48
97
|
images = []
|
49
98
|
|
50
|
-
icons = Helper::AppiconHelper.get_needed_icons(params[:appicon_devices], self.needed_icons, false)
|
99
|
+
icons = Helper::AppiconHelper.get_needed_icons(params[:appicon_devices], is_messages_extension ? self.needed_icons_messages_extension : self.needed_icons, false)
|
51
100
|
icons.each do |icon|
|
52
101
|
width = icon['width']
|
53
102
|
height = icon['height']
|
54
|
-
filename =
|
103
|
+
filename = basename
|
104
|
+
unless icon['device'] == 'universal'
|
105
|
+
filename += "-#{width.to_i}x#{height.to_i}"
|
106
|
+
end
|
107
|
+
filename += ".png"
|
55
108
|
|
56
109
|
# downsize icon
|
57
|
-
|
110
|
+
# "!" resizes to exact size (needed for messages extension)
|
111
|
+
image.resize "#{width}x#{height}!"
|
58
112
|
|
59
113
|
# Don't write change/created times into the PNG properties
|
60
114
|
# so unchanged files don't have different hashes.
|
@@ -63,12 +117,27 @@ module Fastlane
|
|
63
117
|
image.write basepath + filename
|
64
118
|
|
65
119
|
info = {
|
66
|
-
'size' => icon['size'],
|
67
120
|
'idiom' => icon['device'],
|
68
121
|
'filename' => filename,
|
69
122
|
'scale' => icon['scale']
|
70
123
|
}
|
71
124
|
|
125
|
+
# if device is messages, we need to set it to universal
|
126
|
+
if icon['device'] == 'messages'
|
127
|
+
info['idiom'] = 'universal'
|
128
|
+
info['platform'] = 'ios'
|
129
|
+
end
|
130
|
+
|
131
|
+
# if device is ios_marketing but we are generating messages extension app, set the idiom correctly
|
132
|
+
if icon['device'] == 'ios_marketing' && is_messages_extension
|
133
|
+
info['platform'] = 'ios'
|
134
|
+
end
|
135
|
+
|
136
|
+
|
137
|
+
unless icon['device'] == 'universal'
|
138
|
+
info['size'] = icon['size']
|
139
|
+
end
|
140
|
+
|
72
141
|
info['role'] = icon['role'] unless icon['role'].nil?
|
73
142
|
info['subtype'] = icon['subtype'] unless icon['subtype'].nil?
|
74
143
|
|
@@ -83,8 +152,7 @@ module Fastlane
|
|
83
152
|
}
|
84
153
|
}
|
85
154
|
|
86
|
-
|
87
|
-
File.write(File.join(basepath, 'Contents.json'), JSON.dump(contents))
|
155
|
+
File.write(File.join(basepath, 'Contents.json'), JSON.pretty_generate(contents))
|
88
156
|
UI.success("Successfully stored app icon at '#{basepath}'")
|
89
157
|
end
|
90
158
|
|
@@ -122,12 +190,33 @@ module Fastlane
|
|
122
190
|
description: "Name of the appiconset inside the asset catalogue",
|
123
191
|
optional: true,
|
124
192
|
type: String),
|
193
|
+
FastlaneCore::ConfigItem.new(key: :appicon_messages_name,
|
194
|
+
env_name: "APPICON_MESSAGES_NAME",
|
195
|
+
default_value: 'AppIcon.stickersiconset',
|
196
|
+
description: "Name of the appiconset inside the asset catalogue",
|
197
|
+
optional: true,
|
198
|
+
type: String),
|
125
199
|
FastlaneCore::ConfigItem.new(key: :remove_alpha,
|
126
200
|
env_name: "REMOVE_ALPHA",
|
127
201
|
default_value: false,
|
128
202
|
description: "Remove the alpha channel from generated PNG",
|
129
203
|
optional: true,
|
130
|
-
type: Boolean)
|
204
|
+
type: Boolean),
|
205
|
+
FastlaneCore::ConfigItem.new(key: :messages_extension,
|
206
|
+
env_name: "APPICON_MESSAGES_EXTENSION",
|
207
|
+
default_value: false,
|
208
|
+
description: "App icon is generated for Messages extension",
|
209
|
+
optional: true,
|
210
|
+
type: Boolean),
|
211
|
+
FastlaneCore::ConfigItem.new(key: :minimagick_cli,
|
212
|
+
env_name: "APPICON_MINIMAGICK_CLI",
|
213
|
+
description: "Set MiniMagick CLI (auto picked by default). Values are: graphicsmagick, imagemagick",
|
214
|
+
optional: true,
|
215
|
+
type: String,
|
216
|
+
verify_block: proc do |value|
|
217
|
+
av = %w(graphicsmagick imagemagick)
|
218
|
+
UI.user_error!("Unsupported minimagick cli '#{value}', must be: #{av}") unless av.include?(value)
|
219
|
+
end)
|
131
220
|
]
|
132
221
|
end
|
133
222
|
|
@@ -1,10 +1,26 @@
|
|
1
|
+
require 'mini_magick'
|
2
|
+
|
1
3
|
module Fastlane
|
2
4
|
module Helper
|
3
5
|
class AppiconHelper
|
4
|
-
def self.check_input_image_size(image,
|
5
|
-
UI.user_error!("Minimum width of input image should be #{
|
6
|
-
UI.user_error!("Minimum height of input image should be #{
|
7
|
-
UI.user_error!("Input image should be square") if image.width
|
6
|
+
def self.check_input_image_size(image, width, height)
|
7
|
+
UI.user_error!("Minimum width of input image should be #{width}") if image.width < width
|
8
|
+
UI.user_error!("Minimum height of input image should be #{height}") if image.height < height
|
9
|
+
UI.user_error!("Input image should be square") if image.width / image.height != width / height
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.set_cli(minimagick_cli)
|
13
|
+
MiniMagick.configure do |config|
|
14
|
+
case minimagick_cli
|
15
|
+
when "graphicsmagick"
|
16
|
+
config.cli = :graphicsmagick
|
17
|
+
when "imagemagick"
|
18
|
+
config.cli = :imagemagick
|
19
|
+
else
|
20
|
+
config.cli = MiniMagick.cli()
|
21
|
+
end
|
22
|
+
config.timeout = 5
|
23
|
+
end
|
8
24
|
end
|
9
25
|
|
10
26
|
def self.get_needed_icons(devices, needed_icons, is_android = false, custom_sizes = {})
|
@@ -19,7 +35,8 @@ module Fastlane
|
|
19
35
|
if is_android
|
20
36
|
width, height = size.split('x').map { |v| v.to_f }
|
21
37
|
else
|
22
|
-
|
38
|
+
multiple = device.match(/universal/) ? 1 : scale.to_i
|
39
|
+
width, height = size.split('x').map { |v| v.to_f * multiple }
|
23
40
|
end
|
24
41
|
|
25
42
|
icons << {
|
@@ -31,12 +48,12 @@ module Fastlane
|
|
31
48
|
'role' => role,
|
32
49
|
'subtype' => subtype
|
33
50
|
}
|
34
|
-
|
51
|
+
|
35
52
|
end
|
36
53
|
end
|
37
54
|
end
|
38
|
-
|
39
|
-
# Add custom icon sizes (probably for notifications)
|
55
|
+
|
56
|
+
# Add custom icon sizes (probably for notifications)
|
40
57
|
custom_sizes.each do |path, size|
|
41
58
|
path = path.to_s
|
42
59
|
width, height = size.split('x').map { |v| v.to_f }
|
@@ -49,7 +66,7 @@ module Fastlane
|
|
49
66
|
'filename' => File.basename(path)
|
50
67
|
}
|
51
68
|
end
|
52
|
-
|
69
|
+
|
53
70
|
# Sort from the largest to the smallest needed icon
|
54
71
|
icons = icons.sort_by {|value| value['width']} .reverse
|
55
72
|
end
|
metadata
CHANGED
@@ -1,29 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-appicon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boris Bügling
|
8
|
-
|
8
|
+
- Felix Krause
|
9
|
+
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2021-03-25 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: mini_magick
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
16
17
|
requirements:
|
17
|
-
- - "
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 4.9.4
|
21
|
+
- - "<"
|
18
22
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
23
|
+
version: 5.0.0
|
20
24
|
type: :runtime
|
21
25
|
prerelease: false
|
22
26
|
version_requirements: !ruby/object:Gem::Requirement
|
23
27
|
requirements:
|
24
|
-
- - "
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 4.9.4
|
31
|
+
- - "<"
|
25
32
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
33
|
+
version: 5.0.0
|
27
34
|
- !ruby/object:Gem::Dependency
|
28
35
|
name: json
|
29
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,7 +129,7 @@ dependencies:
|
|
122
129
|
- - ">="
|
123
130
|
- !ruby/object:Gem::Version
|
124
131
|
version: 1.95.0
|
125
|
-
description:
|
132
|
+
description:
|
126
133
|
email: boris@icculus.org
|
127
134
|
executables: []
|
128
135
|
extensions: []
|
@@ -135,11 +142,11 @@ files:
|
|
135
142
|
- lib/fastlane/plugin/appicon/actions/appicon_action.rb
|
136
143
|
- lib/fastlane/plugin/appicon/helper/appicon_helper.rb
|
137
144
|
- lib/fastlane/plugin/appicon/version.rb
|
138
|
-
homepage: https://github.com/
|
145
|
+
homepage: https://github.com/fastlane-community/fastlane-plugin-appicon
|
139
146
|
licenses:
|
140
147
|
- MIT
|
141
148
|
metadata: {}
|
142
|
-
post_install_message:
|
149
|
+
post_install_message:
|
143
150
|
rdoc_options: []
|
144
151
|
require_paths:
|
145
152
|
- lib
|
@@ -154,9 +161,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
161
|
- !ruby/object:Gem::Version
|
155
162
|
version: '0'
|
156
163
|
requirements: []
|
157
|
-
|
158
|
-
|
159
|
-
signing_key:
|
164
|
+
rubygems_version: 3.0.3
|
165
|
+
signing_key:
|
160
166
|
specification_version: 4
|
161
167
|
summary: Generate required icon sizes and iconset from a master application icon.
|
162
168
|
test_files: []
|