fastlane-plugin-appicon 0.3.0 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24a0792a488d2de605deff1c9696637c1e21485d
4
- data.tar.gz: 2e6204b9efd7a591948a4e52a887f3e29059b8db
3
+ metadata.gz: a963d66781db8351afddd4a9db82dace5d536300
4
+ data.tar.gz: 7be2ebc287c2ca505f1a0236991c499c525957ac
5
5
  SHA512:
6
- metadata.gz: 3bedaf6d41c10498e9a920b6241a71ea2f446b8e832e741392789daa367b4369fcea3268773b2468099bb78c32fb91f75e8292725345ec840f917fb8d9885096
7
- data.tar.gz: 7c32da3f5e58402eff4d543e1f7045a5b2c491addc95a8d884772a840133cfdda0b8d1021b758c45a0adcf467397949732bdae048ddafb4964d300092be13f7f
6
+ metadata.gz: 88e67a524fd463d7988dcebdc0e4b2be39fbaf9e8734b60930a677954d24f56b577298d4af777b4c57e0ae4c4a5ff524f7dd150e568b563a9ff42f2a23ef512a
7
+ data.tar.gz: e3c1ed50bf9180fc304f3304d6589bf0b43d109055391cab68af7be9ac60e2db05e5f8cfa09421457999d3fb884a8252be12fc7231c3476822561dd5184c289e
data/README.md CHANGED
@@ -14,7 +14,7 @@ fastlane add_plugin appicon
14
14
 
15
15
  ## About appicon
16
16
 
17
- Generate required icon sizes and iconset from a master application icon.
17
+ Generate required icon sizes and iconset from a master application icon.
18
18
 
19
19
  Since many apps use a single 1024x1024 icon to produce all the required sizes from, why not automate the process and save lots of time?
20
20
 
@@ -29,6 +29,14 @@ lane :test do
29
29
  appicon(appicon_image_file: 'spec/fixtures/Themoji.png',
30
30
  appicon_devices: [:ipad, :iphone])
31
31
  end
32
+
33
+ # or
34
+
35
+ lane :android do
36
+ android_appicon(appicon_image_file: 'spec/fixtures/Themoji.png',
37
+ appicon_devices: [:phone, :tablet],
38
+ appicon_path:'app/res/mipmap')
39
+ end
32
40
  ```
33
41
 
34
42
  ## Run tests for this plugin
@@ -39,7 +47,7 @@ To run both the tests, and code style validation, run
39
47
  rake
40
48
  ```
41
49
 
42
- To automatically fix many of the styling issues, use
50
+ To automatically fix many of the styling issues, use
43
51
  ```
44
52
  rubocop -a
45
53
  ```
