From 39e8a6f4d2067be7cad55eb16f699fa2eaa40d11 Mon Sep 17 00:00:00 2001 From: sdefresne Date: Thu, 10 Mar 2016 04:28:28 -0800 Subject: [PATCH] Remove obsolete override "ios_extra_version_path". Chrome on iOS is aligning with the rest of Chrome and no longer uses "ios_extra_version_path". Remove it from version_info components and remove the "gclient" hook that generated ios/build/util/CANARY_VERSION. BUG=591419 Review URL: https://codereview.chromium.org/1784783002 Cr-Commit-Position: refs/heads/master@{#380394} --- .gitignore | 1 - DEPS | 7 ---- components/version_info.gypi | 33 ------------------ components/version_info/BUILD.gn | 21 ------------ ios/build/util/VERSION | 1 - ios/build/util/canary_version.py | 58 -------------------------------- 6 files changed, 121 deletions(-) delete mode 100644 ios/build/util/VERSION delete mode 100755 ios/build/util/canary_version.py diff --git a/.gitignore b/.gitignore index 6e053a5318c86..7077ab2653ca3 100644 --- a/.gitignore +++ b/.gitignore @@ -184,7 +184,6 @@ vs-chromium-project.txt /gyp-mac-tool /infra/.recipe_deps /internal_gyp -/ios/build/util/CANARY_VERSION /ios/third_party/earl_grey/src /ios/third_party/fishhook/src /ios/third_party/gcdwebserver/src diff --git a/DEPS b/DEPS index eea408caccef0..0e6473191a376 100644 --- a/DEPS +++ b/DEPS @@ -650,13 +650,6 @@ hooks = [ '-s', 'src/third_party/WebKit', '-o', 'src/build/util/LASTCHANGE.blink'], }, - { - # Update CANARY_VERSION. - 'name': 'ios_canary_version', - 'pattern': '.', - 'action': ['python', 'src/ios/build/util/canary_version.py', - '-o', 'src/ios/build/util/CANARY_VERSION'], - }, # Pull GN binaries. This needs to be before running GYP below. { 'name': 'gn_win', diff --git a/components/version_info.gypi b/components/version_info.gypi index 472f1d87be20f..d81d85d3935c1 100644 --- a/components/version_info.gypi +++ b/components/version_info.gypi @@ -4,12 +4,6 @@ { 'variables': { - # Some plaform want to override part of the version number generation - # (for example iOS uses a different value for PATCH level for canary). - # This can be done settings "extra_version_path" variable to the path - # of a file with the corresponding value overrides. If present it will - # be loaded after all other input files. - 'extra_version_name': '', 'conditions': [ ['branding == "Chrome"', { 'use_unofficial_version_number%': 0, @@ -93,35 +87,8 @@ '<(template_input_path)', '<@(_outputs)', ], - 'conditions': [ - ['extra_version_name!=""', { - 'variables': { - 'extra_version_flags': [ - '-f', '<(extra_version_name)', - ], - }, - 'inputs': [ - '<(extra_version_name)' - ], - }], - ], }, ], }, ], - 'conditions': [ - ['OS=="ios"', { - 'variables': { - # Use nested 'variables' to workaround how variables work with gyp (no - # determined ordering and thuse it is not possible to define a variable - # in function of another). - 'variables': { - # Path to the file used to override the version PATH level on iOS. - # Default to ios/build/util/VERSION. - 'ios_extra_version_path%': '../ios/build/util/VERSION', - }, - 'extra_version_name': '<(ios_extra_version_path)' - }, - }], - ], } diff --git a/components/version_info/BUILD.gn b/components/version_info/BUILD.gn index 7f51c0a4376fa..6c043e53a912d 100644 --- a/components/version_info/BUILD.gn +++ b/components/version_info/BUILD.gn @@ -6,12 +6,6 @@ import("//build/config/chrome_build.gni") import("//chrome/version.gni") declare_args() { - if (is_ios) { - # Path to the file used to override the version PATH level on iOS. - # Default to ios/build/util/VERSION. - ios_extra_version_path = "//ios/build/util/VERSION" - } - use_unofficial_version_number = !is_chrome_branded } @@ -36,19 +30,4 @@ source_set("version_info") { process_version("generate_version_info") { template_file = "version_info_values.h.version" output = "$target_gen_dir/version_info_values.h" - - if (is_ios) { - # iOS overrides PATCH level of the version with the value from the file - # named by ios_version_path, however, this needs to be the last argument - # to the version.py script, so it cannot be added to the sources variable - # and instead need to be managed manually. - - inputs = [ - ios_extra_version_path, - ] - extra_args = [ - "-f", - rebase_path(ios_extra_version_path, root_build_dir), - ] - } } diff --git a/ios/build/util/VERSION b/ios/build/util/VERSION deleted file mode 100644 index f8c1610924512..0000000000000 --- a/ios/build/util/VERSION +++ /dev/null @@ -1 +0,0 @@ -PATCH=0 diff --git a/ios/build/util/canary_version.py b/ios/build/util/canary_version.py deleted file mode 100755 index 0992368346078..0000000000000 --- a/ios/build/util/canary_version.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python -# Copyright 2014 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Writes canary version information to a specified file.""" - -import datetime -import sys -import optparse -import os - - -def WriteIfChanged(file_name, content): - """ - Write |content| to |file_name| iff the content is different from the - current content. - """ - try: - old_content = open(file_name, 'rb').read() - except EnvironmentError: - pass - else: - if content == old_content: - return - os.unlink(file_name) - open(file_name, 'wb').write(content) - - -def main(argv=None): - if argv is None: - argv = sys.argv - - parser = optparse.OptionParser(usage="canary_version.py [options]") - parser.add_option("-o", "--output", metavar="FILE", - help="write patch level to FILE") - opts, args = parser.parse_args(argv[1:]) - out_file = opts.output - - if args and out_file is None: - out_file = args.pop(0) - - if args: - sys.stderr.write('Unexpected arguments: %r\n\n' % args) - parser.print_help() - sys.exit(2) - - # Number of days since January 1st, 2012. - day_number = (datetime.date.today() - datetime.date(2012, 1, 1)).days - content = "PATCH={}\n".format(day_number) - - if not out_file: - sys.stdout.write(content) - else: - WriteIfChanged(out_file, content) - -if __name__ == '__main__': - sys.exit(main())