From cba155bcfbb1bd00f2c42cbbed50f1f66d428a7b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 12 Sep 2014 21:48:45 +0800 Subject: [PATCH] Add action to copy chromedriver. --- atom.gyp | 30 ++++++++++++++++++++++++++++++ tools/copy_binary.py | 12 ++++++++++++ 2 files changed, 42 insertions(+) create mode 100755 tools/copy_binary.py diff --git a/atom.gyp b/atom.gyp index b725bad1..4bb3de97 100644 --- a/atom.gyp +++ b/atom.gyp @@ -688,6 +688,36 @@ }], # OS=="linux" ], }, # target <(project_name>_dump_symbols + { + 'target_name': 'copy_chromedriver', + 'type': 'none', + 'actions': [ + { + 'action_name': 'Copy ChromeDriver Binary', + 'variables': { + 'conditions': [ + ['OS=="win"', { + 'chromedriver_binary': 'chromedriver.exe', + },{ + 'chromedriver_binary': 'chromedriver', + }], + ], + }, + 'inputs': [ + '<(libchromiumcontent_library_dir)/<(chromedriver_binary)', + ], + 'outputs': [ + '<(PRODUCT_DIR)/<(chromedriver_binary)', + ], + 'action': [ + 'python', + 'tools/copy_binary.py', + '<@(_inputs)', + '<@(_outputs)', + ], + } + ], + }, # copy_chromedriver ], 'conditions': [ ['OS=="mac"', { diff --git a/tools/copy_binary.py b/tools/copy_binary.py new file mode 100755 index 00000000..a21b652a --- /dev/null +++ b/tools/copy_binary.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +import os +import shutil +import stat +import sys + +src = sys.argv[1] +dist = sys.argv[2] + +shutil.copyfile(src, dist) +os.chmod(dist, os.stat(dist).st_mode | stat.S_IEXEC) -- 2.43.0