Skip to content

Commit 59e1b03

Browse files
committed
Merge branch 'master' into implement_zoomEnabled_for_ios_and_android
* master: Implement Android WebView api with pigeon (Java portion) (flutter#4441) [in_app_purchase] Update to the latest pkg:json_serializable (flutter#4434) Implement Android WebView api with pigeon (Dart portion) (flutter#4435) upgraded usage of BinaryMessenger (flutter#4451) [flutter_plugin_tools] Fix pubspec-check on Windows (flutter#4428) Use OpenJDK 11 in CI jobs (flutter#4419) [google_sign_in] remove the commented out code in tests (flutter#4442)
2 parents 024397a + 42364e4 commit 59e1b03

File tree

77 files changed

+8738
-929
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+8738
-929
lines changed

.ci/Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ FROM cirrusci/flutter:2.2.2
55

66
RUN apt-get update -y
77

8-
# Required by Roboeletric and the Android SDK.
9-
RUN apt-get install -y openjdk-8-jdk
10-
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
11-
128
RUN apt-get install -y --no-install-recommends gnupg
139

1410
# Add repo for gcloud sdk and install it

.cirrus.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ task:
197197
- export CIRRUS_CHANGE_MESSAGE=""
198198
- export CIRRUS_COMMIT_MESSAGE=""
199199
- ./script/tool_runner.sh lint-android # must come after build-examples
200+
stable_channel_conditional_script:
201+
- if [[ "$CHANNEL" == "stable" ]]; then
202+
- dart ./ci/stable_conditional.dart
203+
- fi
200204
native_unit_test_script:
201205
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
202206
# might include non-ASCII characters which makes Gradle crash.

ci/stable_conditional.dart

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
//
5+
// stable_conditional.dart
6+
//
7+
// Performs simple find and replace operations for conditional compilation
8+
// before executing stable channel tests.
9+
//
10+
// Example input:
11+
// int main() {
12+
// // FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
13+
// printf("hello world\n");
14+
// // FLUTTER_STABLE_CONDITIONAL_ELSE
15+
// // printf("goodbye world\n");
16+
// // FLUTTER_STABLE_CONDITIONAL_ENDIF
17+
// }
18+
//
19+
// Example output:
20+
// int main() {
21+
// printf("goodbye world\n");
22+
// }
23+
24+
import 'dart:convert' show LineSplitter;
25+
import 'dart:io' show FileSystemEntity, File;
26+
27+
final List<String> _filesToProcess = <String>[
28+
'packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java',
29+
'packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java',
30+
'packages/quick_actions/quick_actions/android/src/test/java/io/flutter/plugins/quickactions/QuickActionsTest.java',
31+
'packages/url_launcher/url_launcher/android/src/test/java/io/flutter/plugins/urllauncher/MethodCallHandlerImplTest.java',
32+
];
33+
34+
final RegExp _replacer = RegExp(
35+
r'^\s*// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE(.*?)^\s*// FLUTTER_STABLE_CONDITIONAL_ELSE(.*?)^\s*// FLUTTER_STABLE_CONDITIONAL_ENDIF',
36+
multiLine: true,
37+
dotAll: true);
38+
final RegExp _commentRemover = RegExp(r'^(\s*)\/\/\s*(.*)');
39+
const String _newline = '\n';
40+
41+
void _process(FileSystemEntity entity) {
42+
const LineSplitter splitter = LineSplitter();
43+
final String text = File(entity.path).readAsStringSync();
44+
String replaced = '';
45+
int index = 0;
46+
for (final RegExpMatch match in _replacer.allMatches(text)) {
47+
replaced += text.substring(index, match.start);
48+
for (final String line in splitter.convert(match.group(2)!)) {
49+
final RegExpMatch? commentRemoverMatch = _commentRemover.firstMatch(line);
50+
if (commentRemoverMatch != null) {
51+
replaced += commentRemoverMatch.group(1)! +
52+
commentRemoverMatch.group(2)! +
53+
_newline;
54+
}
55+
}
56+
index = match.end;
57+
}
58+
if (replaced.isNotEmpty) {
59+
replaced += text.substring(index, text.length);
60+
File(entity.path).writeAsStringSync(replaced);
61+
print('modified: ${entity.path}');
62+
}
63+
}
64+
65+
void main(List<String> args) {
66+
_filesToProcess.map((String path) => File(path)).forEach(_process);
67+
}

packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ public void startListening_registersChannel() {
5555
methodCallHandler.startListening(messenger);
5656

5757
verify(messenger, times(1))
58-
.setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class));
58+
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
59+
.setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null));
60+
// FLUTTER_STABLE_CONDITIONAL_ELSE
61+
// .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class));
62+
// FLUTTER_STABLE_CONDITIONAL_ENDIF
5963
}
6064

6165
@Test
@@ -67,9 +71,15 @@ public void startListening_unregistersExistingChannel() {
6771
methodCallHandler.startListening(secondMessenger);
6872

6973
// Unregisters the first and then registers the second.
70-
verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null);
74+
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
75+
verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null);
7176
verify(secondMessenger, times(1))
72-
.setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class));
77+
.setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null));
78+
// FLUTTER_STABLE_CONDITIONAL_ELSE
79+
// verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null);
80+
// verify(secondMessenger, times(1))
81+
// .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class));
82+
// FLUTTER_STABLE_CONDITIONAL_ENDIF
7383
}
7484

7585
@Test
@@ -79,7 +89,11 @@ public void stopListening_unregistersExistingChannel() {
7989

8090
methodCallHandler.stopListening();
8191

82-
verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null);
92+
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
93+
verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null);
94+
// FLUTTER_STABLE_CONDITIONAL_ELSE
95+
// verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null);
96+
// FLUTTER_STABLE_CONDITIONAL_ENDIF
8397
}
8498

8599
@Test
@@ -88,7 +102,11 @@ public void stopListening_doesNothingWhenUnset() {
88102

89103
methodCallHandler.stopListening();
90104

91-
verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null);
105+
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
106+
verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null, null);
107+
// FLUTTER_STABLE_CONDITIONAL_ELSE
108+
// verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null);
109+
// FLUTTER_STABLE_CONDITIONAL_ENDIF
92110
}
93111

94112
@Test

packages/camera/camera/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import android.os.Handler;
1414
import androidx.annotation.NonNull;
15+
import androidx.annotation.Nullable;
1516
import io.flutter.embedding.engine.systemchannels.PlatformChannel;
1617
import io.flutter.plugin.common.BinaryMessenger;
1718
import io.flutter.plugin.common.MethodCall;
@@ -31,6 +32,15 @@ public class DartMessengerTest {
3132
private static class FakeBinaryMessenger implements BinaryMessenger {
3233
private final List<ByteBuffer> sentMessages = new ArrayList<>();
3334

35+
// TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on stable.
36+
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
37+
@Override
38+
public BinaryMessenger.TaskQueue makeBackgroundTaskQueue() {
39+
return null;
40+
}
41+
// FLUTTER_STABLE_CONDITIONAL_ELSE
42+
// FLUTTER_STABLE_CONDITIONAL_ENDIF
43+
3444
@Override
3545
public void send(@NonNull String channel, ByteBuffer message) {
3646
sentMessages.add(message);
@@ -41,8 +51,17 @@ public void send(@NonNull String channel, ByteBuffer message, BinaryReply callba
4151
send(channel, message);
4252
}
4353

54+
// TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on stable.
55+
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
4456
@Override
45-
public void setMessageHandler(@NonNull String channel, BinaryMessageHandler handler) {}
57+
public void setMessageHandler(
58+
@NonNull String channel,
59+
BinaryMessageHandler handler,
60+
@Nullable BinaryMessenger.TaskQueue taskQueue) {}
61+
// FLUTTER_STABLE_CONDITIONAL_ELSE
62+
// @Override
63+
// public void setMessageHandler(@NonNull String channel, BinaryMessageHandler handler) {}
64+
// FLUTTER_STABLE_CONDITIONAL_ENDIF
4665

4766
List<ByteBuffer> getMessages() {
4867
return new ArrayList<>(sentMessages);

packages/connectivity/connectivity/example/android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ flutter {
5252
}
5353

5454
dependencies {
55-
testImplementation 'junit:junit:4.12'
55+
testImplementation 'junit:junit:4.13'
56+
testImplementation 'org.robolectric:robolectric:4.4'
57+
testImplementation 'org.mockito:mockito-core:3.5.13'
5658
androidTestImplementation 'androidx.test:runner:1.1.1'
5759
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
58-
testImplementation 'org.robolectric:robolectric:3.8'
59-
testImplementation 'org.mockito:mockito-core:3.5.13'
6060
}

packages/connectivity/connectivity/example/android/app/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/connectivity/connectivity/example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
}
66

77
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.5.0'
8+
classpath 'com.android.tools.build:gradle:7.0.1'
99
}
1010
}
1111

packages/connectivity/connectivity/example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip

packages/google_sign_in/google_sign_in/test/google_sign_in_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,6 @@ void main() {
351351

352352
expect(auth.accessToken, '456');
353353
expect(auth.idToken, '123');
354-
// fix deprecated_member_use_from_same_package
355-
// expect(auth.serverAuthCode, '789');
356354
expect(
357355
log,
358356
<Matcher>[

packages/in_app_purchase/in_app_purchase/build.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
## 0.1.6
2+
3+
* Require Dart SDK >= 2.14.
4+
* Update `json_annotation` dependency to `^4.3.0`.
5+
16
## 0.1.5+1
27

38
* Fix a broken link in the README.
9+
410
## 0.1.5
511

612
* Introduced the `SkuDetailsWrapper.introductoryPriceAmountMicros` field of the correct type (`int`) and deprecated the `SkuDetailsWrapper.introductoryPriceMicros` field.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
# See https://pub.dev/packages/build_config
12
targets:
23
$default:
34
builders:
45
json_serializable:
56
options:
67
any_map: true
7-
create_to_json: true
8+
create_to_json: false

0 commit comments

Comments
 (0)