From dfed7164a1c8b6d74ffed9872ab1983364c2dfe8 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Wed, 1 May 2024 18:36:30 -0700 Subject: [PATCH] et phone home (flutter/engine#52506) image --- .../flutter/tools/engine_tool/lib/main.dart | 5 ++ .../tools/engine_tool/lib/src/phone_home.dart | 49 +++++++++++++++++++ .../engine_tool/test/phone_home_test.dart | 19 +++++++ 3 files changed, 73 insertions(+) create mode 100644 engine/src/flutter/tools/engine_tool/lib/src/phone_home.dart create mode 100644 engine/src/flutter/tools/engine_tool/test/phone_home_test.dart diff --git a/engine/src/flutter/tools/engine_tool/lib/main.dart b/engine/src/flutter/tools/engine_tool/lib/main.dart index b3aeec72d9b..c615b23600d 100644 --- a/engine/src/flutter/tools/engine_tool/lib/main.dart +++ b/engine/src/flutter/tools/engine_tool/lib/main.dart @@ -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 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'); diff --git a/engine/src/flutter/tools/engine_tool/lib/src/phone_home.dart b/engine/src/flutter/tools/engine_tool/lib/src/phone_home.dart new file mode 100644 index 00000000000..19a68825a06 --- /dev/null +++ b/engine/src/flutter/tools/engine_tool/lib/src/phone_home.dart @@ -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 args) { + if (args.length != 2 || + args[0].toLowerCase() != 'phone' || + args[1].toLowerCase() != 'home') { + return false; + } + + print(r''' + .. .. .. ...... :::::::. + .:---:.::-=-:::::::::::-=- .-....:----===. + --:-==++=-==++*=-- ....:-:--==*+=------+++==+*+ + .-::-=++*######****#+++==-.:---=-++-+:-:===+*=+%@@: + .:--==*****++++=++++**#%#***=:=+=-+++++***+*#*%@@@@@* + .--==++++++=++***##*+==+*++****++++--=+++*#%%@@@%##%%%. + -----=*++=-+*####**##%##++===---:::-==+**++*+*###%@@@@@# + . ..:===++++==**###*#%* -*##%#*++===:::==+*****#+##%@@@@@@@@ + ::---====++=-+*##+-###=-+ .*#*#***+++++++==++++++*%@@%-.*@@@. + -==-====+++=-=+#*=-%%%%@*. :***+=+=+*#%##%%%#**#@%%@@%=-*@@%- + ==========--=++*#*##*##**++**++==++**#%%@@@%@@@%%%###%%%%%%##: + -====++--=+=-+*********#**+=*+**+###**###*###%%#%%##**######. + .=++++==+****+++**++*+==*#++*#*#**+**+****#%%#%%%#%%%@@@= + :==++*+****************##*+***#*#********#%%#%%%%%%#- + ====++*****#*##*##**#**++##***##**##***#####%%%%* + =+=++++*#****#######*+**##**********###%%%%@@@% + =+++*+*##*****####*##%@@@@%%####*###%%%##%@#% + =+++*+*##%%##%%%%%@%@%**##%%#%%####%@@@@@@%- + :++++***###%%%%%%%%@@@@@@@@@@@@@@@@@@@%+: =***#%%#*+=--=: + .++++***##%%%@@@@@%+ :+*##%#%%%#+ -+**#**#%%@@@@%*=---- + :==++++**#%%%%%%%%% -*+****#%@%= + -++++++*#%%%@@@@%: +=-+*#@#. + .====+**+*#######%# -==:--** + :=====++*#%%%%%%%+ =++==++**+: + ---=+**++*******#+ =**+=++***+**##* + :-=====++**#####* +**+*+=+*+**##*+***+. + -====++**++****** -+====-+**#*: =%%##**#= + -++++***######### :++==**##*#- -#@@@@@%**#= + .---+****###%%%%%#*. .+=++*##**%%%%%@@@@@% *#*#* + . ..:::-=+**##*##%###****--+===+*##*+*%@@%#%# ***# + ...::::: . .--====+***#########**=====++***#%%%######*: =@%= +....::::.:----::::-----=++**********##==-=++**##%*+*#%###**** +.::::::::------=-::::--====+=++++++++:-=-=+**#*##*%%###*#*#*** +:-: ....:-===---------:---===++****- :-=-+****##@@@%%%%##***#*+'''); + return true; +} diff --git a/engine/src/flutter/tools/engine_tool/test/phone_home_test.dart b/engine/src/flutter/tools/engine_tool/test/phone_home_test.dart new file mode 100644 index 00000000000..d861de617fc --- /dev/null +++ b/engine/src/flutter/tools/engine_tool/test/phone_home_test.dart @@ -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.empty()); + expect(emptyResult, isFalse); + + final bool buildResult = phoneHome(['build']); + expect(buildResult, isFalse); + + final bool phoneHomeResult = phoneHome(['Phone', 'Home']); + expect(phoneHomeResult, isTrue); + }); +}