tools/android/sdk_updater/update_sdk.py
def ChangeVersionInGNI(package, arg_version, gn_args_dict, gni_file_path,
                       dry_run):
  """Change the sdk package version in config.gni file."""
  if package in gn_args_dict:
    version_config_name = gn_args_dict.get(package)
    # Regex to parse the line of sdk package version gn argument, e.g.
    # '  default_android_sdk_version = "27"'. Capture a group for the line
    # excluding the version.
    gn_arg_pattern = re.compile(
        # Match the argument with '=' and whitespaces. Capture a group for it.
        r'(^\s*%s\s*=\s*)' % version_config_name +
        # Optional quote.
        r'("?)' +
        # Version number. E.g. 27, 27.0.3, -26.0.0-dev
        r'(?:[-\w\s.]+)' +
        # Optional quote.
        r'("?)' +
        # End of string
        r'$')

    _ReplaceVersionInFile(gni_file_path, gn_arg_pattern, arg_version, dry_run)
Change the sdk package version in config.gni file.
Change the sdk package version in config.gni file.
Change the sdk package version in config . gni file .
def ChangeVersionInGNI(package, arg_version, gn_args_dict, gni_file_path,
                       dry_run):
  if package in gn_args_dict:
    version_config_name = gn_args_dict.get(package)
    gn_arg_pattern = re.compile(
        r'(^\s*%s\s*=\s*)' % version_config_name +
        r'("?)' +
        r'(?:[-\w\s.]+)' +
        r'("?)' +
        r'$')
    _ReplaceVersionInFile(gni_file_path, gn_arg_pattern, arg_version, dry_run)
def ChangeVersionInGNI ( package , arg_version , gn_args_dict , gni_file_path , dry_run ) : if package in gn_args_dict : version_config_name = gn_args_dict . get ( package ) gn_arg_pattern = re . compile ( r'(^\s*%s\s*=\s*)' % version_config_name + r'("?)' + r'(?:[-\w\s.]+)' + r'("?)' + r'$' ) _ReplaceVersionInFile ( gni_file_path , gn_arg_pattern , arg_version , dry_run )
Change the sdk package version in config.gni file.
Change the sdk package version in config . gni file .
"""Change the sdk package version in config.gni file.""" # Regex to parse the line of sdk package version gn argument, e.g. # '  default_android_sdk_version = "27"'. Capture a group for the line # excluding the version. # Match the argument with '=' and whitespaces. Capture a group for it. # Optional quote. # Version number. E.g. 27, 27.0.3, -26.0.0-dev # Optional quote. # End of string
package
arg_version
gn_args_dict
gni_file_path
dry_run