Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cronet_http: require android API level 28 #1088

Merged
merged 8 commits into from
Dec 21, 2023
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
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
}

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