Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
a5d887cb
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
未验证
提交
a5d887cb
编写于
8月 20, 2019
作者:
J
Jonah Williams
提交者:
GitHub
8月 20, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reland remove kernel sdk script (#10814)
上级
a9b47638
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
69 addition
and
148 deletion
+69
-148
ci/licenses_golden/licenses_flutter
ci/licenses_golden/licenses_flutter
+0
-1
web_sdk/BUILD.gn
web_sdk/BUILD.gn
+69
-13
web_sdk/flutter_kernel_sdk.dart
web_sdk/flutter_kernel_sdk.dart
+0
-134
未找到文件。
ci/licenses_golden/licenses_flutter
浏览文件 @
a5d887cb
...
...
@@ -1045,7 +1045,6 @@ FILE: ../../../flutter/vulkan/vulkan_utilities.cc
FILE: ../../../flutter/vulkan/vulkan_utilities.h
FILE: ../../../flutter/vulkan/vulkan_window.cc
FILE: ../../../flutter/vulkan/vulkan_window.h
FILE: ../../../flutter/web_sdk/flutter_kernel_sdk.dart
FILE: ../../../flutter/web_sdk/libraries.json
FILE: ../../../flutter/web_sdk/sdk_rewriter.dart
----------------------------------------------------------------------------------------------------
...
...
web_sdk/BUILD.gn
浏览文件 @
a5d887cb
...
...
@@ -6,7 +6,6 @@ import("//third_party/dart/build/dart/dart_action.gni")
import("//third_party/dart/utils/compile_platform.gni")
sdk_dill = "$root_out_dir/flutter_web_sdk/kernel/flutter_ddc_sdk.dill"
sdk_libraries_json = "$root_out_dir/flutter_web_sdk/libraries.json"
web_ui_sources =
exec_script("//third_party/dart/tools/list_dart_files.py",
...
...
@@ -31,6 +30,7 @@ web_engine_sources += [ "$flutter_root/lib/web_ui/lib/src/engine.dart" ]
group("web_sdk") {
deps = [
":flutter_dartdevc_kernel_sdk",
":flutter_dartdevc_kernel_sdk_outline",
":web_engine_sources",
":web_ui_library",
":web_ui_sources",
...
...
@@ -95,32 +95,88 @@ copy("web_ui_library") {
]
}
prebuilt_dart_action("flutter_dartdevc_kernel_sdk") {
# Compile the DDC SDK's summary.
prebuilt_dart_action("flutter_dartdevc_kernel_sdk_outline") {
deps = [
"//third_party/dart/pkg:pkg_files_stamp",
"//third_party/dart/utils/dartdevc:dartdevc_files_stamp",
"//third_party/dart/utils/dartdevc:dartdevc_sdk_patch_stamp",
]
inputs = [
"//third_party/dart/pkg/dev_compiler/tool/kernel_sdk.dart",
]
inputs = []
outputs = [
sdk_dill,
"$root_out_dir/flutter_web_sdk/lib/_internal/libraries.json",
"$root_out_dir/flutter_web_sdk/kernel/amd/dart_sdk.js",
"$root_out_dir/flutter_web_sdk/kernel/amd/dart_sdk.js.map",
]
script = "flutter_kernel_sdk.dart"
script = "//third_party/dart/utils/bazel/kernel_worker.dart"
args = [
"--summary-only",
"--target",
"ddc",
"--packages-file",
"file:///" + rebase_path("//third_party/dart/.packages"),
"--multi-root-scheme",
"org-dartlang-sdk",
"--multi-root",
rebase_path("../../"),
"--libraries-file",
"file:///" + rebase_path("$root_out_dir/flutter_web_sdk/libraries.json"),
"--output",
rebase_path(sdk_dill),
"--source",
"dart:core",
# Additional Flutter web dart libraries
"--source",
"dart:ui",
"--source",
"dart:_engine",
]
}
# Compiles the DDC SDK's JS code.
prebuilt_dart_action("flutter_dartdevc_kernel_sdk") {
deps = [
"//third_party/dart/pkg:pkg_files_stamp",
"//third_party/dart/utils/dartdevc:dartdevc_files_stamp",
"//third_party/dart/utils/dartdevc:dartdevc_sdk_patch_stamp",
]
inputs = []
packages = "//third_party/dart/.packages"
output_path = rebase_path(sdk_dill)
libraries_path = rebase_path(sdk_libraries_json)
script = "//third_party/dart/pkg/dev_compiler/bin/dartdevc.dart"
outputs = [
"$root_out_dir/flutter_web_sdk/kernel/amd/dart_sdk.js",
"$root_out_dir/flutter_web_sdk/kernel/amd/dart_sdk.js.map",
]
args = [
"--output=$output_path",
"--libraries=$libraries_path",
"-k",
"--compile-sdk",
"dart:core",
# Additional Flutter web dart libraries
"dart:ui",
"dart:_engine",
"--no-summarize",
"--packages",
"file:///" + rebase_path("//third_party/dart/.packages"),
"--multi-root-scheme",
"org-dartlang-sdk",
"--multi-root",
rebase_path("../../"),
"--multi-root-output-path",
rebase_path("$root_out_dir/"),
"--libraries-file",
"file:///" + rebase_path("$root_out_dir/flutter_web_sdk/libraries.json"),
"--modules",
"amd",
"-o",
rebase_path("$root_out_dir/flutter_web_sdk/kernel/amd/dart_sdk.js"),
]
}
web_sdk/flutter_kernel_sdk.dart
已删除
100644 → 0
浏览文件 @
a9b47638
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// These packages exist in the third_party/dart .package, but not locally
// which confuses the analyzer.
// ignore_for_file: uri_does_not_exist
import
'dart:async'
;
import
'dart:convert'
show
json
;
import
'dart:io'
;
import
'package:args/args.dart'
show
ArgParser
;
import
'package:dev_compiler/src/compiler/module_builder.dart'
;
import
'package:dev_compiler/src/compiler/shared_command.dart'
show
SharedCompilerOptions
;
import
'package:dev_compiler/src/kernel/target.dart'
;
import
'package:dev_compiler/src/kernel/command.dart'
;
import
'package:dev_compiler/src/kernel/compiler.dart'
;
import
'package:front_end/src/api_unstable/ddc.dart'
show
CompilerOptions
,
kernelForModule
,
DiagnosticMessage
,
printDiagnosticMessage
,
Severity
;
import
'package:kernel/kernel.dart'
;
import
'package:kernel/target/targets.dart'
;
import
'package:path/path.dart'
as
path
;
// This script is forked from https://github.com/dart-lang/sdk/blob/master/pkg/dev_compiler/tool/kernel_sdk.dart
// and produces the precompiled sdk for dartdevc. This has been modified to include a dart:ui target.
Future
main
(
List
<
String
>
args
)
async
{
var
ddcPath
=
path
.
dirname
(
path
.
dirname
(
path
.
fromUri
(
Platform
.
script
)));
// Parse flags.
var
parser
=
ArgParser
()
..
addOption
(
'output'
)
..
addOption
(
'libraries'
,
defaultsTo:
path
.
join
(
ddcPath
,
'../../sdk/lib/libraries.json'
));
var
parserOptions
=
parser
.
parse
(
args
);
var
outputPath
=
parserOptions
[
'output'
]
as
String
;
if
(
outputPath
==
null
)
{
var
sdkRoot
=
path
.
absolute
(
path
.
dirname
(
path
.
dirname
(
ddcPath
)));
var
buildDir
=
path
.
join
(
sdkRoot
,
Platform
.
isMacOS
?
'xcodebuild'
:
'out'
);
var
genDir
=
path
.
join
(
buildDir
,
'ReleaseX64'
,
'gen'
,
'utils'
,
'dartdevc'
);
outputPath
=
path
.
join
(
genDir
,
'kernel'
,
'ddc_sdk.dill'
);
}
var
librarySpecPath
=
parserOptions
[
'libraries'
]
as
String
;
var
packagesPath
=
path
.
join
(
ddcPath
,
'../third_party/dart/.packages'
);
void
onDiagnostic
(
DiagnosticMessage
message
)
{
printDiagnosticMessage
(
message
,
print
);
if
(
message
.
severity
==
Severity
.
error
||
message
.
severity
==
Severity
.
internalProblem
)
{
exitCode
=
1
;
}
}
var
target
=
FlutterDevCompilerTarget
();
var
options
=
CompilerOptions
()
..
compileSdk
=
true
// TODO(sigmund): remove this unnecessary option when possible.
..
sdkRoot
=
Uri
.
base
..
packagesFileUri
=
Uri
.
base
.
resolveUri
(
Uri
.
file
(
packagesPath
))
..
librariesSpecificationUri
=
Uri
.
base
.
resolveUri
(
Uri
.
file
(
librarySpecPath
))
..
target
=
target
..
onDiagnostic
=
onDiagnostic
..
environmentDefines
=
{};
var
inputs
=
target
.
extraRequiredLibraries
.
map
(
Uri
.
parse
).
toList
();
var
compilerResult
=
await
kernelForModule
(
inputs
,
options
);
var
component
=
compilerResult
.
component
;
var
outputDir
=
path
.
dirname
(
outputPath
);
await
Directory
(
outputDir
).
create
(
recursive:
true
);
await
writeComponentToBinary
(
component
,
outputPath
);
var
jsModule
=
ProgramCompiler
(
component
,
compilerResult
.
classHierarchy
,
SharedCompilerOptions
(
moduleName:
'dart_sdk'
),
{}).
emitModule
(
component
,
[],
[],
{});
var
moduleFormats
=
{
'amd'
:
ModuleFormat
.
amd
,
};
for
(
var
name
in
moduleFormats
.
keys
)
{
var
format
=
moduleFormats
[
name
];
var
jsDir
=
path
.
join
(
outputDir
,
name
);
var
jsPath
=
path
.
join
(
jsDir
,
'dart_sdk.js'
);
await
Directory
(
jsDir
).
create
();
var
jsCode
=
jsProgramToCode
(
jsModule
,
format
);
await
File
(
jsPath
).
writeAsString
(
jsCode
.
code
);
await
File
(
'
$jsPath
.map'
).
writeAsString
(
json
.
encode
(
jsCode
.
sourceMap
));
}
}
class
FlutterDevCompilerTarget
extends
DevCompilerTarget
{
FlutterDevCompilerTarget
()
:
super
(
TargetFlags
());
@override
List
<
String
>
get
extraRequiredLibraries
=>
const
[
'dart:_runtime'
,
'dart:_debugger'
,
'dart:_foreign_helper'
,
'dart:_interceptors'
,
'dart:_internal'
,
'dart:_isolate_helper'
,
'dart:_js_helper'
,
'dart:_js_mirrors'
,
'dart:_js_primitives'
,
'dart:_metadata'
,
'dart:_native_typed_data'
,
'dart:async'
,
'dart:collection'
,
'dart:convert'
,
'dart:developer'
,
'dart:io'
,
'dart:isolate'
,
'dart:js'
,
'dart:js_util'
,
'dart:math'
,
'dart:mirrors'
,
'dart:typed_data'
,
'dart:indexed_db'
,
'dart:html'
,
'dart:html_common'
,
'dart:svg'
,
'dart:web_audio'
,
'dart:web_gl'
,
'dart:web_sql'
,
'dart:ui'
,
'dart:_engine'
,
];
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录