Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
2a9cb77
WIP: Migrating package:objective_c to native_assets
liamappelbe May 8, 2025
e7a73d6
trying to migrate ffigen
liamappelbe May 8, 2025
79a93fe
revert example changes
liamappelbe May 26, 2025
a9fe416
wip
liamappelbe May 26, 2025
4bb4a27
Merge branch 'main' into objc_native
liamappelbe May 26, 2025
665c57e
merge cruft
liamappelbe May 26, 2025
e4e60b8
Merge branch 'main' into objc_native
liamappelbe Jun 12, 2025
fb4f2d5
merge cruft
liamappelbe Jun 12, 2025
3a10246
Merge branch 'main' into objc_native
liamappelbe Jun 12, 2025
32a78c2
merge cruft
liamappelbe Jun 12, 2025
c1fd221
fixes
liamappelbe Jun 13, 2025
309820c
Merge branch 'main' into objc_native
liamappelbe Jun 18, 2025
d56aa6a
fmt
liamappelbe Jun 18, 2025
e197d81
Remove flutter deps
liamappelbe Jun 18, 2025
763703a
Fix example
liamappelbe Jun 18, 2025
623740a
use dev sdk in workflows
liamappelbe Jun 18, 2025
072d9ef
fix analysis
liamappelbe Jun 18, 2025
6dc4b8a
fix workflow
liamappelbe Jun 18, 2025
d1b7313
workflow
liamappelbe Jun 18, 2025
db35a69
fix workflow
liamappelbe Jun 18, 2025
42ca198
Fix linux and mac builds
liamappelbe Jun 18, 2025
9fb56d1
cleanup
liamappelbe Jun 23, 2025
3e6b920
another code split
liamappelbe Jun 27, 2025
57f5cfe
Merge branch 'main' into objc_native
liamappelbe Jul 2, 2025
c16de8c
Fix generation bug
liamappelbe Jul 2, 2025
73a9009
Revert code split
liamappelbe Jul 2, 2025
edbee93
Fix issues with exported globals
liamappelbe Jul 2, 2025
9a7a648
Merge branch 'main' into objc_native_2
liamappelbe Nov 6, 2025
3cad1fa
Merge cruft
liamappelbe Nov 6, 2025
ededf4a
fix analysis
liamappelbe Nov 6, 2025
2e92574
Update version
liamappelbe Nov 6, 2025
ca16b77
fix deps
liamappelbe Nov 6, 2025
13da29f
fix tests
liamappelbe Nov 6, 2025
e7afa6e
fix swiftgen
liamappelbe Nov 6, 2025
857e5cb
fix more tests
liamappelbe Nov 6, 2025
dd9330c
fix swiftgen
liamappelbe Nov 6, 2025
0cf8052
fix swiftgen
liamappelbe Nov 6, 2025
5811044
Merge branch 'main' into objc_native
liamappelbe Nov 7, 2025
c69e2f2
Remove temp etc
liamappelbe Nov 7, 2025
709f80b
Merge branch 'main' into objc_native
liamappelbe Nov 11, 2025
9a97e4c
delete temp
liamappelbe Nov 11, 2025
dc42bec
delete temp
liamappelbe Nov 11, 2025
b0c6a85
Fix swift2objc test
liamappelbe Nov 11, 2025
a30eba1
fix swiftgen
liamappelbe Nov 11, 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
30 changes: 15 additions & 15 deletions .github/workflows/ffigen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
with:
channel: 'stable'
channel: master
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be beta?
Or do you intend to wait to merge this PR until the next stable is out, and merge it as stable?

Maybe add a todo to flip it back to stable as soon as the next stable is released.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is a temporary change so I can test on CI. I'll wait for stable and revert these changes before landing.

- id: install
name: Install dependencies
run: flutter pub get && flutter pub get --directory="example/shared_bindings" && flutter pub get --directory="../objective_c" && flutter pub get --directory="example/add"
run: dart pub get && dart pub get --directory="example/shared_bindings" && dart pub get --directory="../objective_c" && dart pub get --directory="example/add"
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- name: Build test dylib and bindings
run: dart --enable-asserts test/setup.dart
- name: Analyze code
run: flutter analyze --fatal-infos
run: dart analyze --fatal-infos

