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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ff1ba4cc66c9787a4cd8aa9a0b80c0bd19929e41
4
- data.tar.gz: 375acf30b12018dcb191cb3207ffdb1ad5ec2964
2
+ SHA256:
3
+ metadata.gz: 5fff389605deb85a3b0d307fa9528bc0a7aef85f5506468adecb690daac00744
4
+ data.tar.gz: d42df4bfd343a2e25f59dde5777b7d1a292552a408bacdee792e44ac26c8412f
5
5
  SHA512:
6
- metadata.gz: e172c0695b483d5ae6be616197633127a5e8e86ab93577e6031c2dc5fe1189858efe3d1b60c4c15d70733a3aecb70f5af98d67ba6fdf8f57e2ac7703b661ae0d
7
- data.tar.gz: dfa4fafae47ead9c12d5278dcaa605124febd59695e2ddc0afd0b69f843291096c6c07d7edf900d7501ba5975f7c44de2c1fbebe82bb7d2665efef2a02a09ed2
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
- # FastlaneCore::ConfigItem.new(key: :your_option,
29
- # env_name: "BRANDING_YOUR_OPTION",
30
- # description: "A description of your option",
31
- # optional: false,
32
- # type: String)
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.sort_by do |path|
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
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Branding
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
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.3
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: 2016-07-05 00:00:00.000000000 Z
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
- rubyforge_project:
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: