Skip to content

Commit

Permalink
cronet_http: require android API level 28 (#1088)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianquinlan committed Dec 21, 2023
1 parent b10f448 commit 26e55c3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/cronet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
- main
- master
paths:
- '.github/workflows/**'
- '.github/workflows/cronet.yaml'
- 'pkgs/cronet_http/**'
- 'pkgs/http_client_conformance_tests/**'
pull_request:
paths:
- '.github/workflows/**'
- '.github/workflows/cronet.yaml'
- 'pkgs/cronet_http/**'
- 'pkgs/http_client_conformance_tests/**'
schedule:
Expand Down Expand Up @@ -58,8 +58,11 @@ jobs:
uses: reactivecircus/android-emulator-runner@v2
if: always() && steps.install.outcome == 'success'
with:
# api-level/minSdkVersion should be help in sync in:
# - .github/workflows/cronet.yml
# - pkgs/cronet_http/android/build.gradle
# - pkgs/cronet_http/example/android/app/build.gradle
api-level: 28
target: ${{ matrix.package == 'cronet_http_embedded' && 'default' || 'playstore' }}
arch: x86_64
target: ${{ matrix.package == 'cronet_http_embedded' && 'google_apis' || 'playstore' }}
profile: pixel
script: cd 'pkgs/${{ matrix.package }}/example' && flutter test --timeout=1200s integration_test/
6 changes: 5 additions & 1 deletion pkgs/cronet_http/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ android {
}

defaultConfig {
minSdkVersion 19
// api-level/minSdkVersion should be help in sync in:
// - .github/workflows/cronet.yml
// - pkgs/cronet_http/android/build.gradle
// - pkgs/cronet_http/example/android/app/build.gradle
minSdkVersion 28

This comment has been minimized.

Copy link
@AlexV525

AlexV525 Dec 22, 2023

Contributor

I found that the cronet should support 21+. https://groups.google.com/a/chromium.org/g/net-dev/c/pzadAPvBjpU

}

defaultConfig {
Expand Down
6 changes: 5 additions & 1 deletion pkgs/cronet_http/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ android {
applicationId "io.flutter.cronet_http_example"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 21
// api-level/minSdkVersion should be help in sync in:
// - .github/workflows/cronet.yml
// - pkgs/cronet_http/android/build.gradle
// - pkgs/cronet_http/example/android/app/build.gradle
minSdkVersion 28
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
9 changes: 5 additions & 4 deletions pkgs/cronet_http/tool/prepare_for_embedded.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
/// 1. Modifying the Gradle build file to reference the embedded Cronet.
/// 2. Modifying the *name* and *description* in `pubspec.yaml`.
/// 3. Replacing `README.md` with `README_EMBEDDED.md`.
/// 4. Change the name of `cronet_http.dart` to `cronet_http_embedded.dart`.
/// 5. Update all the imports from `package:cronet_http/cronet_http.dart` to
/// `package:cronet_http_embedded/cronet_http_embedded.dart`
///
/// After running this script, `flutter pub publish`
/// can be run to update package:cronet_http_embedded.
Expand Down Expand Up @@ -40,8 +43,6 @@ final _cronetVersionUri = Uri.https(
'android/maven2/org/chromium/net/group-index.xml',
);

/// Runs `prepare_for_embedded.dart publish` for publishing,
/// or only the Android dependency will be modified.
void main(List<String> args) async {
if (Directory.current.path.endsWith('tool')) {
_packageDirectory = Directory.current.parent;
Expand All @@ -53,8 +54,8 @@ void main(List<String> args) async {
updateCronetDependency(latestVersion);
updatePubSpec();
updateReadme();
updateLibraryName();
updateImports();
updateEntryPoint();
}

Future<String> _getLatestCronetVersion() async {
Expand Down Expand Up @@ -129,7 +130,7 @@ void updateImports() {
}
}

void updateEntryPoint() {
void updateLibraryName() {
print('Renaming cronet_http.dart to cronet_http_embedded.dart');
File(
'${_packageDirectory.path}/lib/cronet_http.dart',
Expand Down

0 comments on commit 26e55c3

Please sign in to comment.