test-linux:
needs: analyze
Expand All @@ -56,9 +56,9 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
with:
channel: 'stable'
channel: master
- name: Install dependencies
run: flutter pub get && flutter pub get --directory="../jni"
run: dart pub get && flutter pub get --directory="../jni"
- name: Install libclang-14-dev
run: sudo apt-get install libclang-14-dev
- name: Build test dylib and bindings
Expand All @@ -80,9 +80,9 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
with:
channel: stable
channel: master
- name: Install dependencies
run: flutter pub get && flutter pub get --directory="../objective_c" && flutter pub get --directory="../jni"
run: dart pub get && dart pub get --directory="../objective_c" && flutter pub get --directory="../jni"
- name: Install clang-format
uses: ConorMacBride/install-package@3e7ad059e07782ee54fa35f827df52aae0626f30
with:
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
with:
channel: master
- name: Install dependencies
run: flutter pub get && flutter pub get --directory="../objective_c" && flutter pub get --directory="../jni"
run: dart pub get && dart pub get --directory="../objective_c" && flutter pub get --directory="../jni"
- name: Install clang-format
uses: ConorMacBride/install-package@3e7ad059e07782ee54fa35f827df52aae0626f30
with:
Expand All @@ -142,13 +142,13 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
with:
channel: 'stable'
channel: master
- name: Install dependencies
run: flutter pub get && flutter pub get --directory="../objective_c"
run: dart pub get && dart pub get --directory="../objective_c"
- name: Build test dylib and bindings
run: dart --enable-asserts test/setup.dart --main-thread-dispatcher
run: dart --enable-asserts test/setup.dart
- name: Run Flutter tests
run: flutter test
run: dart test

test-windows:
needs: analyze
Expand All @@ -160,9 +160,9 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
with:
channel: 'stable'
channel: master
- name: Install dependencies
run: flutter pub get && flutter pub get --directory="../jni"
run: dart pub get && flutter pub get --directory="../jni"
- name: Build test dylib and bindings
run: dart --enable-asserts test/setup.dart
- name: Run VM tests
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
with:
channel: "master"
channel: master
- name: Install dependencies
run: flutter pub get
- name: Build test dylib and bindings
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ffigen_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
with:
channel: 'stable'
channel: master
- name: Install dependencies
run: flutter pub get && flutter pub get --directory="../objective_c" && flutter pub get --directory="../jni"
run: dart pub get && dart pub get --directory="../objective_c" && flutter pub get --directory="../jni"
- name: Install clang-format
uses: ConorMacBride/install-package@3e7ad059e07782ee54fa35f827df52aae0626f30
with:
brew: clang-format
- name: Build test dylib and bindings
run: dart --enable-asserts test/setup.dart --main-thread-dispatcher
run: dart --enable-asserts test/setup.dart
- name: Run VM tests
run: flutter test
run: dart test
- name: Generate package:jni bindings
run: dart --enable-asserts run tool/generate_ffi_bindings.dart
working-directory: pkgs/jni/
29 changes: 13 additions & 16 deletions .github/workflows/objective_c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
channel: 'stable'
sdk: dev
- id: install
name: Install dependencies
run: flutter pub get
run: dart pub get
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: flutter analyze --fatal-infos
run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

test-mac:
Expand All @@ -54,14 +54,11 @@ jobs:
working-directory: pkgs/objective_c/
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
channel: 'beta'
sdk: dev
- name: Install dependencies
run: flutter pub get
- name: Build test dylib
# TODO(https://github.com/dart-lang/native/issues/1068): Remove this.
run: dart --enable-asserts test/setup.dart
run: dart pub get
- name: Install coverage
run: dart pub global activate coverage
- name: Run VM tests and collect coverage
Expand Down Expand Up @@ -89,13 +86,13 @@ jobs:
runs-on: 'macos-latest'
defaults:
run:
working-directory: pkgs/objective_c/example/
working-directory: pkgs/objective_c/example
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
channel: 'stable'
sdk: dev
- name: Install dependencies
run: flutter pub get
- name: Build the example app
run: flutter build macos
run: dart pub get
- name: Run the example app
run: dart run lib/main.dart
15 changes: 4 additions & 11 deletions .github/workflows/swiftgen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
with:
channel: 'stable'
channel: master
- id: install
name: Install dependencies
run: flutter pub get
run: dart pub get && dart pub get --directory="example"
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
Expand All @@ -60,16 +60,9 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
with:
channel: 'stable'
channel: master
- name: Install dependencies
run: flutter pub get
- name: Install ObjC dependencies
working-directory: pkgs/objective_c/
run: flutter pub get
- name: Build ObjC test dylib
working-directory: pkgs/objective_c/
# TODO(https://github.com/dart-lang/native/issues/1068): Remove this.
run: dart test/setup.dart
run: dart pub get
- name: Install coverage
run: dart pub global activate coverage
- name: Run VM tests and collect coverage
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ doc/api/
# Files generated by tests for debugging purposes.
**/test/debug_generated/*
coverage/
**/temp/

## Downloaded files and build artifacts
*.jar
Expand Down
9 changes: 0 additions & 9 deletions pkgs/ffigen/lib/src/code_generator/objc_built_in_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,3 @@ const objCBuiltInCategories = {
'NSNumberIsFloat',
'NSStringExtensionMethods',
};

