fastlane-plugin-branding 0.1.0 → 0.1.4
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 +29 -20
- data/lib/fastlane/plugin/branding/actions/branding_action.rb +29 -16
- data/lib/fastlane/plugin/branding/version.rb +1 -1
- metadata +6 -8
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
@@ -1,6 +1,14 @@
|
|
1
1
|
# branding plugin
|
2
2
|
|
3
3
|
[](https://rubygems.org/gems/fastlane-plugin-branding)
|
4
|
+

|
5
|
+
|
6
|
+
|
7
|
+
Render your App's icon to the terminal whenever you run fastlane!
|
8
|
+
|
9
|
+
[](https://asciinema.org/a/6xe3kkh6a6qm5v8awvp08fm3q)
|
10
|
+
|
11
|
+
_Serious Branding!_
|
4
12
|
|
5
13
|
## Getting Started
|
6
14
|
|
@@ -10,30 +18,31 @@ This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To ge
|
|
10
18
|
fastlane add_plugin branding
|
11
19
|
```
|
12
20
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
21
|
+
Once you've added the plugin, add the `branding` action to your `Fastfile`.
|
22
|
+
Like this:
|
23
|
+
```ruby
|
24
|
+
platform :ios do
|
25
|
+
before_all do
|
26
|
+
branding
|
27
|
+
end
|
28
|
+
end
|
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
|
+
```
|
22
38
|
|
23
|
-
|
39
|
+
## Why?
|
24
40
|
|
25
|
-
|
41
|
+
You worked hard on your app, so show some pride and see your app's icon during the start of your fastlane runs.
|
26
42
|
|
27
|
-
|
43
|
+
## Usage
|
28
44
|
|
29
|
-
|
30
|
-
rake
|
31
|
-
```
|
32
|
-
|
33
|
-
To automatically fix many of the styling issues, use
|
34
|
-
```
|
35
|
-
rubocop -a
|
36
|
-
```
|
45
|
+
This plugin makes use of [branding.rb](https://github.com/snatchev/branding.rb) to render your AppIcon in glorious hi-res 240 colors!
|
37
46
|
|
38
47
|
## Issues and Feedback
|
39
48
|
|
@@ -4,12 +4,15 @@ module Fastlane
|
|
4
4
|
module Actions
|
5
5
|
class BrandingAction < Action
|
6
6
|
def self.run(params)
|
7
|
-
rows, cols = Branding::Canvas.terminal_size
|
8
|
-
ideal_width = cols /
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
rows, cols = ::Branding::Canvas.terminal_size
|
8
|
+
ideal_width = cols / 3
|
9
|
+
|
10
|
+
if path = best_icon(params[:brand_icon_path], ideal_width)
|
11
|
+
logo = ::Branding::Logo.new(path)
|
12
|
+
logo.algo = :normal
|
13
|
+
logo.print
|
14
|
+
puts "\e[0m"
|
15
|
+
end
|
13
16
|
end
|
14
17
|
|
15
18
|
def self.description
|
@@ -22,29 +25,39 @@ module Fastlane
|
|
22
25
|
|
23
26
|
def self.available_options
|
24
27
|
[
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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)
|
30
33
|
]
|
31
34
|
end
|
32
35
|
|
33
36
|
def self.is_supported?(platform)
|
34
37
|
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
35
38
|
# See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
|
36
|
-
[:ios, :mac].include?(platform)
|
39
|
+
[:ios, :mac, :android].include?(platform)
|
37
40
|
end
|
38
41
|
|
39
|
-
def self.best_icon(ideal_width)
|
40
|
-
icon_paths = Dir.glob("**/AppIcon.
|
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
|
+
|
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
|
41
53
|
|
42
|
-
paths =
|
43
|
-
png = PNG.from_file(path)
|
54
|
+
paths = paths.sort_by do |path|
|
55
|
+
png = ::Branding::PNG.from_file(path)
|
44
56
|
(ideal_width - png.width).abs
|
45
57
|
end
|
46
58
|
|
47
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."
|
48
61
|
nil
|
49
62
|
else
|
50
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
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0
|
19
|
+
version: 0.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0
|
26
|
+
version: 0.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: fastlane
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ files:
|
|
50
50
|
- lib/fastlane/plugin/branding/actions/branding_action.rb
|
51
51
|
- lib/fastlane/plugin/branding/helper/branding_helper.rb
|
52
52
|
- lib/fastlane/plugin/branding/version.rb
|
53
|
-
homepage:
|
53
|
+
homepage: https://github.com/snatchev/fastlane-branding-plugin
|
54
54
|
licenses:
|
55
55
|
- MIT
|
56
56
|
metadata: {}
|
@@ -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.4.5.1
|
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:
|