Add action to copy chromedriver.

This commit is contained in:
Cheng Zhao 2014-09-12 21:48:45 +08:00
parent 88269a613a
commit cba155bcfb
2 changed files with 42 additions and 0 deletions

View file

@ -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"', {

12
tools/copy_binary.py Executable file
View file

@ -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)