danger-app_size_report 1.0.0 → 1.1.0

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
2
  SHA256:
3
- metadata.gz: 51678b949d92e02ba3e1a894123ac553027e7fad07dba8157877296e4177e6a2
4
- data.tar.gz: '044917b9b27fe9bb6677649051d1757ffebe2cc42df99e02266cf5f8608d73c9'
3
+ metadata.gz: 6c168dda142fc49e3062dc11827166cf7b5474ca3809f798a3475957108edf0a
4
+ data.tar.gz: 9fcffb9b7ad8c70098c7e3f1d89e8f749df8fc78e5c4917dd1bd57159fc08733
5
5
  SHA512:
6
- metadata.gz: 922c09c181eec687676307efd9031bc4634f4965388f2513431829c115d631c70f475a8f26f7a4f5f9e36e76f51d3c8035b1e0736ad9e8cb2d62537abc606b76
7
- data.tar.gz: 7d8d16cc6a68d75ba094b5ba20da98cd119b8f4264c64f8c52b1f8b49a0618317370241cd280da71f73212bf9c79234ef01f40fb3b6ae70f81400e76db1bc5b0
6
+ metadata.gz: 9fcb6ac92658c712e11ebb64b4d83a50356e93c31780199cf927c6ea3f0291b9eae413a1e05d2f588a2c839bea5331727e0e5ddca1fb6c26d382b3ee68d422fe
7
+ data.tar.gz: 00be5ceaafadf145940cef9781c7fbcb1eca3ac02694c936c0b7703c78c47582250498f396b367cc933b267b349e879dd3a56a124f2dc1a069f7da8f42ecacbb
@@ -0,0 +1,3 @@
1
+ **Change Description:**
2
+
3
+ **Test Plan/Testing Performed:**
data/.rubocop.yml CHANGED
@@ -10,11 +10,11 @@ Metrics/BlockLength:
10
10
  Metrics/PerceivedComplexity:
11
11
  Max: 20
12
12
  Metrics/CyclomaticComplexity:
13
- Max: 15
13
+ Max: 20
14
14
  Metrics/AbcSize:
15
- Max: 70
15
+ Max: 90
16
16
  Metrics/ClassLength:
17
- Max: 200
17
+ Max: 220
18
18
  Metrics/ParameterLists:
19
19
  Max: 11
20
20
  Style/Documentation:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-app_size_report (0.0.4)
4
+ danger-app_size_report (1.1.0)
5
5
  danger-plugin-api (~> 1.0)
6
6
 
7
7
  GEM
@@ -62,7 +62,8 @@ GEM
62
62
  faraday-retry (1.0.3)
63
63
  ffi (1.15.5)
64
64
  formatador (1.1.0)
65
- git (1.11.0)
65
+ git (1.13.1)
66
+ addressable (~> 2.8)
66
67
  rchardet (~> 1.8)
67
68
  guard (2.18.0)
68
69
  formatador (>= 0.2.4)
@@ -106,7 +107,7 @@ GEM
106
107
  method_source (~> 1.0)
107
108
  public_suffix (4.0.7)
108
109
  rainbow (3.1.1)
109
- rake (10.5.0)
110
+ rake (13.0.6)
110
111
  rb-fsevent (0.11.1)
111
112
  rb-inotify (0.10.1)
112
113
  ffi (~> 1.0)
@@ -154,6 +155,7 @@ GEM
154
155
  PLATFORMS
155
156
  x86_64-darwin-20
156
157
  x86_64-darwin-21
158
+ x86_64-linux
157
159
 
158
160
  DEPENDENCIES
159
161
  bundler (~> 2.0)
@@ -162,7 +164,7 @@ DEPENDENCIES
162
164
  guard-rspec (~> 4.7)
163
165
  listen (= 3.0.7)
164
166
  pry (~> 0.14.1)
165
- rake (~> 10.0)
167
+ rake (~> 13.0)
166
168
  rspec (~> 3.4)
167
169
  rubocop (~> 1.25.0)
168
170
  yard (~> 0.9.27)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # danger-app_size_report
2
2
 
