Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
ee0b5cb5
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
ee0b5cb5
编写于
11月 20, 2020
作者:
F
Filip Filmar
提交者:
GitHub
11月 20, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add and use --quiet flag on the license checker (#22485)
上级
1fe4b51e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
11 deletion
+30
-11
ci/licenses.sh
ci/licenses.sh
+11
-2
ci/licenses_golden/tool_signature
ci/licenses_golden/tool_signature
+1
-1
tools/licenses/lib/main.dart
tools/licenses/lib/main.dart
+18
-8
未找到文件。
ci/licenses.sh
浏览文件 @
ee0b5cb5
...
...
@@ -33,6 +33,14 @@ SRC_DIR="$(cd "$SCRIPT_DIR/../.."; pwd -P)"
DART_BIN
=
"
$SRC_DIR
/third_party/dart/tools/sdks/dart-sdk/bin"
PATH
=
"
$DART_BIN
:
$PATH
"
# Use:
# env VERBOSE=1 ./ci/licenses.sh
# to turn on verbose progress report printing.
QUIET
=
"--quiet"
if
[[
"
${
VERBOSE
}
"
==
"1"
]]
;
then
QUIET
=
""
fi
echo
"Verifying license script is still happy..."
echo
"Using pub from
$(
command
-v
pub
)
, dart from
$(
command
-v
dart
)
"
...
...
@@ -58,7 +66,8 @@ function collect_licenses() (
dart
--enable-asserts
lib/main.dart
\
--src
../../..
\
--out
../../../out/license_script_output
\
--golden
../../ci/licenses_golden
--golden
../../ci/licenses_golden
\
"
${
QUIET
}
"
)
# Verifies the licenses in the repo.
...
...
@@ -137,4 +146,4 @@ function verify_licenses() (
return
$exitStatus
)
verify_licenses
\ No newline at end of file
verify_licenses
ci/licenses_golden/tool_signature
浏览文件 @
ee0b5cb5
Signature: 1
f9d73861a9bb353a12cfa2ba38f6a12
Signature: 1
64585dad7317491c0f98b96519f87c7
tools/licenses/lib/main.dart
浏览文件 @
ee0b5cb5
...
...
@@ -2319,7 +2319,7 @@ class _RepositoryRoot extends _RepositoryDirectory {
class
_Progress
{
_Progress
(
this
.
max
)
{
_Progress
(
this
.
max
,
{
bool
quiet
=
false
})
:
_quiet
=
quiet
{
// This may happen when a git client contains left-over empty component
// directories after DEPS file changes.
if
(
max
<=
0
)
...
...
@@ -2327,6 +2327,7 @@ class _Progress {
}
final
int
max
;
final
bool
_quiet
;
int
get
withLicense
=>
_withLicense
;
int
_withLicense
=
0
;
int
get
withoutLicense
=>
_withoutLicense
;
...
...
@@ -2354,11 +2355,15 @@ class _Progress {
void
update
({
bool
flush
=
false
})
{
if
(
_lastUpdate
==
null
||
_lastUpdate
.
elapsedMilliseconds
>
90
||
flush
)
{
_lastUpdate
??=
Stopwatch
();
final
String
line
=
toString
();
system
.
stderr
.
write
(
'
\r
$line
'
);
if
(
_lastLength
>
line
.
length
)
system
.
stderr
.
write
(
' '
*
(
_lastLength
-
line
.
length
));
_lastLength
=
line
.
length
;
if
(
_quiet
)
{
system
.
stderr
.
write
(
'.'
);
}
else
{
final
String
line
=
toString
();
system
.
stderr
.
write
(
'
\r
$line
'
);
if
(
_lastLength
>
line
.
length
)
system
.
stderr
.
write
(
' '
*
(
_lastLength
-
line
.
length
));
_lastLength
=
line
.
length
;
}
_lastUpdate
.
reset
();
_lastUpdate
.
start
();
}
...
...
@@ -2423,6 +2428,7 @@ Future<void> _collectLicensesForComponent(_RepositoryDirectory componentRoot, {
String
outputGoldenPath
,
bool
writeSignature
,
bool
force
,
bool
quiet
,
})
async
{
// Check whether the golden file matches the signature of the current contents of this directory.
final
String
goldenSignature
=
await
_readSignature
(
inputGoldenPath
);
...
...
@@ -2432,7 +2438,7 @@ Future<void> _collectLicensesForComponent(_RepositoryDirectory componentRoot, {
return
;
}
final
_Progress
progress
=
_Progress
(
componentRoot
.
fileCount
);
final
_Progress
progress
=
_Progress
(
componentRoot
.
fileCount
,
quiet:
quiet
);
final
system
.
File
outFile
=
system
.
File
(
outputGoldenPath
);
final
system
.
IOSink
sink
=
outFile
.
openWrite
();
...
...
@@ -2506,9 +2512,11 @@ Future<void> main(List<String> arguments) async {
..
addOption
(
'src'
,
help:
'The root of the engine source'
)
..
addOption
(
'out'
,
help:
'The directory where output is written'
)
..
addOption
(
'golden'
,
help:
'The directory containing golden results'
)
..
addFlag
(
'quiet'
,
help:
'If set, the diagnostic output is much less verbose'
)
..
addFlag
(
'release'
,
help:
'Print output in the format used for product releases'
);
final
ArgResults
argResults
=
parser
.
parse
(
arguments
);
final
bool
quiet
=
argResults
[
'quiet'
];
final
bool
releaseMode
=
argResults
[
'release'
];
if
(
argResults
[
'src'
]
==
null
)
{
print
(
'Flutter license script: Must provide --src directory'
);
...
...
@@ -2538,7 +2546,8 @@ Future<void> main(List<String> arguments) async {
if
(
releaseMode
)
{
system
.
stderr
.
writeln
(
'Collecting licenses...'
);
final
_Progress
progress
=
_Progress
(
root
.
fileCount
);
system
.
stderr
.
writeln
(
'quiet:
$quiet
'
);
final
_Progress
progress
=
_Progress
(
root
.
fileCount
,
quiet:
quiet
);
final
List
<
License
>
licenses
=
Set
<
License
>.
from
(
root
.
getLicenses
(
progress
).
toList
()).
toList
();
if
(
progress
.
hadErrors
)
throw
'Had failures while collecting licenses.'
;
...
...
@@ -2596,6 +2605,7 @@ Future<void> main(List<String> arguments) async {
outputGoldenPath:
path
.
join
(
argResults
[
'out'
],
goldenFileName
),
writeSignature:
component
.
io
.
name
!=
'flutter'
,
force:
forceRunAll
||
component
.
io
.
name
==
'flutter'
,
quiet:
quiet
,
);
usedGoldens
.
add
(
goldenFileName
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录