const objCBuiltInGlobals = {
'NSKeyValueChangeIndexesKey',
'NSKeyValueChangeKindKey',
'NSKeyValueChangeNewKey',
'NSKeyValueChangeNotificationIsPriorKey',
'NSKeyValueChangeOldKey',
'NSLocalizedDescriptionKey',
};
13 changes: 8 additions & 5 deletions pkgs/ffigen/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ dev_dependencies:
json_schema: ^5.1.1
leak_tracker: ^10.0.7
objective_c: ^9.0.0
test: ^1.16.2
test: ^1.26.2

dependency_overrides:
# package:objective_c has a flutter dependency, so `dart test` must be run
# using the dart from the flutter SDK.
# See https://github.com/dart-lang/native/issues/1068
code_assets:
path: ../code_assets
hooks:
path: ../hooks
native_toolchain_c:
path: ../native_toolchain_c
objective_c:
path: ../objective_c/
path: ../objective_c
10 changes: 0 additions & 10 deletions pkgs/ffigen/test/native_objc_test/arc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ void main() {

group('ARC', () {
setUpAll(() {
// TODO(https://github.com/dart-lang/native/issues/1068): Remove this.
DynamicLibrary.open(
path.join(
packagePathForTests,
'..',
'objective_c',
'test',
'objective_c.dylib',
),
);
final dylib = File(
path.join(
packagePathForTests,
Expand Down
10 changes: 0 additions & 10 deletions pkgs/ffigen/test/native_objc_test/bad_method_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ import 'util.dart';
void main() {
group('bad_method_test', () {
setUpAll(() {
// TODO(https://github.com/dart-lang/native/issues/1068): Remove this.
DynamicLibrary.open(
path.join(
packagePathForTests,
'..',
'objective_c',
'test',
'objective_c.dylib',
),
);
final dylib = File(
path.join(
packagePathForTests,
Expand Down
10 changes: 0 additions & 10 deletions pkgs/ffigen/test/native_objc_test/bad_override_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ import 'util.dart';
void main() {
group('bad overrides', () {
setUpAll(() {
// TODO(https://github.com/dart-lang/native/issues/1068): Remove this.
DynamicLibrary.open(
path.join(
packagePathForTests,
'..',
'objective_c',
'test',
'objective_c.dylib',
),
);
final dylib = File(
path.join(
packagePathForTests,
Expand Down
10 changes: 0 additions & 10 deletions pkgs/ffigen/test/native_objc_test/block_annotation_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@ void main() {
// correct block type.

setUpAll(() {
// TODO(https://github.com/dart-lang/native/issues/1068): Remove this.
DynamicLibrary.open(
path.join(
packagePathForTests,
'..',
'objective_c',
'test',
'objective_c.dylib',
),
);
final dylib = File(
path.join(
packagePathForTests,
Expand Down
10 changes: 0 additions & 10 deletions pkgs/ffigen/test/native_objc_test/block_inherit_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ import 'util.dart';
void main() {
group('Block inheritance', () {
setUpAll(() {
// TODO(https://github.com/dart-lang/native/issues/1068): Remove this.
DynamicLibrary.open(
path.join(
packagePathForTests,
'..',
'objective_c',
'test',
'objective_c.dylib',
),
);
final dylib = File(
path.join(
packagePathForTests,
Expand Down
10 changes: 0 additions & 10 deletions pkgs/ffigen/test/native_objc_test/block_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,6 @@ void main() {

group('Blocks', () {
setUpAll(() {
// TODO(https://github.com/dart-lang/native/issues/1068): Remove this.
DynamicLibrary.open(
path.join(
packagePathForTests,
'..',
'objective_c',
'test',
'objective_c.dylib',
),
);
final dylib = File(
path.join(
packagePathForTests,
Expand Down
10 changes: 0 additions & 10 deletions pkgs/ffigen/test/native_objc_test/cast_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ void main() {

group('cast', () {
setUpAll(() {
// TODO(https://github.com/dart-lang/native/issues/1068): Remove this.
DynamicLibrary.open(
path.join(
packagePathForTests,
'..',
'objective_c',
'test',
'objective_c.dylib',
),
);
final dylib = File(
path.join(
packagePathForTests,
Expand Down
10 changes: 0 additions & 10 deletions pkgs/ffigen/test/native_objc_test/category_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ import 'util.dart';
void main() {
group('categories', () {
setUpAll(() {
// TODO(https://github.com/dart-lang/native/issues/1068): Remove this.
DynamicLibrary.open(
path.join(
packagePathForTests,
'..',
'objective_c',
'test',
'objective_c.dylib',
),
);
final dylib = File(
path.join(
packagePathForTests,
Expand Down
Loading
Loading