Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
fe570619
E
engine
项目概览
weixin_43355755
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fe570619
编写于
7月 16, 2015
作者:
A
Adam Barth
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add a script for updating code from Chromium and Mojo
上级
1b8968c2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
175 addition
and
0 deletion
+175
-0
sky/tools/roll/roll.py
sky/tools/roll/roll.py
+146
-0
sky/tools/roll/utils.py
sky/tools/roll/utils.py
+29
-0
未找到文件。
sky/tools/roll/roll.py
0 → 100755
浏览文件 @
fe570619
#!/usr/bin/env python
# Copyright 2015 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.
import
argparse
import
json
import
os
import
subprocess
import
sys
import
urllib2
from
utils
import
commit
from
utils
import
system
# //base and its dependencies
_base_deps
=
[
'base'
,
'testing'
,
'third_party/ashmem'
,
'third_party/libevent'
,
'third_party/libxml'
,
# via //base/test
'third_party/modp_b64'
,
'third_party/tcmalloc'
,
]
# //build and its dependencies
_build_deps
=
[
'build'
,
'third_party/android_testrunner'
,
'third_party/binutils'
,
'third_party/pymock'
,
'tools/android'
,
'tools/clang'
,
'tools/generate_library_loader'
,
'tools/gritsettings'
,
'tools/relocation_packer'
,
'tools/valgrind'
,
]
# things used from //mojo/public
_mojo_sdk_deps
=
[
'third_party/cython'
,
]
_chromium_libs
=
[
'crypto'
,
'url'
,
]
_third_party_deps
=
[
'third_party/android_platform'
,
'third_party/apple_apsl'
,
'third_party/boringssl'
,
'third_party/brotli'
,
'third_party/expat'
,
'third_party/freetype-android'
,
'third_party/harfbuzz-ng'
,
'third_party/iccjpeg'
,
'third_party/jinja2'
,
'third_party/jsr-305'
,
'third_party/junit'
,
'third_party/khronos'
,
'third_party/libjpeg'
,
'third_party/libpng'
,
'third_party/libXNVCtrl'
,
'third_party/markupsafe'
,
'third_party/mesa'
,
'third_party/mockito'
,
'third_party/ots'
,
'third_party/ply'
,
'third_party/protobuf'
,
'third_party/qcms'
,
'third_party/re2'
,
'third_party/robolectric'
,
'third_party/smhasher'
,
'third_party/yasm'
,
'third_party/zlib'
,
]
dirs_from_chromium
=
_base_deps
+
_build_deps
+
_mojo_sdk_deps
+
_chromium_libs
+
_third_party_deps
dirs_from_mojo
=
[
'gpu'
,
'mojo'
,
'mojom'
,
'services/android'
,
'services/asset_bundle'
,
'services/keyboard'
,
'services/sensors'
,
]
# The contents of these files before the roll will be preserved after the roll,
# even though they live in directories rolled in from Chromium.
files_not_to_roll
=
[
'build/config/ui.gni'
,
'build/ls.py'
,
'build/module_args/mojo.gni'
,
]
def
rev
(
source_dir
,
dest_dir
,
dirs_to_rev
):
for
d
in
dirs_to_rev
:
print
"removing directory %s"
%
d
try
:
system
([
"git"
,
"rm"
,
"-r"
,
d
],
cwd
=
dest_dir
)
except
subprocess
.
CalledProcessError
:
print
"Could not remove %s"
%
d
print
"cloning directory %s"
%
d
files
=
system
([
"git"
,
"ls-files"
,
d
],
cwd
=
source_dir
)
for
f
in
files
.
splitlines
():
source_path
=
os
.
path
.
join
(
source_dir
,
f
)
if
not
os
.
path
.
isfile
(
source_path
):
continue
dest_path
=
os
.
path
.
join
(
dest_dir
,
f
)
system
([
"mkdir"
,
"-p"
,
os
.
path
.
dirname
(
dest_path
)],
cwd
=
source_dir
)
system
([
"cp"
,
source_path
,
dest_path
],
cwd
=
source_dir
)
system
([
"git"
,
"add"
,
d
],
cwd
=
dest_dir
)
for
f
in
files_not_to_roll
:
system
([
"git"
,
"checkout"
,
"HEAD"
,
f
],
cwd
=
dest_dir
)
system
([
"git"
,
"add"
,
"."
],
cwd
=
dest_dir
)
src_commit
=
system
([
"git"
,
"rev-parse"
,
"HEAD"
],
cwd
=
source_dir
).
strip
()
commit
(
"Update to mojo %s"
%
src_commit
,
cwd
=
dest_dir
)
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
"Update the mojo repo's "
+
"snapshot of things imported from chromium."
)
parser
.
add_argument
(
"--mojo-dir"
,
type
=
str
)
parser
.
add_argument
(
"--chromium-dir"
,
type
=
str
)
parser
.
add_argument
(
"--dest-dir"
,
type
=
str
)
args
=
parser
.
parse_args
()
if
args
.
mojo_dir
:
rev
(
args
.
mojo_dir
,
args
.
dest_dir
,
dirs_from_mojo
)
if
args
.
chromium_dir
:
rev
(
args
.
chromium_dir
,
args
.
dest_dir
,
dirs_from_chromium
)
return
0
if
__name__
==
"__main__"
:
sys
.
exit
(
main
())
sky/tools/roll/utils.py
0 → 100755
浏览文件 @
fe570619
#!/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.
import
fnmatch
import
os
import
subprocess
def
commit
(
message
,
cwd
=
None
):
subprocess
.
call
([
'git'
,
'commit'
,
'-a'
,
'-m'
,
message
],
cwd
=
cwd
)
def
system
(
command
,
cwd
=
None
):
return
subprocess
.
check_output
(
command
,
cwd
=
cwd
)
def
find
(
patterns
,
start
=
'.'
):
for
path
,
dirs
,
files
in
os
.
walk
(
start
):
for
basename
in
files
+
dirs
:
if
any
([
fnmatch
.
fnmatch
(
basename
,
pattern
)
for
pattern
in
patterns
]):
filename
=
os
.
path
.
join
(
path
,
basename
)
yield
filename
def
filter_file
(
path
,
predicate
):
with
open
(
path
,
'r+'
)
as
f
:
lines
=
f
.
readlines
()
new_lines
=
[
line
for
line
in
lines
if
predicate
(
line
)]
f
.
seek
(
0
)
f
.
truncate
()
f
.
write
(
''
.
join
(
new_lines
))
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录