Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
7c805c0a
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,发现更多精彩内容 >>
未验证
提交
7c805c0a
编写于
2月 13, 2018
作者:
J
Jacob Richman
提交者:
GitHub
2月 13, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Track widget creation locations. (#4529)
* Track widget creation locations.
上级
439edca2
变更
7
展开全部
显示空白变更内容
内联
并排
Showing
7 changed file
with
762 addition
and
21 deletion
+762
-21
flutter_kernel_transformers/lib/track_widget_constructor_locations.dart
..._transformers/lib/track_widget_constructor_locations.dart
+573
-0
flutter_kernel_transformers/pubspec.yaml
flutter_kernel_transformers/pubspec.yaml
+116
-0
frontend_server/BUILD.gn
frontend_server/BUILD.gn
+3
-0
frontend_server/lib/server.dart
frontend_server/lib/server.dart
+34
-4
frontend_server/pubspec.yaml
frontend_server/pubspec.yaml
+3
-0
travis/analyze.sh
travis/analyze.sh
+15
-0
travis/licenses_golden/licenses_flutter
travis/licenses_golden/licenses_flutter
+18
-17
未找到文件。
flutter_kernel_transformers/lib/track_widget_constructor_locations.dart
0 → 100644
浏览文件 @
7c805c0a
此差异已折叠。
点击以展开。
flutter_kernel_transformers/pubspec.yaml
0 → 100644
浏览文件 @
7c805c0a
name
:
flutter_kernel_transformers
version
:
0.0.1-dev
description
:
Kernel transformers that operate on Flutter source code.
homepage
:
http://flutter.io
author
:
Flutter Authors <flutter-dev@googlegroups.com>
dependencies
:
kernel
:
any
meta
:
any
dev_dependencies
:
test
:
any
when
:
any
dependency_overrides
:
args
:
path
:
../../third_party/dart/third_party/pkg/args
async
:
path
:
../../third_party/dart/third_party/pkg/async
charcode
:
path
:
../../third_party/dart/third_party/pkg/charcode
collection
:
path
:
../../third_party/dart/third_party/pkg/collection
convert
:
path
:
../../third_party/dart/third_party/pkg/convert
crypto
:
path
:
../../third_party/dart/third_party/pkg/crypto
front_end
:
path
:
../../third_party/dart/pkg/front_end/
kernel
:
path
:
../../third_party/dart/pkg/kernel/
logging
:
path
:
../../third_party/dart/third_party/pkg/logging
meta
:
path
:
../../third_party/dart/pkg/meta
quiver
:
path
:
../../third_party/dart/third_party/pkg/quiver
package_config
:
path
:
../../third_party/dart/third_party/pkg_tested/package_config
path
:
path
:
../../third_party/dart/third_party/pkg/path
source_span
:
path
:
../../third_party/dart/third_party/pkg/source_span
typed_data
:
path
:
../../third_party/dart/third_party/pkg/typed_data
usage
:
path
:
../../third_party/dart/third_party/pkg/usage
vm
:
path
:
../../third_party/dart/pkg/vm/
analyzer
:
path
:
../../third_party/dart/pkg/analyzer
barback
:
path
:
../../third_party/dart/third_party/pkg/barback
boolean_selector
:
path
:
../../third_party/dart/third_party/pkg/boolean_selector
cli_util
:
path
:
../../third_party/dart/third_party/pkg/cli_util
csslib
:
path
:
../../third_party/dart/third_party/pkg/csslib
glob
:
path
:
../../third_party/dart/third_party/pkg/glob
html
:
path
:
../../third_party/dart/third_party/pkg/html
http
:
path
:
../../third_party/dart/third_party/pkg/http
http_multi_server
:
path
:
../../third_party/dart/third_party/pkg/http_multi_server
http_parser
:
path
:
../../third_party/dart/third_party/pkg/http_parser
isolate
:
path
:
../../third_party/dart/third_party/pkg/isolate
matcher
:
path
:
../../third_party/dart/third_party/pkg/matcher
mime
:
path
:
../../third_party/dart/third_party/pkg/mime
mockito
:
path
:
../../third_party/dart/third_party/pkg/mockito
package_resolver
:
path
:
../../third_party/dart/third_party/pkg_tested/package_resolver
plugin
:
path
:
../../third_party/dart/third_party/pkg/plugin
pool
:
path
:
../../third_party/dart/third_party/pkg/pool
pub_semver
:
path
:
../../third_party/dart/third_party/pkg/pub_semver
shelf
:
path
:
../../third_party/dart/third_party/pkg/shelf
shelf_packages_handler
:
path
:
../../third_party/dart/third_party/pkg/shelf_packages_handler
shelf_static
:
path
:
../../third_party/dart/third_party/pkg/shelf_static
shelf_web_socket
:
path
:
../../third_party/dart/third_party/pkg/shelf_web_socket
source_map_stack_trace
:
path
:
../../third_party/dart/third_party/pkg/source_map_stack_trace
source_maps
:
path
:
../../third_party/dart/third_party/pkg/source_maps
stack_trace
:
path
:
../../third_party/dart/third_party/pkg/stack_trace
stream_channel
:
path
:
../../third_party/dart/third_party/pkg/stream_channel
string_scanner
:
path
:
../../third_party/dart/third_party/pkg/string_scanner
test
:
path
:
../../third_party/dart/third_party/pkg/test
utf
:
path
:
../../third_party/dart/third_party/pkg/utf
watcher
:
path
:
../../third_party/dart/third_party/pkg/watcher
web_socket_channel
:
path
:
../../third_party/dart/third_party/pkg/web_socket_channel
when
:
path
:
../../third_party/pkg/when
yaml
:
path
:
../../third_party/dart/third_party/pkg/yaml
frontend_server/BUILD.gn
浏览文件 @
7c805c0a
...
...
@@ -16,6 +16,9 @@ application_snapshot("frontend_server") {
frontend_server_files = exec_script("//third_party/dart/tools/list_dart_files.py",
[ "absolute", rebase_path("."), ], "list lines")
frontend_server_files += exec_script("//third_party/dart/tools/list_dart_files.py",
[ "absolute", rebase_path("../flutter_kernel_transformers"), ], "list lines")
frontend_server_files += exec_script("//third_party/dart/tools/list_dart_files.py",
[ "absolute", rebase_path("../../third_party/dart/pkg"), ], "list lines")
...
...
frontend_server/lib/server.dart
浏览文件 @
7c805c0a
// Copyright 2017 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.
library
frontend_server
;
import
'dart:async'
;
...
...
@@ -22,6 +26,8 @@ import 'package:usage/uuid/uuid.dart';
import
'package:vm/incremental_compiler.dart'
show
IncrementalCompiler
;
import
'package:vm/kernel_front_end.dart'
show
compileToKernel
;
import
'package:flutter_kernel_transformers/track_widget_constructor_locations.dart'
;
ArgParser
_argParser
=
new
ArgParser
(
allowTrailingOptions:
true
)
..
addFlag
(
'train'
,
help:
'Run through sample command line to produce snapshot'
,
...
...
@@ -46,7 +52,10 @@ ArgParser _argParser = new ArgParser(allowTrailingOptions: true)
defaultsTo:
true
)
..
addOption
(
'packages'
,
help:
'.packages file to use for compilation'
,
defaultsTo:
null
);
defaultsTo:
null
)
..
addFlag
(
'track-widget-creation'
,
help:
'Run a kernel transformer to track creation locations for widgets.'
,
defaultsTo:
false
);
String
_usage
=
'''
Usage: server [options] [input.dart]
...
...
@@ -115,9 +124,12 @@ class BinaryPrinterFactory {
}
class
_FrontendCompiler
implements
CompilerInterface
{
_FrontendCompiler
(
this
.
_outputStream
,
{
this
.
printerFactory
})
{
_FrontendCompiler
(
this
.
_outputStream
,
{
this
.
printerFactory
,
this
.
trackWidgetCreation
})
{
_outputStream
??=
stdout
;
printerFactory
??=
new
BinaryPrinterFactory
();
if
(
trackWidgetCreation
)
{
widgetCreatorTracker
=
new
WidgetCreatorTracker
();
}
}
StringSink
_outputStream
;
...
...
@@ -130,6 +142,8 @@ class _FrontendCompiler implements CompilerInterface {
String
_kernelBinaryFilename
;
String
_kernelBinaryFilenameIncremental
;
String
_kernelBinaryFilenameFull
;
final
bool
trackWidgetCreation
;
WidgetCreatorTracker
widgetCreatorTracker
;
@override
Future
<
Null
>
compile
(
...
...
@@ -171,6 +185,7 @@ class _FrontendCompiler implements CompilerInterface {
program
=
await
_runWithPrintRedirection
(()
=>
compileToKernel
(
filenameUri
,
compilerOptions
,
aot:
options
[
'aot'
]));
}
runFlutterSpecificKernelTransforms
(
program
);
if
(
program
!=
null
)
{
final
IOSink
sink
=
new
File
(
_kernelBinaryFilename
).
openWrite
();
final
BinaryPrinter
printer
=
printerFactory
.
newBinaryPrinter
(
sink
);
...
...
@@ -223,12 +238,23 @@ class _FrontendCompiler implements CompilerInterface {
}
}
void
runFlutterSpecificKernelTransforms
(
Program
program
)
{
if
(
program
==
null
)
{
return
;
}
if
(
trackWidgetCreation
)
{
widgetCreatorTracker
.
transform
(
program
);
}
}
@override
Future
<
Null
>
recompileDelta
()
async
{
final
String
boundaryKey
=
new
Uuid
().
generateV4
();
_outputStream
.
writeln
(
'result
$boundaryKey
'
);
await
invalidateIfBootstrapping
();
final
Program
deltaProgram
=
await
_generator
.
compile
();
runFlutterSpecificKernelTransforms
(
deltaProgram
);
final
IOSink
sink
=
new
File
(
_kernelBinaryFilename
).
openWrite
();
final
BinaryPrinter
printer
=
printerFactory
.
newBinaryPrinter
(
sink
);
printer
.
writeProgramFile
(
deltaProgram
);
...
...
@@ -267,6 +293,7 @@ class _FrontendCompiler implements CompilerInterface {
return
Uri
.
base
.
resolve
(
uriPath
);
}
/// Runs the given function [f] in a Zone that redirects all prints into
/// [_outputStream].
Future
<
T
>
_runWithPrintRedirection
<
T
>(
Future
<
T
>
f
())
{
...
...
@@ -314,8 +341,11 @@ Future<int> starter(
return
0
;
}
compiler
??=
new
_FrontendCompiler
(
output
,
printerFactory:
binaryPrinterFactory
);
compiler
??=
new
_FrontendCompiler
(
output
,
printerFactory:
binaryPrinterFactory
,
trackWidgetCreation:
options
[
'track-widget-creation'
],
);
input
??=
stdin
;
// Has to be a directory, that won't have any of the compiled application
...
...
frontend_server/pubspec.yaml
浏览文件 @
7c805c0a
...
...
@@ -12,6 +12,7 @@ dependencies:
convert
:
any
crypto
:
any
front_end
:
any
flutter_kernel_transformers
:
any
kernel
:
any
logging
:
any
meta
:
any
...
...
@@ -71,6 +72,8 @@ dependency_overrides:
path
:
../../third_party/dart/third_party/pkg/convert
crypto
:
path
:
../../third_party/dart/third_party/pkg/crypto
flutter_kernel_transformers
:
path
:
../flutter_kernel_transformers
front_end
:
path
:
../../third_party/dart/pkg/front_end/
kernel
:
...
...
travis/analyze.sh
浏览文件 @
7c805c0a
...
...
@@ -32,3 +32,18 @@ if [ -n "$RESULTS" ]; then
echo
"Failed."
exit
1
;
fi
echo
"Analyzing flutter_kernel_transformers..."
pushd
flutter/flutter_kernel_transformers/
;
pub get
;
popd
RESULTS
=
`
dartanalyzer
\
--packages
=
flutter/flutter_kernel_transformers/.packages
\
--options
flutter/analysis_options.yaml
\
flutter/flutter_kernel_transformers
\
2>&1
\
|
grep
-Ev
"No issues found!"
\
|
grep
-Ev
"Analyzing.+flutter_kernel_transformers"
`
echo
"
$RESULTS
"
if
[
-n
"
$RESULTS
"
]
;
then
echo
"Failed."
exit
1
;
fi
travis/licenses_golden/licenses_flutter
浏览文件 @
7c805c0a
...
...
@@ -1881,12 +1881,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
LIBRARY: engine
ORIGIN: ../../../flutter/f
ml/platform/darwin/scoped_block.h
+ ../../../LICENSE
ORIGIN: ../../../flutter/f
lutter_kernel_transformers/lib/track_widget_constructor_locations.dart
+ ../../../LICENSE
TYPE: LicenseType.bsd
FILE: ../../../flutter/fml/platform/darwin/scoped_block.h
FILE: ../../../flutter/sky/engine/wtf/allocator/PartitionAllocator.h
FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm
----------------------------------------------------------------------------------------------------
Copyright
(c) 2013
The Chromium Authors. All rights reserved.
Copyright
2018
The Chromium Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
...
...
@@ -1917,17 +1918,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
LIBRARY: engine
ORIGIN: ../../../flutter/
lib/ui/painting/image.cc
+ ../../../LICENSE
ORIGIN: ../../../flutter/
fml/platform/darwin/scoped_block.h
+ ../../../LICENSE
TYPE: LicenseType.bsd
FILE: ../../../flutter/lib/ui/painting/image.cc
FILE: ../../../flutter/lib/ui/painting/image.h
FILE: ../../../flutter/shell/common/switches.cc
FILE: ../../../flutter/shell/common/switches.h
FILE: ../../../flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java
FILE: ../../../flutter/shell/platform/android/io/flutter/view/FlutterMain.java
FILE: ../../../flutter/shell/platform/android/io/flutter/view/FlutterView.java
FILE: ../../../flutter/fml/platform/darwin/scoped_block.h
FILE: ../../../flutter/sky/engine/wtf/allocator/PartitionAllocator.h
----------------------------------------------------------------------------------------------------
Copyright 2013 The Chromium Authors. All rights reserved.
Copyright
(c)
2013 The Chromium Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
...
...
@@ -1958,12 +1954,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
LIBRARY: engine
ORIGIN: ../../../flutter/
shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h
+ ../../../LICENSE
ORIGIN: ../../../flutter/
lib/ui/painting/image.cc
+ ../../../LICENSE
TYPE: LicenseType.bsd
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm
FILE: ../../../flutter/lib/ui/painting/image.cc
FILE: ../../../flutter/lib/ui/painting/image.h
FILE: ../../../flutter/shell/common/switches.cc
FILE: ../../../flutter/shell/common/switches.h
FILE: ../../../flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java
FILE: ../../../flutter/shell/platform/android/io/flutter/view/FlutterMain.java
FILE: ../../../flutter/shell/platform/android/io/flutter/view/FlutterView.java
----------------------------------------------------------------------------------------------------
Copyright 201
8
The Chromium Authors. All rights reserved.
Copyright 201
3
The Chromium Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录