danger-app_size_report 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/Gemfile.lock +170 -0
- data/Guardfile +2 -0
- data/LICENSE +21 -0
- data/README.md +46 -8
- data/Rakefile +2 -0
- data/Resources/App Thinning Size Report.txt +57 -0
- data/Resources/expectedReportJSON.json +590 -0
- data/danger-app_size_report.gemspec +13 -11
- data/lib/app_size_report/gem_version.rb +3 -1
- data/lib/app_size_report/plugin.rb +152 -78
- data/lib/converter/helper/json_converter.rb +14 -0
- data/lib/converter/helper/memory_size.rb +107 -0
- data/lib/converter/helper/result_factory.rb +34 -0
- data/lib/converter/models/app_size_model.rb +32 -0
- data/lib/converter/models/device_model.rb +17 -0
- data/lib/converter/models/variant_model.rb +24 -0
- data/lib/converter/parser/app_size_parser.rb +48 -0
- data/lib/converter/parser/model_parser.rb +13 -0
- data/lib/converter/parser/report_parser.rb +65 -0
- data/lib/converter/parser/variant_descriptor_parser.rb +53 -0
- data/lib/converter/parser/variant_parser.rb +10 -0
- data/lib/danger_app_size_report.rb +3 -1
- data/lib/danger_plugin.rb +3 -1
- data/spec/app_size_report_spec.rb +18 -27
- data/spec/spec_helper.rb +19 -17
- metadata +35 -21
- data/LICENSE.txt +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b365600ee021d284beda6dcbfbf0458f1a5a70e57e5602de4f90fa96a42e89d
|
4
|
+
data.tar.gz: 0c673c72637fd341e61c43ec044bdf9c5e2742e9571920269dfdacf8a2c97cb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df752062c2f4f08a90f1ccaf9d153f25e1c782e4c342c22529175989a44dd0187470abeeabc88e726b8d0cd31f14df9abafd6c7f22b3c7b8d2e672f2556fde82
|
7
|
+
data.tar.gz: 414f43733a1c575c051ed0bfce2a9bf9e28438facb30c361080fef18d58c4ecb58d12ad86806ce17feefa0ab8f8f52137a8a9e71bb91a2a1986003d392ee9b23
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
danger-app_size_report (0.0.2)
|
5
|
+
danger-plugin-api (~> 1.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
addressable (2.8.0)
|
11
|
+
public_suffix (>= 2.0.2, < 5.0)
|
12
|
+
ast (2.4.2)
|
13
|
+
claide (1.1.0)
|
14
|
+
claide-plugins (0.9.2)
|
15
|
+
cork
|
16
|
+
nap
|
17
|
+
open4 (~> 1.3)
|
18
|
+
coderay (1.1.3)
|
19
|
+
colored2 (3.1.2)
|
20
|
+
cork (0.3.0)
|
21
|
+
colored2 (~> 3.1)
|
22
|
+
danger (8.4.2)
|
23
|
+
claide (~> 1.0)
|
24
|
+
claide-plugins (>= 0.9.2)
|
25
|
+
colored2 (~> 3.1)
|
26
|
+
cork (~> 0.1)
|
27
|
+
faraday (>= 0.9.0, < 2.0)
|
28
|
+
faraday-http-cache (~> 2.0)
|
29
|
+
git (~> 1.7)
|
30
|
+
kramdown (~> 2.3)
|
31
|
+
kramdown-parser-gfm (~> 1.0)
|
32
|
+
no_proxy_fix
|
33
|
+
octokit (~> 4.7)
|
34
|
+
terminal-table (>= 1, < 4)
|
35
|
+
danger-plugin-api (1.0.0)
|
36
|
+
danger (> 2.0)
|
37
|
+
diff-lcs (1.5.0)
|
38
|
+
faraday (1.9.3)
|
39
|
+
faraday-em_http (~> 1.0)
|
40
|
+
faraday-em_synchrony (~> 1.0)
|
41
|
+
faraday-excon (~> 1.1)
|
42
|
+
faraday-httpclient (~> 1.0)
|
43
|
+
faraday-multipart (~> 1.0)
|
44
|
+
faraday-net_http (~> 1.0)
|
45
|
+
faraday-net_http_persistent (~> 1.0)
|
46
|
+
faraday-patron (~> 1.0)
|
47
|
+
faraday-rack (~> 1.0)
|
48
|
+
faraday-retry (~> 1.0)
|
49
|
+
ruby2_keywords (>= 0.0.4)
|
50
|
+
faraday-em_http (1.0.0)
|
51
|
+
faraday-em_synchrony (1.0.0)
|
52
|
+
faraday-excon (1.1.0)
|
53
|
+
faraday-http-cache (2.2.0)
|
54
|
+
faraday (>= 0.8)
|
55
|
+
faraday-httpclient (1.0.1)
|
56
|
+
faraday-multipart (1.0.3)
|
57
|
+
multipart-post (>= 1.2, < 3)
|
58
|
+
faraday-net_http (1.0.1)
|
59
|
+
faraday-net_http_persistent (1.2.0)
|
60
|
+
faraday-patron (1.0.0)
|
61
|
+
faraday-rack (1.0.0)
|
62
|
+
faraday-retry (1.0.3)
|
63
|
+
ffi (1.15.5)
|
64
|
+
formatador (1.1.0)
|
65
|
+
git (1.10.2)
|
66
|
+
rchardet (~> 1.8)
|
67
|
+
guard (2.18.0)
|
68
|
+
formatador (>= 0.2.4)
|
69
|
+
listen (>= 2.7, < 4.0)
|
70
|
+
lumberjack (>= 1.0.12, < 2.0)
|
71
|
+
nenv (~> 0.1)
|
72
|
+
notiffany (~> 0.0)
|
73
|
+
pry (>= 0.13.0)
|
74
|
+
shellany (~> 0.0)
|
75
|
+
thor (>= 0.18.1)
|
76
|
+
guard-compat (1.2.1)
|
77
|
+
guard-rspec (4.7.3)
|
78
|
+
guard (~> 2.1)
|
79
|
+
guard-compat (~> 1.1)
|
80
|
+
rspec (>= 2.99.0, < 4.0)
|
81
|
+
kramdown (2.3.1)
|
82
|
+
rexml
|
83
|
+
kramdown-parser-gfm (1.1.0)
|
84
|
+
kramdown (~> 2.0)
|
85
|
+
listen (3.0.7)
|
86
|
+
rb-fsevent (>= 0.9.3)
|
87
|
+
rb-inotify (>= 0.9.7)
|
88
|
+
lumberjack (1.2.8)
|
89
|
+
method_source (1.0.0)
|
90
|
+
multipart-post (2.1.1)
|
91
|
+
nap (1.1.0)
|
92
|
+
nenv (0.3.0)
|
93
|
+
no_proxy_fix (0.1.2)
|
94
|
+
notiffany (0.1.3)
|
95
|
+
nenv (~> 0.1)
|
96
|
+
shellany (~> 0.0)
|
97
|
+
octokit (4.22.0)
|
98
|
+
faraday (>= 0.9)
|
99
|
+
sawyer (~> 0.8.0, >= 0.5.3)
|
100
|
+
open4 (1.3.4)
|
101
|
+
parallel (1.21.0)
|
102
|
+
parser (3.1.0.0)
|
103
|
+
ast (~> 2.4.1)
|
104
|
+
pry (0.14.1)
|
105
|
+
coderay (~> 1.1)
|
106
|
+
method_source (~> 1.0)
|
107
|
+
public_suffix (4.0.6)
|
108
|
+
rainbow (3.1.1)
|
109
|
+
rake (10.5.0)
|
110
|
+
rb-fsevent (0.11.0)
|
111
|
+
rb-inotify (0.10.1)
|
112
|
+
ffi (~> 1.0)
|
113
|
+
rchardet (1.8.0)
|
114
|
+
regexp_parser (2.2.0)
|
115
|
+
rexml (3.2.5)
|
116
|
+
rspec (3.10.0)
|
117
|
+
rspec-core (~> 3.10.0)
|
118
|
+
rspec-expectations (~> 3.10.0)
|
119
|
+
rspec-mocks (~> 3.10.0)
|
120
|
+
rspec-core (3.10.2)
|
121
|
+
rspec-support (~> 3.10.0)
|
122
|
+
rspec-expectations (3.10.2)
|
123
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
124
|
+
rspec-support (~> 3.10.0)
|
125
|
+
rspec-mocks (3.10.2)
|
126
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
127
|
+
rspec-support (~> 3.10.0)
|
128
|
+
rspec-support (3.10.3)
|
129
|
+
rubocop (1.25.0)
|
130
|
+
parallel (~> 1.10)
|
131
|
+
parser (>= 3.1.0.0)
|
132
|
+
rainbow (>= 2.2.2, < 4.0)
|
133
|
+
regexp_parser (>= 1.8, < 3.0)
|
134
|
+
rexml
|
135
|
+
rubocop-ast (>= 1.15.1, < 2.0)
|
136
|
+
ruby-progressbar (~> 1.7)
|
137
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
138
|
+
rubocop-ast (1.15.1)
|
139
|
+
parser (>= 3.0.1.1)
|
140
|
+
ruby-progressbar (1.11.0)
|
141
|
+
ruby2_keywords (0.0.5)
|
142
|
+
sawyer (0.8.2)
|
143
|
+
addressable (>= 2.3.5)
|
144
|
+
faraday (> 0.8, < 2.0)
|
145
|
+
shellany (0.0.1)
|
146
|
+
terminal-table (3.0.2)
|
147
|
+
unicode-display_width (>= 1.1.1, < 3)
|
148
|
+
thor (1.2.1)
|
149
|
+
unicode-display_width (2.1.0)
|
150
|
+
webrick (1.7.0)
|
151
|
+
yard (0.9.27)
|
152
|
+
webrick (~> 1.7.0)
|
153
|
+
|
154
|
+
PLATFORMS
|
155
|
+
x86_64-darwin-20
|
156
|
+
|
157
|
+
DEPENDENCIES
|
158
|
+
bundler (~> 2.0)
|
159
|
+
danger-app_size_report!
|
160
|
+
guard (~> 2.14)
|
161
|
+
guard-rspec (~> 4.7)
|
162
|
+
listen (= 3.0.7)
|
163
|
+
pry (~> 0.14.1)
|
164
|
+
rake (~> 10.0)
|
165
|
+
rspec (~> 3.4)
|
166
|
+
rubocop (~> 1.25.0)
|
167
|
+
yard (~> 0.9.27)
|
168
|
+
|
169
|
+
BUNDLED WITH
|
170
|
+
2.3.6
|
data/Guardfile
CHANGED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2021 ChargePoint
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,17 +1,55 @@
|
|
1
1
|
# danger-app_size_report
|
2
2
|
|
3
|
-
Danger
|
3
|
+
A [Danger](https://github.com/danger/danger) plugin for reporting iOS app size violations. A valid [App Thinning Size Report](https://developer.apple.com/documentation/xcode/reducing-your-app-s-size) must be passed to the plugin for accurate functionality.
|
4
4
|
|
5
5
|
## Installation
|
6
|
-
|
6
|
+
|
7
|
+
$ gem install danger-app_size_report
|
7
8
|
|
8
9
|
## Usage
|
9
10
|
|
10
|
-
|
11
|
+
### `flag_violations`
|
12
|
+
|
13
|
+
Report app size violations given a valid App Thinning Size Report.
|
11
14
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
15
|
+
// Dangerfile
|
16
|
+
|
17
|
+
report_path = "/Path/to/AppSizeReport.txt"
|
18
|
+
app_size_report.flag_violations(
|
19
|
+
report_path,
|
20
|
+
build_type: 'App',
|
21
|
+
size_limit: 4,
|
22
|
+
limit_unit: 'GB',
|
23
|
+
fail_on_warning: false
|
16
24
|
)
|
17
|
-
|
25
|
+
|
26
|
+
#### Parameters
|
27
|
+
|
28
|
+
- `report_path` [String, required] Path to valid App Thinning Size Report text file.
|
29
|
+
- `build_type` [String, optional] [Default: 'App'] Specify whether the report corresponds to an App or an App Clip.
|
30
|
+
- Supported values: 'App', 'Clip'
|
31
|
+
- `size_limit` [Numeric, optional] [Default: 4] Specify the app size limit.
|
32
|
+
- `limit_unit` [String, optional] [Default: 'GB'] Specific the unit for the given size limit.
|
33
|
+
- Supported values: 'KB', 'MB', 'GB'
|
34
|
+
- `fail_on_warning` [Boolean, optional] [Default: false] Specify whether the PR should fail if one or more app variants exceed the given size limit. By default, the plugin issues a warning in this case.
|
35
|
+
|
36
|
+
### `report_json`
|
37
|
+
|
38
|
+
Returns a JSON string representation of the given App Thinning Size Report.
|
39
|
+
|
40
|
+
// Dangerfile
|
41
|
+
|
42
|
+
report_path = "/Path/to/AppSizeReport.txt"
|
43
|
+
app_size_json = app_size_report.report_json(report_path)
|
44
|
+
|
45
|
+
#### Parameters
|
46
|
+
|
47
|
+
- `report_path` [String, required] Path to valid App Thinning Size Report text file.
|
48
|
+
|
49
|
+
## Development
|
50
|
+
|
51
|
+
1. Clone this repo
|
52
|
+
2. Run `bundle install` to setup dependencies.
|
53
|
+
3. Run `bundle exec rake spec` to run the tests.
|
54
|
+
4. Use `bundle exec guard` to automatically have tests run as you make changes.
|
55
|
+
5. Make your changes.
|
data/Rakefile
CHANGED
@@ -0,0 +1,57 @@
|
|
1
|
+
|
2
|
+
App Thinning Size Report for All Variants of CP
|
3
|
+
|
4
|
+
Variant: ChargePointAppClip-0F01226A-99F0-4092-8BBD-6919103E6F0A.ipa
|
5
|
+
Supported variant descriptors: [device: iPhone8,4, os-version: 14.0], [device: iPhone8,1, os-version: 14.0], and [device: iPod9,1, os-version: 14.0]
|
6
|
+
App + On Demand Resources size: 5.4 MB compressed, 11.6 MB uncompressed
|
7
|
+
App size: 5.4 MB compressed, 11.6 MB uncompressed
|
8
|
+
On Demand Resources size: Zero KB compressed, Zero KB uncompressed
|
9
|
+
|
10
|
+
|
11
|
+
Variant: ChargePointAppClip-35AD0331-EA57-4B82-B8E6-029D7786B9B7.ipa
|
12
|
+
Supported variant descriptors: [device: iPhone10,3, os-version: 14.0], [device: iPhone10,6, os-version: 14.0], [device: iPhone13,4, os-version: 14.0], [device: iPhone9,4, os-version: 14.0], [device: iPhone10,2, os-version: 14.0], [device: iPhone12,3, os-version: 14.0], [device: iPhone12,5, os-version: 14.0], [device: iPhone11,4, os-version: 14.0], [device: iPhone9,2, os-version: 14.0], [device: iPhone11,2, os-version: 14.0], [device: iPhone13,1, os-version: 14.0], [device: iPhone13,3, os-version: 14.0], [device: iPhone10,5, os-version: 14.0], [device: iPhone13,2, os-version: 14.0], and [device: iPhone11,6, os-version: 14.0]
|
13
|
+
App + On Demand Resources size: 6.6 MB compressed, 12.9 MB uncompressed
|
14
|
+
App size: 6.6 MB compressed, 12.9 MB uncompressed
|
15
|
+
On Demand Resources size: Zero KB compressed, Zero KB uncompressed
|
16
|
+
|
17
|
+
|
18
|
+
Variant: ChargePointAppClip-4982417C-64B2-48AA-B47A-AB97290C2D46.ipa
|
19
|
+
Supported variant descriptors: [device: iPad8,11, os-version: 14.0], [device: iPad8,5, os-version: 14.0], [device: MacFamily20,1, os-version: 14.0], [device: iPad8,6, os-version: 14.0], [device: iPad13,2, os-version: 14.0], [device: iPad8,8, os-version: 14.0], [device: iPad7,3, os-version: 14.0], [device: iPad11,4, os-version: 14.0], [device: iPad11,2, os-version: 14.0], [device: iPad6,3, os-version: 14.0], [device: iPad7,1, os-version: 14.0], [device: iPad8,12, os-version: 14.0], [device: iPad11,3, os-version: 14.0], [device: iPad7,4, os-version: 14.0], [device: iPad8,1, os-version: 14.0], [device: iPad11,1, os-version: 14.0], [device: iPad7,2, os-version: 14.0], [device: iPad8,10, os-version: 14.0], [device: iPad6,4, os-version: 14.0], [device: iPad8,9, os-version: 14.0], [device: iPad8,2, os-version: 14.0], [device: iPad8,3, os-version: 14.0], [device: iPad13,1, os-version: 14.0], [device: iPad8,7, os-version: 14.0], and [device: iPad8,4, os-version: 14.0]
|
20
|
+
App + On Demand Resources size: 5.4 MB compressed, 11.6 MB uncompressed
|
21
|
+
App size: 5.4 MB compressed, 11.6 MB uncompressed
|
22
|
+
On Demand Resources size: Zero KB compressed, Zero KB uncompressed
|
23
|
+
|
24
|
+
|
25
|
+
Variant: ChargePointAppClip-759FEA38-87EA-46C1-96A1-010F088B2E3A.ipa
|
26
|
+
Supported variant descriptors: [device: iPad5,3, os-version: 14.0], [device: iPad5,2, os-version: 14.0], [device: iPad6,11, os-version: 14.0], [device: iPad7,6, os-version: 14.0], [device: iPad6,8, os-version: 14.0], [device: iPad5,4, os-version: 14.0], [device: iPad7,12, os-version: 14.0], [device: iPad6,7, os-version: 14.0], [device: iPad7,5, os-version: 14.0], [device: iPad6,12, os-version: 14.0], [device: iPad11,6, os-version: 14.0], [device: iPad7,11, os-version: 14.0], [device: iPad5,1, os-version: 14.0], and [device: iPad11,7, os-version: 14.0]
|
27
|
+
App + On Demand Resources size: 5.4 MB compressed, 11.6 MB uncompressed
|
28
|
+
App size: 5.4 MB compressed, 11.6 MB uncompressed
|
29
|
+
On Demand Resources size: Zero KB compressed, Zero KB uncompressed
|
30
|
+
|
31
|
+
|
32
|
+
Variant: ChargePointAppClip-9EC3FFDB-82C5-4EC0-882B-2005C6FEADD2.ipa
|
33
|
+
Supported variant descriptors: [device: iPhone8,2, os-version: 14.0]
|
34
|
+
App + On Demand Resources size: 6.6 MB compressed, 12.9 MB uncompressed
|
35
|
+
App size: 6.6 MB compressed, 12.9 MB uncompressed
|
36
|
+
On Demand Resources size: Zero KB compressed, Zero KB uncompressed
|
37
|
+
|
38
|
+
|
39
|
+
Variant: ChargePointAppClip-CDC4B730-FF8B-43B3-B392-3E29B1DC4A13.ipa
|
40
|
+
Supported variant descriptors: [device: iPhone12,8, os-version: 14.0], [device: iPhone9,3, os-version: 14.0], [device: iPhone9,1, os-version: 14.0], [device: iPhone10,1, os-version: 14.0], and [device: iPhone10,4, os-version: 14.0]
|
41
|
+
App + On Demand Resources size: 5.4 MB compressed, 11.6 MB uncompressed
|
42
|
+
App size: 5.4 MB compressed, 11.6 MB uncompressed
|
43
|
+
On Demand Resources size: Zero KB compressed, Zero KB uncompressed
|
44
|
+
|
45
|
+
|
46
|
+
Variant: ChargePointAppClip-D958C2E0-14C7-481E-BB6B-6450CC20B2C1.ipa
|
47
|
+
Supported variant descriptors: [device: iPhone12,1, os-version: 14.0] and [device: iPhone11,8, os-version: 14.0]
|
48
|
+
App + On Demand Resources size: 5.4 MB compressed, 11.6 MB uncompressed
|
49
|
+
App size: 5.4 MB compressed, 11.6 MB uncompressed
|
50
|
+
On Demand Resources size: Zero KB compressed, Zero KB uncompressed
|
51
|
+
|
52
|
+
|
53
|
+
Variant: ChargePointAppClip.ipa
|
54
|
+
Supported variant descriptors: Universal
|
55
|
+
App + On Demand Resources size: 9.3 MB compressed, 16 MB uncompressed
|
56
|
+
App size: 9.3 MB compressed, 16 MB uncompressed
|
57
|
+
On Demand Resources size: Zero KB compressed, Zero KB uncompressed
|