The project is in a healthy, maintained state
A Danger plugin for reporting iOS and Android app size violations.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 2.14
= 3.0.7
~> 0.14.1
~> 13.0
~> 3.4
~> 1.25.0
~> 0.9.27

Runtime

 Project Readme

danger-app_size_report

Build Status

A Danger plugin for reporting iOS and Android app size violations.

Installation

$ gem install danger-app_size_report

Usage

flag_ios_violations

Report iOS app size violations given a valid App Thinning Size Report. A valid App Thinning Size Report must be passed to the plugin for accurate functionality.

// Dangerfile

report_path = "/Path/to/AppSizeReport.txt"
app_size_report.flag_ios_violations(
    report_path,
    build_type: 'App',
    limit_size: 4,
    limit_unit: 'GB',
    fail_on_warning: false
)

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.

Parameters

  • report_path [String, required] Path to valid App Thinning Size Report text file.
  • build_type [String, optional] [Default: 'App'] Specify whether the report corresponds to an App or an App Clip.
    • Supported values: 'App', 'Clip'
  • 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.
  • limit_unit [String, optional] [Default: 'GB'] Specific the unit for the given size limit.
    • Supported values: 'KB', 'MB', 'GB'
  • 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.

report_json

Returns a JSON string representation of the given iOS App Thinning Size Report.

// Dangerfile

report_path = "/Path/to/AppSizeReport.txt"
app_size_json = app_size_report.report_json(report_path)

Parameters

  • report_path [String, required] Path to valid App Thinning Size Report text file.

flag_android_violations

Report Android app size violations given a valid Android App Bundle (AAB).

// Dangerfile

aab_path = "/Path/to/app.aab"
ks_path = "/Path/to/keyStore"
ks_alias = "KeyAlias"
ks_password = "Key Password"
ks_alias_password = "Key Alias Password"
app_size_report.flag_android_violations(
    aab_path,
    ks_path,
    ks_alias,
    ks_password,
    ks_alias_password,
    screen_densities: ["MDPI", "HDPI", "XHDPI", "XXHDPI", "XXXHDPI"],
    languages: ["en", "de", "da", "es", "fr", "it", "nb", "nl", "sv"],
    build_type: 'Instant',
    limit_size: 4,
    limit_unit: 'MB',
    fail_on_warning: false
)

The top 25 violations will be displayed in the PR report with any remaining violations and variants under the size limit placed under collapsible sections as seen below.

Parameters

  • aab_path [String, required] Path to valid AAB file.
  • ks_path [String, required] Path to valid signing key file.
  • ks_alias [String, required] Alias of signing key.
  • ks_password [String, required] Password of signing key.
  • ks_alias_password [String, required] Alias Password of signing key.
  • screen_densities [Array, optional] [Default: ["MDPI", "HDPI", "XHDPI", "XXHDPI", "XXXHDPI"]] Array of screen densities to check APK size.
  • languages [Array, optional] [Default: ["en"]] Array of languages to check APK size
  • build_type [String, optional] [Default: 'App'] Specify whether the report corresponds to an App or an Instant.
    • Supported values: 'App', 'Instant'
  • 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.
  • limit_unit [String, optional] [Default: 'MB'] Specific the unit for the given size limit.
    • Supported values: 'KB', 'MB', 'GB'
  • 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.

Contribute

  1. Fork this repo.
  2. Run bundle install to setup dependencies.
  3. Run bundle exec rake spec to run the tests.
  4. Use bundle exec guard to automatically have tests run as you make changes.
  5. Make your changes.
  6. Submit a pull request with your desired changes to be merged on review.

More Info

Open an issue if you have any questions!