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

[infra] Use Pub Workspaces #1884

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e2d528f
Added ffi to workspace
Levi-Lesches Jan 12, 2025
935a52c
Added ffigen to workspace
Levi-Lesches Jan 12, 2025
4abff69
Added jni to workspace (FAILED)
Levi-Lesches Jan 12, 2025
58df689
Fixed jni issues
Levi-Lesches Jan 13, 2025
6d1fb6b
Fixed issues in ffigen
Levi-Lesches Jan 13, 2025
2998552
Added jnigen to workspace
Levi-Lesches Jan 13, 2025
fefc30f
Added native_assets_builder to the workspace
Levi-Lesches Jan 13, 2025
349c05c
Fixed issues with native_assets_builder/test_data/*
Levi-Lesches Jan 13, 2025
aad35e2
Fix lints
Levi-Lesches Jan 13, 2025
d512ee2
Fixed issues in native_assets_cli
Levi-Lesches Jan 13, 2025
c6069a0
Added objective_c to the workspace
Levi-Lesches Jan 13, 2025
7394804
Added swift2objc ot the workspace
Levi-Lesches Jan 13, 2025
c1ec515
Added swiftgen to the workspace
Levi-Lesches Jan 13, 2025
eaf70d0
Bumped publish CI to stable channel (from dev)
Levi-Lesches Jan 13, 2025
234310e
Added ffi and ffigen to workspace analysis_options.yaml
Levi-Lesches Jan 13, 2025
04efe21
Added jni to analysis_options.yaml and fixed lints
Levi-Lesches Jan 13, 2025
0285b9a
Added jnigen to analysis_options.yaml and fixed lints
Levi-Lesches Jan 13, 2025
4c21c13
Added native_assets_builder to analysis_options.yaml
Levi-Lesches Jan 13, 2025
2cdbf2c
Added native_assets_cli to analysis_options.yaml
Levi-Lesches Jan 13, 2025
788f876
Added native_toolchain_c and objective_c to analysis_options
Levi-Lesches Jan 13, 2025
b0d1609
Added swift2objc to analysis_options and fixed lints
Levi-Lesches Jan 13, 2025
29536dc
Added swiftgen to analysis_options
Levi-Lesches Jan 13, 2025
4f0391a
Formatted and fixed lints
Levi-Lesches Jan 13, 2025
1e939dd
Added all native_assets_builder/test_data to workspace
Levi-Lesches Jan 13, 2025
e449145
Revert "Added all native_assets_builder/test_data to workspace"
Levi-Lesches Jan 13, 2025
466625f
Fixed wrong_linker name
Levi-Lesches Jan 13, 2025
b69058e
Fixed fail_on_os_sdk_version_link name
Levi-Lesches Jan 13, 2025
92c57ac
Fixed native_add_source name
Levi-Lesches Jan 13, 2025
27286a9
Fixed native_add_version_skew name
Levi-Lesches Jan 13, 2025
bad52ba
Added all test_data to the workspace (not version_skew)
Levi-Lesches Jan 13, 2025
815671e
Updated CI to use Flutter and dev -> beta channel
Levi-Lesches Jan 13, 2025
ca1602f
CI: Replaced beta -> main channel
Levi-Lesches Jan 14, 2025
33640fa
Reworked native_assets_builder test helpers to remove workspace
Levi-Lesches Jan 14, 2025
58f28cd
Fixed more CI checks
Levi-Lesches Jan 14, 2025
f389a65
Removed extra pub gets from CI
Levi-Lesches Jan 14, 2025
bc7ec72
Added native_assets_cli/example/* to workspace
Levi-Lesches Jan 15, 2025
29c6eea
Added ffigen/example/* to the workspace
Levi-Lesches Jan 15, 2025
fbe5cd4
Merge branch 'main' into workspaces
Levi-Lesches Jan 15, 2025
b3f91b2
Merged main branch
Levi-Lesches Jan 15, 2025
e7e5adb
Bumped versions and added Dart 3.6 to changelogs
Levi-Lesches Jan 15, 2025
c4fe35c
Fix some more CIs
Levi-Lesches Jan 15, 2025
a2f412a
Fix even more CI
Levi-Lesches Jan 15, 2025
1d86663
Fix package:jni ffigen issues
HosseinYousefi Jan 21, 2025
bf5d11c
Merged main
Levi-Lesches Jan 21, 2025
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
Prev Previous commit
Next Next commit
Fixed jni issues
  • Loading branch information
Levi-Lesches committed Jan 13, 2025
commit 58df689a1ceb0870026509dec247816fa3eb1fe7
2 changes: 1 addition & 1 deletion pkgs/ffi/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ environment:

resolution: workspace
dev_dependencies:
dart_flutter_team_lints: ^2.0.0
dart_flutter_team_lints: ^3.2.0
test: ^1.21.2
2 changes: 1 addition & 1 deletion pkgs/ffigen/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies:
dev_dependencies:
async: ^2.11.0
coverage: ^1.11.0
dart_flutter_team_lints: ^2.0.0
dart_flutter_team_lints: ^3.2.0
json_schema: ^5.1.1
leak_tracker: ^10.0.7
objective_c: ^4.1.0
Expand Down
2 changes: 1 addition & 1 deletion pkgs/jni/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies:
dev_dependencies:
dart_flutter_team_lints: ^3.2.0
## Pin ffigen version because we are depending on internal APIs.
ffigen: 8.0.2
ffigen: ^16.0.0
logging: ^1.2.0
test: ^1.25.8

Expand Down
7 changes: 4 additions & 3 deletions pkgs/jni/tool/generate_ffi_bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'dart:io';

import 'package:args/args.dart';
import 'package:ffigen/ffigen.dart' as ffigen;
import 'package:ffigen/src/header_parser.dart' as ffigen;
import 'package:logging/logging.dart';

import 'wrapper_generators/generate_c_extensions.dart';
Expand Down Expand Up @@ -51,15 +52,15 @@ void main(List<String> args) {
});

logger.info('Generating C wrappers');
final minimalConfig = ffigen.Config.fromFile(File('ffigen_exts.yaml'));
final minimalConfig = ffigen.YamlConfig.fromFile(File('ffigen_exts.yaml'));
final minimalLibrary = ffigen.parse(minimalConfig);
generateCWrappers(minimalLibrary);

logger.info('Generating FFI bindings for package:jni');

final config = ffigen.Config.fromFile(File('ffigen.yaml'));
final config = ffigen.YamlConfig.fromFile(File('ffigen.yaml'));
final library = ffigen.parse(config);
final outputFile = File(config.output);
final outputFile = File(config.output.toFilePath());
library.generateFile(outputFile);

logger.info('Generating Dart extensions');
Expand Down
4 changes: 4 additions & 0 deletions pkgs/jni/tool/wrapper_generators/ffigen_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ final dummyWriter = Writer(
lookUpBindings: [],
ffiNativeBindings: [],
noLookUpBindings: [],
nativeEntryPoints: [],
className: 'unused',
silenceEnumWarning: true,
generateForPackageObjectiveC: false,
nativeAssetId: null,
);

/// Find compound having [name] in [library].
Expand Down
4 changes: 2 additions & 2 deletions pkgs/jni/tool/wrapper_generators/generate_c_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ String getWrapperFuncName(String name) {
}

// Returns declaration of function field in GlobalJniEnv struct
String getFunctionFieldDecl(Member field, {required bool isField}) {
String getFunctionFieldDecl(CompoundMember field, {required bool isField}) {
final fieldType = field.type;
if (fieldType is PointerType && fieldType.child is NativeFunc) {
final nativeFunc = fieldType.child as NativeFunc;
Expand Down Expand Up @@ -226,7 +226,7 @@ const _noCheckException = {
'ExceptionDescribe',
};

String? getWrapperFunc(Member field) {
String? getWrapperFunc(CompoundMember field) {
final fieldType = field.type;
if (fieldType is PointerType && fieldType.child is NativeFunc) {
final functionType = (fieldType.child as NativeFunc).type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ String getCheckedGetter(Type returnType) {
}

String? getGlobalEnvExtensionFunction(
Member field,
CompoundMember field,
Type? checkedReturnType, {
required bool isLeaf,
}) {
Expand Down Expand Up @@ -276,7 +276,7 @@ class GlobalJniEnv {
}

String? getFunctionPointerExtensionFunction(
Member field, {
CompoundMember field, {
bool indirect = false,
bool implicitThis = false,
required bool isLeaf,
Expand Down