-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[jnigen] Remove C-based bindings (#1091)
- Loading branch information
1 parent
0f41ebb
commit 2393cca
Showing
96 changed files
with
4,672 additions
and
28,509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
pkgs/jnigen/android_test_runner/integration_test/runtime_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Generated file. Do not edit or check-in to version control. | ||
|
||
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import "package:flutter_test/flutter_test.dart"; | ||
|
||
import "../../test/jackson_core_test/runtime_test_registrant.dart" | ||
as jackson_core_test; | ||
import "../../test/simple_package_test/runtime_test_registrant.dart" | ||
as simple_package_test; | ||
import "../../test/kotlin_test/runtime_test_registrant.dart" as kotlin_test; | ||
|
||
typedef TestCaseCallback = void Function(); | ||
|
||
void test(String description, TestCaseCallback testCase) { | ||
testWidgets(description, (widgetTester) async => testCase()); | ||
} | ||
|
||
void main() { | ||
jackson_core_test.registerTests("jackson_core_test", test); | ||
simple_package_test.registerTests("simple_package_test", test); | ||
kotlin_test.registerTests("kotlin_test", test); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
# In-App Java Example | ||
|
||
This example shows how to write custom java code in `android/app/src` and call it using `jnigen` generated bindings. | ||
This example shows how to write custom java code in `android/app/src` and call | ||
it using `jnigen` generated bindings. | ||
|
||
#### How to run this example: | ||
* Run `flutter run` to run the app. | ||
|
||
* To regenerate bindings after changing Java code, run `flutter pub run jnigen --config jnigen.yaml`. This requires at least one APK build to have been run before, so that it's possible for `jnigen` to obtain classpaths of Android Gradle libraries. Therefore, once run `flutter build apk` before generating bindings for the first time, or after a `flutter clean`. | ||
- Run `flutter run` to run the app. | ||
|
||
#### General steps | ||
These are general steps to integrate Java code into a flutter project using `jnigen`. | ||
|
||
* Write Java code in suitable package folder, under `android/` subproject of the flutter app. | ||
|
||
* Create A jnigen config like `jnigen.yaml` in this example. | ||
- To regenerate bindings after changing Java code, run | ||
`flutter pub run jnigen --config jnigen.yaml`. This requires at least one APK | ||
build to have been run before, so that it's possible for `jnigen` to obtain | ||
classpaths of Android Gradle libraries. Therefore, once run | ||
`flutter build apk` before generating bindings for the first time, or after a | ||
`flutter clean`. | ||
|
||
* Generate bindings using jnigen config. | ||
|
||
* Add an `externalNativeBuild` to gradle script (see `android/app/build.gradle` in this example). | ||
|
||
* Add proguard rules to exclude your custom classes from tree shaking, since they are always accessed reflectively in JNI. | ||
#### General steps | ||
|
||
* Build and run the app. | ||
These are general steps to integrate Java code into a flutter project using | ||
`jnigen`. | ||
|
||
- Write Java code in suitable package folder, under `android/` subproject of the | ||
flutter app. | ||
- Create A jnigen config like `jnigen.yaml` in this example. | ||
- Generate bindings using jnigen config. | ||
- Add proguard rules to exclude your custom classes from tree shaking, since | ||
they are always accessed reflectively in JNI. | ||
- Build and run the app. |
Oops, something went wrong.