From b7cdb00d094306dc75a6559d03fabb836448c019 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Jul 2015 12:32:47 +0800 Subject: [PATCH] Hard code the chromedriver's version It is not possible to run chromedriver for all targets. --- script/create-dist.py | 7 +++---- script/lib/config.py | 4 ++++ script/lib/util.py | 7 ------- script/upload.py | 6 +++--- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/script/create-dist.py b/script/create-dist.py index 928430e..dbecc0a 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -8,9 +8,9 @@ import sys import stat from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ - get_target_arch + get_target_arch, get_chromedriver_version from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \ - execute, get_chromedriver_version, atom_gyp + execute, atom_gyp ATOM_SHELL_VERSION = get_atom_shell_version() @@ -96,8 +96,7 @@ def main(): create_version() create_dist_zip() - if target_arch != 'arm': - create_chrome_binary_zip('chromedriver', get_chromedriver_version()) + create_chrome_binary_zip('chromedriver', get_chromedriver_version()) create_chrome_binary_zip('mksnapshot', ATOM_SHELL_VERSION) create_symbols_zip() diff --git a/script/lib/config.py b/script/lib/config.py index ec10629..8264015 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -37,6 +37,10 @@ def get_target_arch(): return 'x64' +def get_chromedriver_version(): + return 'v2.15' + + def s3_config(): config = (os.environ.get('ATOM_SHELL_S3_BUCKET', ''), os.environ.get('ATOM_SHELL_S3_ACCESS_KEY', ''), diff --git a/script/lib/util.py b/script/lib/util.py index 0111294..fc52d31 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -190,13 +190,6 @@ def get_atom_shell_version(): return 'v' + atom_gyp()['version%'] -def get_chromedriver_version(): - SOURCE_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', '..')) - chromedriver = os.path.join(SOURCE_ROOT, 'dist', 'chromedriver') - output = subprocess.check_output([chromedriver, '-v']).strip() - return 'v' + output[13:output.rfind(' ')] - - def parse_version(version): if version[0] == 'v': version = version[1:] diff --git a/script/upload.py b/script/upload.py index 67ce921..9757fe6 100755 --- a/script/upload.py +++ b/script/upload.py @@ -7,9 +7,9 @@ import subprocess import sys import tempfile -from lib.config import PLATFORM, get_target_arch +from lib.config import PLATFORM, get_target_arch, get_chromedriver_version from lib.util import atom_gyp, execute, get_atom_shell_version, parse_version, \ - get_chromedriver_version, scoped_cwd + scoped_cwd from lib.github import GitHub @@ -83,7 +83,7 @@ def main(): upload_atom_shell(github, release, os.path.join(DIST_DIR, SYMBOLS_NAME)) # Upload chromedriver and mksnapshot for minor version update. - if get_target_arch() != 'arm' and parse_version(args.version)[2] == '0': + if parse_version(args.version)[2] == '0': chromedriver = 'chromedriver-{0}-{1}-{2}.zip'.format( get_chromedriver_version(), PLATFORM, get_target_arch()) upload_atom_shell(github, release, os.path.join(DIST_DIR, chromedriver)) -- 2.7.4