Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tools/engine_tool/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
49 changes: 49 additions & 0 deletions tools/engine_tool/lib/src/phone_home.dart
Original file line number Diff line number Diff line change
@@ -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;
}
19 changes: 19 additions & 0 deletions tools/engine_tool/test/phone_home_test.dart
Original file line number Diff line number Diff line change
@@ -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);
});
}