Giter VIP home page Giter VIP logo

danger-app_size_report's Introduction

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.