3
+ [![Build Status](https://app.bitrise.io/app/2f93240761558c73/status.svg?token=RAmtNFYZtsHZGwu04sEgPA&branch=main)](https://app.bitrise.io/app/2f93240761558c73)
4
+
3
5
  A [Danger](https://github.com/danger/danger) plugin for reporting iOS and Android app size violations.
4
6
 
5
7
  ## Installation
@@ -18,12 +20,12 @@ Report **iOS** app size violations given a valid App Thinning Size Report. A val
18
20
  app_size_report.flag_ios_violations(
19
21
  report_path,
20
22
  build_type: 'App',
21
- size_limit: 4,
23
+ limit_size: 4,
22
24
  limit_unit: 'GB',
23
25
  fail_on_warning: false
24
26
  )
25
27
 
26
- The list of variants with their sizes and any violations will be displayed in the PR report as seen below. Supported variant descriptors are placed under collapsible sections.
28
+ The list of variants with their sizes and any violations will be displayed in the PR report as seen below. Additionally, the report will include warnings for any variants that exceed the optimal size limit for cellular downloads (200 MB). Supported variant descriptors are placed under collapsible sections.
27
29
 
28
30
  <p align="center">
29
31
  <img src="Resources/Images/app_thinning_size_report.png">
@@ -34,7 +36,7 @@ The list of variants with their sizes and any violations will be displayed in th
34
36
  - `report_path` [String, required] Path to valid App Thinning Size Report text file.
35
37
  - `build_type` [String, optional] [Default: 'App'] Specify whether the report corresponds to an App or an App Clip.
36
38
  - Supported values: 'App', 'Clip'
37
- - `size_limit` [Numeric, optional] [Default: 4] Specify the app size limit.
39
+ - `limit_size` [Numeric, optional] [Default: 4] Specify the app size limit. If the build type is set to 'Clip' and the specified app size limit exceeds 15 MB, the 15 MB limit will be enforced to meet Apple's App Clip size requirements.
38
40
  - `limit_unit` [String, optional] [Default: 'GB'] Specific the unit for the given size limit.
39
41
  - Supported values: 'KB', 'MB', 'GB'
40
42
  - `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.
@@ -72,7 +74,7 @@ Report <b>Android</b> app size violations given a valid Android App Bundle (AAB)
72
74
  screen_densities: ["MDPI", "HDPI", "XHDPI", "XXHDPI", "XXXHDPI"],
73
75
  languages: ["en", "de", "da", "es", "fr", "it", "nb", "nl", "sv"],
74
76
  build_type: 'Instant',
75
- size_limit: 4,
77
+ limit_size: 4,
76
78
  limit_unit: 'MB',
77
79
  fail_on_warning: false
78
80
  )
@@ -94,7 +96,7 @@ The top 25 violations will be displayed in the PR report with any remaining viol
94
96
  - `languages` [Array, optional] [Default: ["en"]] Array of languages to check APK size
95
97
  - `build_type` [String, optional] [Default: 'App'] Specify whether the report corresponds to an App or an Instant.
96
98
  - Supported values: 'App', 'Instant'
97
- - `size_limit` [Numeric, optional] [Default: 150] Specify the app size limit.
99
+ - `limit_size` [Numeric, optional] [Default: 150] Specify the app size limit. If the build type is set to 'Instant' and the specified app size limit exceeds 4 MB, the 4 MB limit will be enforced to meet Android Instant App size requirements.
98
100
  - `limit_unit` [String, optional] [Default: 'MB'] Specific the unit for the given size limit.
99
101
  - Supported values: 'KB', 'MB', 'GB'
100
102
  - `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.
@@ -0,0 +1,218 @@
1
+
2
+ App Thinning Size Report for All Variants of CP
3
+
4
+ Variant: com.coulomb.ChargePoint-0F621BC7-39A7-4E09-B6B4-9DD22F886611.ipa
5
+ Supported variant descriptors: [device: iPad6,8, os-version: 12.2], [device: iPad4,4, os-version: 12.2], [device: iPad5,2, os-version: 12.2], [device: iPad7,5, os-version: 12.2], [device: iPad7,6, os-version: 12.2], [device: iPad4,5, os-version: 12.2], [device: iPad4,8, os-version: 12.2], [device: iPad4,2, os-version: 12.2], [device: iPad4,6, os-version: 12.2], [device: iPad4,1, os-version: 12.2], [device: iPad4,3, os-version: 12.2], [device: iPad4,9, os-version: 12.2], [device: iPad4,7, os-version: 12.2], [device: iPad5,1, os-version: 12.2], [device: iPad6,7, os-version: 12.2], [device: iPad5,3, os-version: 12.2], [device: iPad5,4, os-version: 12.2], [device: iPad6,11, os-version: 12.2], and [device: iPad6,12, os-version: 12.2]
6
+ App + On Demand Resources size: 13.1 MB compressed, 31.3 MB uncompressed
7
+ App size: 13.1 MB compressed, 31.3 MB uncompressed
8
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
9
+
10
+
11
+ Variant: com.coulomb.ChargePoint-174FD93A-9E4E-4F9A-9087-27B87F10BA73.ipa
12
+ Supported variant descriptors: [device: iPod9,1, os-version: 14.0], [device: iPod9,1, os-version: 13.0], and [device: iPod9,1, os-version: 15.0]
13
+ App + On Demand Resources size: 13 MB compressed, 31.1 MB uncompressed
14
+ App size: 13 MB compressed, 31.1 MB uncompressed
15
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
16
+
17
+
18
+ Variant: com.coulomb.ChargePoint-278634B1-ADB2-426F-B246-EE96AA618F04.ipa
19
+ Supported variant descriptors: [device: iPad11,1, os-version: 12.2], [device: iPad6,3, os-version: 12.2], [device: iPad8,6, os-version: 12.2], [device: iPad11,3, os-version: 12.2], [device: iPad7,4, os-version: 12.2], [device: iPad7,2, os-version: 12.2], [device: iPad8,7, os-version: 12.2], [device: iPad8,2, os-version: 12.2], [device: iPad8,8, os-version: 12.2], [device: iPad7,3, os-version: 12.2], [device: iPad8,1, os-version: 12.2], [device: iPad11,2, os-version: 12.2], [device: iPad8,5, os-version: 12.2], [device: iPad8,3, os-version: 12.2], [device: iPad8,4, os-version: 12.2], [device: iPad11,4, os-version: 12.2], [device: iPad7,1, os-version: 12.2], and [device: iPad6,4, os-version: 12.2]
20
+ App + On Demand Resources size: 13.1 MB compressed, 31.3 MB uncompressed
21
+ App size: 13.1 MB compressed, 31.3 MB uncompressed
22
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
23
+
24
+
25
+ Variant: com.coulomb.ChargePoint-319AF157-5859-40A3-9B93-C4D508F7FD8E.ipa
26
+ Supported variant descriptors: [device: iPhone8,1, os-version: 14.0], [device: iPhone8,1, os-version: 13.0], [device: iPhone8,4, os-version: 13.0], [device: iPhone8,1, os-version: 15.0], [device: iPhone8,4, os-version: 14.0], and [device: iPhone8,4, os-version: 15.0]
27
+ App + On Demand Resources size: 13.2 MB compressed, 31.4 MB uncompressed
28
+ App size: 13.2 MB compressed, 31.4 MB uncompressed
29
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
30
+
31
+
32
+ Variant: com.coulomb.ChargePoint-3520FD6F-7E39-49A1-A497-9DBE73E3CCF3.ipa
33
+ Supported variant descriptors: [device: Watch6,7, os-version: 8.0] and [device: Watch6,9, os-version: 8.0]
34
+ App + On Demand Resources size: 1.5 MB compressed, 4 MB uncompressed
35
+ App size: 1.5 MB compressed, 4 MB uncompressed
36
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
37
+
38
+
39
+ Variant: com.coulomb.ChargePoint-376FB823-0A1A-49EF-B671-090463D499A0.ipa
40
+ Supported variant descriptors: [device: iPhone7,1, os-version: 12.0] and [device: iPhone8,2, os-version: 12.0]
41
+ App + On Demand Resources size: 19.4 MB compressed, 46.8 MB uncompressed
42
+ App size: 19.4 MB compressed, 46.8 MB uncompressed
43
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
44
+
45
+
46
+ Variant: com.coulomb.ChargePoint-452B5133-09CC-4C39-95B9-A7773BC0056E.ipa
47
+ Supported variant descriptors: [device: iPhone10,4, os-version: 12.0], [device: iPhone9,1, os-version: 12.0], [device: iPhone9,3, os-version: 12.0], and [device: iPhone10,1, os-version: 12.0]
48
+ App + On Demand Resources size: 18 MB compressed, 45.4 MB uncompressed
49
+ App size: 18 MB compressed, 45.4 MB uncompressed
50
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
51
+
52
+
53
+ Variant: com.coulomb.ChargePoint-47FC97BE-599B-48F7-B844-8A6F8E61C3B9.ipa
54
+ Supported variant descriptors: [device: iPad7,2, os-version: 12.0], [device: iPad8,6, os-version: 12.0], [device: iPad8,4, os-version: 12.0], [device: iPad8,5, os-version: 12.0], [device: iPad7,4, os-version: 12.0], [device: iPad7,3, os-version: 12.0], [device: iPad8,8, os-version: 12.0], [device: iPad6,4, os-version: 12.0], [device: iPad8,7, os-version: 12.0], [device: iPad8,3, os-version: 12.0], [device: iPad7,1, os-version: 12.0], [device: iPad8,2, os-version: 12.0], [device: iPad6,3, os-version: 12.0], and [device: iPad8,1, os-version: 12.0]
55
+ App + On Demand Resources size: 15.5 MB compressed, 38.4 MB uncompressed
56
+ App size: 15.5 MB compressed, 38.4 MB uncompressed
57
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
58
+
59
+
60
+ Variant: com.coulomb.ChargePoint-4ACDED96-0276-4C4E-8297-7CDCEAAB9B08.ipa
61
+ Supported variant descriptors: [device: iPhone11,6, os-version: 12.0], [device: iPhone10,2, os-version: 12.0], [device: iPhone10,5, os-version: 12.0], [device: iPhone11,4, os-version: 12.0], [device: iPhone10,6, os-version: 12.0], [device: iPhone9,2, os-version: 12.0], [device: iPhone9,4, os-version: 12.0], [device: iPhone10,3, os-version: 12.0], and [device: iPhone11,2, os-version: 12.0]
62
+ App + On Demand Resources size: 19.4 MB compressed, 46.8 MB uncompressed
63
+ App size: 19.4 MB compressed, 46.8 MB uncompressed
64
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
65
+
66
+
67
+ Variant: com.coulomb.ChargePoint-53B11A8A-8555-4E56-BA5F-F9B07CFBFF4D.ipa
68
+ Supported variant descriptors: [device: iPod7,1, os-version: 12.2] and [device: iPod9,1, os-version: 12.2]
69
+ App + On Demand Resources size: 15.4 MB compressed, 38 MB uncompressed
70
+ App size: 15.4 MB compressed, 38 MB uncompressed
71
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
72
+
73
+
74
+ Variant: com.coulomb.ChargePoint-61A9F30A-EC77-4D83-B822-0C248C27F457.ipa
75
+ Supported variant descriptors: [device: iPhone8,2, os-version: 14.0], [device: iPhone8,2, os-version: 15.0], and [device: iPhone8,2, os-version: 13.0]
76
+ App + On Demand Resources size: 14.5 MB compressed, 32.7 MB uncompressed
77
+ App size: 14.5 MB compressed, 32.7 MB uncompressed
78
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
79
+
80
+
81
+ Variant: com.coulomb.ChargePoint-6D0FF167-145A-41EC-B042-82FAD5BC0C0F.ipa
82
+ Supported variant descriptors: [device: iPad7,2, os-version: 15.0], [device: iPad13,4, os-version: 15.0], [device: iPad8,11, os-version: 15.0], [device: iPad13,10, os-version: 15.0], [device: iPad8,5, os-version: 15.0], [device: iPad11,1, os-version: 13.0], [device: iPad13,1, os-version: 14.0], [device: iPad13,5, os-version: 14.0], [device: iPad8,12, os-version: 14.0], [device: iPad11,1, os-version: 14.0], [device: iPad8,11, os-version: 13.0], [device: iPad8,1, os-version: 15.0], [device: iPad8,7, os-version: 15.0], [device: iPad13,5, os-version: 15.0], [device: iPad13,6, os-version: 15.0], [device: iPad8,11, os-version: 14.0], [device: iPad13,4, os-version: 14.0], [device: iPad8,7, os-version: 13.0], [device: iPad8,2, os-version: 14.0], [device: MacFamily20,1, os-version: 14.0], [device: iPad7,3, os-version: 14.0], [device: iPad11,4, os-version: 14.0], [device: iPad8,5, os-version: 14.0], [device: iPad13,7, os-version: 14.0], [device: iPad13,7, os-version: 15.0], [device: iPad14,2, os-version: 15.0], [device: iPad8,10, os-version: 13.0], [device: iPad13,8, os-version: 15.0], [device: iPad6,4, os-version: 13.0], [device: iPad6,3, os-version: 15.0], [device: iPad7,1, os-version: 13.0], [device: iPad7,3, os-version: 15.0], [device: iPad8,12, os-version: 13.0], [device: iPad8,6, os-version: 14.0], [device: iPad11,3, os-version: 15.0], [device: iPad6,4, os-version: 14.0], [device: iPad13,11, os-version: 14.0], [device: iPad11,1, os-version: 15.0], [device: iPad8,4, os-version: 13.0], [device: iPad8,10, os-version: 14.0], [device: iPad8,10, os-version: 15.0], [device: iPad11,3, os-version: 13.0], [device: iPad7,4, os-version: 14.0], [device: iPad11,2, os-version: 13.0], [device: iPad8,8, os-version: 13.0], [device: iPad8,9, os-version: 14.0], [device: iPad8,9, os-version: 13.0], [device: iPad7,2, os-version: 14.0], [device: iPad7,2, os-version: 13.0], [device: iPad13,11, os-version: 15.0], [device: iPad13,9, os-version: 14.0], [device: iPad13,9, os-version: 15.0], [device: iPad8,3, os-version: 13.0], [device: iPad8,8, os-version: 14.0], [device: iPad8,7, os-version: 14.0], [device: iPad8,4, os-version: 15.0], [device: iPad8,8, os-version: 15.0], [device: iPad8,1, os-version: 13.0], [device: iPad7,3, os-version: 13.0], [device: iPad13,6, os-version: 14.0], [device: iPad6,3, os-version: 13.0], [device: iPad13,10, os-version: 14.0], [device: iPad14,1, os-version: 15.0], [device: iPad8,2, os-version: 13.0], [device: iPad7,1, os-version: 15.0], [device: MacFamily20,1, os-version: 15.0], [device: iPad11,2, os-version: 15.0], [device: iPad13,1, os-version: 15.0], [device: iPad8,12, os-version: 15.0], [device: iPad11,4, os-version: 15.0], [device: iPad11,4, os-version: 13.0], [device: iPad8,2, os-version: 15.0], [device: iPad8,3, os-version: 14.0], [device: iPad13,2, os-version: 14.0], [device: iPad8,1, os-version: 14.0], [device: iPad8,9, os-version: 15.0], [device: iPad6,3, os-version: 14.0], [device: iPad11,2, os-version: 14.0], [device: iPad13,8, os-version: 14.0], [device: iPad6,4, os-version: 15.0], [device: iPad8,5, os-version: 13.0], [device: iPad7,4, os-version: 15.0], [device: iPad8,3, os-version: 15.0], [device: iPad8,6, os-version: 15.0], [device: iPad13,2, os-version: 15.0], [device: iPad7,4, os-version: 13.0], [device: iPad8,6, os-version: 13.0], [device: iPad8,4, os-version: 14.0], [device: iPad11,3, os-version: 14.0], and [device: iPad7,1, os-version: 14.0]
83
+ App + On Demand Resources size: 13 MB compressed, 31.2 MB uncompressed
84
+ App size: 13 MB compressed, 31.2 MB uncompressed
85
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
86
+
87
+
88
+ Variant: com.coulomb.ChargePoint-74332B21-5BDF-46C5-A17F-FC6E030C39A9.ipa
89
+ Supported variant descriptors: [device: iPhone14,5, os-version: 15.0], [device: iPhone10,2, os-version: 15.0], [device: iPhone10,6, os-version: 14.0], [device: iPhone12,3, os-version: 15.0], [device: iPhone12,5, os-version: 13.0], [device: iPhone10,2, os-version: 14.0], [device: iPhone13,4, os-version: 14.0], [device: iPhone10,3, os-version: 13.0], [device: iPhone13,1, os-version: 14.0], [device: iPhone11,2, os-version: 15.0], [device: iPhone13,3, os-version: 15.0], [device: iPhone11,4, os-version: 15.0], [device: iPhone9,2, os-version: 14.0], [device: iPhone10,5, os-version: 13.0], [device: iPhone14,3, os-version: 15.0], [device: iPhone11,4, os-version: 13.0], [device: iPhone10,6, os-version: 15.0], [device: iPhone10,3, os-version: 15.0], [device: iPhone13,2, os-version: 15.0], [device: iPhone10,2, os-version: 13.0], [device: iPhone12,5, os-version: 15.0], [device: iPhone9,4, os-version: 15.0], [device: iPhone9,2, os-version: 13.0], [device: iPhone13,3, os-version: 14.0], [device: iPhone11,6, os-version: 13.0], [device: iPhone12,3, os-version: 14.0], [device: iPhone13,2, os-version: 14.0], [device: iPhone9,4, os-version: 14.0], [device: iPhone13,4, os-version: 15.0], [device: iPhone14,4, os-version: 15.0], [device: iPhone12,3, os-version: 13.0], [device: iPhone11,2, os-version: 14.0], [device: iPhone10,5, os-version: 14.0], [device: iPhone13,1, os-version: 15.0], [device: iPhone10,3, os-version: 14.0], [device: iPhone11,4, os-version: 14.0], [device: iPhone14,2, os-version: 15.0], [device: iPhone11,2, os-version: 13.0], [device: iPhone12,5, os-version: 14.0], [device: iPhone11,6, os-version: 15.0], [device: iPhone10,6, os-version: 13.0], [device: iPhone10,5, os-version: 15.0], [device: iPhone9,2, os-version: 15.0], [device: iPhone9,4, os-version: 13.0], and [device: iPhone11,6, os-version: 14.0]
90
+ App + On Demand Resources size: 14.5 MB compressed, 32.7 MB uncompressed
91
+ App size: 14.5 MB compressed, 32.7 MB uncompressed
92
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
93
+
94
+
95
+ Variant: com.coulomb.ChargePoint-7D05CC6B-6D34-49D7-8933-E7493E5C0758.ipa
96
+ Supported variant descriptors: [device: Watch5,11, os-version: 8.0], [device: Watch4,3, os-version: 7.0], [device: Watch5,9, os-version: 7.0], [device: Watch4,3, os-version: 6.0], [device: Watch4,1, os-version: 8.0], [device: Watch4,1, os-version: 7.0], [device: Watch5,11, os-version: 7.0], [device: Watch5,3, os-version: 6.0], [device: Watch5,9, os-version: 8.0], [device: Watch6,3, os-version: 8.0], [device: Watch5,1, os-version: 6.0], [device: Watch6,3, os-version: 7.0], [device: Watch6,1, os-version: 8.0], [device: Watch5,1, os-version: 7.0], [device: Watch5,3, os-version: 7.0], [device: Watch4,1, os-version: 6.0], [device: Watch4,3, os-version: 8.0], [device: Watch5,1, os-version: 8.0], [device: Watch5,3, os-version: 8.0], and [device: Watch6,1, os-version: 7.0]
97
+ App + On Demand Resources size: 1.4 MB compressed, 3.9 MB uncompressed
98
+ App size: 1.4 MB compressed, 3.9 MB uncompressed
99
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
100
+
101
+
102
+ Variant: com.coulomb.ChargePoint-7DBC3582-3CA2-464D-88D0-754632DEC0AE.ipa
103
+ Supported variant descriptors: [device: iPod7,1, os-version: 12.0]
104
+ App + On Demand Resources size: 17.8 MB compressed, 45.1 MB uncompressed
105
+ App size: 17.8 MB compressed, 45.1 MB uncompressed
106
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
107
+
108
+
109
+ Variant: com.coulomb.ChargePoint-896BC17F-1C43-46E5-B081-7EA2EFC66960.ipa
110
+ Supported variant descriptors: [device: iPhone10,1, os-version: 12.2], [device: iPhone9,1, os-version: 12.2], [device: iPhone10,4, os-version: 12.2], and [device: iPhone9,3, os-version: 12.2]
111
+ App + On Demand Resources size: 15.6 MB compressed, 38.3 MB uncompressed
112
+ App size: 15.6 MB compressed, 38.3 MB uncompressed
113
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
114
+
115
+
116
+ Variant: com.coulomb.ChargePoint-8F07BEDD-0AA2-4ACB-A8E8-6BD7F11574F0.ipa
117
+ Supported variant descriptors: [device: iPhone11,8, os-version: 12.2]
118
+ App + On Demand Resources size: 15.7 MB compressed, 38.3 MB uncompressed
119
+ App size: 15.7 MB compressed, 38.3 MB uncompressed
120
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
121
+
122
+
123
+ Variant: com.coulomb.ChargePoint-93A9CA61-2990-4E41-8CAF-89D6DF8F6107.ipa
124
+ Supported variant descriptors: [device: iPhone11,8, os-version: 12.0]
125
+ App + On Demand Resources size: 18 MB compressed, 45.4 MB uncompressed
126
+ App size: 18 MB compressed, 45.4 MB uncompressed
127
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
128
+
129
+
130
+ Variant: com.coulomb.ChargePoint-98CBE270-E59C-44AD-A526-F3F759CB2020.ipa
131
+ Supported variant descriptors: [device: iPhone9,3, os-version: 15.0], [device: iPhone10,4, os-version: 15.0], [device: iPhone12,8, os-version: 15.0], [device: iPhone10,4, os-version: 14.0], [device: iPhone12,8, os-version: 13.0], [device: iPhone9,1, os-version: 14.0], [device: iPhone10,1, os-version: 15.0], [device: iPhone9,1, os-version: 13.0], [device: iPhone9,3, os-version: 14.0], [device: iPhone10,1, os-version: 13.0], [device: iPhone9,3, os-version: 13.0], [device: iPhone12,8, os-version: 14.0], [device: iPhone10,4, os-version: 13.0], [device: iPhone10,1, os-version: 14.0], and [device: iPhone9,1, os-version: 15.0]
132
+ App + On Demand Resources size: 13.2 MB compressed, 31.4 MB uncompressed
133
+ App size: 13.2 MB compressed, 31.4 MB uncompressed
134
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
135
+
136
+
137
+ Variant: com.coulomb.ChargePoint-AD119811-CF14-413D-AE43-366F8E350D61.ipa
138
+ Supported variant descriptors: [device: Watch3,4, os-version: 8.0], [device: Watch2,4, os-version: 6.0], [device: Watch3,2, os-version: 7.0], [device: Watch2,7, os-version: 6.0], [device: Watch3,2, os-version: 8.0], [device: Watch3,2, os-version: 6.0], [device: Watch3,4, os-version: 6.0], and [device: Watch3,4, os-version: 7.0]
139
+ App + On Demand Resources size: 1.5 MB compressed, 3.9 MB uncompressed
140
+ App size: 1.5 MB compressed, 3.9 MB uncompressed
141
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
142
+
143
+
144
+ Variant: com.coulomb.ChargePoint-B2E7FEEC-7D9D-45E5-9F59-20BB0EF36E45.ipa
145
+ Supported variant descriptors: [device: iPhone8,4, os-version: 12.0], [device: iPhone6,1, os-version: 12.0], [device: iPhone6,2, os-version: 12.0], [device: iPhone8,1, os-version: 12.0], and [device: iPhone7,2, os-version: 12.0]
146
+ App + On Demand Resources size: 18 MB compressed, 45.4 MB uncompressed
147
+ App size: 18 MB compressed, 45.4 MB uncompressed
148
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
149
+
150
+
151
+ Variant: com.coulomb.ChargePoint-BE970F6E-EB3B-40EA-8592-EABC7ADDEE44.ipa
152
+ Supported variant descriptors: [device: iPhone10,3, os-version: 12.2], [device: iPhone11,4, os-version: 12.2], [device: iPhone11,6, os-version: 12.2], [device: iPhone9,2, os-version: 12.2], [device: iPhone11,2, os-version: 12.2], [device: iPhone10,6, os-version: 12.2], [device: iPhone9,4, os-version: 12.2], [device: iPhone10,5, os-version: 12.2], and [device: iPhone10,2, os-version: 12.2]
153
+ App + On Demand Resources size: 17 MB compressed, 39.7 MB uncompressed
154
+ App size: 17 MB compressed, 39.7 MB uncompressed
155
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
156
+
157
+
158
+ Variant: com.coulomb.ChargePoint-D89DBC0E-1DC9-4EC5-BC3D-35F03496EA42.ipa
159
+ Supported variant descriptors: [device: iPhone8,1, os-version: 12.2], [device: iPhone8,4, os-version: 12.2], [device: iPhone6,1, os-version: 12.2], [device: iPhone6,2, os-version: 12.2], and [device: iPhone7,2, os-version: 12.2]
160
+ App + On Demand Resources size: 15.6 MB compressed, 38.3 MB uncompressed
161
+ App size: 15.6 MB compressed, 38.3 MB uncompressed
162
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
163
+
164
+
165
+ Variant: com.coulomb.ChargePoint-E0CC1B66-C636-4873-86C6-E1146D422097.ipa
166
+ Supported variant descriptors: [device: Watch6,6, os-version: 8.0] and [device: Watch6,8, os-version: 8.0]
167
+ App + On Demand Resources size: 1.4 MB compressed, 3.9 MB uncompressed
168
+ App size: 1.4 MB compressed, 3.9 MB uncompressed
169
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
170
+
171
+
172
+ Variant: com.coulomb.ChargePoint-E45A276E-8E53-4778-A5C0-17BA70702DAF.ipa
173
+ Supported variant descriptors: [device: iPad5,2, os-version: 14.0], [device: iPad6,7, os-version: 14.0], [device: iPad5,1, os-version: 13.0], [device: iPad6,7, os-version: 13.0], [device: iPad5,2, os-version: 13.0], [device: iPad5,3, os-version: 13.0], [device: iPad6,12, os-version: 13.0], [device: iPad6,12, os-version: 14.0], [device: iPad6,8, os-version: 14.0], [device: iPad7,6, os-version: 14.0], [device: iPad5,1, os-version: 14.0], [device: iPad7,6, os-version: 13.0], [device: iPad5,4, os-version: 13.0], [device: iPad12,2, os-version: 15.0], [device: iPad6,12, os-version: 15.0], [device: iPad7,5, os-version: 15.0], [device: iPad7,11, os-version: 13.0], [device: iPad6,11, os-version: 14.0], [device: iPad7,6, os-version: 15.0], [device: iPad6,8, os-version: 15.0], [device: iPad12,1, os-version: 15.0], [device: iPad5,1, os-version: 15.0], [device: iPad11,7, os-version: 14.0], [device: iPad11,6, os-version: 15.0], [device: iPad11,7, os-version: 15.0], [device: iPad7,11, os-version: 14.0], [device: iPad5,3, os-version: 14.0], [device: iPad7,12, os-version: 13.0], [device: iPad6,11, os-version: 13.0], [device: iPad6,7, os-version: 15.0], [device: iPad7,5, os-version: 14.0], [device: iPad5,2, os-version: 15.0], [device: iPad7,11, os-version: 15.0], [device: iPad7,12, os-version: 15.0], [device: iPad7,5, os-version: 13.0], [device: iPad11,6, os-version: 14.0], [device: iPad5,4, os-version: 14.0], [device: iPad5,3, os-version: 15.0], [device: iPad5,4, os-version: 15.0], [device: iPad6,11, os-version: 15.0], [device: iPad6,8, os-version: 13.0], and [device: iPad7,12, os-version: 14.0]
174
+ App + On Demand Resources size: 13 MB compressed, 31.2 MB uncompressed
175
+ App size: 13 MB compressed, 31.2 MB uncompressed
176
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
177
+
178
+
179
+ Variant: com.coulomb.ChargePoint-E525F5DD-7DDD-4F12-BFE5-75AD0C60F6E8.ipa
180
+ Supported variant descriptors: [device: iPhone8,2, os-version: 12.2] and [device: iPhone7,1, os-version: 12.2]
181
+ App + On Demand Resources size: 17 MB compressed, 39.7 MB uncompressed
182
+ App size: 17 MB compressed, 39.7 MB uncompressed
183
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
184
+
185
+
186
+ Variant: com.coulomb.ChargePoint-E894449A-9C96-4CE2-9F5E-BC9C03A0A38B.ipa
187
+ Supported variant descriptors: [device: iPad7,5, os-version: 12.0], [device: iPad4,7, os-version: 12.0], [device: iPad5,1, os-version: 12.0], [device: iPad4,2, os-version: 12.0], [device: iPad7,6, os-version: 12.0], [device: iPad6,8, os-version: 12.0], [device: iPad6,7, os-version: 12.0], [device: iPad4,9, os-version: 12.0], [device: iPad4,5, os-version: 12.0], [device: iPad6,12, os-version: 12.0], [device: iPad4,3, os-version: 12.0], [device: iPad4,4, os-version: 12.0], [device: iPad4,8, os-version: 12.0], [device: iPad5,4, os-version: 12.0], [device: iPad4,6, os-version: 12.0], [device: iPad4,1, os-version: 12.0], [device: iPad5,2, os-version: 12.0], [device: iPad5,3, os-version: 12.0], and [device: iPad6,11, os-version: 12.0]
188
+ App + On Demand Resources size: 15.5 MB compressed, 38.4 MB uncompressed
189
+ App size: 15.5 MB compressed, 38.4 MB uncompressed
190
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
191
+
192
+
193
+ Variant: com.coulomb.ChargePoint-EE074FC2-36D8-4643-AF58-BD1949768961.ipa
194
+ Supported variant descriptors: [device: Watch4,4, os-version: 7.0], [device: Watch6,4, os-version: 7.0], [device: Watch4,4, os-version: 8.0], [device: Watch5,4, os-version: 8.0], [device: Watch6,4, os-version: 8.0], [device: Watch5,12, os-version: 7.0], [device: Watch6,2, os-version: 7.0], [device: Watch5,2, os-version: 8.0], [device: Watch5,2, os-version: 7.0], [device: Watch5,12, os-version: 8.0], [device: Watch5,10, os-version: 8.0], [device: Watch4,2, os-version: 6.0], [device: Watch4,4, os-version: 6.0], [device: Watch4,2, os-version: 7.0], [device: Watch5,10, os-version: 7.0], [device: Watch6,2, os-version: 8.0], [device: Watch4,2, os-version: 8.0], [device: Watch5,2, os-version: 6.0], [device: Watch5,4, os-version: 6.0], and [device: Watch5,4, os-version: 7.0]
195
+ App + On Demand Resources size: 1.4 MB compressed, 3.9 MB uncompressed
196
+ App size: 1.4 MB compressed, 3.9 MB uncompressed
197
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
198
+
199
+
200
+ Variant: com.coulomb.ChargePoint-FAE180F4-4531-47E6-B783-E34BC64D57CC.ipa
201
+ Supported variant descriptors: [device: Watch3,3, os-version: 6.0], [device: Watch3,1, os-version: 7.0], [device: Watch2,3, os-version: 6.0], [device: Watch3,1, os-version: 8.0], [device: Watch3,3, os-version: 7.0], [device: Watch3,3, os-version: 8.0], [device: Watch3,1, os-version: 6.0], and [device: Watch2,6, os-version: 6.0]
202
+ App + On Demand Resources size: 1.5 MB compressed, 3.9 MB uncompressed
203
+ App size: 1.5 MB compressed, 3.9 MB uncompressed
204
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
205
+
206
+
207
+ Variant: com.coulomb.ChargePoint-FD582A8B-E3DD-4753-A1A0-01B6F7783355.ipa
208
+ Supported variant descriptors: [device: iPhone12,1, os-version: 15.0], [device: iPhone12,1, os-version: 13.0], [device: iPhone11,8, os-version: 14.0], [device: iPhone11,8, os-version: 15.0], [device: iPhone11,8, os-version: 13.0], and [device: iPhone12,1, os-version: 14.0]
209
+ App + On Demand Resources size: 13.2 MB compressed, 31.4 MB uncompressed
210
+ App size: 13.2 MB compressed, 31.4 MB uncompressed
211
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
212
+
213
+
214
+ Variant: com.coulomb.ChargePoint.ipa
215
+ Supported variant descriptors: Universal
216
+ App + On Demand Resources size: 28.9 MB compressed, 57.8 MB uncompressed
217
+ App size: 28.9 MB compressed, 207.8 MB uncompressed
218
+ On Demand Resources size: Zero KB compressed, Zero KB uncompressed
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  # General ruby development
27
27
  spec.add_development_dependency 'bundler', '~> 2.0'
28
- spec.add_development_dependency 'rake', '~> 10.0'
28
+ spec.add_development_dependency 'rake', '~> 13.0'
29
29
 
30
30
  # Testing support
31
31
  spec.add_development_dependency 'rspec', '~> 3.4'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppSizeReport
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.0'
5
5
  end
@@ -15,26 +15,24 @@ module Danger
15
15
  # A valid App Thinning Size Report must be passed to the plugin
16
16
  # for accurate functionality in case of iOS.
17
17
  #
18
- # @example Report iOS app size violations if one or more App variants
19
- # exceed 4GB.
18
+ # @example Report iOS app size violations if one or more App variants exceed 4GB.
20
19
  #
21
20
  # report_path = "/Path/to/AppSize/Report.txt"
22
21
  # app_size_report.flag_ios_violations(
23
22
  # report_path,
24
23
  # build_type: 'App',
25
- # size_limit: 4,
24
+ # limit_size: 4,
26
25
  # limit_unit: 'GB',
27
26
  # fail_on_warning: false
28
27
  # )
29
28
  #
30
- # @example Report iOS app size violations if one or more App Clip variants
31
- # exceed 8MB.
29
+ # @example Report iOS app size violations if one or more App Clip variants exceed 8MB.
32
30
  #
33
31
  # report_path = "/Path/to/AppSize/Report.txt"
34
32
  # app_size_report.flag_ios_violations(
35
33
  # report_path,
36
34
  # build_type: 'Clip',
37
- # size_limit: 8,
35
+ # limit_size: 8,
38
36
  # limit_unit: 'MB',
39
37
  # fail_on_warning: false
40
38
  # )
@@ -45,7 +43,7 @@ module Danger
45
43
  # app_size_report.flag_ios_violations(
46
44
  # report_path,
47
45
  # build_type: 'Clip',
48
- # size_limit: 8,
46
+ # limit_size: 8,
49
47
  # limit_unit: 'MB',
50
48
  # fail_on_warning: true
51
49
  # )
@@ -71,7 +69,7 @@ module Danger
71
69
  # screen_densities: ["MDPI", "HDPI", "XHDPI", "XXHDPI", "XXXHDPI"],
72
70
  # languages: ["en", "de", "da", "es", "fr", "it", "nb", "nl", "sv"],
73
71
  # build_type: 'App',
74
- # size_limit: 14,
72
+ # limit_size: 14,
75
73
  # limit_unit: 'MB',
76
74
  # fail_on_warning: false
77
75
  # )
@@ -92,7 +90,7 @@ module Danger
92
90
  # screen_densities: ["MDPI", "HDPI", "XHDPI", "XXHDPI", "XXXHDPI"],
93
91
  # languages: ["en", "de", "da", "es", "fr", "it", "nb", "nl", "sv"],
94
92
  # build_type: 'Instant',
95
- # size_limit: 4,
93
+ # limit_size: 4,
96
94
  # limit_unit: 'MB',
97
95
  # fail_on_warning: false
98
96
  # )
@@ -113,7 +111,7 @@ module Danger
113
111
  # screen_densities: ["MDPI", "HDPI", "XHDPI", "XXHDPI", "XXXHDPI"],
114
112
  # languages: ["en", "de", "da", "es", "fr", "it", "nb", "nl", "sv"],
115
113
  # build_type: 'Instant',
116
- # size_limit: 4,
114
+ # limit_size: 4,
117
115
  # limit_unit: 'MB',
118
116
  # fail_on_warning: true
119
117
  # )
@@ -123,80 +121,107 @@ module Danger
123
121
  #
124
122
  class DangerAppSizeReport < Plugin
125
123
  # Reports IOS app size violations given a valid App Thinning Size Report.
126
- # @param [String, required] report_path
127
- # Path to valid App Thinning Size Report text file.
128
- # @param [String, optional] build_type
129
- # Specify whether the report corresponds to an App or an App Clip.
130
- # Default: 'App'
131
- # Supported values: 'App', 'Clip'
132
- # @param [Numeric, optional] size_limit
133
- # Specify the app size limit.
134
- # Default: 4
135
- # @param [String, optional] limit_unit
136
- # Specific the unit for the given size limit.
137
- # Default: 'GB'
138
- # Supported values: 'KB', 'MB', 'GB'
139
- # @param [Boolean, optional] fail_on_warning
140
- # Specify whether the PR should fail if one or more app variants
141
- # exceed the given size limit. By default, the plugin issues
142
- # a warning in this case.
143
- # Default: 'false'
124
+ # The plugin also warns users about variants that exceed the optimal size
125
+ # limit for cellular downloads (200 MB).
126
+ # @overload flag_ios_violations(report_path, build_type, limit_size, limit_unit, fail_on_warning)
127
+ # @param [String, required] report_path
128
+ # Path to valid App Thinning Size Report text file.
129
+ # @param [String, optional] build_type
130
+ # Specify whether the report corresponds to an App or an App Clip.
131
+ # Default: 'App'
132
+ # Supported values: 'App', 'Clip'
133
+ # @param [Numeric, optional] limit_size
134
+ # Specify the app size limit. If the build type is set to 'Clip' and the
135
+ # specified app size limit exceeds 10 MB, the 10 MB limit will be enforced
136
+ # to meet Apple's App Clip size requirements.
137
+ # Default: 4
138
+ # @param [String, optional] limit_unit
139
+ # Specific the unit for the given size limit.
140
+ # Default: 'GB'
141
+ # Supported values: 'KB', 'MB', 'GB'
142
+ # @param [Boolean, optional] fail_on_warning
143
+ # Specify whether the PR should fail if one or more app variants
144
+ # exceed the given size limit. By default, the plugin issues
145
+ # a warning in this case.
146
+ # Default: 'false'
144
147
  # @return [void]
145
148
  #
146
- def flag_ios_violations(report_path, build_type: 'App', size_limit: 4, limit_unit: 'GB', fail_on_warning: false)
149
+ def flag_ios_violations(report_path, **kargs)
150
+ supported_kargs = %i[build_type limit_size limit_unit size_limit fail_on_warning]
151
+
152
+ # Identify any unsupported arguments passed to method
153
+ unsupported_kargs = kargs.keys - supported_kargs
154
+
155
+ raise ArgumentError, "The argument '#{unsupported_kargs[0]}' is not supported by flag_ios_violations" if unsupported_kargs.count == 1
156
+
157
+ raise ArgumentError, "The arguments #{unsupported_kargs} are not supported by flag_ios_violations" if unsupported_kargs.count > 1
158
+
159
+ # Set up optional arguments with default values if needed
160
+ build_type = kargs[:build_type] || 'App'
161
+ limit_size = kargs[:limit_size] || kargs[:size_limit] || 4
162
+ limit_unit = kargs[:limit_unit] || 'GB'
163
+ fail_on_warning = kargs[:fail_on_warning] || false
164
+
147
165
  report_text = File.read(report_path)
148
166
  variants = ReportParser.parse(report_text)
149
167
 
150
168
  raise ArgumentError, "The 'build_type' argument only accepts the values \"App\" and \"Clip\"" unless %w[App Clip].include? build_type
151
169
 
152
- raise ArgumentError, "The 'size_limit' argument only accepts numeric values" unless size_limit.is_a? Numeric
170
+ if kargs[:limit_size]
171
+ raise ArgumentError, "The 'limit_size' argument only accepts numeric values" unless limit_size.is_a? Numeric
172
+ elsif kargs[:size_limit]
173
+ raise ArgumentError, "The 'size_limit' argument only accepts numeric values" unless limit_size.is_a? Numeric
174
+ end
153
175
 
154
176
  limit_unit.upcase!
155
177
  raise ArgumentError, "The 'build_type' argument only accepts the values \"KB\", \"MB\" and \"GB\"" unless %w[KB MB GB].include? limit_unit
156
178
 
157
179
  raise ArgumentError, "The 'fail_on_warning' argument only accepts the values 'true' and 'false'" unless [true, false].include? fail_on_warning
158
180
 
159
- generate_size_report_markdown(variants, build_type, size_limit, limit_unit, fail_on_warning)
181
+ generate_size_report_markdown(variants, build_type, limit_size, limit_unit, fail_on_warning)
160
182
  generate_variant_descriptors_markdown(variants)
161
183
  generate_ads_label_markdown
162
184
  end
163
185
 
164
186
  # Reports Android app size violations given a valid AAB.
165
- # @param [String, required] aab_path
166
- # Path to valid AAB file.
167
- # @param [String, required] ks_path
168
- # Path to valid signing key file.
169
- # @param [String, required] ks_alias
170
- # Alias of signing key
171
- # @param [String, required] ks_password
172
- # Password of signing key
173
- # @param [String, required] ks_alias_password
174
- # Alias Password of signing key.
175
- # @param [Array, optional] screen_densities
176
- # Array of screen densities to check APK size
177
- # Default: ["MDPI", "HDPI", "XHDPI", "XXHDPI", "XXXHDPI"]
178
- # @param [Array, optional] languages
179
- # Array of languages to check APK size
180
- # Default: ["en"]
181
- # @param [String, optional] build_type
182
- # Specify whether the report corresponds to an App, Instant.
183
- # Default: 'App'
184
- # Supported values: 'App', 'Instant'
185
- # @param [Numeric, optional] size_limit
186
- # Specify the app size limit.
187
- # Default: 150
188
- # @param [String, optional] limit_unit
189
- # Specific the unit for the given size limit.
190
- # Default: 'MB'
191
- # Supported values: 'KB', 'MB', 'GB'
192
- # @param [Boolean, optional] fail_on_warning
193
- # Specify whether the PR should fail if one or more app variants
194
- # exceed the given size limit. By default, the plugin issues
195
- # a warning in this case.
196
- # Default: 'false'
187
+ # @overload flag_android_violations(aab_path, ks_path, ks_alias, ks_password, ks_alias_password, screen_densities, languages, build_type, limit_size, size_limit, limit_unit, fail_on_warning)
188
+ # @param [String, required] aab_path
189
+ # Path to valid AAB file.
190
+ # @param [String, required] ks_path
191
+ # Path to valid signing key file.
192
+ # @param [String, required] ks_alias
193
+ # Alias of signing key.
194
+ # @param [String, required] ks_password
195
+ # Password of signing key.
196
+ # @param [String, required] ks_alias_password
197
+ # Alias Password of signing key.
198
+ # @param [Array, optional] screen_densities
199
+ # Array of screen densities to check APK size.
200
+ # Default: ["MDPI", "HDPI", "XHDPI", "XXHDPI", "XXXHDPI"]
201
+ # @param [Array, optional] languages
202
+ # Array of languages to check APK size.
203
+ # Default: ["en"]
204
+ # @param [String, optional] build_type
205
+ # Specify whether the report corresponds to an App, Instant.
206
+ # Default: 'App'
207
+ # Supported values: 'App', 'Instant'
208
+ # @param [Numeric, optional] limit_size
209
+ # Specify the app size limit. If the build type is set to 'Instant' and the
210
+ # specified app size limit exceeds 4 MB, the 4 MB limit will be enforced to
211
+ # meet Android Instant App size requirements.
212
+ # Default: 150
213
+ # @param [String, optional] limit_unit
214
+ # Specific the unit for the given size limit.
215
+ # Default: 'MB'
216
+ # Supported values: 'KB', 'MB', 'GB'
217
+ # @param [Boolean, optional] fail_on_warning
218
+ # Specify whether the PR should fail if one or more app variants
219
+ # exceed the given size limit. By default, the plugin issues
220
+ # a warning in this case.
221
+ # Default: 'false'
197
222
  # @return [void]
198
223
  #
199
- def flag_android_violations(aab_path, ks_path, ks_alias, ks_password, ks_alias_password, screen_densities: %w[MDPI HDPI XHDPI XXHDPI XXXHDPI], languages: ['en'], build_type: 'App', size_limit: 150, limit_unit: 'MB', fail_on_warning: false)
224
+ def flag_android_violations(aab_path, ks_path, ks_alias, ks_password, ks_alias_password, **kargs)
200
225
  project_root = Dir.pwd
201
226
  temp_path = "#{project_root}/temp"
202
227
  apks_path = "#{temp_path}/output.apks"
@@ -205,9 +230,28 @@ module Danger
205
230
  bundletool_version = '1.8.2'
206
231
  variants_limit = 25
207
232
 
233
+ supported_kargs = %i[screen_densities languages build_type limit_size size_limit limit_unit fail_on_warning]
234
+ unsupported_kargs = kargs.keys - supported_kargs
235
+
236
+ raise ArgumentError, "The argument #{unsupported_kargs[0]} is not supported by flag_android_violations" if unsupported_kargs.count == 1
237
+
238
+ raise ArgumentError, "The arguments #{unsupported_kargs} are not supported by flag_android_violations" if unsupported_kargs.count > 1
239
+
240
+ # Set up optional arguments with default values if needed
241
+ screen_densities = kargs[:screen_densities] || %w[MDPI HDPI XHDPI XXHDPI XXXHDPI]
242
+ languages = kargs[:languages] || ['en']
243
+ build_type = kargs[:build_type] || 'App'
244
+ limit_size = kargs[:limit_size] || kargs[:size_limit] || 150
245
+ limit_unit = kargs[:limit_unit] || 'MB'
246
+ fail_on_warning = kargs[:fail_on_warning] || false
247
+
208
248
  raise ArgumentError, "The 'build_type' argument only accepts the values \"App\" and \"Instant\"" unless %w[App Instant].include? build_type
209
249
 
210
- raise ArgumentError, "The 'size_limit' argument only accepts numeric values" unless size_limit.is_a? Numeric
250
+ if kargs[:limit_size]
251
+ raise ArgumentError, "The 'limit_size' arguments only accepts numeric values" unless limit_size.is_a? Numeric
252
+ elsif kargs[:size_limit]
253
+ raise ArgumentError, "The 'size_limit' argument only accepts numeric values" unless limit_size.is_a? Numeric
254
+ end
211
255
 
212
256
  limit_unit.upcase!
213
257
  raise ArgumentError, "The 'limit_unit' argument only accepts the values \"KB\", \"MB\" and \"GB\"" unless %w[KB MB GB].include? limit_unit
@@ -229,9 +273,8 @@ module Danger
229
273
 
230
274
  clean_temp!(temp_path)
231
275
 
232
- generate_android_size_report_markdown(sorted_sizes, build_type, size_limit, limit_unit, fail_on_warning,
276
+ generate_android_size_report_markdown(sorted_sizes, build_type, limit_size, limit_unit, fail_on_warning,
233
277
  variants_limit)
234
- generate_ads_label_markdown
235
278
  end
236
279
 
237
280
  # Returns a JSON string representation of the given App Thinning Size Report.
@@ -339,12 +382,13 @@ module Danger
339
382
 
340
383
  def generate_size_report_markdown(variants, build_type, size_limit, limit_unit, fail_on_warning)
341
384
  limit_size = MemorySize.new("#{size_limit}#{limit_unit}")
385
+ cellular_limit_size = MemorySize.new('200 MB')
342
386
 
343
- if build_type == 'Clip' && limit_size.megabytes > 10
344
- message "The size limit was set to 10 MB as the given limit of #{size_limit} #{limit_unit} exceeds Apple's App Clip size restrictions"
345
- size_limit = 10
387
+ if build_type == 'Clip' && limit_size.megabytes > 15
388
+ message "The size limit was set to 15 MB as the given limit of #{size_limit} #{limit_unit} exceeds Apple's App Clip size restrictions"
389
+ size_limit = 15
346
390
  limit_unit = 'MB'
347
- limit_size.kilobytes = 10 * 1024
391
+ limit_size.kilobytes = 15 * 1024
348
392
  elsif build_type == 'App' && limit_size.gigabytes > 4
349
393
  message "The size limit was set to 4 GB as the given limit of #{size_limit} #{limit_unit} exceeds Apple's App size restrictions"
350
394
  size_limit = 4
@@ -353,8 +397,10 @@ module Danger
353
397
  end
354
398
 
355
399
  flagged_variant_names = []
400
+ flagged_cellular_variant_names = []
356
401
  variants.each do |variant|
357
402
  flagged_variant_names.append(variant.variant) if variant.app_size.uncompressed.value > limit_size.megabytes || variant.on_demand_resources_size.uncompressed.value > limit_size.megabytes
403
+ flagged_cellular_variant_names.append(variant.variant) if variant.app_size.uncompressed.value > cellular_limit_size.megabytes || variant.on_demand_resources_size.uncompressed.value > cellular_limit_size.megabytes
358
404
  end
359
405
 
360
406
  if flagged_variant_names.length.positive?
@@ -365,21 +411,25 @@ module Danger
365
411
  end
366
412
  end
367
413
 
414
+ warn 'The optimal cellular size limit of 200 MB has been exceeded by one or more variants' if flagged_cellular_variant_names.length.positive?
415
+
368
416
  size_report = "# App Thinning Size Report\n"
369
417
  size_report << "### Size limit = #{size_limit} #{limit_unit.upcase}\n\n"
370
- size_report << "| Under Limit | Variant | App Size - Compressed | App Size - Uncompressed | ODR Size - Compressed | ODR Size - Uncompressed |\n"
371
- size_report << "| :-: | :-: | :-: | :-: | :-: | :-: |\n"
418
+ size_report << "| Under Limit | Variant | Cellular Friendly | App Size - Compressed | App Size - Uncompressed | ODR Size - Compressed | ODR Size - Uncompressed |\n"
419
+ size_report << "| :-: | :-: | :-: | :-: | :-: | :-: | :-:|\n"
372
420
 
373
421
  flagged_variants_set = flagged_variant_names.to_set
422
+ flagged_cellular_variants_set = flagged_cellular_variant_names.to_set
374
423
 
375
424
  variants.each do |variant|
376
425
  is_violating = flagged_variants_set.include?(variant.variant) ? '❌' : '✅'
426
+ is_cellular_friendly = flagged_cellular_variants_set.include?(variant.variant) ? '❌' : '✅'
377
427
  app_size_compressed = "#{variant.app_size.compressed.value} #{variant.app_size.compressed.unit}"
378
428
  app_size_uncompressed = "#{variant.app_size.uncompressed.value} #{variant.app_size.uncompressed.unit}"
379
429
  odr_size_compressed = "#{variant.on_demand_resources_size.compressed.value} #{variant.on_demand_resources_size.compressed.unit}"
380
430
  odr_size_uncompressed = "#{variant.on_demand_resources_size.uncompressed.value} #{variant.on_demand_resources_size.uncompressed.unit}"
381
431
 
382
- size_report << "#{is_violating} | #{variant.variant} | #{app_size_compressed} | #{app_size_uncompressed} | #{odr_size_compressed} | #{odr_size_uncompressed} |\n"
432
+ size_report << "#{is_violating} | #{variant.variant} | #{is_cellular_friendly} | #{app_size_compressed} | #{app_size_uncompressed} | #{odr_size_compressed} | #{odr_size_uncompressed} |\n"
383
433
  end
384
434
 
385
435
  markdown size_report
@@ -2,8 +2,8 @@
2
2
 
3
3
  require_relative '../helper/json_converter'
4
4
 
5
- # App Size Model
6
- # @example 'App size: 6.6 MB compressed, 12.9 MB uncompressed'
5
+ # App Size Model.
6
+ # Example: 'App size: 6.6 MB compressed, 12.9 MB uncompressed'
7
7
  class AppSizeModel < JSONConverter
8
8
  attr_reader :compressed, :uncompressed
9
9
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  require_relative '../helper/json_converter'
4
4
 
5
- # Device Model
6
- # @example 'device: iPhone10,3, os-version: 14.0'
5
+ # Device Model.
6
+ # Example: 'device: iPhone10,3, os-version: 14.0'
7
7
  class DeviceModel < JSONConverter
8
8
  attr_reader :device, :os_version
9
9
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  require_relative './model_parser'
4
4
 
5
- # Parse Variant section of App Thinning Size Report
6
- # @example 'Variant: ChargePointAppClip-35AD0331-EA57-4B82-B8E6-029D7786B9B7.ipa'
5
+ # Parse Variant section of App Thinning Size Report.
6
+ # Example: 'Variant: ChargePointAppClip-35AD0331-EA57-4B82-B8E6-029D7786B9B7.ipa'
7
7
  class VariantParser < ModelParser
8
8
  def parse
9
9
  @text = @text.strip
@@ -15,22 +15,33 @@ module Danger
15
15
  end
16
16
 
17
17
  it 'Converts App Size Report to JSON' do
18
- json_string = @app_size_report.report_json("#{File.dirname(__dir__)}/Resources/App\ Thinning\ Size\ Report.txt")
18
+ json_string = @app_size_report.report_json("#{File.dirname(__dir__)}/Resources/App\ Thinning\ Size\ Report\ CPClip.txt")
19
19
 
20
20
  expected_json = File.read("#{File.dirname(__dir__)}/Resources/expectedReportJSON.json")
21
21
 
22
22
  expect(json_string).to eq(expected_json)
23
23
  end
24
24
 
25
- it 'Generates IOS App Size Danger Report' do
25
+ it 'Generates IOS App Size Danger Report for Clip' do
26
26
  @app_size_report.flag_ios_violations(
27
- "#{File.dirname(__dir__)}/Resources/App\ Thinning\ Size\ Report.txt",
27
+ "#{File.dirname(__dir__)}/Resources/App\ Thinning\ Size\ Report\ CPClip.txt",
28
28
  build_type: 'Clip',
29
- size_limit: 12,
29
+ limit_size: 12,
30
30
  limit_unit: 'MB'
31
31
  )
32
32
 
33
- expect(@dangerfile.status_report[:warnings]).to eq(['The size limit of 10 MB has been exceeded by one or more variants'])
33
+ expect(@dangerfile.status_report[:warnings]).to eq(['The size limit of 12 MB has been exceeded by one or more variants'])
34
+ end
35
+
36
+ it 'Generates IOS App Size Danger Report for App' do
37
+ @app_size_report.flag_ios_violations(
38
+ "#{File.dirname(__dir__)}/Resources/App\ Thinning\ Size\ Report\ CP.txt",
39
+ build_type: 'App',
40
+ limit_size: 45,
41
+ limit_unit: 'MB'
42
+ )
43
+
44
+ expect(@dangerfile.status_report[:warnings]).to eq(['The size limit of 45 MB has been exceeded by one or more variants', 'The optimal cellular size limit of 200 MB has been exceeded by one or more variants'])
34
45
  end
35
46
 
36
47
  it 'Generates Android App Size Danger Report' do
@@ -43,7 +54,7 @@ module Danger
43
54
  screen_densities: %w[MDPI HDPI XHDPI XXHDPI XXXHDPI],
44
55
  languages: %w[en de da es fr it nb nl sv],
45
56
  build_type: 'Instant',
46
- size_limit: 1.459,
57
+ limit_size: 1.459,
47
58
  limit_unit: 'MB'
48
59
  )
49
60
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-app_size_report
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rishab Sukumar
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-04-27 00:00:00.000000000 Z
13
+ date: 2023-12-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: danger-plugin-api
@@ -46,14 +46,14 @@ dependencies:
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '10.0'
49
+ version: '13.0'
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: '10.0'
56
+ version: '13.0'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: rspec
59
59
  requirement: !ruby/object:Gem::Requirement
@@ -159,6 +159,7 @@ executables: []
159
159
  extensions: []
160
160
  extra_rdoc_files: []
161
161
  files:
162
+ - ".github/PULL_REQUEST_TEMPLATE.md"
162
163
  - ".gitignore"
163
164
  - ".rubocop.yml"
164
165
  - Gemfile
@@ -167,7 +168,8 @@ files:
167
168
  - LICENSE
168
169
  - README.md
169
170
  - Rakefile
170
- - Resources/App Thinning Size Report.txt
171
+ - Resources/App Thinning Size Report CP.txt
172
+ - Resources/App Thinning Size Report CPClip.txt
171
173
  - Resources/Images/android_instant_size_report.png
172
174
  - Resources/Images/app_thinning_size_report.png
173
175
  - Resources/app.aab