@@ -0,0 +1,90 @@
1
+ module Fastlane
2
+ module Actions
3
+ class AndroidAppiconAction < Action
4
+ def self.needed_icons
5
+ {
6
+ phone: {
7
+ 'ldpi' => ['36x36'],
8
+ 'mdpi' => ['48x48'],
9
+ 'hdpi' => ['72x72'],
10
+ 'xhdpi' => ['96x96']
11
+ },
12
+ tablet: {
13
+ 'xxhdpi' => ['144x144'],
14
+ 'xxxhdpi' => ['192x192']
15
+ }
16
+ }
17
+ end
18
+
19
+ def self.run(params)
20
+ fname = params[:appicon_image_file]
21
+
22
+ require 'mini_magick'
23
+ image = MiniMagick::Image.open(fname)
24
+
25
+ UI.user_error!("Minimum width of input image should be 512") if image.width < 512
26
+ UI.user_error!("Minimum height of input image should be 512") if image.height < 512
27
+ UI.user_error!("Input image should be square") if image.width != image.height
28
+
29
+ params[:appicon_devices].each do |device|
30
+ self.needed_icons[device].each do |scale, sizes|
31
+ sizes.each do |size|
32
+ width, height = size.split('x').map { |v| v.to_f * scale.to_i }
33
+
34
+ basepath = Pathname.new("#{params[:appicon_path]}-#{scale}")
35
+ FileUtils.mkdir_p(basepath)
36
+ filename = "#{params[:appicon_filename]}.png"
37
+
38
+ image = MiniMagick::Image.open(fname)
39
+ image.format 'png'
40
+ image.resize "#{width}x#{height}"
41
+ image.write basepath + filename
42
+ end
43
+ end
44
+ end
45
+
46
+ UI.success("Successfully stored launcher icons at '#{params[:appicon_path]}'")
47
+ end
48
+
49
+ def self.description
50
+ "Generate required icon sizes from a master application icon"
51
+ end
52
+
53
+ def self.authors
54
+ ["@adrum"]
55
+ end
56
+
57
+ def self.available_options
58
+ [
59
+ FastlaneCore::ConfigItem.new(key: :appicon_image_file,
60
+ env_name: "APPICON_IMAGE_FILE",
61
+ description: "Path to a square image file, at least 512x512",
62
+ optional: false,
63
+ type: String),
64
+ FastlaneCore::ConfigItem.new(key: :appicon_devices,
65
+ env_name: "APPICON_DEVICES",
66
+ default_value: [:phone],
67
+ description: "Array of device types to generate icons for",
68
+ optional: true,
69
+ type: Array),
70
+ FastlaneCore::ConfigItem.new(key: :appicon_path,
71
+ env_name: "APPICON_PATH",
72
+ default_value: 'app/res/mipmap/',
73
+ description: "Path to res subfolder",
74
+ optional: true,
75
+ type: String),
76
+ FastlaneCore::ConfigItem.new(key: :appicon_filename,
77
+ env_name: "APPICON_FILENAME",
78
+ default_value: 'ic_launcher',
79
+ description: "The output filename of each image",
80
+ optional: true,
81
+ type: String)
82
+ ]
83
+ end
84
+
85
+ def self.is_supported?(platform)
86
+ [:android].include?(platform)
87
+ end
88
+ end
89
+ end
90
+ end
@@ -4,12 +4,12 @@ module Fastlane
4
4
  def self.needed_icons
5
5
  {
6
6
  iphone: {
7
- '2x' => ['29x29', '40x40', '60x60'],
8
- '3x' => ['29x29', '40x40', '60x60']
7
+ '2x' => ['20x20', '29x29', '40x40', '60x60'],
8
+ '3x' => ['20x20', '29x29', '40x40', '60x60']
9
9
  },
10
10
  ipad: {
11
- '1x' => ['29x29', '40x40', '76x76'],
12
- '2x' => ['29x29', '40x40', '76x76', '83.5x83.5']
11
+ '1x' => ['20x20', '29x29', '40x40', '76x76'],
12
+ '2x' => ['20x20', '29x29', '40x40', '76x76', '83.5x83.5']
13
13
  }
14
14
  }
15
15
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Appicon
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,125 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-appicon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.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: 2016-07-04 00:00:00.000000000 Z
11
+ date: 2016-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_magick
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.5.1
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
26
  version: 4.5.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: fastlane
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: 1.95.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: 1.95.0
125
125
  description:
@@ -128,11 +128,12 @@ executables: []
128
128
  extensions: []
129
129
  extra_rdoc_files: []
130
130
  files:
131
+ - LICENSE
132
+ - README.md
133
+ - lib/fastlane/plugin/appicon.rb
134
+ - lib/fastlane/plugin/appicon/actions/android_appicon_action.rb
131
135
  - lib/fastlane/plugin/appicon/actions/appicon_action.rb
132
136
  - lib/fastlane/plugin/appicon/version.rb
133
- - lib/fastlane/plugin/appicon.rb
134
- - README.md
135
- - LICENSE
136
137
  homepage: https://github.com/neonichu/fastlane-plugin-appicon
137
138
  licenses:
138
139
  - MIT
@@ -143,19 +144,18 @@ require_paths:
143
144
  - lib
144
145
  required_ruby_version: !ruby/object:Gem::Requirement
145
146
  requirements:
146
- - - '>='
147
+ - - ">="
147
148
  - !ruby/object:Gem::Version
148
149
  version: '0'
149
150
  required_rubygems_version: !ruby/object:Gem::Requirement
150
151
  requirements:
151
- - - '>='
152
+ - - ">="
152
153
  - !ruby/object:Gem::Version
153
154
  version: '0'
154
155
  requirements: []
155
156
  rubyforge_project:
156
- rubygems_version: 2.0.14.1
157
+ rubygems_version: 2.5.1
157
158
  signing_key:
158
159
  specification_version: 4
159
160
  summary: Generate required icon sizes and iconset from a master application icon.
160
161
  test_files: []
161
- has_rdoc: