This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
upgraded usage of BinaryMessenger #4451
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d0d9362
upgraded usage of BinaryMessenger
gaaclarke 755e897
added script to massage stable channel tests
gaaclarke a5021dd
[url_launcher_web] Regenerate mocks used by integration tests.
ditman 8c69fa1
stuart feedback:
gaaclarke 34980e1
stuart feedback
gaaclarke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,71 @@ | ||
| // 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. | ||
| // | ||
| // stable_conditional.dart | ||
| // | ||
| // Performs simple find and replace operations for conditional compilation | ||
| // before executing stable channel tests. | ||
| // | ||
| // Example input: | ||
| // int main() { | ||
| // // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE | ||
| // printf("hello world\n"); | ||
| // // FLUTTER_STABLE_CONDITIONAL_ELSE | ||
| // // printf("goodbye world\n"); | ||
| // // FLUTTER_STABLE_CONDITIONAL_ENDIF | ||
| // } | ||
| // | ||
| // Example output: | ||
| // int main() { | ||
| // printf("goodbye world\n"); | ||
| // } | ||
|
|
||
| import 'dart:convert' show LineSplitter; | ||
| import 'dart:io' show Directory, FileSystemEntity, File; | ||
|
|
||
| final RegExp _isSourceRegex = | ||
| RegExp(r'\.cc$|\.java$|\.m$\.h$|\.c$|\.swift$|\.kt$'); | ||
| final RegExp _replacer = RegExp( | ||
| r'^\s*// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE(.*?)^\s*// FLUTTER_STABLE_CONDITIONAL_ELSE(.*?)^\s*// FLUTTER_STABLE_CONDITIONAL_ENDIF', | ||
| multiLine: true, | ||
| dotAll: true); | ||
| final RegExp _commentRemover = RegExp(r'^(\s*)\/\/\s*(.*)'); | ||
| const String _newline = '\n'; | ||
|
|
||
| bool _isSourceFile(FileSystemEntity entity) => | ||
| _isSourceRegex.hasMatch(entity.path); | ||
|
|
||
| void _process(FileSystemEntity entity) { | ||
| const LineSplitter splitter = LineSplitter(); | ||
| final String text = File(entity.path).readAsStringSync(); | ||
| String replaced = ''; | ||
| int index = 0; | ||
| for (final RegExpMatch match in _replacer.allMatches(text)) { | ||
| replaced += text.substring(index, match.start); | ||
| for (final String line in splitter.convert(match.group(2)!)) { | ||
| final RegExpMatch? commentRemoverMatch = _commentRemover.firstMatch(line); | ||
| if (commentRemoverMatch != null) { | ||
| replaced += commentRemoverMatch.group(1)! + | ||
| commentRemoverMatch.group(2)! + | ||
| _newline; | ||
| } | ||
| } | ||
| index = match.end; | ||
| } | ||
| if (replaced.isNotEmpty) { | ||
| replaced += text.substring(index, text.length); | ||
| File(entity.path).writeAsStringSync(replaced); | ||
| print('modified: ${entity.path}'); | ||
| } | ||
| } | ||
|
|
||
| void main(List<String> args) { | ||
| final List<String> filesToProcess = <String>[ | ||
| 'packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java', | ||
| 'packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java', | ||
| 'packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java', | ||
| 'packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java', | ||
gaaclarke marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ]; | ||
| filesToProcess.map((String path) => File(path)).forEach(_process); | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.