Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
liujiuri
engine
提交
830fced7
E
engine
项目概览
liujiuri
/
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,发现更多精彩内容 >>
提交
830fced7
编写于
11月 19, 2015
作者:
J
Jason Simmons
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2082 from jason-simmons/apk_upload_artifacts_2
Upload artifacts as a zip file
上级
b2a4c8f8
5aa1119e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
101 addition
and
27 deletion
+101
-27
build/android/ant/BUILD.gn
build/android/ant/BUILD.gn
+13
-0
sky/dist/BUILD.gn
sky/dist/BUILD.gn
+1
-0
sky/tools/release_engine.py
sky/tools/release_engine.py
+87
-27
未找到文件。
build/android/ant/BUILD.gn
0 → 100644
浏览文件 @
830fced7
# 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.
copy("keystore") {
sources = [
"chromium-debug.keystore",
]
outputs = [
"$root_out_dir/chromium-debug.keystore",
]
}
sky/dist/BUILD.gn
浏览文件 @
830fced7
...
...
@@ -103,6 +103,7 @@ group("dist") {
deps += [
":sky_engine",
":sky_services",
"//build/android/ant:keystore",
]
}
}
sky/tools/release_engine.py
浏览文件 @
830fced7
...
...
@@ -10,6 +10,8 @@ import os
import
subprocess
import
sys
import
distutils.util
import
tempfile
import
zipfile
DRY_RUN
=
False
...
...
@@ -36,42 +38,87 @@ def git_revision(cwd):
],
cwd
=
cwd
).
strip
()
class
Artifact
(
object
):
def
__init__
(
self
,
category
,
name
):
self
.
category
=
category
self
.
name
=
name
GS_URL
=
'gs://mojo/flutter/%(commit_hash)s/%(config)s/%(name)s'
GS_URL
=
'gs://mojo/sky/%(category)s/%(config)s/%(commit_hash)s/%(name)s'
# Paths of the artifacts that will be packaged into a zip file.
ZIP_ARTIFACTS
=
{
'android-arm'
:
[
'chromium-debug.keystore'
,
'icudtl.dat'
,
'dist/shell/SkyShell.apk'
,
'dist/shell/flutter.mojo'
,
'gen/sky/shell/shell/classes.dex'
,
'gen/sky/shell/shell/shell/libs/armeabi-v7a/libsky_shell.so'
,
],
'linux-x64'
:
[
'dist/shell/icudtl.dat'
,
'dist/shell/sky_shell'
,
'dist/shell/sky_snapshot'
,
'dist/shell/flutter.mojo'
,
],
}
ARTIFACTS
=
{
# Paths of the artifacts that will be uploaded to GCS as individual files.
FILE_ARTIFACTS
=
{
'android-arm'
:
[
Artifact
(
'shell'
,
'SkyShell.apk'
),
Artifact
(
'shell'
,
'flutter.mojo'
),
Artifact
(
'shell'
,
'libflutter_library.so'
),
'dist/shell/flutter.mojo'
,
'dist/shell/libflutter_library.so'
,
],
'linux-x64'
:
[
Artifact
(
'shell'
,
'icudtl.dat'
),
Artifact
(
'shell'
,
'sky_shell'
),
Artifact
(
'shell'
,
'sky_snapshot'
),
Artifact
(
'shell'
,
'flutter.mojo'
),
Artifact
(
'shell'
,
'libflutter_library.so'
),
]
'dist/shell/flutter.mojo'
,
'dist/shell/libflutter_library.so'
,
],
}
def
find_missing_artifacts
(
config
,
config_root
):
result
=
[]
for
artifact_map
in
[
ZIP_ARTIFACTS
,
FILE_ARTIFACTS
]:
for
artifact_path
in
artifact_map
[
config
]:
full_path
=
os
.
path
.
join
(
config_root
,
artifact_path
)
if
not
os
.
path
.
exists
(
full_path
):
result
.
append
(
full_path
)
return
result
# Do not try to compress file types that are already compressed.
FILE_TYPE_COMPRESSION
=
{
'.apk'
:
zipfile
.
ZIP_STORED
,
}
def
upload_artifacts
(
dist_root
,
config
,
commit_hash
):
for
artifact
in
ARTIFACTS
[
config
]:
src
=
os
.
path
.
join
(
artifact
.
category
,
artifact
.
name
)
# Build and upload a zip file of artifacts
zip_fd
,
zip_filename
=
tempfile
.
mkstemp
(
'.zip'
,
'artifacts_'
)
try
:
os
.
close
(
zip_fd
)
artifact_zip
=
zipfile
.
ZipFile
(
zip_filename
,
'w'
)
for
artifact_path
in
ZIP_ARTIFACTS
[
config
]:
_
,
extension
=
os
.
path
.
splitext
(
artifact_path
)
artifact_zip
.
write
(
os
.
path
.
join
(
dist_root
,
artifact_path
),
os
.
path
.
basename
(
artifact_path
),
FILE_TYPE_COMPRESSION
.
get
(
extension
,
zipfile
.
ZIP_DEFLATED
))
artifact_zip
.
close
()
dst
=
GS_URL
%
{
'config'
:
config
,
'commit_hash'
:
commit_hash
,
'name'
:
'artifacts.zip'
,
}
run
(
dist_root
,
[
'gsutil'
,
'cp'
,
zip_filename
,
dst
])
finally
:
os
.
remove
(
zip_filename
)
# Upload individual file artifacts
for
artifact_path
in
FILE_ARTIFACTS
[
config
]:
dst
=
GS_URL
%
{
'category'
:
artifact
.
category
,
'config'
:
config
,
'commit_hash'
:
commit_hash
,
'name'
:
artifact
.
name
,
'name'
:
os
.
path
.
basename
(
artifact_path
)
,
}
z
=
','
.
join
([
'mojo'
,
'
dat
'
])
run
(
dist_root
,
[
'gsutil'
,
'cp'
,
'-z'
,
z
,
src
,
dst
])
z
=
','
.
join
([
'mojo'
,
'
so
'
])
run
(
dist_root
,
[
'gsutil'
,
'cp'
,
'-z'
,
z
,
artifact_path
,
dst
])
def
main
():
...
...
@@ -99,10 +146,10 @@ def main():
# Derived paths:
dart_sdk_root
=
os
.
path
.
join
(
engine_root
,
'third_party/dart-sdk/dart-sdk'
)
pub_path
=
os
.
path
.
join
(
dart_sdk_root
,
'bin/pub'
)
android_
dist_root
=
os
.
path
.
join
(
engine_root
,
'out/android_Release/dist
'
)
linux_
dist_root
=
os
.
path
.
join
(
engine_root
,
'out/Release/dist
'
)
sky_engine_package_root
=
os
.
path
.
join
(
android_
dist_root
,
'
packages/sky_engine/sky_engine'
)
sky_services_package_root
=
os
.
path
.
join
(
android_
dist_root
,
'
packages/sky_services/sky_services'
)
android_
out_root
=
os
.
path
.
join
(
engine_root
,
'out/android_Release
'
)
linux_
out_root
=
os
.
path
.
join
(
engine_root
,
'out/Release
'
)
sky_engine_package_root
=
os
.
path
.
join
(
android_
out_root
,
'dist/
packages/sky_engine/sky_engine'
)
sky_services_package_root
=
os
.
path
.
join
(
android_
out_root
,
'dist/
packages/sky_services/sky_services'
)
sky_engine_revision_file
=
os
.
path
.
join
(
sky_engine_package_root
,
'lib'
,
'REVISION'
)
run
(
engine_root
,
[
'sky/tools/gn'
,
'--android'
,
'--release'
])
...
...
@@ -114,8 +161,21 @@ def main():
with
open
(
sky_engine_revision_file
,
'w'
)
as
stream
:
stream
.
write
(
commit_hash
)
upload_artifacts
(
android_dist_root
,
'android-arm'
,
commit_hash
)
upload_artifacts
(
linux_dist_root
,
'linux-x64'
,
commit_hash
)
configs
=
[(
'android-arm'
,
android_out_root
),
(
'linux-x64'
,
linux_out_root
)]
# Check for missing artifact files
missing_artifacts
=
[]
for
config
,
config_root
in
configs
:
missing_artifacts
.
extend
(
find_missing_artifacts
(
config
,
config_root
))
if
missing_artifacts
:
print
(
'Build is missing files:
\n
%s'
%
'
\n
'
.
join
(
'
\t
%s'
%
path
for
path
in
missing_artifacts
))
return
1
# Upload artifacts
for
config
,
config_root
in
configs
:
upload_artifacts
(
config_root
,
config
,
commit_hash
)
run
(
sky_engine_package_root
,
[
pub_path
,
'publish'
,
'--force'
])
run
(
sky_services_package_root
,
[
pub_path
,
'publish'
,
'--force'
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录