parser property

ArgParser parser
getter/setter pair

Command-line argument parser for Fastlane publisher.

Defines all supported command-line options for the Fastlane publisher with their descriptions, types, defaults, and validation rules. Used for parsing user input and generating help documentation.

Includes comprehensive options for:

  • File paths and binary types
  • Version and release management
  • Track and rollout configuration
  • Metadata and asset handling
  • Upload controls and validation
  • Advanced Google Play features

Implementation

static ArgParser parser = ArgParser()
  ..addOption(
    'file-path',
    abbr: 'f',
    help: 'Path to the file to upload.',
    mandatory: true,
  )
  ..addOption(
    'binary-type',
    help:
        'The binary type of the application to use. Valid values are apk, aab.',
    defaultsTo: "apk",
  )
  ..addOption(
    'package-name',
    abbr: 'p',
    help: 'The package name of the application to use.',
    defaultsTo: BuildInfo.androidPackageName,
    mandatory: BuildInfo.androidPackageName == null,
  )
  ..addOption(
    'version-name',
    help:
        'Version name (used when uploading new APKs/AABs) - defaults to versionName in build.gradle or AndroidManifest.xml.',
  )
  ..addOption(
    'version-code',
    abbr: 'c',
    help: 'The versionCode for which to download the generated APK.',
  )
  ..addOption(
    'release-status',
    abbr: 'r',
    help:
        'Release status (used when uploading new APKs/AABs) - valid values are completed, draft, halted, inProgress.',
  )
  ..addOption(
    'track',
    abbr: 't',
    help:
        'The track of the application to use. The default available tracks are: production, beta, alpha, internal.',
  )
  ..addOption(
    'rollout',
    abbr: 'R',
    help:
        'The percentage of the user fraction when uploading to the rollout track (setting to 1 will complete the rollout).',
  )
  ..addOption(
    'metadata-path',
    help: 'Path to the directory containing the metadata files.',
    defaultsTo: Files.androidDistributionMetadataDir.path,
  )
  ..addOption(
    'json-key',
    abbr: 'j',
    help:
        'The path to a file containing service account JSON, used to authenticate with Google.',
    defaultsTo: Files.fastlaneJson.path,
  )
  ..addOption(
    'json-key-data',
    abbr: 'J',
    help:
        'The raw service account JSON data used to authenticate with Google.',
  )
  ..addOption('apk', abbr: 'a', help: 'Path to the APK file to upload.')
  ..addMultiOption(
    'apk-paths',
    abbr: 'A',
    help: 'An array of paths to APK files to upload.',
  )
  ..addOption('aab', abbr: 'b', help: 'Path to the AAB file to upload.')
  ..addMultiOption(
    'aab-paths',
    abbr: 'B',
    help: 'An array of paths to AAB files to upload.',
  )
  ..addFlag(
    'skip-upload-apk',
    negatable: false,
    defaultsTo: false,
    help: 'Whether to skip uploading APK.',
  )
  ..addFlag(
    'skip-upload-aab',
    negatable: false,
    defaultsTo: false,
    help: 'Whether to skip uploading AAB.',
  )
  ..addFlag(
    'skip-upload-metadata',
    negatable: false,
    defaultsTo: false,
    help: 'Whether to skip uploading metadata, changelogs not included.',
  )
  ..addFlag(
    'skip-upload-changelogs',
    negatable: false,
    defaultsTo: false,
    help: 'Whether to skip uploading changelogs.',
  )
  ..addFlag(
    'skip-upload-images',
    negatable: false,
    defaultsTo: false,
    help: 'Whether to skip uploading images, screenshots not included.',
  )
  ..addFlag(
    'skip-upload-screenshots',
    negatable: false,
    defaultsTo: false,
    help: 'Whether to skip uploading screenshots.',
  )
  ..addFlag(
    'sync-image-upload',
    negatable: false,
    defaultsTo: false,
    help:
        'Whether to use sha256 comparison to skip upload of images and screenshots that are already in Play Store.',
  )
  ..addOption(
    'track-promote-to',
    abbr: 'T',
    help:
        'The track to promote to. The default available tracks are: production, beta, alpha, internal.',
  )
  ..addOption(
    'track-promote-release-status',
    abbr: 's',
    help:
        'Promoted track release status (used when promoting a track) - valid values are completed, draft, halted, inProgress.',
  )
  ..addFlag(
    'validate-only',
    negatable: false,
    defaultsTo: false,
    help:
        'Only validate changes with Google Play rather than actually publish.',
  )
  ..addOption(
    'mapping',
    abbr: 'm',
    help:
        'Path to the mapping file to upload (mapping.txt or native-debug-symbols.zip alike).',
  )
  ..addMultiOption(
    'mapping-paths',
    abbr: 'M',
    help:
        'An array of paths to mapping files to upload (mapping.txt or native-debug-symbols.zip alike).',
  )
  ..addOption(
    'root-url',
    abbr: 'u',
    help:
        'Root URL for the Google Play API. The provided URL will be used for API calls in place of https://www.googleapis.com/.',
  )
  ..addOption(
    'timeout',
    defaultsTo: "300",
    help: 'Timeout for read, open and send (in seconds).',
  )
  ..addMultiOption(
    'version-codes-to-retain',
    abbr: 'V',
    help: 'An array of version codes to retain when publishing a new APK.',
  )
  ..addFlag(
    'changes-not-sent-for-review',
    negatable: false,
    defaultsTo: false,
    help:
        'Indicates that the changes in this edit will not be reviewed until they are explicitly sent for review from the Google Play Console UI.',
  )
  ..addFlag(
    'rescue-changes-not-sent-for-review',
    negatable: false,
    defaultsTo: true,
    help:
        'Catches changes_not_sent_for_review errors when an edit is committed and retries with the configuration that the error message recommended.',
  )
  ..addOption(
    'in-app-update-priority',
    abbr: 'I',
    help:
        'In-app update priority for all the newly added APKs in the release. Can take values between [0,5].',
  )
  ..addOption(
    'obb-main-references-version',
    abbr: 'O',
    help: 'References version of main expansion file.',
  )
  ..addOption(
    'obb-main-file-size',
    abbr: 'S',
    help: 'Size of main expansion file in bytes.',
  )
  ..addOption(
    'obb-patch-references-version',
    abbr: 'P',
    help: 'References version of patch expansion file.',
  )
  ..addOption(
    'obb-patch-file-size',
    abbr: 'F',
    help: 'Size of patch expansion file in bytes.',
  )
  ..addFlag(
    'upload-debug-symbols',
    negatable: false,
    defaultsTo: true,
    help: 'Whether to upload debug symbols.',
  )
  ..addFlag(
    'ack-bundle-installation-warning',
    negatable: false,
    defaultsTo: false,
    help:
        'Must be set to true if the bundle installation may trigger a warning on user devices (e.g can only be downloaded over wifi). Typically this is required for bundles over 150MB.',
  );