mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
et phone home (flutter/engine#52506)
<img width="684" alt="image" src="https://github.com/flutter/engine/assets/919017/2dcdc7e9-b0e1-434d-9078-1de6a3d57d35">
This commit is contained in:
parent
829ae71a50
commit
dfed7164a1
@ -14,8 +14,13 @@ import 'package:process_runner/process_runner.dart';
|
||||
import 'src/commands/command_runner.dart';
|
||||
import 'src/environment.dart';
|
||||
import 'src/logger.dart';
|
||||
import 'src/phone_home.dart';
|
||||
|
||||
void main(List<String> args) async {
|
||||
if (phoneHome(args)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final bool verbose = args.contains('--verbose') || args.contains('-v');
|
||||
final bool help = args.contains('help') || args.contains('--help') ||
|
||||
args.contains('-h');
|
||||
|
||||
49
engine/src/flutter/tools/engine_tool/lib/src/phone_home.dart
Normal file
49
engine/src/flutter/tools/engine_tool/lib/src/phone_home.dart
Normal file
@ -0,0 +1,49 @@
|
||||
// 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.
|
||||
|
||||
/// Returns true if et successfully phoned home.
|
||||
bool phoneHome(List<String> args) {
|
||||
if (args.length != 2 ||
|
||||
args[0].toLowerCase() != 'phone' ||
|
||||
args[1].toLowerCase() != 'home') {
|
||||
return false;
|
||||
}
|
||||
|
||||
print(r'''
|
||||
.. .. .. ...... :::::::.
|
||||
.:---:.::-=-:::::::::::-=- .-....:----===.
|
||||
--:-==++=-==++*=-- ....:-:--==*+=------+++==+*+
|
||||
.-::-=++*######****#+++==-.:---=-++-+:-:===+*=+%@@:
|
||||
.:--==*****++++=++++**#%#***=:=+=-+++++***+*#*%@@@@@*
|
||||
.--==++++++=++***##*+==+*++****++++--=+++*#%%@@@%##%%%.
|
||||
-----=*++=-+*####**##%##++===---:::-==+**++*+*###%@@@@@#
|
||||
. ..:===++++==**###*#%* -*##%#*++===:::==+*****#+##%@@@@@@@@
|
||||
::---====++=-+*##+-###=-+ .*#*#***+++++++==++++++*%@@%-.*@@@.
|
||||
-==-====+++=-=+#*=-%%%%@*. :***+=+=+*#%##%%%#**#@%%@@%=-*@@%-
|
||||
==========--=++*#*##*##**++**++==++**#%%@@@%@@@%%%###%%%%%%##:
|
||||
-====++--=+=-+*********#**+=*+**+###**###*###%%#%%##**######.
|
||||
.=++++==+****+++**++*+==*#++*#*#**+**+****#%%#%%%#%%%@@@=
|
||||
:==++*+****************##*+***#*#********#%%#%%%%%%#-
|
||||
====++*****#*##*##**#**++##***##**##***#####%%%%*
|
||||
=+=++++*#****#######*+**##**********###%%%%@@@%
|
||||
=+++*+*##*****####*##%@@@@%%####*###%%%##%@#%
|
||||
=+++*+*##%%##%%%%%@%@%**##%%#%%####%@@@@@@%-
|
||||
:++++***###%%%%%%%%@@@@@@@@@@@@@@@@@@@%+: =***#%%#*+=--=:
|
||||
.++++***##%%%@@@@@%+ :+*##%#%%%#+ -+**#**#%%@@@@%*=----
|
||||
:==++++**#%%%%%%%%% -*+****#%@%=
|
||||
-++++++*#%%%@@@@%: +=-+*#@#.
|
||||
.====+**+*#######%# -==:--**
|
||||
:=====++*#%%%%%%%+ =++==++**+:
|
||||
---=+**++*******#+ =**+=++***+**##*
|
||||
:-=====++**#####* +**+*+=+*+**##*+***+.
|
||||
-====++**++****** -+====-+**#*: =%%##**#=
|
||||
-++++***######### :++==**##*#- -#@@@@@%**#=
|
||||
.---+****###%%%%%#*. .+=++*##**%%%%%@@@@@% *#*#*
|
||||
. ..:::-=+**##*##%###****--+===+*##*+*%@@%#%# ***#
|
||||
...::::: . .--====+***#########**=====++***#%%%######*: =@%=
|
||||
....::::.:----::::-----=++**********##==-=++**##%*+*#%###****
|
||||
.::::::::------=-::::--====+=++++++++:-=-=+**#*##*%%###*#*#***
|
||||
:-: ....:-===---------:---===++****- :-=-+****##@@@%%%%##***#*+''');
|
||||
return true;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
// 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.
|
||||
|
||||
import 'package:engine_tool/src/phone_home.dart';
|
||||
import 'package:litetest/litetest.dart';
|
||||
|
||||
void main() {
|
||||
test('can et phone home', () async {
|
||||
final bool emptyResult = phoneHome(List<String>.empty());
|
||||
expect(emptyResult, isFalse);
|
||||
|
||||
final bool buildResult = phoneHome(<String>['build']);
|
||||
expect(buildResult, isFalse);
|
||||
|
||||
final bool phoneHomeResult = phoneHome(<String>['Phone', 'Home']);
|
||||
expect(phoneHomeResult, isTrue);
|
||||
});
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user