fastlane-plugin-branding 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +8 -1
- data/lib/fastlane/plugin/branding/actions/branding_action.rb +21 -11
- data/lib/fastlane/plugin/branding/version.rb +1 -1
- metadata +3 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5fff389605deb85a3b0d307fa9528bc0a7aef85f5506468adecb690daac00744
|
4
|
+
data.tar.gz: d42df4bfd343a2e25f59dde5777b7d1a292552a408bacdee792e44ac26c8412f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 911802ede73dc17a2604271436796c5d3fd8199b79a11be86be9dbdd2633bf2119065e83683a3b20ab74f08546744705a109ca7a9fc714fb368aff0a78eced49
|
7
|
+
data.tar.gz: 741122b9a87d82f6412c4c78a3ddf39c1c01579e49a709c7ca94c8f92480b971cf1cd2bb6d6ede98c17a9106b23bec6ffec485b20dc4fb6dadfc6895b356be09
|
data/README.md
CHANGED
@@ -20,7 +20,6 @@ fastlane add_plugin branding
|
|
20
20
|
|
21
21
|
Once you've added the plugin, add the `branding` action to your `Fastfile`.
|
22
22
|
Like this:
|
23
|
-
|
24
23
|
```ruby
|
25
24
|
platform :ios do
|
26
25
|
before_all do
|
@@ -28,6 +27,14 @@ platform :ios do
|
|
28
27
|
end
|
29
28
|
end
|
30
29
|
```
|
30
|
+
or:
|
31
|
+
```ruby
|
32
|
+
platform :android do
|
33
|
+
before_all do
|
34
|
+
branding(brand_icon_path: "./resources/**/icon.*")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
```
|
31
38
|
|
32
39
|
## Why?
|
33
40
|
|
@@ -7,11 +7,11 @@ module Fastlane
|
|
7
7
|
rows, cols = ::Branding::Canvas.terminal_size
|
8
8
|
ideal_width = cols / 3
|
9
9
|
|
10
|
-
if path = best_icon(ideal_width)
|
10
|
+
if path = best_icon(params[:brand_icon_path], ideal_width)
|
11
11
|
logo = ::Branding::Logo.new(path)
|
12
12
|
logo.algo = :normal
|
13
13
|
logo.print
|
14
|
-
puts
|
14
|
+
puts "\e[0m"
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -25,29 +25,39 @@ module Fastlane
|
|
25
25
|
|
26
26
|
def self.available_options
|
27
27
|
[
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
FastlaneCore::ConfigItem.new(key: :brand_icon_path,
|
29
|
+
env_name: "BRAND_ICON_PATH",
|
30
|
+
description: "specific path to icon",
|
31
|
+
optional: true,
|
32
|
+
type: String)
|
33
33
|
]
|
34
34
|
end
|
35
35
|
|
36
36
|
def self.is_supported?(platform)
|
37
37
|
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
38
38
|
# See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
|
39
|
-
[:ios, :mac].include?(platform)
|
39
|
+
[:ios, :mac, :android].include?(platform)
|
40
40
|
end
|
41
41
|
|
42
|
-
def self.best_icon(ideal_width)
|
43
|
-
icon_paths = Dir.glob("**/AppIcon.appiconset/*.png").map(&File.method(:realpath))
|
42
|
+
def self.best_icon(brand_icon_path, ideal_width)
|
43
|
+
icon_paths = Dir.glob(brand_icon_path || "**/AppIcon.appiconset/*.png").map(&File.method(:realpath))
|
44
44
|
|
45
|
-
paths = icon_paths.
|
45
|
+
paths = icon_paths.filter do |path|
|
46
|
+
begin
|
47
|
+
png = ::Branding::PNG.from_file(path)
|
48
|
+
true
|
49
|
+
rescue NotImplementedError => err
|
50
|
+
false
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
paths = paths.sort_by do |path|
|
46
55
|
png = ::Branding::PNG.from_file(path)
|
47
56
|
(ideal_width - png.width).abs
|
48
57
|
end
|
49
58
|
|
50
59
|
if paths.empty?
|
60
|
+
puts "No branding image found. Only true color is supported at the moment, so check the color depth of your images and try again."
|
51
61
|
nil
|
52
62
|
else
|
53
63
|
paths.first
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-branding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Natchev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: branding
|
@@ -69,10 +69,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
|
-
|
73
|
-
rubygems_version: 2.6.4
|
72
|
+
rubygems_version: 3.0.3.1
|
74
73
|
signing_key:
|
75
74
|
specification_version: 4
|
76
75
|
summary: Add some branding to your fastlane output
|
77
76
|
test_files: []
|
78
|
-
has_rdoc:
|