-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix configuration directory issue. (#1346)
- Loading branch information
Showing
7 changed files
with
102 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
/// Removes intermittent messages that may be mixed with regular Flutter output. | ||
String stripIntermittentFlutterMessages(String content) { | ||
// filter for concurrent flutter execution | ||
final waitingForString = 'Waiting for another flutter'; | ||
if (content.contains(waitingForString)) { | ||
content = content | ||
.split('\n') | ||
.where((e) => !e.contains(waitingForString)) | ||
.join('\n'); | ||
} | ||
// filter for welcome screen | ||
if (content.contains('Welcome to Flutter!')) { | ||
final lines = content.split('\n'); | ||
final separator = lines.indexWhere((l) => l.trim().isEmpty); | ||
if (separator >= 0) { | ||
content = lines.take(separator).join('\n'); | ||
} | ||
} | ||
return content; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'dart:convert'; | ||
|
||
import 'package:pana/src/tool/flutter_tool.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
group('Intermittent messages', () { | ||
final jsonOutput = | ||
const JsonEncoder.withIndent(' ').convert({'key': 'value'}); | ||
|
||
test('unchanged text', () { | ||
expect(stripIntermittentFlutterMessages(jsonOutput), jsonOutput); | ||
}); | ||
|
||
test('waiting for another process', () { | ||
expect( | ||
stripIntermittentFlutterMessages( | ||
'Waiting for another flutter process to complete.\n$jsonOutput'), | ||
jsonOutput, | ||
); | ||
}); | ||
|
||
test('welcome screen', () { | ||
expect( | ||
stripIntermittentFlutterMessages( | ||
'$jsonOutput\n\n$_welcomeScreenOutput'), | ||
jsonOutput, | ||
); | ||
}); | ||
}); | ||
} | ||
|
||
final _welcomeScreenOutput = | ||
''' ╔════════════════════════════════════════════════════════════════════════════╗ | ||
║ Welcome to Flutter! - https://flutter.dev ║ | ||
║ ║ | ||
║ The Flutter tool uses Google Analytics to anonymously report feature usage ║ | ||
║ statistics and basic crash reports. This data is used to help improve ║ | ||
║ Flutter tools over time. ║ | ||
║ ║ | ||
║ Flutter tool analytics are not sent on the very first run. To disable ║ | ||
║ reporting, type 'flutter config --no-analytics'. To display the current ║ | ||
║ setting, type 'flutter config'. If you opt out of analytics, an opt-out ║ | ||
║ event will be sent, and then no further information will be sent by the ║ | ||
║ Flutter tool. ║ | ||
║ ║ | ||
║ By downloading the Flutter SDK, you agree to the Google Terms of Service. ║ | ||
║ The Google Privacy Policy describes how data is handled in this service. ║ | ||
║ ║ | ||
║ Moreover, Flutter includes the Dart SDK, which may send usage metrics and ║ | ||
║ crash reports to Google. ║ | ||
║ ║ | ||
║ Read about data we send with crash reports: ║ | ||
║ https://flutter.dev/docs/reference/crash-reporting ║ | ||
║ ║ | ||
║ See Google's privacy policy: ║ | ||
║ https://policies.google.com/privacy ║ | ||
║ ║ | ||
║ To disable animations in this tool, use ║ | ||
║ 'flutter config --no-cli-animations'. ║ | ||
╚════════════════════════════════════════════════════════════════════════════╝ | ||
'''; |