Skip to content

Commit cd92c20

Browse files
authored
Upgrade to jni/jnigen 0.15.x (#1851)
1 parent e4558df commit cd92c20

File tree

5 files changed

+525
-438
lines changed

5 files changed

+525
-438
lines changed

.github/workflows/cronet.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,43 @@ env:
2121
PUB_ENVIRONMENT: bot.github
2222

2323
jobs:
24+
generate:
25+
name: jnigen
26+
runs-on: ubuntu-latest
27+
defaults:
28+
run:
29+
working-directory: pkgs/cronet_http
30+
steps:
31+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
32+
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165
33+
with:
34+
distribution: 'zulu'
35+
java-version: '17'
36+
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
37+
with:
38+
channel: 'stable'
39+
- id: install
40+
name: Install dependencies
41+
run: flutter pub get
42+
- name: Build APK
43+
run: cd example && flutter build apk && cd ..
44+
- name: Upgrade
45+
# Set this to `true` if you are using this workflow to regenerate the jni
46+
# bindings.
47+
if: false
48+
run: dart pub upgrade --major-versions jnigen jni
49+
- name: Regenerate
50+
run: dart run jnigen --config jnigen.yaml
51+
- name: Generated Diff
52+
id: diff
53+
run: git diff --exit-code lib/src/jni/jni_bindings.dart
54+
- name: Upload bindings
55+
if: failure()
56+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
57+
with:
58+
name: JNI Bindings
59+
path: pkgs/cronet_http/lib/src/jni/jni_bindings.dart
60+
retention-days: 1
2461
verify:
2562
name: Format & Analyze & Test (${{ matrix.cronetHttpNoPlay == 'true' && 'without Google Play' || 'with Google Play'}})
2663
runs-on: ubuntu-cpu16-ram64

pkgs/cronet_http/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## 1.6.1-wip
1+
## 1.7.0-wip
22

33
* Fix a bug where cronet would throw `ClassNotFoundException` in debug mode.
4+
* Upgrade `package:jni` to 0.15.2 and `package:jnigen` to 0.15.0.
45

56
## 1.6.0
67

pkgs/cronet_http/lib/src/cronet_client.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ class CronetEngine {
125125
bool? enableQuic,
126126
String? storagePath,
127127
String? userAgent}) {
128-
final builder = jb.CronetEngine$Builder(
129-
JObject.fromReference(Jni.getCachedApplicationContext()));
128+
final builder = jb.CronetEngine$Builder(Jni.androidApplicationContext);
130129

131130
try {
132131
if (storagePath != null) {

0 commit comments

Comments
 (0)