@@ -0,0 +1,2641 @@
+#!/usr/bin/env python%0A%0A# Copyright (c) 2013 Intel Corporation. All rights reserved.%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0A%0A%22%22%22%0Aincrement-version.py -- Bump Beta or Canary version number across all required%0Afiles.%0A%0ACrosswalk's versioning schema is %22MAJOR.MINOR.BUILD.PATCH%22. Incrementing a beta%0Aversion will monotonically increase the PATCH number, while incrementing a%0Acanary version will monotonically increase the BUILD number.%0A%22%22%22%0A%0Aimport optparse%0Aimport os%0Aimport re%0Aimport sys%0A%0A%0Adef path_from_root(path):%0A  %22%22%22%0A  Returns the absolute path to %7Cpath%7C, which is supposed to be relative to the%0A  repository's root directory.%0A  %22%22%22%0A  return os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', path)%0A%0A%0Adef increment_versions(replacements):%0A  %22%22%22%0A  %7Creplacements%7C is a dictionary whose keys are files (relative to the root of%0A  the repository) and values are regular expresions that match a section in the%0A  file with the version number we want to increase.%0A%0A  The regular expression is expected to have 2 groups, the first matching%0A  whatever precedes the version number and needs to stay the same, and the%0A  second matching the number itself.%0A%0A  Each of the files specified will be overwritten with new version numbers.%0A  %22%22%22%0A  for path, regexp in replacements.iteritems():%0A    # The paths are always relative to the repository's root directory.%0A    path = path_from_root(path)%0A%0A    def _replacement_func(match_obj):%0A      version_number = int(match_obj.group(2))%0A      return '%25s%25s' %25 (match_obj.group(1), version_number + 1)%0A%0A    contents = re.sub(regexp, _replacement_func, open(path).read())%0A    open(path, 'w').write(contents)%0A%0A%0Adef main():%0A  option_parser = optparse.OptionParser()%0A  option_parser.add_option(%0A    '', '--type', choices=('beta', 'canary'), dest='release_type',%0A    help='What part of the version number must be increased. %5C%22beta%5C%22 '%0A         'increases the patch version, %5C%22canary%5C%22 increases the build '%0A         'version.')%0A  options, _ = option_parser.parse_args()%0A%0A  if options.release_type == 'beta':%0A    replacements = %7B%0A      'VERSION': r'(PATCH=)(%5Cd+)',%0A      'packaging/crosswalk.spec': r'(Version:%5Cs+%5Cd+%5C.%5Cd+%5C.%5Cd+%5C.)(%5Cd+)',%0A    %7D%0A    increment_versions(replacements)%0A  elif options.release_type == 'canary':%0A    replacements = %7B%0A      'VERSION': r'(BUILD=)(%5Cd+)',%0A      'packaging/crosswalk.spec': r'(Version:%5Cs+%5Cd+%5C.%5Cd+%5C.)(%5Cd+)',%0A    %7D%0A    increment_versions(replacements)%0A  else:%0A    print '--type is a required argument and has not been specified. Exiting.'%0A    return 1%0A%0A  return 0%0A%0A%0Aif __name__ == '__main__':%0A  sys.exit(main())%0A

Add increment-version.py.