Skip to content

Commit 77887a5

Browse files
committed
⬇️ Downgrade minSdkVersion to 21
1 parent 473a892 commit 77887a5

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

.github/workflows/cronet.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ jobs:
5858
uses: reactivecircus/android-emulator-runner@v2
5959
if: always() && steps.install.outcome == 'success'
6060
with:
61-
# api-level/minSdkVersion should be help in sync in:
62-
# - .github/workflows/cronet.yml
63-
# - pkgs/cronet_http/android/build.gradle
64-
# - pkgs/cronet_http/example/android/app/build.gradle
6561
api-level: 28
6662
target: ${{ matrix.package == 'cronet_http_embedded' && 'google_apis' || 'playstore' }}
6763
profile: pixel

pkgs/cronet_http/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.1-wip
2+
3+
* Support Android API 21+.
4+
15
## 1.0.0
26

37
* No functional changes.

pkgs/cronet_http/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ android {
5050
// - .github/workflows/cronet.yml
5151
// - pkgs/cronet_http/android/build.gradle
5252
// - pkgs/cronet_http/example/android/app/build.gradle
53-
minSdkVersion 28
53+
minSdkVersion 21
5454
}
5555

5656
defaultConfig {

pkgs/cronet_http/example/android/app/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@ android {
4444

4545
defaultConfig {
4646
applicationId "io.flutter.cronet_http_example"
47-
// You can update the following values to match your application needs.
48-
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
4947
// api-level/minSdkVersion should be help in sync in:
5048
// - .github/workflows/cronet.yml
5149
// - pkgs/cronet_http/android/build.gradle
5250
// - pkgs/cronet_http/example/android/app/build.gradle
53-
minSdkVersion 28
51+
minSdkVersion 21
5452
targetSdkVersion flutter.targetSdkVersion
5553
versionCode flutterVersionCode.toInteger()
5654
versionName flutterVersionName

pkgs/cronet_http/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: cronet_http
2-
version: 1.0.0
2+
version: 1.0.1-wip
33
description: >-
44
An Android Flutter plugin that provides access to the Cronet HTTP client.
55
repository: https://github.com/dart-lang/http/tree/master/pkgs/cronet_http

pkgs/cronet_http/tool/prepare_for_embedded.dart

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import 'package:http/http.dart' as http;
2929
import 'package:xml/xml.dart';
3030
import 'package:yaml_edit/yaml_edit.dart';
3131

32+
late final String _scriptName;
3233
late final Directory _packageDirectory;
3334

3435
const _gmsDependencyName = 'com.google.android.gms:play-services-cronet';
@@ -52,12 +53,14 @@ final implementationRegExp = RegExp(
5253
);
5354

5455
void main(List<String> args) async {
55-
if (Directory.current.path.endsWith('tool')) {
56-
_packageDirectory = Directory.current.parent;
57-
} else {
58-
_packageDirectory = Directory.current;
59-
}
60-
56+
final script = Platform.script.toFilePath();
57+
_scriptName = script.split(Platform.pathSeparator).last;
58+
_packageDirectory = Directory(
59+
Uri.directory(
60+
'${script.replaceAll(_scriptName, '')}'
61+
'..${Platform.pathSeparator}',
62+
).toFilePath(),
63+
);
6164
final latestVersion = await _getLatestCronetVersion();
6265
updateBuildGradle(latestVersion);
6366
updateExampleBuildGradle();
@@ -137,7 +140,9 @@ void updateReadme() {
137140
void updateImports() {
138141
print('Updating imports in Dart files');
139142
for (final file in _packageDirectory.listSync(recursive: true)) {
140-
if (file is File && file.path.endsWith('.dart')) {
143+
if (file is File &&
144+
file.path.endsWith('.dart') &&
145+
!file.path.contains(_scriptName)) {
141146
final updatedSource = file.readAsStringSync().replaceAll(
142147
'package:cronet_http/cronet_http.dart',
143148
'package:cronet_http_embedded/cronet_http_embedded.dart',

0 commit comments

Comments
 (0)