diff --git a/.github/workflows/ffigen.yml b/.github/workflows/ffigen.yml index d8823f09e7..a453bcb713 100644 --- a/.github/workflows/ffigen.yml +++ b/.github/workflows/ffigen.yml @@ -34,17 +34,17 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 with: - channel: 'stable' + channel: master - id: install name: Install dependencies - run: flutter pub get && flutter pub get --directory="example/shared_bindings" && flutter pub get --directory="../objective_c" + run: dart pub get && dart pub get --directory="example/shared_bindings" && dart pub get --directory="../objective_c" - 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 test/setup.dart - name: Analyze code - run: flutter analyze --fatal-infos + run: dart analyze --fatal-infos test-linux: needs: analyze @@ -56,9 +56,9 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 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 @@ -80,9 +80,9 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 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: @@ -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: @@ -142,13 +142,13 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 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 test/setup.dart --main-thread-dispatcher + run: dart test/setup.dart - name: Run Flutter tests - run: flutter test + run: dart test test-windows: needs: analyze @@ -160,9 +160,9 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 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 test/setup.dart - name: Run VM tests @@ -191,7 +191,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 with: - channel: "master" + channel: master - name: Install dependencies run: flutter pub get - name: Build test dylib and bindings diff --git a/.github/workflows/ffigen_weekly.yml b/.github/workflows/ffigen_weekly.yml index d7726e6f79..12854b7e0d 100644 --- a/.github/workflows/ffigen_weekly.yml +++ b/.github/workflows/ffigen_weekly.yml @@ -30,17 +30,17 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 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 test/setup.dart --main-thread-dispatcher + run: dart test/setup.dart - name: Run VM tests - run: flutter test + run: dart test - name: Generate package:jni bindings run: dart run tool/generate_ffi_bindings.dart working-directory: pkgs/jni/ diff --git a/.github/workflows/objective_c.yaml b/.github/workflows/objective_c.yaml index cfdc211cc4..68042798c2 100644 --- a/.github/workflows/objective_c.yaml +++ b/.github/workflows/objective_c.yaml @@ -31,17 +31,17 @@ jobs: fail-fast: false steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 + - 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: @@ -52,14 +52,11 @@ jobs: working-directory: pkgs/objective_c/ steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 + - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c with: - channel: 'stable' + 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 test/setup.dart + run: dart pub get - name: Install coverage run: dart pub global activate coverage - name: Run VM tests and collect coverage @@ -87,13 +84,13 @@ jobs: runs-on: 'macos-latest' defaults: run: - working-directory: pkgs/objective_c/example/ + working-directory: pkgs/objective_c/example steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 + - 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 diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_types.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_types.dart index a150eb96e0..78fcc2f63b 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_types.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_types.dart @@ -131,12 +131,3 @@ const objCBuiltInCategories = { 'NSNumberIsFloat', 'NSStringExtensionMethods', }; - -const objCBuiltInGlobals = { - 'NSKeyValueChangeIndexesKey', - 'NSKeyValueChangeKindKey', - 'NSKeyValueChangeNewKey', - 'NSKeyValueChangeNotificationIsPriorKey', - 'NSKeyValueChangeOldKey', - 'NSLocalizedDescriptionKey', -}; diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 3284e7b799..c8a97164b7 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -165,6 +165,7 @@ class Writer { ], ); } + additionalImports.forEach(markImportUsed); /// [_lookupFuncIdentifier] should be unique in top level. _lookupFuncIdentifier = _resolveNameConflict( diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 193a1373bf..356e0647a2 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -41,11 +41,14 @@ dev_dependencies: json_schema: ^5.1.1 leak_tracker: ^10.0.7 objective_c: ^8.1.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 diff --git a/pkgs/ffigen/test/native_objc_test/arc_test.dart b/pkgs/ffigen/test/native_objc_test/arc_test.dart index e23719c614..6b9a47bb9e 100644 --- a/pkgs/ffigen/test/native_objc_test/arc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/arc_test.dart @@ -22,16 +22,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, diff --git a/pkgs/ffigen/test/native_objc_test/bad_method_test.dart b/pkgs/ffigen/test/native_objc_test/bad_method_test.dart index 3f7d3f6db6..23ad2a8047 100644 --- a/pkgs/ffigen/test/native_objc_test/bad_method_test.dart +++ b/pkgs/ffigen/test/native_objc_test/bad_method_test.dart @@ -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, diff --git a/pkgs/ffigen/test/native_objc_test/bad_override_test.dart b/pkgs/ffigen/test/native_objc_test/bad_override_test.dart index 761d3d240a..df85a8fc57 100644 --- a/pkgs/ffigen/test/native_objc_test/bad_override_test.dart +++ b/pkgs/ffigen/test/native_objc_test/bad_override_test.dart @@ -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, diff --git a/pkgs/ffigen/test/native_objc_test/block_annotation_test.dart b/pkgs/ffigen/test/native_objc_test/block_annotation_test.dart index f716ddcc1d..c864388c2f 100644 --- a/pkgs/ffigen/test/native_objc_test/block_annotation_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_annotation_test.dart @@ -37,16 +37,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, diff --git a/pkgs/ffigen/test/native_objc_test/block_inherit_test.dart b/pkgs/ffigen/test/native_objc_test/block_inherit_test.dart index abda74ddb9..1c60769ca0 100644 --- a/pkgs/ffigen/test/native_objc_test/block_inherit_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_inherit_test.dart @@ -21,16 +21,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, diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 12910ca552..0b4256b64f 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -54,16 +54,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, diff --git a/pkgs/ffigen/test/native_objc_test/cast_test.dart b/pkgs/ffigen/test/native_objc_test/cast_test.dart index 8d5eb1b294..7ab4c8dbfe 100644 --- a/pkgs/ffigen/test/native_objc_test/cast_test.dart +++ b/pkgs/ffigen/test/native_objc_test/cast_test.dart @@ -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, diff --git a/pkgs/ffigen/test/native_objc_test/category_test.dart b/pkgs/ffigen/test/native_objc_test/category_test.dart index c69406057e..d044c7ad6f 100644 --- a/pkgs/ffigen/test/native_objc_test/category_test.dart +++ b/pkgs/ffigen/test/native_objc_test/category_test.dart @@ -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, diff --git a/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart b/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart index 6557b058c7..0d7324689a 100644 --- a/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart +++ b/pkgs/ffigen/test/native_objc_test/forward_decl_test.dart @@ -16,16 +16,6 @@ import 'util.dart'; void main() { group('forward decl', () { 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, diff --git a/pkgs/ffigen/test/native_objc_test/global_native_test.dart b/pkgs/ffigen/test/native_objc_test/global_native_test.dart index 0cb2727fd6..32e4803a0a 100644 --- a/pkgs/ffigen/test/native_objc_test/global_native_test.dart +++ b/pkgs/ffigen/test/native_objc_test/global_native_test.dart @@ -18,16 +18,6 @@ import 'util.dart'; void main() { group('global using @Native', () { 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, diff --git a/pkgs/ffigen/test/native_objc_test/global_test.dart b/pkgs/ffigen/test/native_objc_test/global_test.dart index 89a5ffebb6..e8aaee53f7 100644 --- a/pkgs/ffigen/test/native_objc_test/global_test.dart +++ b/pkgs/ffigen/test/native_objc_test/global_test.dart @@ -20,16 +20,6 @@ void main() { late GlobalTestObjCLibrary lib; 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, diff --git a/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test.dart b/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test.dart index 0c3a8b47d6..b3cb3903f3 100644 --- a/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test.dart +++ b/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test.dart @@ -17,16 +17,6 @@ import 'util.dart'; void main() { group('inheritedInstancetype', () { 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, diff --git a/pkgs/ffigen/test/native_objc_test/is_instance_test.dart b/pkgs/ffigen/test/native_objc_test/is_instance_test.dart index 2a90aeded8..29251357aa 100644 --- a/pkgs/ffigen/test/native_objc_test/is_instance_test.dart +++ b/pkgs/ffigen/test/native_objc_test/is_instance_test.dart @@ -18,16 +18,6 @@ import 'util.dart'; void main() { group('isInstance', () { 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, diff --git a/pkgs/ffigen/test/native_objc_test/isolate_test.dart b/pkgs/ffigen/test/native_objc_test/isolate_test.dart index 1ebdb4f9c9..4fd7ebf0ee 100644 --- a/pkgs/ffigen/test/native_objc_test/isolate_test.dart +++ b/pkgs/ffigen/test/native_objc_test/isolate_test.dart @@ -20,16 +20,6 @@ import 'util.dart'; void main() { group('isolate', () { 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, diff --git a/pkgs/ffigen/test/native_objc_test/log_test.dart b/pkgs/ffigen/test/native_objc_test/log_test.dart index 94f1a2ac9b..cb734292e4 100644 --- a/pkgs/ffigen/test/native_objc_test/log_test.dart +++ b/pkgs/ffigen/test/native_objc_test/log_test.dart @@ -18,16 +18,6 @@ import 'util.dart'; void main() { group('log_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, diff --git a/pkgs/ffigen/test/native_objc_test/method_filtering_test.dart b/pkgs/ffigen/test/native_objc_test/method_filtering_test.dart index 94c66b654e..7ddd0a286d 100644 --- a/pkgs/ffigen/test/native_objc_test/method_filtering_test.dart +++ b/pkgs/ffigen/test/native_objc_test/method_filtering_test.dart @@ -24,7 +24,6 @@ void main() { group('no version info', () { late final String bindings; setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. generateBindingsForCoverage('method_filtering'); bindings = File( path.join( diff --git a/pkgs/ffigen/test/native_objc_test/method_test.dart b/pkgs/ffigen/test/native_objc_test/method_test.dart index de03b95b27..03d6da67c1 100644 --- a/pkgs/ffigen/test/native_objc_test/method_test.dart +++ b/pkgs/ffigen/test/native_objc_test/method_test.dart @@ -19,16 +19,6 @@ void main() { group('method calls', () { 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, diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart index 9c52091377..3b88eaecda 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test.dart @@ -17,16 +17,6 @@ import 'util.dart'; void main() { group('native_objc_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, diff --git a/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test.dart b/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test.dart index 98112a9875..18b95fe5e9 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test.dart @@ -21,16 +21,6 @@ void main() { late NSObject obj; group('Nullable 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, diff --git a/pkgs/ffigen/test/native_objc_test/nullable_test.dart b/pkgs/ffigen/test/native_objc_test/nullable_test.dart index 76b220a2a2..5c8051878f 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_test.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_test.dart @@ -20,16 +20,6 @@ void main() { late NSObject obj; group('Nullability', () { 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, diff --git a/pkgs/ffigen/test/native_objc_test/property_test.dart b/pkgs/ffigen/test/native_objc_test/property_test.dart index 46d7b2c39e..dd5f3966a0 100644 --- a/pkgs/ffigen/test/native_objc_test/property_test.dart +++ b/pkgs/ffigen/test/native_objc_test/property_test.dart @@ -20,16 +20,6 @@ void main() { group('properties', () { 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, diff --git a/pkgs/ffigen/test/native_objc_test/protocol_test.dart b/pkgs/ffigen/test/native_objc_test/protocol_test.dart index 4d84b7cfdd..8b81683fa7 100644 --- a/pkgs/ffigen/test/native_objc_test/protocol_test.dart +++ b/pkgs/ffigen/test/native_objc_test/protocol_test.dart @@ -29,16 +29,6 @@ void main() { group('protocol', () { 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, diff --git a/pkgs/ffigen/test/native_objc_test/ref_count_test.dart b/pkgs/ffigen/test/native_objc_test/ref_count_test.dart index 122bbb626f..c41084e34c 100644 --- a/pkgs/ffigen/test/native_objc_test/ref_count_test.dart +++ b/pkgs/ffigen/test/native_objc_test/ref_count_test.dart @@ -22,16 +22,6 @@ void main() { group('Reference counting', () { 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, diff --git a/pkgs/ffigen/test/native_objc_test/rename_test.dart b/pkgs/ffigen/test/native_objc_test/rename_test.dart index f93217b2cc..b017699f38 100644 --- a/pkgs/ffigen/test/native_objc_test/rename_test.dart +++ b/pkgs/ffigen/test/native_objc_test/rename_test.dart @@ -17,16 +17,6 @@ import 'util.dart'; void main() { group('rename_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, diff --git a/pkgs/ffigen/test/native_objc_test/runtime_version_test.dart b/pkgs/ffigen/test/native_objc_test/runtime_version_test.dart index 5fe3a40526..c0faf1f626 100644 --- a/pkgs/ffigen/test/native_objc_test/runtime_version_test.dart +++ b/pkgs/ffigen/test/native_objc_test/runtime_version_test.dart @@ -18,16 +18,6 @@ import 'util.dart'; void main() { group('runtime version check', () { 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, diff --git a/pkgs/ffigen/test/native_objc_test/sdk_variable_test.dart b/pkgs/ffigen/test/native_objc_test/sdk_variable_test.dart index d4344a68a4..b0fb85ddb5 100644 --- a/pkgs/ffigen/test/native_objc_test/sdk_variable_test.dart +++ b/pkgs/ffigen/test/native_objc_test/sdk_variable_test.dart @@ -17,16 +17,6 @@ void main() { late String bindings; 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, diff --git a/pkgs/ffigen/test/native_objc_test/setup.dart b/pkgs/ffigen/test/native_objc_test/setup.dart index c02c47602c..cc43511bed 100644 --- a/pkgs/ffigen/test/native_objc_test/setup.dart +++ b/pkgs/ffigen/test/native_objc_test/setup.dart @@ -165,7 +165,6 @@ Future clean(List testNames) async { Future main(List arguments) async { final parser = ArgParser(); parser.addFlag('clean'); - parser.addFlag('main-thread-dispatcher'); final args = parser.parse(arguments); // Allow running this script directly from any path (or an IDE). @@ -178,9 +177,5 @@ Future main(List arguments) async { return await clean(_getTestNames()); } - await _runDart([ - '../objective_c/test/setup.dart', - if (args.flag('main-thread-dispatcher')) '--main-thread-dispatcher', - ]); return await build(args.rest.isNotEmpty ? args.rest : _getTestNames()); } diff --git a/pkgs/ffigen/test/native_objc_test/static_func_test.dart b/pkgs/ffigen/test/native_objc_test/static_func_test.dart index 9638f62e26..a80b30dd8a 100644 --- a/pkgs/ffigen/test/native_objc_test/static_func_test.dart +++ b/pkgs/ffigen/test/native_objc_test/static_func_test.dart @@ -27,16 +27,6 @@ void main() { group('static functions', () { 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, diff --git a/pkgs/ffigen/test/native_objc_test/string_test.dart b/pkgs/ffigen/test/native_objc_test/string_test.dart index c46d9cd214..dc79057009 100644 --- a/pkgs/ffigen/test/native_objc_test/string_test.dart +++ b/pkgs/ffigen/test/native_objc_test/string_test.dart @@ -18,16 +18,6 @@ import 'util.dart'; void main() { group('string', () { 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, diff --git a/pkgs/ffigen/test/native_objc_test/swift_class_test.dart b/pkgs/ffigen/test/native_objc_test/swift_class_test.dart index 964e9e1bae..5b4cf28f0d 100644 --- a/pkgs/ffigen/test/native_objc_test/swift_class_test.dart +++ b/pkgs/ffigen/test/native_objc_test/swift_class_test.dart @@ -16,16 +16,6 @@ import 'util.dart'; void main() { group('swift_class_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, diff --git a/pkgs/ffigen/test/native_objc_test/typedef_test.dart b/pkgs/ffigen/test/native_objc_test/typedef_test.dart index 0ee3392148..179ccdf208 100644 --- a/pkgs/ffigen/test/native_objc_test/typedef_test.dart +++ b/pkgs/ffigen/test/native_objc_test/typedef_test.dart @@ -16,16 +16,6 @@ import 'util.dart'; void main() { group('typedef', () { 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, diff --git a/pkgs/ffigen/test/setup.dart b/pkgs/ffigen/test/setup.dart index 56d99bc6dd..6c05b2566f 100644 --- a/pkgs/ffigen/test/setup.dart +++ b/pkgs/ffigen/test/setup.dart @@ -8,8 +8,6 @@ import 'dart:async'; import 'dart:io'; -import 'package:args/args.dart'; - Future _run(String subdir, String script, List flags) async { final dir = Platform.script.resolve('$subdir/'); print('\nRunning $script in ${dir.toFilePath()}'); @@ -28,15 +26,9 @@ Future _run(String subdir, String script, List flags) async { } Future main(List arguments) async { - final parser = ArgParser(); - parser.addFlag('main-thread-dispatcher'); - final args = parser.parse(arguments); - await _run('native_test', 'build_test_dylib.dart', []); if (Platform.isMacOS) { - await _run('native_objc_test', 'setup.dart', [ - if (args.flag('main-thread-dispatcher')) '--main-thread-dispatcher', - ]); + await _run('native_objc_test', 'setup.dart', []); } print('\nSuccess :)\n'); } diff --git a/pkgs/objective_c/.metadata b/pkgs/objective_c/.metadata deleted file mode 100644 index a41ab896bb..0000000000 --- a/pkgs/objective_c/.metadata +++ /dev/null @@ -1,33 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: "aedce673f760bc19f13aa0600e2c1df9ae502117" - channel: "master" - -project_type: plugin_ffi - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: aedce673f760bc19f13aa0600e2c1df9ae502117 - base_revision: aedce673f760bc19f13aa0600e2c1df9ae502117 - - platform: ios - create_revision: aedce673f760bc19f13aa0600e2c1df9ae502117 - base_revision: aedce673f760bc19f13aa0600e2c1df9ae502117 - - platform: macos - create_revision: aedce673f760bc19f13aa0600e2c1df9ae502117 - base_revision: aedce673f760bc19f13aa0600e2c1df9ae502117 - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/pkgs/objective_c/example/.gitignore b/pkgs/objective_c/example/.gitignore new file mode 100644 index 0000000000..3a85790408 --- /dev/null +++ b/pkgs/objective_c/example/.gitignore @@ -0,0 +1,3 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ diff --git a/pkgs/objective_c/example/CHANGELOG.md b/pkgs/objective_c/example/CHANGELOG.md new file mode 100644 index 0000000000..effe43c82c --- /dev/null +++ b/pkgs/objective_c/example/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/pkgs/objective_c/example/README.md b/pkgs/objective_c/example/README.md index ef2deb7f61..9d9d2e46eb 100644 --- a/pkgs/objective_c/example/README.md +++ b/pkgs/objective_c/example/README.md @@ -1,5 +1 @@ -# objective_c example - -Demonstrates how to use the objective_c plugin. - -TODO(https://github.com/dart-lang/native/issues/1068): Migrate to native assets. +Demonstrates using package:objective_c: `dart run lib/main.dart` diff --git a/pkgs/objective_c/example/analysis_options.yaml b/pkgs/objective_c/example/analysis_options.yaml index 22c406e139..572dd239d0 100644 --- a/pkgs/objective_c/example/analysis_options.yaml +++ b/pkgs/objective_c/example/analysis_options.yaml @@ -1,6 +1 @@ -include: package:flutter_lints/flutter.yaml - -analyzer: - language: - strict-casts: true - strict-inference: true +include: package:lints/recommended.yaml diff --git a/pkgs/objective_c/example/ios/Flutter/AppFrameworkInfo.plist b/pkgs/objective_c/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 7c56964006..0000000000 --- a/pkgs/objective_c/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 12.0 - - diff --git a/pkgs/objective_c/example/ios/Flutter/Debug.xcconfig b/pkgs/objective_c/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index ec97fc6f30..0000000000 --- a/pkgs/objective_c/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/pkgs/objective_c/example/ios/Flutter/Release.xcconfig b/pkgs/objective_c/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index c4855bfe20..0000000000 --- a/pkgs/objective_c/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/pkgs/objective_c/example/ios/Podfile b/pkgs/objective_c/example/ios/Podfile deleted file mode 100644 index d97f17e223..0000000000 --- a/pkgs/objective_c/example/ios/Podfile +++ /dev/null @@ -1,44 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '12.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/pkgs/objective_c/example/ios/Runner.xcodeproj/project.pbxproj b/pkgs/objective_c/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 8f49bdf9e3..0000000000 --- a/pkgs/objective_c/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,728 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 0016C0D0D056FCD78A6A33E8 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5349C2B3D454EF3220FB3306 /* Pods_RunnerTests.framework */; }; - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 4D7C7CB911925A31801A2F1E /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0B910B6B0374F2338E70D6AC /* Pods_Runner.framework */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 97C146E61CF9000F007C117D /* Project object */; - proxyType = 1; - remoteGlobalIDString = 97C146ED1CF9000F007C117D; - remoteInfo = Runner; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 0B910B6B0374F2338E70D6AC /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 5349C2B3D454EF3220FB3306 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 5898EAFA36C90FEB069D15C8 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; - 5E623BDE574BD3F02055F373 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; - 6F2BCFFFCABF2D8A79F17D26 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - B6F1E5A6A7CC24D81665E0BA /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - F794A460162AE19694C18D43 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - FFB0D24362152330E942673E /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4D7C7CB911925A31801A2F1E /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B209388E6951AC88C18EE569 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 0016C0D0D056FCD78A6A33E8 /* Pods_RunnerTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 2961EE994295B641DF59D533 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 0B910B6B0374F2338E70D6AC /* Pods_Runner.framework */, - 5349C2B3D454EF3220FB3306 /* Pods_RunnerTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 331C8082294A63A400263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C807B294A618700263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 331C8082294A63A400263BE5 /* RunnerTests */, - 97F4D88CC18AF014179906AC /* Pods */, - 2961EE994295B641DF59D533 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - 331C8081294A63A400263BE5 /* RunnerTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; - 97F4D88CC18AF014179906AC /* Pods */ = { - isa = PBXGroup; - children = ( - FFB0D24362152330E942673E /* Pods-Runner.debug.xcconfig */, - 6F2BCFFFCABF2D8A79F17D26 /* Pods-Runner.release.xcconfig */, - B6F1E5A6A7CC24D81665E0BA /* Pods-Runner.profile.xcconfig */, - 5E623BDE574BD3F02055F373 /* Pods-RunnerTests.debug.xcconfig */, - F794A460162AE19694C18D43 /* Pods-RunnerTests.release.xcconfig */, - 5898EAFA36C90FEB069D15C8 /* Pods-RunnerTests.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 331C8080294A63A400263BE5 /* RunnerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; - buildPhases = ( - 11218719EF64897AFE1F9EE8 /* [CP] Check Pods Manifest.lock */, - 331C807D294A63A400263BE5 /* Sources */, - 331C807F294A63A400263BE5 /* Resources */, - B209388E6951AC88C18EE569 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 331C8086294A63A400263BE5 /* PBXTargetDependency */, - ); - name = RunnerTests; - productName = RunnerTests; - productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - E0D32FA7EF8A23FC0FD30465 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 98CA06E4ED3E0BFB8A3C613F /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1510; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 331C8080294A63A400263BE5 = { - CreatedOnToolsVersion = 14.0; - TestTargetID = 97C146ED1CF9000F007C117D; - }; - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - 331C8080294A63A400263BE5 /* RunnerTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 331C807F294A63A400263BE5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 11218719EF64897AFE1F9EE8 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - 98CA06E4ED3E0BFB8A3C613F /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - E0D32FA7EF8A23FC0FD30465 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 331C807D294A63A400263BE5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 97C146ED1CF9000F007C117D /* Runner */; - targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.github.dartlang.objectiveCExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 331C8088294A63A400263BE5 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5E623BDE574BD3F02055F373 /* Pods-RunnerTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.github.dartlang.objectiveCExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Debug; - }; - 331C8089294A63A400263BE5 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F794A460162AE19694C18D43 /* Pods-RunnerTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.github.dartlang.objectiveCExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Release; - }; - 331C808A294A63A400263BE5 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5898EAFA36C90FEB069D15C8 /* Pods-RunnerTests.profile.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.github.dartlang.objectiveCExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.github.dartlang.objectiveCExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.github.dartlang.objectiveCExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 331C8088294A63A400263BE5 /* Debug */, - 331C8089294A63A400263BE5 /* Release */, - 331C808A294A63A400263BE5 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/pkgs/objective_c/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/pkgs/objective_c/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a625..0000000000 --- a/pkgs/objective_c/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/pkgs/objective_c/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/pkgs/objective_c/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d..0000000000 --- a/pkgs/objective_c/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/pkgs/objective_c/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/pkgs/objective_c/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5ea..0000000000 --- a/pkgs/objective_c/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/pkgs/objective_c/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/pkgs/objective_c/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 8e3ca5dfe1..0000000000 --- a/pkgs/objective_c/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pkgs/objective_c/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/pkgs/objective_c/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c7..0000000000 --- a/pkgs/objective_c/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/pkgs/objective_c/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/pkgs/objective_c/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d..0000000000 --- a/pkgs/objective_c/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/pkgs/objective_c/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/pkgs/objective_c/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5ea..0000000000 --- a/pkgs/objective_c/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/pkgs/objective_c/example/ios/Runner/AppDelegate.swift b/pkgs/objective_c/example/ios/Runner/AppDelegate.swift deleted file mode 100644 index 626664468b..0000000000 --- a/pkgs/objective_c/example/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import Flutter -import UIKit - -@main -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab2d..0000000000 --- a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada4725..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 7353c41ecf..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 797d452e45..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index 6ed2d933e1..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cd7b0099c..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index fe730945a0..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index 321773cd85..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 797d452e45..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index 502f463a9b..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index 0ec3034392..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index 0ec3034392..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index e9f5fea27c..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index 84ac32ae7d..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 8953cba090..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index 0467bf12aa..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2fd4..0000000000 --- a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eacad..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad..0000000000 Binary files a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b70..0000000000 --- a/pkgs/objective_c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/pkgs/objective_c/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/pkgs/objective_c/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7c9..0000000000 --- a/pkgs/objective_c/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pkgs/objective_c/example/ios/Runner/Base.lproj/Main.storyboard b/pkgs/objective_c/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516fb..0000000000 --- a/pkgs/objective_c/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pkgs/objective_c/example/ios/Runner/Info.plist b/pkgs/objective_c/example/ios/Runner/Info.plist deleted file mode 100644 index 8bbbc6dc9a..0000000000 --- a/pkgs/objective_c/example/ios/Runner/Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Objective C - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - objective_c_example - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - - diff --git a/pkgs/objective_c/example/ios/Runner/Runner-Bridging-Header.h b/pkgs/objective_c/example/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index 308a2a560b..0000000000 --- a/pkgs/objective_c/example/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" diff --git a/pkgs/objective_c/example/ios/RunnerTests/RunnerTests.swift b/pkgs/objective_c/example/ios/RunnerTests/RunnerTests.swift deleted file mode 100644 index 86a7c3b1b6..0000000000 --- a/pkgs/objective_c/example/ios/RunnerTests/RunnerTests.swift +++ /dev/null @@ -1,12 +0,0 @@ -import Flutter -import UIKit -import XCTest - -class RunnerTests: XCTestCase { - - func testExample() { - // If you add code to the Runner application, consider adding tests here. - // See https://developer.apple.com/documentation/xctest for more information about using XCTest. - } - -} diff --git a/pkgs/objective_c/example/lib/main.dart b/pkgs/objective_c/example/lib/main.dart index e6c44abd11..6bf9da655a 100644 --- a/pkgs/objective_c/example/lib/main.dart +++ b/pkgs/objective_c/example/lib/main.dart @@ -1,33 +1,10 @@ -// Copyright (c) 2024, 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 'dart:io'; -import 'package:flutter/material.dart'; import 'package:objective_c/objective_c.dart'; void main() { - runApp(const MaterialApp(home: MainApp())); -} - -class MainApp extends StatefulWidget { - const MainApp({super.key}); - - @override - State createState() => _MainAppState(); -} - -class _MainAppState extends State { - late final String message; - - @override - void initState() { - super.initState(); - - message = NSString('Hello World!').toString(); - } + // Objective-C is only supported on macOS and iOS. + assert(Platform.isMacOS || Platform.isIOS); - @override - Widget build(BuildContext context) { - return Scaffold(body: Center(child: Text(message))); - } + print('Hello World'.toNSString().toDartString()); } diff --git a/pkgs/objective_c/example/macos/Flutter/Flutter-Debug.xcconfig b/pkgs/objective_c/example/macos/Flutter/Flutter-Debug.xcconfig deleted file mode 100644 index 4b81f9b2d2..0000000000 --- a/pkgs/objective_c/example/macos/Flutter/Flutter-Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/pkgs/objective_c/example/macos/Flutter/Flutter-Release.xcconfig b/pkgs/objective_c/example/macos/Flutter/Flutter-Release.xcconfig deleted file mode 100644 index 5caa9d1579..0000000000 --- a/pkgs/objective_c/example/macos/Flutter/Flutter-Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/pkgs/objective_c/example/macos/Podfile b/pkgs/objective_c/example/macos/Podfile deleted file mode 100644 index c795730db8..0000000000 --- a/pkgs/objective_c/example/macos/Podfile +++ /dev/null @@ -1,43 +0,0 @@ -platform :osx, '10.14' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_macos_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_macos_build_settings(target) - end -end diff --git a/pkgs/objective_c/example/macos/Runner.xcodeproj/project.pbxproj b/pkgs/objective_c/example/macos/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 7fb6863fbd..0000000000 --- a/pkgs/objective_c/example/macos/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,801 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXAggregateTarget section */ - 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; - buildPhases = ( - 33CC111E2044C6BF0003C045 /* ShellScript */, - ); - dependencies = ( - ); - name = "Flutter Assemble"; - productName = FLX; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - 5C3BF24AE85F5C730B12E1C3 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76CD4A3B26D45B1D35ED40BC /* Pods_Runner.framework */; }; - 98677E5D0F050EAF7F207C67 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A9FB1952D96C5AEFCA4D69B /* Pods_RunnerTests.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 33CC10E52044A3C60003C045 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 33CC10EC2044A3C60003C045; - remoteInfo = Runner; - }; - 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 33CC10E52044A3C60003C045 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 33CC111A2044C6BA0003C045; - remoteInfo = FLX; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 33CC110E2044A8840003C045 /* Bundle Framework */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Bundle Framework"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 253A21F847FB1AF244672D0E /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; - 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* objective_c_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = objective_c_example.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; - 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; - 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; - 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; - 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; - 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 6A9FB1952D96C5AEFCA4D69B /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 76CD4A3B26D45B1D35ED40BC /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - AC25B0021603A0772CA9840F /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - E5900647B1760244CA95C2A6 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - E739196F186306D59FB11177 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - ECD2E4ECDB0FCE6DA971A318 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; - EE079268A4FB02480F3FCA89 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 331C80D2294CF70F00263BE5 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 98677E5D0F050EAF7F207C67 /* Pods_RunnerTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10EA2044A3C60003C045 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 5C3BF24AE85F5C730B12E1C3 /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 331C80D6294CF71000263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C80D7294CF71000263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; - 33BA886A226E78AF003329D5 /* Configs */ = { - isa = PBXGroup; - children = ( - 33E5194F232828860026EE4D /* AppInfo.xcconfig */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, - ); - path = Configs; - sourceTree = ""; - }; - 33CC10E42044A3C60003C045 = { - isa = PBXGroup; - children = ( - 33FAB671232836740065AC1E /* Runner */, - 33CEB47122A05771004F2AC0 /* Flutter */, - 331C80D6294CF71000263BE5 /* RunnerTests */, - 33CC10EE2044A3C60003C045 /* Products */, - D73912EC22F37F3D000D13A0 /* Frameworks */, - 96BE0B041091E6177B65072F /* Pods */, - ); - sourceTree = ""; - }; - 33CC10EE2044A3C60003C045 /* Products */ = { - isa = PBXGroup; - children = ( - 33CC10ED2044A3C60003C045 /* objective_c_example.app */, - 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 33CC11242044D66E0003C045 /* Resources */ = { - isa = PBXGroup; - children = ( - 33CC10F22044A3C60003C045 /* Assets.xcassets */, - 33CC10F42044A3C60003C045 /* MainMenu.xib */, - 33CC10F72044A3C60003C045 /* Info.plist */, - ); - name = Resources; - path = ..; - sourceTree = ""; - }; - 33CEB47122A05771004F2AC0 /* Flutter */ = { - isa = PBXGroup; - children = ( - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, - ); - path = Flutter; - sourceTree = ""; - }; - 33FAB671232836740065AC1E /* Runner */ = { - isa = PBXGroup; - children = ( - 33CC10F02044A3C60003C045 /* AppDelegate.swift */, - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, - 33E51913231747F40026EE4D /* DebugProfile.entitlements */, - 33E51914231749380026EE4D /* Release.entitlements */, - 33CC11242044D66E0003C045 /* Resources */, - 33BA886A226E78AF003329D5 /* Configs */, - ); - path = Runner; - sourceTree = ""; - }; - 96BE0B041091E6177B65072F /* Pods */ = { - isa = PBXGroup; - children = ( - EE079268A4FB02480F3FCA89 /* Pods-Runner.debug.xcconfig */, - E739196F186306D59FB11177 /* Pods-Runner.release.xcconfig */, - E5900647B1760244CA95C2A6 /* Pods-Runner.profile.xcconfig */, - ECD2E4ECDB0FCE6DA971A318 /* Pods-RunnerTests.debug.xcconfig */, - AC25B0021603A0772CA9840F /* Pods-RunnerTests.release.xcconfig */, - 253A21F847FB1AF244672D0E /* Pods-RunnerTests.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; - D73912EC22F37F3D000D13A0 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 76CD4A3B26D45B1D35ED40BC /* Pods_Runner.framework */, - 6A9FB1952D96C5AEFCA4D69B /* Pods_RunnerTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 331C80D4294CF70F00263BE5 /* RunnerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; - buildPhases = ( - DD8A915821E91B2D640F20A1 /* [CP] Check Pods Manifest.lock */, - 331C80D1294CF70F00263BE5 /* Sources */, - 331C80D2294CF70F00263BE5 /* Frameworks */, - 331C80D3294CF70F00263BE5 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 331C80DA294CF71000263BE5 /* PBXTargetDependency */, - ); - name = RunnerTests; - productName = RunnerTests; - productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 33CC10EC2044A3C60003C045 /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - FF16D30B988DB2BCD781BB14 /* [CP] Check Pods Manifest.lock */, - 33CC10E92044A3C60003C045 /* Sources */, - 33CC10EA2044A3C60003C045 /* Frameworks */, - 33CC10EB2044A3C60003C045 /* Resources */, - 33CC110E2044A8840003C045 /* Bundle Framework */, - 3399D490228B24CF009A79C7 /* ShellScript */, - 774CDE4872C6F2C91B1264E0 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 33CC11202044C79F0003C045 /* PBXTargetDependency */, - ); - name = Runner; - productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* objective_c_example.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 33CC10E52044A3C60003C045 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1510; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 331C80D4294CF70F00263BE5 = { - CreatedOnToolsVersion = 14.0; - TestTargetID = 33CC10EC2044A3C60003C045; - }; - 33CC10EC2044A3C60003C045 = { - CreatedOnToolsVersion = 9.2; - LastSwiftMigration = 1100; - ProvisioningStyle = Automatic; - SystemCapabilities = { - com.apple.Sandbox = { - enabled = 1; - }; - }; - }; - 33CC111A2044C6BA0003C045 = { - CreatedOnToolsVersion = 9.2; - ProvisioningStyle = Manual; - }; - }; - }; - buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 33CC10E42044A3C60003C045; - productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 33CC10EC2044A3C60003C045 /* Runner */, - 331C80D4294CF70F00263BE5 /* RunnerTests */, - 33CC111A2044C6BA0003C045 /* Flutter Assemble */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 331C80D3294CF70F00263BE5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10EB2044A3C60003C045 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3399D490228B24CF009A79C7 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; - }; - 33CC111E2044C6BF0003C045 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - Flutter/ephemeral/FlutterInputs.xcfilelist, - ); - inputPaths = ( - Flutter/ephemeral/tripwire, - ); - outputFileListPaths = ( - Flutter/ephemeral/FlutterOutputs.xcfilelist, - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; - }; - 774CDE4872C6F2C91B1264E0 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - DD8A915821E91B2D640F20A1 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - FF16D30B988DB2BCD781BB14 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 331C80D1294CF70F00263BE5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10E92044A3C60003C045 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 33CC10EC2044A3C60003C045 /* Runner */; - targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; - }; - 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; - targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - 33CC10F52044A3C60003C045 /* Base */, - ); - name = MainMenu.xib; - path = Runner; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 331C80DB294CF71000263BE5 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = ECD2E4ECDB0FCE6DA971A318 /* Pods-RunnerTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.github.dartlang.objectiveCExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/objective_c_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/objective_c_example"; - }; - name = Debug; - }; - 331C80DC294CF71000263BE5 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AC25B0021603A0772CA9840F /* Pods-RunnerTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.github.dartlang.objectiveCExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/objective_c_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/objective_c_example"; - }; - name = Release; - }; - 331C80DD294CF71000263BE5 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 253A21F847FB1AF244672D0E /* Pods-RunnerTests.profile.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.github.dartlang.objectiveCExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/objective_c_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/objective_c_example"; - }; - name = Profile; - }; - 338D0CE9231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Profile; - }; - 338D0CEA231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Profile; - }; - 338D0CEB231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Profile; - }; - 33CC10F92044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 33CC10FA2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Release; - }; - 33CC10FC2044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 33CC10FD2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; - 33CC111C2044C6BA0003C045 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 33CC111D2044C6BA0003C045 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 331C80DB294CF71000263BE5 /* Debug */, - 331C80DC294CF71000263BE5 /* Release */, - 331C80DD294CF71000263BE5 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10F92044A3C60003C045 /* Debug */, - 33CC10FA2044A3C60003C045 /* Release */, - 338D0CE9231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10FC2044A3C60003C045 /* Debug */, - 33CC10FD2044A3C60003C045 /* Release */, - 338D0CEA231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC111C2044C6BA0003C045 /* Debug */, - 33CC111D2044C6BA0003C045 /* Release */, - 338D0CEB231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 33CC10E52044A3C60003C045 /* Project object */; -} diff --git a/pkgs/objective_c/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/pkgs/objective_c/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d..0000000000 --- a/pkgs/objective_c/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/pkgs/objective_c/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/pkgs/objective_c/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index c87f478474..0000000000 --- a/pkgs/objective_c/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pkgs/objective_c/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/pkgs/objective_c/example/macos/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c7..0000000000 --- a/pkgs/objective_c/example/macos/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/pkgs/objective_c/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/pkgs/objective_c/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d..0000000000 --- a/pkgs/objective_c/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/pkgs/objective_c/example/macos/Runner/AppDelegate.swift b/pkgs/objective_c/example/macos/Runner/AppDelegate.swift deleted file mode 100644 index b3c1761412..0000000000 --- a/pkgs/objective_c/example/macos/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import Cocoa -import FlutterMacOS - -@main -class AppDelegate: FlutterAppDelegate { - override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { - return true - } - - override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { - return true - } -} diff --git a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index a2ec33f19f..0000000000 --- a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_16.png", - "scale" : "1x" - }, - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "2x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "1x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_64.png", - "scale" : "2x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_128.png", - "scale" : "1x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "2x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "1x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "2x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "1x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_1024.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png deleted file mode 100644 index 82b6f9d9a3..0000000000 Binary files a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png and /dev/null differ diff --git a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png deleted file mode 100644 index 13b35eba55..0000000000 Binary files a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png and /dev/null differ diff --git a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png deleted file mode 100644 index 0a3f5fa40f..0000000000 Binary files a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png and /dev/null differ diff --git a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png deleted file mode 100644 index bdb57226d5..0000000000 Binary files a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png and /dev/null differ diff --git a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png deleted file mode 100644 index f083318e09..0000000000 Binary files a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png and /dev/null differ diff --git a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png deleted file mode 100644 index 326c0e72c9..0000000000 Binary files a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png and /dev/null differ diff --git a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png deleted file mode 100644 index 2f1632cfdd..0000000000 Binary files a/pkgs/objective_c/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png and /dev/null differ diff --git a/pkgs/objective_c/example/macos/Runner/Base.lproj/MainMenu.xib b/pkgs/objective_c/example/macos/Runner/Base.lproj/MainMenu.xib deleted file mode 100644 index 80e867a4e0..0000000000 --- a/pkgs/objective_c/example/macos/Runner/Base.lproj/MainMenu.xib +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pkgs/objective_c/example/macos/Runner/Configs/AppInfo.xcconfig b/pkgs/objective_c/example/macos/Runner/Configs/AppInfo.xcconfig deleted file mode 100644 index 50d7b8686b..0000000000 --- a/pkgs/objective_c/example/macos/Runner/Configs/AppInfo.xcconfig +++ /dev/null @@ -1,14 +0,0 @@ -// Application-level settings for the Runner target. -// -// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the -// future. If not, the values below would default to using the project name when this becomes a -// 'flutter create' template. - -// The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = objective_c_example - -// The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.github.dartlang.objectiveCExample - -// The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2024 com.github.dart_lang. All rights reserved. diff --git a/pkgs/objective_c/example/macos/Runner/Configs/Debug.xcconfig b/pkgs/objective_c/example/macos/Runner/Configs/Debug.xcconfig deleted file mode 100644 index 36b0fd9464..0000000000 --- a/pkgs/objective_c/example/macos/Runner/Configs/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Debug.xcconfig" -#include "Warnings.xcconfig" diff --git a/pkgs/objective_c/example/macos/Runner/Configs/Release.xcconfig b/pkgs/objective_c/example/macos/Runner/Configs/Release.xcconfig deleted file mode 100644 index dff4f49561..0000000000 --- a/pkgs/objective_c/example/macos/Runner/Configs/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Release.xcconfig" -#include "Warnings.xcconfig" diff --git a/pkgs/objective_c/example/macos/Runner/Configs/Warnings.xcconfig b/pkgs/objective_c/example/macos/Runner/Configs/Warnings.xcconfig deleted file mode 100644 index 42bcbf4780..0000000000 --- a/pkgs/objective_c/example/macos/Runner/Configs/Warnings.xcconfig +++ /dev/null @@ -1,13 +0,0 @@ -WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings -GCC_WARN_UNDECLARED_SELECTOR = YES -CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES -CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE -CLANG_WARN__DUPLICATE_METHOD_MATCH = YES -CLANG_WARN_PRAGMA_PACK = YES -CLANG_WARN_STRICT_PROTOTYPES = YES -CLANG_WARN_COMMA = YES -GCC_WARN_STRICT_SELECTOR_MATCH = YES -CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES -CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES -GCC_WARN_SHADOW = YES -CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/pkgs/objective_c/example/macos/Runner/DebugProfile.entitlements b/pkgs/objective_c/example/macos/Runner/DebugProfile.entitlements deleted file mode 100644 index dddb8a30c8..0000000000 --- a/pkgs/objective_c/example/macos/Runner/DebugProfile.entitlements +++ /dev/null @@ -1,12 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.cs.allow-jit - - com.apple.security.network.server - - - diff --git a/pkgs/objective_c/example/macos/Runner/Info.plist b/pkgs/objective_c/example/macos/Runner/Info.plist deleted file mode 100644 index 4789daa6a4..0000000000 --- a/pkgs/objective_c/example/macos/Runner/Info.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSHumanReadableCopyright - $(PRODUCT_COPYRIGHT) - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/pkgs/objective_c/example/macos/Runner/MainFlutterWindow.swift b/pkgs/objective_c/example/macos/Runner/MainFlutterWindow.swift deleted file mode 100644 index 3cc05eb234..0000000000 --- a/pkgs/objective_c/example/macos/Runner/MainFlutterWindow.swift +++ /dev/null @@ -1,15 +0,0 @@ -import Cocoa -import FlutterMacOS - -class MainFlutterWindow: NSWindow { - override func awakeFromNib() { - let flutterViewController = FlutterViewController() - let windowFrame = self.frame - self.contentViewController = flutterViewController - self.setFrame(windowFrame, display: true) - - RegisterGeneratedPlugins(registry: flutterViewController) - - super.awakeFromNib() - } -} diff --git a/pkgs/objective_c/example/macos/Runner/Release.entitlements b/pkgs/objective_c/example/macos/Runner/Release.entitlements deleted file mode 100644 index 852fa1a472..0000000000 --- a/pkgs/objective_c/example/macos/Runner/Release.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - com.apple.security.app-sandbox - - - diff --git a/pkgs/objective_c/example/macos/RunnerTests/RunnerTests.swift b/pkgs/objective_c/example/macos/RunnerTests/RunnerTests.swift deleted file mode 100644 index 61f3bd1fc5..0000000000 --- a/pkgs/objective_c/example/macos/RunnerTests/RunnerTests.swift +++ /dev/null @@ -1,12 +0,0 @@ -import Cocoa -import FlutterMacOS -import XCTest - -class RunnerTests: XCTestCase { - - func testExample() { - // If you add code to the Runner application, consider adding tests here. - // See https://developer.apple.com/documentation/xctest for more information about using XCTest. - } - -} diff --git a/pkgs/objective_c/example/pubspec.yaml b/pkgs/objective_c/example/pubspec.yaml index 8395b9bc66..7ff218f53b 100644 --- a/pkgs/objective_c/example/pubspec.yaml +++ b/pkgs/objective_c/example/pubspec.yaml @@ -1,27 +1,15 @@ -# Copyright (c) 2024, 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. - name: example description: "Demonstrates using package:objective_c" -publish_to: 'none' -version: 0.1.0 +version: 1.0.0 +publish_to: none environment: - sdk: '>=3.8.0 <4.0.0' - flutter: '>=3.32.0' + sdk: '>=3.9.0-21.0.dev <4.0.0' dependencies: - ffi: ^2.1.0 - flutter: - sdk: flutter objective_c: path: .. dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^3.0.0 - -flutter: - uses-material-design: true + lints: ^5.0.0 + test: ^1.24.0 diff --git a/pkgs/objective_c/ffigen_c.yaml b/pkgs/objective_c/ffigen_c.yaml index 779f01edfb..5db1ba35db 100644 --- a/pkgs/objective_c/ffigen_c.yaml +++ b/pkgs/objective_c/ffigen_c.yaml @@ -6,28 +6,20 @@ headers: entry-points: - 'src/include/dart_api_dl.h' - 'src/objective_c.h' - - 'src/objective_c_runtime.h' - 'src/os_version.h' ffi-native: - assetId: 'objective_c.framework/objective_c' + asset-id: 'package:objective_c/objective_c.dylib' exclude-all-by-default: true generate-for-package-objective-c: true sort: true functions: include: - - 'objc_.*' - - 'object_getClass' - - 'sel_registerName' - - 'sel_getName' - - 'protocol_getMethodDescription' - - 'protocol_getName' - 'newFinalizableHandle' - 'DOBJC_.*' leaf: include: - '.*' exclude: - - 'objc_msgSend.*' - 'DOBJC_deleteFinalizableHandle' - 'DOBJC_disposeObjCBlockWithClosure' - 'DOBJC_newFinalizableBool' @@ -35,31 +27,11 @@ functions: - 'DOBJC_awaitWaiter' rename: 'DOBJC_(.*)': '$1' - 'sel_registerName': 'registerName' - 'sel_getName': 'getName' - 'objc_getClass': 'getClass' - 'objc_retain': 'objectRetain' - 'objc_retainBlock': 'blockRetain' - 'objc_release': 'objectRelease' - 'objc_autorelease': 'objectAutorelease' - 'objc_msgSend': 'msgSend' - 'objc_msgSend_fpret': 'msgSendFpret' - 'objc_msgSend_stret': 'msgSendStret' - 'object_getClass': 'getObjectClass' - 'objc_copyClassList': 'copyClassList' - 'objc_getProtocol': 'getProtocol' - 'protocol_getMethodDescription': 'getMethodDescription' - 'protocol_getName': 'getProtocolName' -globals: - include: - - '_NSConcrete.*Block' - rename: - '_(.*)': '$1' typedefs: include: - 'Dart_FinalizableHandle' structs: - include : + include: - '_DOBJC_Context' rename: '_ObjC(.*)': 'ObjC$1' @@ -73,7 +45,7 @@ preamble: | // 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. - // Bindings for `src/objective_c.h` and `src/objective_c_runtime.h`. + // Bindings for `src/objective_c.h` etc. // Regenerate bindings with `dart run tool/generate_code.dart`. // ignore_for_file: always_specify_types diff --git a/pkgs/objective_c/ffigen_objc.yaml b/pkgs/objective_c/ffigen_objc.yaml index 6729995213..ed3bd43bdc 100644 --- a/pkgs/objective_c/ffigen_objc.yaml +++ b/pkgs/objective_c/ffigen_objc.yaml @@ -13,10 +13,13 @@ headers: - 'src/observer.h' - 'src/protocol.h' ffi-native: + asset-id: 'package:objective_c/objective_c.dylib' exclude-all-by-default: true include-transitive-objc-categories: false generate-for-package-objective-c: true sort: true +library-imports: + collection: 'dart:collection' external-versions: # See https://docs.flutter.dev/reference/supported-platforms. ios: @@ -158,14 +161,6 @@ enums: - NSURLBookmarkCreationOptions - NSURLBookmarkResolutionOptions - NSURLHandleStatus -globals: - include: - - NSKeyValueChangeIndexesKey - - NSKeyValueChangeKindKey - - NSKeyValueChangeNewKey - - NSKeyValueChangeNotificationIsPriorKey - - NSKeyValueChangeOldKey - - NSLocalizedDescriptionKey typedefs: include: - 'CFStringRef' @@ -174,7 +169,7 @@ preamble: | // 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. - // Bindings for `src/foundation.h`. + // Bindings for package:objective_c's ObjC code and the Foundation framework. // Regenerate bindings with `dart run tool/generate_code.dart`. // ignore_for_file: always_specify_types @@ -184,4 +179,3 @@ preamble: | // ignore_for_file: unused_element // ignore_for_file: unused_field // coverage:ignore-file - import 'dart:collection'; diff --git a/pkgs/objective_c/ffigen_runtime.yaml b/pkgs/objective_c/ffigen_runtime.yaml new file mode 100644 index 0000000000..fe88ffbafe --- /dev/null +++ b/pkgs/objective_c/ffigen_runtime.yaml @@ -0,0 +1,69 @@ +# Generate bindings for the ObjC runtime headers. +# Regenerate bindings with `dart run tool/generate_code.dart`. +name: RuntimeBindings +output: 'lib/src/runtime_bindings_generated.dart' +headers: + entry-points: + - 'src/objective_c_runtime.h' +ffi-native: +exclude-all-by-default: true +generate-for-package-objective-c: true +sort: true +functions: + include: + - 'objc_.*' + - 'object_getClass' + - 'sel_registerName' + - 'sel_getName' + - 'protocol_getMethodDescription' + - 'protocol_getName' + leaf: + include: + - '.*' + exclude: + - 'objc_msgSend.*' + rename: + 'sel_registerName': 'registerName' + 'sel_getName': 'getName' + 'objc_getClass': 'getClass' + 'objc_retain': 'objectRetain' + 'objc_retainBlock': 'blockRetain' + 'objc_release': 'objectRelease' + 'objc_autorelease': 'objectAutorelease' + 'objc_msgSend': 'msgSend' + 'objc_msgSend_fpret': 'msgSendFpret' + 'objc_msgSend_stret': 'msgSendStret' + 'object_getClass': 'getObjectClass' + 'objc_copyClassList': 'copyClassList' + 'objc_getProtocol': 'getProtocol' + 'protocol_getMethodDescription': 'getMethodDescription' + 'protocol_getName': 'getProtocolName' +globals: + include: + - '_NSConcrete.*Block' + - NSKeyValueChangeIndexesKey + - NSKeyValueChangeKindKey + - NSKeyValueChangeNewKey + - NSKeyValueChangeNotificationIsPriorKey + - NSKeyValueChangeOldKey + - NSLocalizedDescriptionKey + rename: + '_(.*)': '$1' +structs: + include: + - '_ObjC.*' + rename: + '_ObjC(.*)': 'ObjC$1' +preamble: | + // Copyright (c) 2024, 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. + + // Bindings for `src/objective_c_runtime.h`. + // Regenerate bindings with `dart run tool/generate_code.dart`. + + // ignore_for_file: always_specify_types + // ignore_for_file: camel_case_types + // ignore_for_file: non_constant_identifier_names + // ignore_for_file: unused_element + // coverage:ignore-file diff --git a/pkgs/objective_c/hook/build.dart b/pkgs/objective_c/hook/build.dart new file mode 100644 index 0000000000..539ee2a9c1 --- /dev/null +++ b/pkgs/objective_c/hook/build.dart @@ -0,0 +1,124 @@ +// Copyright (c) 2025, 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 'dart:io'; + +import 'package:code_assets/code_assets.dart'; +import 'package:hooks/hooks.dart'; +import 'package:logging/logging.dart'; +import 'package:native_toolchain_c/src/cbuilder/compiler_resolver.dart'; + +const objCFlags = ['-x', 'objective-c', '-fobjc-arc']; + +const assetName = 'objective_c.dylib'; + +// TODO(https://github.com/dart-lang/native/issues/2272): Remove this from the +// main build. +const extraCFiles = ['test/util.c']; + +final logger = Logger('') + ..level = Level.INFO + ..onRecord.listen((record) { + print('${record.level.name}: ${record.time}: ${record.message}'); + }); + +void main(List args) async { + await build(args, (input, output) async { + const supportedOSs = {OS.iOS, OS.macOS}; + if (!supportedOSs.contains(input.config.code.targetOS)) { + // Nothing to do. + return; + } + + if (input.config.code.linkModePreference == LinkModePreference.static) { + throw UnsupportedError('LinkModePreference.static is not supported.'); + } + + final packageName = input.packageName; + final assetPath = input.outputDirectory.resolve(assetName); + final srcDir = Directory.fromUri(input.packageRoot.resolve('src/')); + + final cFiles = []; + final mFiles = []; + final hFiles = []; + for (final file in srcDir.listSync(recursive: true)) { + if (file is File) { + final path = file.path; + if (path.endsWith('.c')) cFiles.add(path); + if (path.endsWith('.m')) mFiles.add(path); + if (path.endsWith('.h')) hFiles.add(path); + } + } + + cFiles.addAll(extraCFiles.map((f) => input.packageRoot.resolve(f).path)); + + final cFlags = []; + final mFlags = [...cFlags, ...objCFlags]; + + final builder = await Builder.create(input, input.packageRoot.path); + + final objectFiles = await Future.wait(>[ + for (final src in cFiles) builder.buildObject(src, cFlags), + for (final src in mFiles) builder.buildObject(src, mFlags), + ]); + await builder.linkLib(objectFiles, assetPath.toFilePath()); + + output.addDependencies(cFiles.map(Uri.file)); + output.addDependencies(mFiles.map(Uri.file)); + output.addDependencies(hFiles.map(Uri.file)); + + output.assets.code.add( + CodeAsset( + package: packageName, + name: assetName, + file: assetPath, + linkMode: DynamicLoadingBundled(), + ), + ); + }); +} + +class Builder { + final String _comp; + final String _rootDir; + final Uri _tempOutDir; + Builder._(this._comp, this._rootDir, this._tempOutDir); + + static Future create(BuildInput input, String rootDir) async { + final resolver = CompilerResolver( + codeConfig: input.config.code, + logger: logger, + ); + return Builder._( + (await resolver.resolveCompiler()).uri.toFilePath(), + rootDir, + input.outputDirectory.resolve('obj/'), + ); + } + + Future buildObject(String input, List flags) async { + assert(input.startsWith(_rootDir)); + final relativeInput = input.substring(_rootDir.length); + final output = '${_tempOutDir.resolve(relativeInput).path}.o'; + File(output).parent.createSync(recursive: true); + await _compile([...flags, '-c', input, '-fpic', '-I', 'src'], output); + return output; + } + + Future linkLib(List objects, String output) => + _compile(['-shared', '-undefined', 'dynamic_lookup', ...objects], output); + + Future _compile(List flags, String output) async { + final args = [...flags, '-o', output]; + logger.info('Running: $_comp ${args.join(" ")}'); + final proc = await Process.run(_comp, args); + logger.info(proc.stdout); + logger.info(proc.stderr); + if (proc.exitCode != 0) { + exitCode = proc.exitCode; + throw Exception('Command failed: $_comp ${args.join(" ")}'); + } + logger.info('Generated $output'); + } +} diff --git a/pkgs/objective_c/ios/Classes/objective_c.c b/pkgs/objective_c/ios/Classes/objective_c.c deleted file mode 100644 index 6d9c021cce..0000000000 --- a/pkgs/objective_c/ios/Classes/objective_c.c +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) 2024, 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. - -// Relative import to be able to reuse the C sources. -// See the comment in ../objective_c.podspec for more information. -#include "../../src/objective_c.c" -#include "../../src/include/dart_api_dl.c" diff --git a/pkgs/objective_c/ios/Classes/objective_c.m b/pkgs/objective_c/ios/Classes/objective_c.m deleted file mode 100644 index b3ce4fb158..0000000000 --- a/pkgs/objective_c/ios/Classes/objective_c.m +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2024, 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. - -// Relative import to be able to reuse the ObjC sources. -// See the comment in ../objective_c.podspec for more information. -#include "../../src/input_stream_adapter.m" -#include "../../src/objective_c.m" -#include "../../src/objective_c_bindings_generated.m" -#include "../../src/observer.m" -#include "../../src/protocol.m" diff --git a/pkgs/objective_c/ios/objective_c.podspec b/pkgs/objective_c/ios/objective_c.podspec deleted file mode 100644 index e784ccd7c0..0000000000 --- a/pkgs/objective_c/ios/objective_c.podspec +++ /dev/null @@ -1,28 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint objective_c.podspec` to validate before publishing. -# -Pod::Spec.new do |s| - s.name = 'objective_c' - s.version = '0.0.1' - s.summary = 'A library to access Objective C from Flutter that acts as a support library for package:ffigen.' - s.description = <<-DESC -A library to access Objective C from Flutter that acts as a support library for package:ffigen. - DESC - s.homepage = 'http://example.com' - s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } - - # This will ensure the source files in Classes/ are included in the native - # builds of apps using this FFI plugin. Podspec does not support relative - # paths, so Classes contains a forwarder C file that relatively imports - # `../src/*` so that the C sources can be shared among all target platforms. - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.dependency 'Flutter' - s.platform = :ios, '12.0' - - # Flutter.framework does not contain a i386 slice. - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } - s.swift_version = '5.0' -end diff --git a/pkgs/objective_c/lib/objective_c.dart b/pkgs/objective_c/lib/objective_c.dart index 02b661d843..573a6893af 100644 --- a/pkgs/objective_c/lib/objective_c.dart +++ b/pkgs/objective_c/lib/objective_c.dart @@ -10,16 +10,10 @@ export 'src/c_bindings_generated.dart' Dart_FinalizableHandle_, ObjCBlockDesc, ObjCBlockImpl, - ObjCMethodDesc, - ObjCObject, - ObjCProtocol, - ObjCSelector, - blockRetain, - objectRelease, - objectRetain, signalWaiter; export 'src/cf_string.dart'; export 'src/converter.dart'; +export 'src/globals.dart'; export 'src/internal.dart' hide blockHasRegisteredClosure, isValidBlock, isValidClass, isValidObject; export 'src/ns_data.dart'; @@ -29,7 +23,17 @@ export 'src/ns_mutable_data.dart'; export 'src/ns_number.dart'; export 'src/ns_string.dart'; export 'src/objective_c_bindings_exported.dart'; +export 'src/objective_c_bindings_generated.dart'; export 'src/observer.dart'; export 'src/os_version.dart'; export 'src/protocol_builder.dart'; +export 'src/runtime_bindings_generated.dart' + show + ObjCMethodDesc, + ObjCObject, + ObjCProtocol, + ObjCSelector, + blockRetain, + objectRelease, + objectRetain; export 'src/selector.dart'; diff --git a/pkgs/objective_c/lib/src/c_bindings_generated.dart b/pkgs/objective_c/lib/src/c_bindings_generated.dart index a14b277ac1..a5c072ab59 100644 --- a/pkgs/objective_c/lib/src/c_bindings_generated.dart +++ b/pkgs/objective_c/lib/src/c_bindings_generated.dart @@ -2,7 +2,7 @@ // 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. -// Bindings for `src/objective_c.h` and `src/objective_c_runtime.h`. +// Bindings for `src/objective_c.h` etc. // Regenerate bindings with `dart run tool/generate_code.dart`. // ignore_for_file: always_specify_types @@ -15,51 +15,16 @@ // // Generated by `package:ffigen`. // ignore_for_file: type=lint -@ffi.DefaultAsset('objective_c.framework/objective_c') +@ffi.DefaultAsset('package:objective_c/objective_c.dylib') library; import 'dart:ffi' as ffi; -@ffi.Array.multi([32]) -@ffi.Native>>(symbol: '_NSConcreteAutoBlock') -external ffi.Array> NSConcreteAutoBlock; - -@ffi.Array.multi([32]) -@ffi.Native>>( - symbol: '_NSConcreteFinalizingBlock', -) -external ffi.Array> NSConcreteFinalizingBlock; - -@ffi.Array.multi([32]) -@ffi.Native>>(symbol: '_NSConcreteGlobalBlock') -external ffi.Array> NSConcreteGlobalBlock; - -@ffi.Array.multi([32]) -@ffi.Native>>(symbol: '_NSConcreteMallocBlock') -external ffi.Array> NSConcreteMallocBlock; - -@ffi.Array.multi([32]) -@ffi.Native>>(symbol: '_NSConcreteStackBlock') -external ffi.Array> NSConcreteStackBlock; - @ffi.Native)>( symbol: 'DOBJC_awaitWaiter', ) external void awaitWaiter(ffi.Pointer waiter); -@ffi.Native Function(ffi.Pointer)>( - symbol: 'objc_retainBlock', - isLeaf: true, -) -external ffi.Pointer blockRetain(ffi.Pointer object); - -@ffi.Native< - ffi.Pointer> Function(ffi.Pointer) ->(symbol: 'objc_copyClassList', isLeaf: true) -external ffi.Pointer> copyClassList( - ffi.Pointer count, -); - @ffi.Native( symbol: 'DOBJC_deleteFinalizableHandle', ) @@ -81,55 +46,10 @@ external ffi.Pointer fillContext( ffi.Pointer context, ); -@ffi.Native Function(ffi.Pointer)>( - symbol: 'objc_getClass', - isLeaf: true, -) -external ffi.Pointer getClass(ffi.Pointer name); - -@ffi.Native< - ObjCMethodDesc Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Bool, - ) ->(symbol: 'protocol_getMethodDescription', isLeaf: true) -external ObjCMethodDesc getMethodDescription( - ffi.Pointer protocol, - ffi.Pointer sel, - bool isRequiredMethod, - bool isInstanceMethod, -); - -@ffi.Native Function(ffi.Pointer)>( - symbol: 'sel_getName', - isLeaf: true, -) -external ffi.Pointer getName(ffi.Pointer sel); - -@ffi.Native Function(ffi.Pointer)>( - symbol: 'object_getClass', - isLeaf: true, -) -external ffi.Pointer getObjectClass(ffi.Pointer object); - /// Returns the MacOS/iOS version we're running on. @ffi.Native<_Version Function()>(symbol: 'DOBJC_getOsVesion', isLeaf: true) external _Version getOsVesion(); -@ffi.Native Function(ffi.Pointer)>( - symbol: 'objc_getProtocol', - isLeaf: true, -) -external ffi.Pointer getProtocol(ffi.Pointer name); - -@ffi.Native Function(ffi.Pointer)>( - symbol: 'protocol_getName', - isLeaf: true, -) -external ffi.Pointer getProtocolName(ffi.Pointer proto); - @ffi.Native)>( symbol: 'DOBJC_initializeApi', isLeaf: true, @@ -142,15 +62,6 @@ external int initializeApi(ffi.Pointer data); ) external bool isValidBlock(ffi.Pointer block); -@ffi.Native(symbol: 'objc_msgSend') -external void msgSend(); - -@ffi.Native(symbol: 'objc_msgSend_fpret') -external void msgSendFpret(); - -@ffi.Native(symbol: 'objc_msgSend_stret') -external void msgSendStret(); - @ffi.Native Function(ffi.Handle)>( symbol: 'DOBJC_newFinalizableBool', ) @@ -170,32 +81,6 @@ external Dart_FinalizableHandle newFinalizableHandle( ) external ffi.Pointer newWaiter(); -@ffi.Native Function(ffi.Pointer)>( - symbol: 'objc_autorelease', - isLeaf: true, -) -external ffi.Pointer objectAutorelease( - ffi.Pointer object, -); - -@ffi.Native)>( - symbol: 'objc_release', - isLeaf: true, -) -external void objectRelease(ffi.Pointer object); - -@ffi.Native Function(ffi.Pointer)>( - symbol: 'objc_retain', - isLeaf: true, -) -external ffi.Pointer objectRetain(ffi.Pointer object); - -@ffi.Native Function(ffi.Pointer)>( - symbol: 'sel_registerName', - isLeaf: true, -) -external ffi.Pointer registerName(ffi.Pointer name); - @ffi.Native< ffi.Void Function( ffi.Pointer)>>, @@ -290,18 +175,8 @@ final class ObjCBlockImpl extends ffi.Struct { external int dispose_port; } -final class ObjCMethodDesc extends ffi.Struct { - external ffi.Pointer name; - - external ffi.Pointer types; -} - final class ObjCObject extends ffi.Opaque {} -final class ObjCProtocol extends ffi.Opaque {} - -final class ObjCSelector extends ffi.Opaque {} - final class _Dart_Isolate extends ffi.Opaque {} final class _Version extends ffi.Struct { diff --git a/pkgs/objective_c/lib/src/globals.dart b/pkgs/objective_c/lib/src/globals.dart new file mode 100644 index 0000000000..65fa8c71a3 --- /dev/null +++ b/pkgs/objective_c/lib/src/globals.dart @@ -0,0 +1,43 @@ +// Copyright (c) 2025, 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 'objective_c_bindings_generated.dart'; +import 'runtime_bindings_generated.dart' as r; + + +NSString get NSKeyValueChangeIndexesKey => NSString.castFromPointer( + r.NSKeyValueChangeIndexesKey, + retain: true, + release: true, +); + +NSString get NSKeyValueChangeKindKey => NSString.castFromPointer( + r.NSKeyValueChangeKindKey, + retain: true, + release: true, +); + +NSString get NSKeyValueChangeNewKey => NSString.castFromPointer( + r.NSKeyValueChangeNewKey, + retain: true, + release: true, +); + +NSString get NSKeyValueChangeNotificationIsPriorKey => NSString.castFromPointer( + r.NSKeyValueChangeNotificationIsPriorKey, + retain: true, + release: true, +); + +NSString get NSKeyValueChangeOldKey => NSString.castFromPointer( + r.NSKeyValueChangeOldKey, + retain: true, + release: true, +); + +NSString get NSLocalizedDescriptionKey => NSString.castFromPointer( + r.NSLocalizedDescriptionKey, + retain: true, + release: true, +); diff --git a/pkgs/objective_c/lib/src/internal.dart b/pkgs/objective_c/lib/src/internal.dart index b6507c6c21..7960d41bb3 100644 --- a/pkgs/objective_c/lib/src/internal.dart +++ b/pkgs/objective_c/lib/src/internal.dart @@ -8,8 +8,9 @@ import 'dart:isolate'; import 'package:ffi/ffi.dart'; import 'c_bindings_generated.dart' as c; +import 'runtime_bindings_generated.dart' as r; -typedef ObjectPtr = Pointer; +typedef ObjectPtr = Pointer; typedef BlockPtr = Pointer; typedef VoidPtr = Pointer; @@ -77,23 +78,25 @@ final class ObjCRuntimeError extends Error { String toString() => '$runtimeType: $message'; } -extension GetProtocolName on Pointer { +extension GetProtocolName on Pointer { /// Returns the name of the protocol. - String get name => c.getProtocolName(this).cast().toDartString(); + String get name => r.getProtocolName(this).cast().toDartString(); } /// Only for use by ffigen bindings. -Pointer registerName(String name) { +Pointer registerName(String name) { + _ensureDartAPI(); final cstr = name.toNativeUtf8(); - final sel = c.registerName(cstr.cast()); + final sel = r.registerName(cstr.cast()); calloc.free(cstr); return sel; } /// Only for use by ffigen bindings. ObjectPtr getClass(String name) { + _ensureDartAPI(); final cstr = name.toNativeUtf8(); - final clazz = c.getClass(cstr.cast()); + final clazz = r.getClass(cstr.cast()); calloc.free(cstr); if (clazz == nullptr) { throw FailedToLoadClassException(name); @@ -102,9 +105,10 @@ ObjectPtr getClass(String name) { } /// Only for use by ffigen bindings. -Pointer getProtocol(String name) { +Pointer getProtocol(String name) { + _ensureDartAPI(); final cstr = name.toNativeUtf8(); - final clazz = c.getProtocol(cstr.cast()); + final clazz = r.getProtocol(cstr.cast()); calloc.free(cstr); if (clazz == nullptr) { throw FailedToLoadProtocolException(name); @@ -114,12 +118,13 @@ Pointer getProtocol(String name) { /// Only for use by ffigen bindings. Pointer? getProtocolMethodSignature( - Pointer protocol, - Pointer sel, { + Pointer protocol, + Pointer sel, { required bool isRequired, required bool isInstanceMethod, }) { - final sig = c + _ensureDartAPI(); + final sig = r .getMethodDescription(protocol, sel, isRequired, isInstanceMethod) .types; return sig == nullptr ? null : sig; @@ -127,17 +132,17 @@ Pointer? getProtocolMethodSignature( /// Only for use by ffigen bindings. final msgSendPointer = Native.addressOf>( - c.msgSend, + r.msgSend, ); /// Only for use by ffigen bindings. final msgSendFpretPointer = Native.addressOf>( - c.msgSendFpret, + r.msgSendFpret, ); /// Only for use by ffigen bindings. final msgSendStretPointer = Native.addressOf>( - c.msgSendStret, + r.msgSendStret, ); /// Only for use by ffigen bindings. @@ -145,7 +150,7 @@ final useMsgSendVariants = Abi.current() == Abi.iosX64 || Abi.current() == Abi.macosX64; /// Only for use by ffigen bindings. -bool respondsToSelector(ObjectPtr obj, Pointer sel) => +bool respondsToSelector(ObjectPtr obj, Pointer sel) => _objcMsgSendRespondsToSelector(obj, _selRespondsToSelector, sel); final _selRespondsToSelector = registerName('respondsToSelector:'); final _objcMsgSendRespondsToSelector = msgSendPointer @@ -153,13 +158,13 @@ final _objcMsgSendRespondsToSelector = msgSendPointer NativeFunction< Bool Function( ObjectPtr, - Pointer, - Pointer aSelector, + Pointer, + Pointer aSelector, ) > >() .asFunction< - bool Function(ObjectPtr, Pointer, Pointer) + bool Function(ObjectPtr, Pointer, Pointer) >(); // _FinalizablePointer exists because we can't access `this` in the initializers @@ -227,10 +232,10 @@ abstract final class _ObjCReference _isReleased.value = true; } - void release() => _release(c.objectRelease); + void release() => _release(r.objectRelease); Pointer autorelease() { - _release(c.objectAutorelease); + _release(r.objectAutorelease); return _finalizable.ptr; } @@ -258,7 +263,7 @@ abstract final class _ObjCReference Pointer retainAndAutorelease() { final ptr = pointer; _retain(ptr); - c.objectAutorelease(ptr.cast()); + r.objectAutorelease(ptr.cast()); return ptr; } @@ -282,19 +287,19 @@ class _ObjCRefHolder> { } @pragma('vm:deeply-immutable') -final class ObjCObjectRef extends _ObjCReference { +final class ObjCObjectRef extends _ObjCReference { ObjCObjectRef(ObjectPtr ptr, {required super.retain, required super.release}) : super(_FinalizablePointer(ptr)); @override - void _retain(ObjectPtr ptr) => c.objectRetain(ptr); + void _retain(ObjectPtr ptr) => r.objectRetain(ptr); @override bool _isValid(ObjectPtr ptr) => _isValidObject(ptr); } /// Only for use by ffigen bindings. -class ObjCObjectBase extends _ObjCRefHolder { +class ObjCObjectBase extends _ObjCRefHolder { ObjCObjectBase(ObjectPtr ptr, {required bool retain, required bool release}) : super(ObjCObjectRef(ptr, retain: retain, release: release)); } @@ -303,7 +308,7 @@ class ObjCObjectBase extends _ObjCRefHolder { // readable memory, or be null. May (rarely) return false positives. bool _isValidObject(ObjectPtr ptr) { if (ptr == nullptr) return false; - return _isValidClass(c.getObjectClass(ptr)); + return _isValidClass(r.getObjectClass(ptr)); } final _allClasses = {}; @@ -318,7 +323,7 @@ bool _isValidClass(ObjectPtr clazz, {bool forceReloadClasses = false}) { // enabled, and only happens more than O(1) times if there are actually // invalid objects in use, which shouldn't happen in correct code. final countPtr = calloc(); - final classList = c.copyClassList(countPtr); + final classList = r.copyClassList(countPtr); final count = countPtr.value; calloc.free(countPtr); _allClasses.clear(); @@ -341,7 +346,7 @@ final class ObjCBlockRef extends _ObjCReference { : super(_FinalizablePointer(ptr)); @override - void _retain(BlockPtr ptr) => c.blockRetain(ptr.cast()); + void _retain(BlockPtr ptr) => r.blockRetain(ptr.cast()); @override bool _isValid(BlockPtr ptr) => c.isValidBlock(ptr); @@ -380,7 +385,7 @@ BlockPtr _newBlock( int flags, ) { final b = calloc.allocate(sizeOf()); - b.ref.isa = Native.addressOf>(c.NSConcreteGlobalBlock).cast(); + b.ref.isa = Native.addressOf>(r.NSConcreteGlobalBlock).cast(); b.ref.flags = flags; b.ref.reserved = 0; b.ref.invoke = invoke; @@ -388,11 +393,11 @@ BlockPtr _newBlock( b.ref.dispose_port = disposePort; b.ref.descriptor = descriptor; assert(c.isValidBlock(b)); - final copy = c.blockRetain(b.cast()).cast(); + final copy = r.blockRetain(b.cast()).cast(); calloc.free(b); assert( copy.ref.isa == - Native.addressOf>(c.NSConcreteMallocBlock).cast(), + Native.addressOf>(r.NSConcreteMallocBlock).cast(), ); assert(c.isValidBlock(copy)); return copy; diff --git a/pkgs/objective_c/lib/src/ns_input_stream.dart b/pkgs/objective_c/lib/src/ns_input_stream.dart index 8fd8ec742e..7952539996 100644 --- a/pkgs/objective_c/lib/src/ns_input_stream.dart +++ b/pkgs/objective_c/lib/src/ns_input_stream.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:ffi'; import 'dart:isolate'; +import 'globals.dart'; import 'ns_data.dart'; import 'ns_string.dart'; import 'objective_c_bindings_generated.dart'; diff --git a/pkgs/objective_c/lib/src/ns_string.dart b/pkgs/objective_c/lib/src/ns_string.dart index 552b418e56..ca25a11a7e 100644 --- a/pkgs/objective_c/lib/src/ns_string.dart +++ b/pkgs/objective_c/lib/src/ns_string.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffi/ffi.dart'; + import 'objective_c_bindings_generated.dart'; extension StringToNSString on String { diff --git a/pkgs/objective_c/lib/src/objective_c_bindings_exported.dart b/pkgs/objective_c/lib/src/objective_c_bindings_exported.dart index 0fabfe30fa..49a882fa9b 100644 --- a/pkgs/objective_c/lib/src/objective_c_bindings_exported.dart +++ b/pkgs/objective_c/lib/src/objective_c_bindings_exported.dart @@ -12,6 +12,8 @@ export 'objective_c_bindings_generated.dart' CGPoint, CGRect, CGSize, + DOBJCObservation, + DartInputStreamAdapter, DartProtocol, DartProtocolBuilder, NSAppleEventSendOptions, @@ -61,17 +63,11 @@ export 'objective_c_bindings_generated.dart' NSItemProviderRepresentationVisibility, NSItemProviderWriting, NSKeyValueChange, - NSKeyValueChangeIndexesKey, - NSKeyValueChangeKindKey, - NSKeyValueChangeNewKey, - NSKeyValueChangeNotificationIsPriorKey, - NSKeyValueChangeOldKey, NSKeyValueObservingOptions, NSKeyValueSetMutationKind, NSLinguisticTaggerOptions, NSLocale, NSLocaleLanguageDirection, - NSLocalizedDescriptionKey, NSMethodSignature, NSMutableArray, NSMutableCopying, diff --git a/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart b/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart index 2a494eb7c5..043286407b 100644 --- a/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart +++ b/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart @@ -2,7 +2,7 @@ // 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. -// Bindings for `src/foundation.h`. +// Bindings for package:objective_c's ObjC code and the Foundation framework. // Regenerate bindings with `dart run tool/generate_code.dart`. // ignore_for_file: always_specify_types @@ -12,126 +12,16 @@ // ignore_for_file: unused_element // ignore_for_file: unused_field // coverage:ignore-file -import 'dart:collection'; // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. // ignore_for_file: type=lint +import 'dart:collection' as collection; import 'dart:ffi' as ffi; import '../objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -@ffi.Native>(symbol: 'NSKeyValueChangeIndexesKey') -external ffi.Pointer _NSKeyValueChangeIndexesKey; - -NSString get NSKeyValueChangeIndexesKey => NSString.castFromPointer( - _NSKeyValueChangeIndexesKey, - retain: true, - release: true, -); - -set NSKeyValueChangeIndexesKey(NSString value) { - NSString.castFromPointer( - _NSKeyValueChangeIndexesKey, - retain: false, - release: true, - ).ref.release(); - _NSKeyValueChangeIndexesKey = value.ref.retainAndReturnPointer(); -} - -@ffi.Native>(symbol: 'NSKeyValueChangeKindKey') -external ffi.Pointer _NSKeyValueChangeKindKey; - -NSString get NSKeyValueChangeKindKey => NSString.castFromPointer( - _NSKeyValueChangeKindKey, - retain: true, - release: true, -); - -set NSKeyValueChangeKindKey(NSString value) { - NSString.castFromPointer( - _NSKeyValueChangeKindKey, - retain: false, - release: true, - ).ref.release(); - _NSKeyValueChangeKindKey = value.ref.retainAndReturnPointer(); -} - -@ffi.Native>(symbol: 'NSKeyValueChangeNewKey') -external ffi.Pointer _NSKeyValueChangeNewKey; - -NSString get NSKeyValueChangeNewKey => NSString.castFromPointer( - _NSKeyValueChangeNewKey, - retain: true, - release: true, -); - -set NSKeyValueChangeNewKey(NSString value) { - NSString.castFromPointer( - _NSKeyValueChangeNewKey, - retain: false, - release: true, - ).ref.release(); - _NSKeyValueChangeNewKey = value.ref.retainAndReturnPointer(); -} - -@ffi.Native>( - symbol: 'NSKeyValueChangeNotificationIsPriorKey', -) -external ffi.Pointer _NSKeyValueChangeNotificationIsPriorKey; - -NSString get NSKeyValueChangeNotificationIsPriorKey => NSString.castFromPointer( - _NSKeyValueChangeNotificationIsPriorKey, - retain: true, - release: true, -); - -set NSKeyValueChangeNotificationIsPriorKey(NSString value) { - NSString.castFromPointer( - _NSKeyValueChangeNotificationIsPriorKey, - retain: false, - release: true, - ).ref.release(); - _NSKeyValueChangeNotificationIsPriorKey = value.ref.retainAndReturnPointer(); -} - -@ffi.Native>(symbol: 'NSKeyValueChangeOldKey') -external ffi.Pointer _NSKeyValueChangeOldKey; - -NSString get NSKeyValueChangeOldKey => NSString.castFromPointer( - _NSKeyValueChangeOldKey, - retain: true, - release: true, -); - -set NSKeyValueChangeOldKey(NSString value) { - NSString.castFromPointer( - _NSKeyValueChangeOldKey, - retain: false, - release: true, - ).ref.release(); - _NSKeyValueChangeOldKey = value.ref.retainAndReturnPointer(); -} - -@ffi.Native>(symbol: 'NSLocalizedDescriptionKey') -external ffi.Pointer _NSLocalizedDescriptionKey; - -NSString get NSLocalizedDescriptionKey => NSString.castFromPointer( - _NSLocalizedDescriptionKey, - retain: true, - release: true, -); - -set NSLocalizedDescriptionKey(NSString value) { - NSString.castFromPointer( - _NSLocalizedDescriptionKey, - retain: false, - release: true, - ).ref.release(); - _NSLocalizedDescriptionKey = value.ref.retainAndReturnPointer(); -} - @ffi.Native< instancetype Function( ffi.Pointer, @@ -3341,7 +3231,7 @@ enum NSDecodingFailurePolicy { /// NSDictionary class NSDictionary extends NSObject - with MapBase + with collection.MapBase implements NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration { /// Creates a [NSDictionary] from [other]. static NSDictionary of(Map other) => @@ -8943,7 +8833,8 @@ class NSMethodSignature extends NSObject { } /// NSMutableArray -class NSMutableArray extends NSArray with ListBase { +class NSMutableArray extends NSArray + with collection.ListBase { /// Creates a [NSMutableArray] of the given length with [fill] at each /// position. /// @@ -17243,7 +17134,7 @@ interface class NSSecureCoding extends objc.ObjCProtocolBase /// NSSet class NSSet extends NSObject - with SetBase + with collection.SetBase implements NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration { /// Creates a [NSSet] from [elements]. static NSSet of(Iterable elements) => diff --git a/pkgs/objective_c/lib/src/protocol_builder.dart b/pkgs/objective_c/lib/src/protocol_builder.dart index b2b086bc72..5980eb41d2 100644 --- a/pkgs/objective_c/lib/src/protocol_builder.dart +++ b/pkgs/objective_c/lib/src/protocol_builder.dart @@ -12,6 +12,7 @@ import 'c_bindings_generated.dart' as c; import 'internal.dart' show FailedToLoadProtocolMethodException, GetProtocolName, ObjCBlockBase; import 'objective_c_bindings_generated.dart' as objc; +import 'runtime_bindings_generated.dart' as r; import 'selector.dart'; /// Helper class for building Objective C objects that implement protocols. @@ -31,7 +32,7 @@ class ObjCProtocolBuilder { /// /// Note: You cannot call this method after you have called [build]. void implementMethod( - Pointer sel, + Pointer sel, Pointer signature, Pointer trampoline, ObjCBlockBase block, @@ -91,8 +92,8 @@ class ObjCProtocolBuilder { /// want to implement. The generated bindings will include a /// [ObjCProtocolMethod] for each method of the protocol. class ObjCProtocolMethod { - final Pointer _proto; - final Pointer _sel; + final Pointer _proto; + final Pointer _sel; final Pointer _trampoline; final Pointer? _signature; final ObjCBlockBase Function(T) _createBlock; diff --git a/pkgs/objective_c/lib/src/runtime_bindings_generated.dart b/pkgs/objective_c/lib/src/runtime_bindings_generated.dart new file mode 100644 index 0000000000..aa4829d0e8 --- /dev/null +++ b/pkgs/objective_c/lib/src/runtime_bindings_generated.dart @@ -0,0 +1,163 @@ +// Copyright (c) 2024, 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. + +// Bindings for `src/objective_c_runtime.h`. +// Regenerate bindings with `dart run tool/generate_code.dart`. + +// ignore_for_file: always_specify_types +// ignore_for_file: camel_case_types +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: unused_element +// coverage:ignore-file + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +// ignore_for_file: type=lint +import 'dart:ffi' as ffi; + +@ffi.Array.multi([32]) +@ffi.Native>>(symbol: '_NSConcreteAutoBlock') +external ffi.Array> NSConcreteAutoBlock; + +@ffi.Array.multi([32]) +@ffi.Native>>( + symbol: '_NSConcreteFinalizingBlock', +) +external ffi.Array> NSConcreteFinalizingBlock; + +@ffi.Array.multi([32]) +@ffi.Native>>(symbol: '_NSConcreteGlobalBlock') +external ffi.Array> NSConcreteGlobalBlock; + +@ffi.Array.multi([32]) +@ffi.Native>>(symbol: '_NSConcreteMallocBlock') +external ffi.Array> NSConcreteMallocBlock; + +@ffi.Array.multi([32]) +@ffi.Native>>(symbol: '_NSConcreteStackBlock') +external ffi.Array> NSConcreteStackBlock; + +@ffi.Native>() +external ffi.Pointer NSKeyValueChangeIndexesKey; + +@ffi.Native>() +external ffi.Pointer NSKeyValueChangeKindKey; + +@ffi.Native>() +external ffi.Pointer NSKeyValueChangeNewKey; + +@ffi.Native>() +external ffi.Pointer NSKeyValueChangeNotificationIsPriorKey; + +@ffi.Native>() +external ffi.Pointer NSKeyValueChangeOldKey; + +@ffi.Native>() +external ffi.Pointer NSLocalizedDescriptionKey; + +@ffi.Native Function(ffi.Pointer)>( + symbol: 'objc_retainBlock', + isLeaf: true, +) +external ffi.Pointer blockRetain(ffi.Pointer object); + +@ffi.Native< + ffi.Pointer> Function(ffi.Pointer) +>(symbol: 'objc_copyClassList', isLeaf: true) +external ffi.Pointer> copyClassList( + ffi.Pointer count, +); + +@ffi.Native Function(ffi.Pointer)>( + symbol: 'objc_getClass', + isLeaf: true, +) +external ffi.Pointer getClass(ffi.Pointer name); + +@ffi.Native< + ObjCMethodDesc Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Bool, + ) +>(symbol: 'protocol_getMethodDescription', isLeaf: true) +external ObjCMethodDesc getMethodDescription( + ffi.Pointer protocol, + ffi.Pointer sel, + bool isRequiredMethod, + bool isInstanceMethod, +); + +@ffi.Native Function(ffi.Pointer)>( + symbol: 'sel_getName', + isLeaf: true, +) +external ffi.Pointer getName(ffi.Pointer sel); + +@ffi.Native Function(ffi.Pointer)>( + symbol: 'object_getClass', + isLeaf: true, +) +external ffi.Pointer getObjectClass(ffi.Pointer object); + +@ffi.Native Function(ffi.Pointer)>( + symbol: 'objc_getProtocol', + isLeaf: true, +) +external ffi.Pointer getProtocol(ffi.Pointer name); + +@ffi.Native Function(ffi.Pointer)>( + symbol: 'protocol_getName', + isLeaf: true, +) +external ffi.Pointer getProtocolName(ffi.Pointer proto); + +@ffi.Native(symbol: 'objc_msgSend') +external void msgSend(); + +@ffi.Native(symbol: 'objc_msgSend_fpret') +external void msgSendFpret(); + +@ffi.Native(symbol: 'objc_msgSend_stret') +external void msgSendStret(); + +@ffi.Native Function(ffi.Pointer)>( + symbol: 'objc_autorelease', + isLeaf: true, +) +external ffi.Pointer objectAutorelease( + ffi.Pointer object, +); + +@ffi.Native)>( + symbol: 'objc_release', + isLeaf: true, +) +external void objectRelease(ffi.Pointer object); + +@ffi.Native Function(ffi.Pointer)>( + symbol: 'objc_retain', + isLeaf: true, +) +external ffi.Pointer objectRetain(ffi.Pointer object); + +@ffi.Native Function(ffi.Pointer)>( + symbol: 'sel_registerName', + isLeaf: true, +) +external ffi.Pointer registerName(ffi.Pointer name); + +final class ObjCMethodDesc extends ffi.Struct { + external ffi.Pointer name; + + external ffi.Pointer types; +} + +final class ObjCObject extends ffi.Opaque {} + +final class ObjCProtocol extends ffi.Opaque {} + +final class ObjCSelector extends ffi.Opaque {} diff --git a/pkgs/objective_c/lib/src/selector.dart b/pkgs/objective_c/lib/src/selector.dart index 93c79be006..f7d70583fb 100644 --- a/pkgs/objective_c/lib/src/selector.dart +++ b/pkgs/objective_c/lib/src/selector.dart @@ -6,20 +6,20 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; -import 'c_bindings_generated.dart' as c; import 'internal.dart'; +import 'runtime_bindings_generated.dart' as r; extension StringToSelector on String { /// Returns an Objective-C selector (aka `SEL`) for this [String]. /// /// This is equivalent to the Objective-C `@selector()` directive, or the /// `NSSelectorFromString` function. - Pointer toSelector() => registerName(this); + Pointer toSelector() => registerName(this); } -extension SelectorToString on Pointer { +extension SelectorToString on Pointer { /// Returns the string that this Objective-C selector represents. /// /// This is equivalent to the Objective-C `NSSelectorFromString` function. - String toDartString() => c.getName(this).cast().toDartString(); + String toDartString() => r.getName(this).cast().toDartString(); } diff --git a/pkgs/objective_c/macos/Classes/objective_c.c b/pkgs/objective_c/macos/Classes/objective_c.c deleted file mode 100644 index 6d9c021cce..0000000000 --- a/pkgs/objective_c/macos/Classes/objective_c.c +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) 2024, 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. - -// Relative import to be able to reuse the C sources. -// See the comment in ../objective_c.podspec for more information. -#include "../../src/objective_c.c" -#include "../../src/include/dart_api_dl.c" diff --git a/pkgs/objective_c/macos/Classes/objective_c.m b/pkgs/objective_c/macos/Classes/objective_c.m deleted file mode 100644 index b3ce4fb158..0000000000 --- a/pkgs/objective_c/macos/Classes/objective_c.m +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2024, 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. - -// Relative import to be able to reuse the ObjC sources. -// See the comment in ../objective_c.podspec for more information. -#include "../../src/input_stream_adapter.m" -#include "../../src/objective_c.m" -#include "../../src/objective_c_bindings_generated.m" -#include "../../src/observer.m" -#include "../../src/protocol.m" diff --git a/pkgs/objective_c/macos/objective_c.podspec b/pkgs/objective_c/macos/objective_c.podspec deleted file mode 100644 index f3ae43b6b3..0000000000 --- a/pkgs/objective_c/macos/objective_c.podspec +++ /dev/null @@ -1,27 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint objective_c.podspec` to validate before publishing. -# -Pod::Spec.new do |s| - s.name = 'objective_c' - s.version = '0.0.1' - s.summary = 'A library to access Objective C from Flutter that acts as a support library for package:ffigen.' - s.description = <<-DESC -A library to access Objective C from Flutter that acts as a support library for package:ffigen. - DESC - s.homepage = 'http://example.com' - s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } - - # This will ensure the source files in Classes/ are included in the native - # builds of apps using this FFI plugin. Podspec does not support relative - # paths, so Classes contains a forwarder C file that relatively imports - # `../src/*` so that the C sources can be shared among all target platforms. - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.dependency 'FlutterMacOS' - - s.platform = :osx, '10.11' - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } - s.swift_version = '5.0' -end diff --git a/pkgs/objective_c/pubspec.yaml b/pkgs/objective_c/pubspec.yaml index 08e3571ce9..311245c36d 100644 --- a/pkgs/objective_c/pubspec.yaml +++ b/pkgs/objective_c/pubspec.yaml @@ -15,34 +15,30 @@ topics: - codegen environment: - sdk: '>=3.8.0 <4.0.0' - flutter: '>=3.32.0' + sdk: '>=3.9.0-21.0.dev <4.0.0' dependencies: + code_assets: ^0.19.0 ffi: ^2.1.0 - flutter: - sdk: flutter + hooks: ^0.19.0 + logging: ^1.3.0 + native_toolchain_c: ^0.16.0 pub_semver: ^2.1.4 dev_dependencies: args: ^2.6.0 dart_flutter_team_lints: ^3.5.1 ffigen: ^19.1.0 - flutter_lints: ^5.0.0 - flutter_test: - sdk: flutter path: ^1.9.0 - test: ^1.21.1 + test: ^1.26.2 yaml: ^3.1.0 dependency_overrides: + code_assets: + path: ../code_assets ffigen: - path: ../ffigen/ - -flutter: - plugin: - platforms: - ios: - ffiPlugin: true - macos: - ffiPlugin: true + path: ../ffigen + hooks: + path: ../hooks + native_toolchain_c: + path: ../native_toolchain_c diff --git a/pkgs/objective_c/src/CMakeLists.txt b/pkgs/objective_c/src/CMakeLists.txt deleted file mode 100644 index 14fc5b5751..0000000000 --- a/pkgs/objective_c/src/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -# The Flutter tooling requires that developers have CMake 3.10 or later -# installed. You should not increase this version, as doing so will cause -# the plugin to fail to compile for some customers of the plugin. -cmake_minimum_required(VERSION 3.10) - -project(objective_c_library VERSION 0.0.1 LANGUAGES C) - -add_library(objective_c SHARED - "objective_c.c" - "objective_c.m" - "protocol.m" - "include/dart_api_dl.c" -) - -target_link_options(objective_c PRIVATE "-undefined dynamic_lookup") - -set_target_properties(objective_c PROPERTIES - PUBLIC_HEADER objective_c.h - OUTPUT_NAME "objective_c" -) - -target_compile_definitions(objective_c PUBLIC DART_SHARED_LIB) diff --git a/pkgs/objective_c/src/objective_c.c b/pkgs/objective_c/src/objective_c.c index c59a1906ac..9b6e31446f 100644 --- a/pkgs/objective_c/src/objective_c.c +++ b/pkgs/objective_c/src/objective_c.c @@ -50,10 +50,6 @@ FFI_EXPORT bool* DOBJC_newFinalizableBool(Dart_Handle owner) { return pointer; } -FFI_EXPORT intptr_t DOBJC_initializeApi(void* data) { - return Dart_InitializeApiDL(data); -} - FFI_EXPORT DOBJC_Context* DOBJC_fillContext(DOBJC_Context* context) { context->version = 1; context->newWaiter = DOBJC_newWaiter; diff --git a/pkgs/objective_c/src/objective_c.h b/pkgs/objective_c/src/objective_c.h index a389923ee6..033036d04e 100644 --- a/pkgs/objective_c/src/objective_c.h +++ b/pkgs/objective_c/src/objective_c.h @@ -9,6 +9,27 @@ #include "include/dart_api_dl.h" #include "objective_c_runtime.h" +// See https://clang.llvm.org/docs/Block-ABI-Apple.html +typedef struct _ObjCBlockDesc { + unsigned long int reserved; + unsigned long int size; // sizeof(ObjCBlockImpl) + void (*copy_helper)(void *dst, void *src); + void (*dispose_helper)(void *src); + const char *signature; +} ObjCBlockDesc; + +typedef struct _ObjCBlockImpl { + void *isa; // _NSConcreteGlobalBlock + int flags; + int reserved; + void *invoke; // RET (*invoke)(ObjCBlockImpl *, ARGS...); + ObjCBlockDesc *descriptor; + + // Captured variables follow. These are specific to our use case. + void *target; + Dart_Port dispose_port; +} ObjCBlockImpl; + // Initialize the Dart API. FFI_EXPORT intptr_t DOBJC_initializeApi(void *data); @@ -36,10 +57,6 @@ FFI_EXPORT bool *DOBJC_newFinalizableBool(Dart_Handle owner); // Runs fn(arg) on the main thread. If runOnMainThread is already running on the // main thread, fn(arg) is invoked synchronously. Otherwise it is dispatched to // the main thread (ie dispatch_async(dispatch_get_main_queue(), ...)). -// -// This assumes that the main thread is executing its queue. If not, #define -// NO_MAIN_THREAD_DISPATCH to disable this, and run fn(arg) synchronously. The -// flutter runner does execute the main dispatch queue, but the Dart VM doesn't. FFI_EXPORT void DOBJC_runOnMainThread(void (*fn)(void *), void *arg); // Functions for creating a waiter, signaling it, and waiting for the signal. A diff --git a/pkgs/objective_c/src/objective_c.m b/pkgs/objective_c/src/objective_c.m index cebdaba738..b55e7af840 100644 --- a/pkgs/objective_c/src/objective_c.m +++ b/pkgs/objective_c/src/objective_c.m @@ -8,20 +8,26 @@ #import #include "ffi.h" +#include "include/dart_api_dl.h" #include "os_version.h" +_Atomic bool _mainThreadIsListening = false; + +FFI_EXPORT intptr_t DOBJC_initializeApi(void* data) { + dispatch_async(dispatch_get_main_queue(), ^{ + _mainThreadIsListening = true; + }); + return Dart_InitializeApiDL(data); +} + FFI_EXPORT void DOBJC_runOnMainThread(void (*fn)(void *), void *arg) { -#ifdef NO_MAIN_THREAD_DISPATCH - fn(arg); -#else - if ([NSThread isMainThread]) { + if (!_mainThreadIsListening || [NSThread isMainThread]) { fn(arg); } else { dispatch_async(dispatch_get_main_queue(), ^{ fn(arg); }); } -#endif } @interface DOBJCWaiter : NSObject {} diff --git a/pkgs/objective_c/src/objective_c_runtime.h b/pkgs/objective_c/src/objective_c_runtime.h index f911c549f3..bc9179528b 100644 --- a/pkgs/objective_c/src/objective_c_runtime.h +++ b/pkgs/objective_c/src/objective_c_runtime.h @@ -31,27 +31,6 @@ void objc_msgSend(void); void objc_msgSend_fpret(void); void objc_msgSend_stret(void); -// See https://clang.llvm.org/docs/Block-ABI-Apple.html -typedef struct _ObjCBlockDesc { - unsigned long int reserved; - unsigned long int size; // sizeof(ObjCBlockImpl) - void (*copy_helper)(void *dst, void *src); - void (*dispose_helper)(void *src); - const char *signature; -} ObjCBlockDesc; - -typedef struct _ObjCBlockImpl { - void *isa; // _NSConcreteGlobalBlock - int flags; - int reserved; - void *invoke; // RET (*invoke)(ObjCBlockImpl *, ARGS...); - ObjCBlockDesc *descriptor; - - // Captured variables follow. These are specific to our use case. - void *target; - Dart_Port dispose_port; -} ObjCBlockImpl; - // https://opensource.apple.com/source/libclosure/libclosure-38/Block_private.h extern void *_NSConcreteStackBlock[32]; extern void *_NSConcreteMallocBlock[32]; @@ -71,4 +50,11 @@ ObjCMethodDesc protocol_getMethodDescription( bool isInstanceMethod); const char *protocol_getName(ObjCProtocol *proto); +extern const ObjCObject *NSKeyValueChangeIndexesKey; +extern const ObjCObject *NSKeyValueChangeKindKey; +extern const ObjCObject *NSKeyValueChangeNewKey; +extern const ObjCObject *NSKeyValueChangeNotificationIsPriorKey; +extern const ObjCObject *NSKeyValueChangeOldKey; +extern const ObjCObject *NSLocalizedDescriptionKey; + #endif // OBJECTIVE_C_SRC_OBJECTIVE_C_RUNTIME_H_ diff --git a/pkgs/objective_c/test/cf_string_test.dart b/pkgs/objective_c/test/cf_string_test.dart index 84d76b1327..dbde1fb1fd 100644 --- a/pkgs/objective_c/test/cf_string_test.dart +++ b/pkgs/objective_c/test/cf_string_test.dart @@ -6,20 +6,11 @@ @TestOn('mac-os') library; -import 'dart:ffi'; - import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('CFString', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - for (final s in ['Hello', '🇵🇬', 'Embedded\u0000Null']) { test('CFString conversions [$s]', () { final cfString = s diff --git a/pkgs/objective_c/test/converter_test.dart b/pkgs/objective_c/test/converter_test.dart index 6cc3259d03..4a97ccc9b5 100644 --- a/pkgs/objective_c/test/converter_test.dart +++ b/pkgs/objective_c/test/converter_test.dart @@ -6,20 +6,11 @@ @TestOn('mac-os') library; -import 'dart:ffi'; - import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('converter', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - test('basics', () { final obj = NSObject(); expect(toObjCObject(obj), obj); diff --git a/pkgs/objective_c/test/generate_code_test.dart b/pkgs/objective_c/test/generate_code_test.dart index 5d9bb59abf..511a21e4e5 100644 --- a/pkgs/objective_c/test/generate_code_test.dart +++ b/pkgs/objective_c/test/generate_code_test.dart @@ -22,13 +22,22 @@ void main() { await expectLater(generate_code.run(format: true), completes); // Sanity check the generated code. + final rBindings = File( + 'lib/src/runtime_bindings_generated.dart', + ).readAsStringSync(); + expect(rBindings, contains('sel_registerName')); + expect(rBindings, contains('objc_msgSend')); + expect(rBindings, contains('_NSConcreteGlobalBlock')); + expect(rBindings, contains('ObjCObject')); + final cBindings = File( 'lib/src/c_bindings_generated.dart', ).readAsStringSync(); - expect(cBindings, contains('sel_registerName')); - expect(cBindings, contains('objc_msgSend')); - expect(cBindings, contains('_NSConcreteGlobalBlock')); - expect(cBindings, contains('ObjCBlock')); + expect(cBindings, contains('fillContext')); + expect(cBindings, contains('DOBJC_Context')); + expect(cBindings, contains('Dart_FinalizableHandle')); + expect(cBindings, contains('ILLEGAL_PORT')); + expect(cBindings, contains('ObjCBlockImpl')); final objcBindings = File( 'lib/src/objective_c_bindings_generated.dart', diff --git a/pkgs/objective_c/test/interface_lists_test.dart b/pkgs/objective_c/test/interface_lists_test.dart index 6ba8cb3e06..493d6be57d 100644 --- a/pkgs/objective_c/test/interface_lists_test.dart +++ b/pkgs/objective_c/test/interface_lists_test.dart @@ -87,11 +87,6 @@ void main() { ); }); - test('All code genned globals are included in the list', () { - final allGlobals = findBindings(RegExp(r'^\w+ get (\w+) =>')); - expectSetsEqual('generated globals', objCBuiltInGlobals, allGlobals); - }); - test('No stubs', () { final stubRegExp = RegExp(r'\Wstub\W'); expect(bindings.where(stubRegExp.hasMatch).toList(), []); diff --git a/pkgs/objective_c/test/ns_input_stream_test.dart b/pkgs/objective_c/test/ns_input_stream_test.dart index 6caaed3d77..26dc863788 100644 --- a/pkgs/objective_c/test/ns_input_stream_test.dart +++ b/pkgs/objective_c/test/ns_input_stream_test.dart @@ -41,11 +41,6 @@ Future<(int, Uint8List, bool, NSStreamStatus, NSError?)> read( void main() { group('NSInputStream', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - group('toNSInputStream', () { group('empty', () { late NSInputStream inputStream; diff --git a/pkgs/objective_c/test/ns_mutable_data_test.dart b/pkgs/objective_c/test/ns_mutable_data_test.dart index 57e1448427..970ca59766 100644 --- a/pkgs/objective_c/test/ns_mutable_data_test.dart +++ b/pkgs/objective_c/test/ns_mutable_data_test.dart @@ -12,15 +12,8 @@ import 'package:ffi/ffi.dart'; import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('NSData', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - group('toNSData', () { test('empty', () { final data = [].toNSMutableData(); diff --git a/pkgs/objective_c/test/nsarray_test.dart b/pkgs/objective_c/test/nsarray_test.dart index c366401bba..1a0dbc46cf 100644 --- a/pkgs/objective_c/test/nsarray_test.dart +++ b/pkgs/objective_c/test/nsarray_test.dart @@ -6,20 +6,11 @@ @TestOn('mac-os') library; -import 'dart:ffi'; - import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('NSArray', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - test('filled', () { final obj = NSObject(); final array = NSArray.filled(3, obj); diff --git a/pkgs/objective_c/test/nsdata_test.dart b/pkgs/objective_c/test/nsdata_test.dart index 6c6250480b..99f9f2d593 100644 --- a/pkgs/objective_c/test/nsdata_test.dart +++ b/pkgs/objective_c/test/nsdata_test.dart @@ -12,15 +12,8 @@ import 'package:ffi/ffi.dart'; import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('NSData', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - group('toNSData', () { test('empty', () { final data = [].toNSData(); diff --git a/pkgs/objective_c/test/nsdate_test.dart b/pkgs/objective_c/test/nsdate_test.dart index 5dcd5029ef..4079e60b42 100644 --- a/pkgs/objective_c/test/nsdate_test.dart +++ b/pkgs/objective_c/test/nsdate_test.dart @@ -6,20 +6,11 @@ @TestOn('mac-os') library; -import 'dart:ffi'; - import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('NSDate', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - test('from DateTime', () { final dartFirstAppeared = DateTime.utc(2011, 10, 10); final nsDate = dartFirstAppeared.toNSDate(); diff --git a/pkgs/objective_c/test/nsdictionary_test.dart b/pkgs/objective_c/test/nsdictionary_test.dart index 04b970a81c..7c860561c4 100644 --- a/pkgs/objective_c/test/nsdictionary_test.dart +++ b/pkgs/objective_c/test/nsdictionary_test.dart @@ -6,20 +6,11 @@ @TestOn('mac-os') library; -import 'dart:ffi'; - import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('NSDictionary', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - test('of', () { final obj1 = 'obj1'.toNSString(); final obj2 = 'obj2'.toNSString(); diff --git a/pkgs/objective_c/test/nsmutablearray_test.dart b/pkgs/objective_c/test/nsmutablearray_test.dart index d01b21571b..b777061820 100644 --- a/pkgs/objective_c/test/nsmutablearray_test.dart +++ b/pkgs/objective_c/test/nsmutablearray_test.dart @@ -6,20 +6,11 @@ @TestOn('mac-os') library; -import 'dart:ffi'; - import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('NSMutableArray', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - test('filled', () { final obj = NSObject(); final array = NSMutableArray.filled(3, obj); diff --git a/pkgs/objective_c/test/nsmutabledictionary_test.dart b/pkgs/objective_c/test/nsmutabledictionary_test.dart index 4c2e60c14b..eefcdaa415 100644 --- a/pkgs/objective_c/test/nsmutabledictionary_test.dart +++ b/pkgs/objective_c/test/nsmutabledictionary_test.dart @@ -6,20 +6,11 @@ @TestOn('mac-os') library; -import 'dart:ffi'; - import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('NSMutableDictionary', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - test('of', () { final obj1 = 'obj1'.toNSString(); final obj2 = 'obj2'.toNSString(); diff --git a/pkgs/objective_c/test/nsmutableset_test.dart b/pkgs/objective_c/test/nsmutableset_test.dart index e294cfb43c..2de1601224 100644 --- a/pkgs/objective_c/test/nsmutableset_test.dart +++ b/pkgs/objective_c/test/nsmutableset_test.dart @@ -6,20 +6,11 @@ @TestOn('mac-os') library; -import 'dart:ffi'; - import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('NSMutableSet', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - test('of', () { final obj1 = NSObject(); final obj2 = NSObject(); diff --git a/pkgs/objective_c/test/nsnumber_test.dart b/pkgs/objective_c/test/nsnumber_test.dart index bcecd1e937..4cca1eb1fb 100644 --- a/pkgs/objective_c/test/nsnumber_test.dart +++ b/pkgs/objective_c/test/nsnumber_test.dart @@ -6,20 +6,11 @@ @TestOn('mac-os') library; -import 'dart:ffi'; - import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('NSNumber', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - test('from double', () { final n = 1.23.toNSNumber(); diff --git a/pkgs/objective_c/test/nsset_test.dart b/pkgs/objective_c/test/nsset_test.dart index 29e9127885..ff5253fd1c 100644 --- a/pkgs/objective_c/test/nsset_test.dart +++ b/pkgs/objective_c/test/nsset_test.dart @@ -6,20 +6,11 @@ @TestOn('mac-os') library; -import 'dart:ffi'; - import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('NSSet', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - test('of', () { final obj1 = NSObject(); final obj2 = NSObject(); diff --git a/pkgs/objective_c/test/nsstring_test.dart b/pkgs/objective_c/test/nsstring_test.dart index c58ab33bab..9aaf5052ee 100644 --- a/pkgs/objective_c/test/nsstring_test.dart +++ b/pkgs/objective_c/test/nsstring_test.dart @@ -6,20 +6,11 @@ @TestOn('mac-os') library; -import 'dart:ffi'; - import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('NSString', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - for (final s in ['Hello', '🇵🇬', 'Embedded\u0000Null']) { test('NSString to/from Dart string [$s]', () { final ns1 = NSString(s); diff --git a/pkgs/objective_c/test/observer_test.dart b/pkgs/objective_c/test/observer_test.dart index f92b379345..1f68c94c33 100644 --- a/pkgs/objective_c/test/observer_test.dart +++ b/pkgs/objective_c/test/observer_test.dart @@ -15,11 +15,6 @@ import 'util.dart'; void main() { group('Observer', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - test('receive updates', () { // Using NSProgress here because it's already part of our generated // bindings and has a property with a getter and setter. diff --git a/pkgs/objective_c/test/os_version_test.dart b/pkgs/objective_c/test/os_version_test.dart index 8a5a82491f..aed4c57f1d 100644 --- a/pkgs/objective_c/test/os_version_test.dart +++ b/pkgs/objective_c/test/os_version_test.dart @@ -6,20 +6,11 @@ @TestOn('mac-os') library; -import 'dart:ffi'; - import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('osVersion', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - test('getter', () { // macOS 11 was released in 2020 and isn't supported anymore. final oldVersion = Version(11, 0, 0); diff --git a/pkgs/objective_c/test/selector_test.dart b/pkgs/objective_c/test/selector_test.dart index cf2d68d79f..9a96dd1a7f 100644 --- a/pkgs/objective_c/test/selector_test.dart +++ b/pkgs/objective_c/test/selector_test.dart @@ -6,20 +6,11 @@ @TestOn('mac-os') library; -import 'dart:ffi'; - import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -import 'util.dart'; - void main() { group('Selector', () { - setUpAll(() { - // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. - DynamicLibrary.open(testDylib); - }); - test('from String and back', () { expect('hello'.toSelector().toDartString(), 'hello'); expect(''.toSelector().toDartString(), ''); diff --git a/pkgs/objective_c/test/setup.dart b/pkgs/objective_c/test/setup.dart deleted file mode 100644 index a7ae84d0c5..0000000000 --- a/pkgs/objective_c/test/setup.dart +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) 2024, 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. - -// When users import package:objective_c as a plugin, Flutter builds our native -// code automatically. But we want to be able to run tests using `dart test`, so -// we can't use Flutter's build system. So this script builds a dylib containing -// all that native code. - -// ignore_for_file: avoid_print - -import 'dart:ffi'; -import 'dart:io'; - -import 'package:args/args.dart'; - -final cFiles = [ - 'src/objective_c.c', - 'src/include/dart_api_dl.c', - 'test/util.c', -].map(_resolve); -final cMain = _resolve('test/main.c'); -final objCFiles = [ - 'src/input_stream_adapter.m', - 'src/ns_number.m', - 'src/objective_c.m', - 'src/objective_c_bindings_generated.m', - 'src/observer.m', - 'src/protocol.m', -].map(_resolve); -const objCFlags = ['-x', 'objective-c', '-fobjc-arc']; -final outputFile = _resolve('test/objective_c.dylib'); - -final _repoDir = () { - var path = Platform.script; - while (path.pathSegments.isNotEmpty) { - path = path.resolve('..'); - if (Directory(path.resolve('.git').toFilePath()).existsSync()) { - return path; - } - } - throw Exception("Can't find .git dir above ${Platform.script}"); -}(); -final _pkgDir = _repoDir.resolve('pkgs/objective_c/'); -String _resolve(String file) => _pkgDir.resolve(file).toFilePath(); - -void _runClang(List flags, String output) { - final args = [...flags, '-o', output]; - const exec = 'clang'; - print('Running: $exec ${args.join(" ")}'); - final proc = Process.runSync(exec, args); - print(proc.stdout); - print(proc.stderr); - if (proc.exitCode != 0) { - exitCode = proc.exitCode; - throw Exception('Command failed: $exec ${args.join(" ")}'); - } - print('Generated $output'); -} - -String _buildObject(String input, List flags) { - final output = '$input.o'; - _runClang([...flags, '-c', input, '-fpic', '-I', 'src'], output); - return output; -} - -void _linkLib(List inputs, String output) => - _runClang(['-shared', '-undefined', 'dynamic_lookup', ...inputs], output); - -void _linkMain(List inputs, String output) => - _runClang(['-dead_strip', '-fobjc-arc', ...inputs], output); - -void main(List arguments) { - final parser = ArgParser(); - parser.addFlag('main-thread-dispatcher'); - final args = parser.parse(arguments); - - final flags = [ - if (!args.flag('main-thread-dispatcher')) '-DNO_MAIN_THREAD_DISPATCH', - ]; - final objFiles = [ - for (final src in cFiles) _buildObject(src, flags), - for (final src in objCFiles) _buildObject(src, [...objCFlags, ...flags]), - ]; - _linkLib(objFiles, outputFile); - - // Sanity check that the dylib was created correctly. - final lib = DynamicLibrary.open(outputFile); - lib.lookup('DOBJC_disposeObjCBlockWithClosure'); // objective_c.c - lib.lookup('DOBJC_runOnMainThread'); // objective_c.m - lib.lookup('Dart_InitializeApiDL'); // dart_api_dl.c - lib.lookup('OBJC_CLASS_\$_DOBJCDartProtocol'); // protocol.m - lib.lookup('OBJC_CLASS_\$_DOBJCObservation'); // observer.m - // objective_c_bindings_generated.m - lib.lookup('_ObjectiveCBindings_wrapListenerBlock_ovsamd'); - - // Sanity check that the executable can find FFI symbols. - _linkMain([...objFiles, cMain], '$cMain.exe'); - final result = Process.runSync('$cMain.exe', []); - if (result.exitCode != 0) { - throw Exception('Missing symbols from executable:\n${result.stderr}'); - } -} diff --git a/pkgs/objective_c/test/util.dart b/pkgs/objective_c/test/util.dart index 95897ec05c..85967c5d6d 100644 --- a/pkgs/objective_c/test/util.dart +++ b/pkgs/objective_c/test/util.dart @@ -15,7 +15,6 @@ import 'package:objective_c/objective_c.dart'; import 'package:objective_c/src/internal.dart' as internal_for_testing show isValidClass; -import 'package:path/path.dart' as p; final _executeInternalCommand = () { try { @@ -84,9 +83,6 @@ int objectRetainCount(Pointer object) { String pkgDir = findPackageRoot('objective_c').toFilePath(); -// TODO(https://github.com/dart-lang/native/issues/1068): Remove this. -String testDylib = p.join(pkgDir, 'test', 'objective_c.dylib'); - /// Test files are run in a variety of ways, find this package root in all. /// /// Test files can be run from source from any working directory. The Dart SDK diff --git a/pkgs/objective_c/tool/data/extra_methods.dart.in b/pkgs/objective_c/tool/data/extra_methods.dart.in index 24e951dba9..027b37274b 100644 --- a/pkgs/objective_c/tool/data/extra_methods.dart.in +++ b/pkgs/objective_c/tool/data/extra_methods.dart.in @@ -43,7 +43,7 @@ class NSArray with Iterable { objc.ObjCObjectBase operator [](int index) => objectAtIndex(index); } -class NSMutableArray with ListBase { +class NSMutableArray with collection.ListBase { /// Creates a [NSMutableArray] of the given length with [fill] at each /// position. /// @@ -113,7 +113,7 @@ class _NSArrayIterator implements Iterator { // Ideally we'd mixin UnmodifiableMapBase, but it's an ordinary class. So // instead we mixin MapBase and then throw in all the modifying methods (which // is essentially what UnmodifiableMapBase does anyway). -class NSDictionary with MapBase { +class NSDictionary with collection.MapBase { /// Creates a [NSDictionary] from [other]. static NSDictionary of(Map other) => NSMutableDictionary.of(other); @@ -232,7 +232,7 @@ class _NSDictionaryKeyIterator implements Iterator { bool moveNext() => _iterator.moveNext(); } -class NSSet with SetBase { +class NSSet with collection.SetBase { /// Creates a [NSSet] from [elements]. static NSSet of(Iterable elements) => NSMutableSet.of(elements); diff --git a/pkgs/objective_c/tool/generate_code.dart b/pkgs/objective_c/tool/generate_code.dart index 5c298bc586..47f61ba039 100644 --- a/pkgs/objective_c/tool/generate_code.dart +++ b/pkgs/objective_c/tool/generate_code.dart @@ -13,8 +13,10 @@ import 'package:args/args.dart'; import 'package:ffigen/src/executables/ffigen.dart' as ffigen; import 'package:yaml/yaml.dart'; +const runtimeConfig = 'ffigen_runtime.yaml'; const cConfig = 'ffigen_c.yaml'; const objcConfig = 'ffigen_objc.yaml'; +const runtimeBindings = 'lib/src/runtime_bindings_generated.dart'; const cBindings = 'lib/src/c_bindings_generated.dart'; const objcBindings = 'lib/src/objective_c_bindings_generated.dart'; const objcExports = 'lib/src/objective_c_bindings_exported.dart'; @@ -23,7 +25,7 @@ const builtInTypes = '../ffigen/lib/src/code_generator/objc_built_in_types.dart'; const interfaceListTest = 'test/interface_lists_test.dart'; -const privateClasses = {'DartInputStreamAdapter', 'DOBJCObservation'}; +const ffigenFlags = ['--no-format', '-v', 'severe', '--config']; void dartCmd(List args) { final exec = Platform.resolvedExecutable; @@ -176,11 +178,10 @@ ${elements.join('\n')} writeDecls('objCBuiltInEnums', 'enums'); writeDecls('objCBuiltInProtocols', 'objc-protocols'); writeDecls('objCBuiltInCategories', 'objc-categories'); - writeDecls('objCBuiltInGlobals', 'globals'); File(out).writeAsStringSync(s.toString()); - return exports.difference(privateClasses).toList()..sort(); + return exports.toList()..sort(); } void writeExports(List exports, String out) { @@ -198,22 +199,32 @@ export 'objective_c_bindings_generated.dart' } Future run({required bool format}) async { + print('Generating runtime bindings...'); + await ffigen.main([...ffigenFlags, runtimeConfig]); + print('Generating C bindings...'); - await ffigen.main(['--no-format', '-v', 'severe', '--config', cConfig]); + await ffigen.main([...ffigenFlags, cConfig]); print('Generating ObjC bindings...'); - await ffigen.main(['--no-format', '-v', 'severe', '--config', objcConfig]); + await ffigen.main([...ffigenFlags, objcConfig]); mergeExtraMethods(objcBindings, parseExtraMethods(extraMethodsFile)); print('Generating objc_built_in_types.dart...'); final exports = writeBuiltInTypes(objcConfig, builtInTypes); - print('Generating objective_c_bindings_exported.dart...'); + print('Generating objc_bindings_exported.dart...'); writeExports(exports, objcExports); if (format) { print('Formatting bindings...'); - dartCmd(['format', cBindings, objcBindings, builtInTypes, objcExports]); + dartCmd([ + 'format', + runtimeBindings, + cBindings, + objcBindings, + builtInTypes, + objcExports, + ]); } print('Running tests...'); diff --git a/pkgs/swiftgen/example/temp/AVFAudioWrapper.h b/pkgs/swiftgen/example/temp/AVFAudioWrapper.h new file mode 100644 index 0000000000..6c12e248b0 --- /dev/null +++ b/pkgs/swiftgen/example/temp/AVFAudioWrapper.h @@ -0,0 +1,1261 @@ +// Generated by Apple Swift version 6.0.3 effective-5.10 (swiftlang-6.0.3.1.10 clang-1600.0.30.1) +#ifndef AVFAUDIOWRAPPER_SWIFT_H +#define AVFAUDIOWRAPPER_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#include +#include +#include +#include +#else +#include +#include +#include +#include +#endif +#if defined(__cplusplus) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module" +#if defined(__arm64e__) && __has_include() +# include +#else +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-macro-identifier" +# ifndef __ptrauth_swift_value_witness_function_pointer +# define __ptrauth_swift_value_witness_function_pointer(x) +# endif +# ifndef __ptrauth_swift_class_method_pointer +# define __ptrauth_swift_class_method_pointer(x) +# endif +#pragma clang diagnostic pop +#endif +#pragma clang diagnostic pop +#endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif +#if !defined(SWIFT_RUNTIME_NAME) +# if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# else +# define SWIFT_RUNTIME_NAME(X) +# endif +#endif +#if !defined(SWIFT_COMPILE_NAME) +# if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# else +# define SWIFT_COMPILE_NAME(X) +# endif +#endif +#if !defined(SWIFT_METHOD_FAMILY) +# if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# else +# define SWIFT_METHOD_FAMILY(X) +# endif +#endif +#if !defined(SWIFT_NOESCAPE) +# if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +# else +# define SWIFT_NOESCAPE +# endif +#endif +#if !defined(SWIFT_RELEASES_ARGUMENT) +# if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# else +# define SWIFT_RELEASES_ARGUMENT +# endif +#endif +#if !defined(SWIFT_WARN_UNUSED_RESULT) +# if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# else +# define SWIFT_WARN_UNUSED_RESULT +# endif +#endif +#if !defined(SWIFT_NORETURN) +# if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +# else +# define SWIFT_NORETURN +# endif +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if !defined(SWIFT_DEPRECATED_OBJC) +# if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +# else +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# endif +#endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if !defined(SWIFT_INDIRECT_RESULT) +# define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result)) +#endif +#if !defined(SWIFT_CONTEXT) +# define SWIFT_CONTEXT __attribute__((swift_context)) +#endif +#if !defined(SWIFT_ERROR_RESULT) +# define SWIFT_ERROR_RESULT __attribute__((swift_error_result)) +#endif +#if defined(__cplusplus) +# define SWIFT_NOEXCEPT noexcept +#else +# define SWIFT_NOEXCEPT +#endif +#if !defined(SWIFT_C_INLINE_THUNK) +# if __has_attribute(always_inline) +# if __has_attribute(nodebug) +# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug)) +# else +# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) +# endif +# else +# define SWIFT_C_INLINE_THUNK inline +# endif +#endif +#if defined(_WIN32) +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport) +#endif +#else +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +# define SWIFT_IMPORT_STDLIB_SYMBOL +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(objc_modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +@import Foundation; +@import ObjectiveC; +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="AVFAudioWrapper",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) + +SWIFT_CLASS("_TtC15AVFAudioWrapper22AVAUPresetEventWrapper") +@interface AVAUPresetEventWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper34AVAudio3DAngularOrientationWrapper") +@interface AVAudio3DAngularOrientationWrapper : NSObject +@property (nonatomic) float pitch; +@property (nonatomic) float roll; +@property (nonatomic) float yaw; +- (nonnull instancetype)initWithYaw:(float)yaw pitch:(float)pitch roll:(float)roll OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper21AVAudio3DPointWrapper") +@interface AVAudio3DPointWrapper : NSObject +@property (nonatomic) float x; +@property (nonatomic) float y; +@property (nonatomic) float z; +- (nonnull instancetype)initWithX:(float)x y:(float)y z:(float)z OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper33AVAudio3DVectorOrientationWrapper") +@interface AVAudio3DVectorOrientationWrapper : NSObject +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +@class NSString; + +SWIFT_CLASS("_TtC15AVFAudioWrapper25AVAudioApplicationWrapper") +@interface AVAudioApplicationWrapper : NSObject +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull muteStateKey;) ++ (NSString * _Nonnull)muteStateKey SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) AVAudioApplicationWrapper * _Nonnull shared;) ++ (AVAudioApplicationWrapper * _Nonnull)shared SWIFT_WARN_UNUSED_RESULT; +@property (nonatomic, readonly) BOOL isInputMuted; +- (BOOL)setInputMuted:(BOOL)muted error:(NSError * _Nullable * _Nullable)error; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class AVAudioFormatWrapper; + +SWIFT_CLASS("_TtC15AVFAudioWrapper20AVAudioBufferWrapper") +@interface AVAudioBufferWrapper : NSObject +@property (nonatomic, readonly, strong) AVAudioFormatWrapper * _Nonnull format; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper27AVAudioChannelLayoutWrapper") +@interface AVAudioChannelLayoutWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper30AVAudioCompressedBufferWrapper") +@interface AVAudioCompressedBufferWrapper : NSObject +@property (nonatomic, readonly) NSInteger maximumPacketSize; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class AVAudioNodeWrapper; + +SWIFT_CLASS("_TtC15AVFAudioWrapper29AVAudioConnectionPointWrapper") +@interface AVAudioConnectionPointWrapper : NSObject +@property (nonatomic, readonly, strong) AVAudioNodeWrapper * _Nullable node; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper32AVAudioConverterPrimeInfoWrapper") +@interface AVAudioConverterPrimeInfoWrapper : NSObject +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +@class AVAudioPCMBufferWrapper; + +SWIFT_CLASS("_TtC15AVFAudioWrapper23AVAudioConverterWrapper") +@interface AVAudioConverterWrapper : NSObject +@property (nonatomic) NSInteger bitRate; +@property (nonatomic, copy) NSString * _Nullable bitRateStrategy; +@property (nonatomic) BOOL dither; +@property (nonatomic) BOOL downmix; +@property (nonatomic, readonly, strong) AVAudioFormatWrapper * _Nonnull inputFormat; +@property (nonatomic, readonly) NSInteger maximumOutputPacketSize; +@property (nonatomic, readonly, strong) AVAudioFormatWrapper * _Nonnull outputFormat; +@property (nonatomic, strong) AVAudioConverterPrimeInfoWrapper * _Nonnull primeInfo; +@property (nonatomic, copy) NSString * _Nullable sampleRateConverterAlgorithm; +@property (nonatomic) NSInteger sampleRateConverterQuality; +- (nullable instancetype)initFrom:(AVAudioFormatWrapper * _Nonnull)fromFormat to:(AVAudioFormatWrapper * _Nonnull)toFormat OBJC_DESIGNATED_INITIALIZER; +- (BOOL)convertTo:(AVAudioPCMBufferWrapper * _Nonnull)outputBuffer from:(AVAudioPCMBufferWrapper * _Nonnull)inputBuffer error:(NSError * _Nullable * _Nullable)error; +- (void)reset; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class AVAudioInputNodeWrapper; +@class AVAudioMixerNodeWrapper; +@class AVAudioOutputNodeWrapper; + +SWIFT_CLASS("_TtC15AVFAudioWrapper20AVAudioEngineWrapper") +@interface AVAudioEngineWrapper : NSObject +@property (nonatomic) BOOL isAutoShutdownEnabled; +@property (nonatomic, readonly, strong) AVAudioInputNodeWrapper * _Nonnull inputNode; +@property (nonatomic, readonly) BOOL isInManualRenderingMode; +@property (nonatomic, readonly, strong) AVAudioMixerNodeWrapper * _Nonnull mainMixerNode; +@property (nonatomic, readonly, strong) AVAudioFormatWrapper * _Nonnull manualRenderingFormat; +@property (nonatomic, readonly, strong) AVAudioOutputNodeWrapper * _Nonnull outputNode; +@property (nonatomic, readonly) BOOL isRunning; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +- (void)attach:(AVAudioNodeWrapper * _Nonnull)node; +- (void)connect:(AVAudioNodeWrapper * _Nonnull)node1 to:(AVAudioNodeWrapper * _Nonnull)node2 format:(AVAudioFormatWrapper * _Nullable)format; +- (void)detach:(AVAudioNodeWrapper * _Nonnull)node; +- (void)disableManualRenderingMode; +- (void)disconnectMIDI:(AVAudioNodeWrapper * _Nonnull)sourceNode from:(AVAudioNodeWrapper * _Nonnull)destinationNode; +- (void)disconnectMIDIInput:(AVAudioNodeWrapper * _Nonnull)node; +- (void)disconnectMIDIOutput:(AVAudioNodeWrapper * _Nonnull)node; +- (void)disconnectNodeInput:(AVAudioNodeWrapper * _Nonnull)node; +- (void)disconnectNodeOutput:(AVAudioNodeWrapper * _Nonnull)node; +- (void)pause; +- (void)prepare; +- (void)reset; +- (BOOL)startAndReturnError:(NSError * _Nullable * _Nullable)error; +- (void)stop; +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper54AVAudioEnvironmentDistanceAttenuationParametersWrapper") +@interface AVAudioEnvironmentDistanceAttenuationParametersWrapper : NSObject +@property (nonatomic) float maximumDistance; +@property (nonatomic) float referenceDistance; +@property (nonatomic) float rolloffFactor; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class AVAudioEnvironmentReverbParametersWrapper; + +SWIFT_CLASS("_TtC15AVFAudioWrapper29AVAudioEnvironmentNodeWrapper") +@interface AVAudioEnvironmentNodeWrapper : NSObject +@property (nonatomic, readonly, strong) AVAudioEnvironmentDistanceAttenuationParametersWrapper * _Nonnull distanceAttenuationParameters; +@property (nonatomic, strong) AVAudio3DAngularOrientationWrapper * _Nonnull listenerAngularOrientation; +@property (nonatomic, strong) AVAudio3DPointWrapper * _Nonnull listenerPosition; +@property (nonatomic, strong) AVAudio3DVectorOrientationWrapper * _Nonnull listenerVectorOrientation; +@property (nonatomic) float outputVolume; +@property (nonatomic, readonly, strong) AVAudioEnvironmentReverbParametersWrapper * _Nonnull reverbParameters; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +@class AVAudioUnitEQFilterParametersWrapper; + +SWIFT_CLASS("_TtC15AVFAudioWrapper41AVAudioEnvironmentReverbParametersWrapper") +@interface AVAudioEnvironmentReverbParametersWrapper : NSObject +@property (nonatomic) BOOL enable; +@property (nonatomic, readonly, strong) AVAudioUnitEQFilterParametersWrapper * _Nonnull filterParameters; +@property (nonatomic) float level; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class NSURL; + +SWIFT_CLASS("_TtC15AVFAudioWrapper18AVAudioFileWrapper") +@interface AVAudioFileWrapper : NSObject +@property (nonatomic, readonly, strong) AVAudioFormatWrapper * _Nonnull fileFormat; +@property (nonatomic, readonly, strong) AVAudioFormatWrapper * _Nonnull processingFormat; +@property (nonatomic, readonly, copy) NSURL * _Nonnull url; +- (nullable instancetype)initForReading:(NSURL * _Nonnull)fileURL error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER; +- (BOOL)readInto:(AVAudioPCMBufferWrapper * _Nonnull)buffer error:(NSError * _Nullable * _Nullable)error; +- (BOOL)writeFrom:(AVAudioPCMBufferWrapper * _Nonnull)buffer error:(NSError * _Nullable * _Nullable)error; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper20AVAudioFormatWrapper") +@interface AVAudioFormatWrapper : NSObject +@property (nonatomic, readonly, strong) AVAudioChannelLayoutWrapper * _Nullable channelLayout; +@property (nonatomic, readonly) BOOL isInterleaved; +@property (nonatomic, readonly) double sampleRate; +@property (nonatomic, readonly) BOOL isStandard; +- (nonnull instancetype)initWithStandardFormatWithSampleRate:(double)sampleRate channelLayout:(AVAudioChannelLayoutWrapper * _Nonnull)layout OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper20AVAudioIONodeWrapper") +@interface AVAudioIONodeWrapper : NSObject +@property (nonatomic, readonly) NSTimeInterval presentationLatency; +@property (nonatomic, readonly) BOOL isVoiceProcessingEnabled; +- (BOOL)setVoiceProcessingEnabled:(BOOL)enabled error:(NSError * _Nullable * _Nullable)error; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class AVAudioVoiceProcessingOtherAudioDuckingConfigurationWrapper; + +SWIFT_CLASS("_TtC15AVFAudioWrapper23AVAudioInputNodeWrapper") +@interface AVAudioInputNodeWrapper : NSObject +@property (nonatomic) BOOL isVoiceProcessingAGCEnabled; +@property (nonatomic) BOOL isVoiceProcessingBypassed; +@property (nonatomic) BOOL isVoiceProcessingInputMuted; +@property (nonatomic, strong) AVAudioVoiceProcessingOtherAudioDuckingConfigurationWrapper * _Nonnull voiceProcessingOtherAudioDuckingConfiguration; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper23AVAudioMixerNodeWrapper") +@interface AVAudioMixerNodeWrapper : NSObject +@property (nonatomic) float outputVolume; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper31AVAudioMixingDestinationWrapper") +@interface AVAudioMixingDestinationWrapper : NSObject +@property (nonatomic, readonly, strong) AVAudioConnectionPointWrapper * _Nonnull connectionPoint; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class AVAudioTimeWrapper; + +SWIFT_CLASS("_TtC15AVFAudioWrapper18AVAudioNodeWrapper") +@interface AVAudioNodeWrapper : NSObject +@property (nonatomic, readonly, strong) AVAudioEngineWrapper * _Nullable engine; +@property (nonatomic, readonly, strong) AVAudioTimeWrapper * _Nullable lastRenderTime; +@property (nonatomic, readonly) NSTimeInterval latency; +@property (nonatomic, readonly) NSInteger numberOfInputs; +@property (nonatomic, readonly) NSInteger numberOfOutputs; +@property (nonatomic, readonly) NSTimeInterval outputPresentationLatency; +- (void)reset; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper24AVAudioOutputNodeWrapper") +@interface AVAudioOutputNodeWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper23AVAudioPCMBufferWrapper") +@interface AVAudioPCMBufferWrapper : NSObject +@property (nonatomic, readonly) NSInteger stride; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper37AVAudioPlayerNodeBufferOptionsWrapper") +@interface AVAudioPlayerNodeBufferOptionsWrapper : NSObject +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) AVAudioPlayerNodeBufferOptionsWrapper * _Nonnull interrupts;) ++ (AVAudioPlayerNodeBufferOptionsWrapper * _Nonnull)interrupts SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) AVAudioPlayerNodeBufferOptionsWrapper * _Nonnull interruptsAtLoop;) ++ (AVAudioPlayerNodeBufferOptionsWrapper * _Nonnull)interruptsAtLoop SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) AVAudioPlayerNodeBufferOptionsWrapper * _Nonnull loops;) ++ (AVAudioPlayerNodeBufferOptionsWrapper * _Nonnull)loops SWIFT_WARN_UNUSED_RESULT; +@property (nonatomic, readonly) BOOL isEmpty; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper24AVAudioPlayerNodeWrapper") +@interface AVAudioPlayerNodeWrapper : NSObject +@property (nonatomic, readonly) BOOL isPlaying; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +- (AVAudioTimeWrapper * _Nullable)nodeTimeForPlayerTime:(AVAudioTimeWrapper * _Nonnull)playerTime SWIFT_WARN_UNUSED_RESULT; +- (void)pause; +- (void)play; +- (void)playAt:(AVAudioTimeWrapper * _Nullable)when; +- (AVAudioTimeWrapper * _Nullable)playerTimeForNodeTime:(AVAudioTimeWrapper * _Nonnull)nodeTime SWIFT_WARN_UNUSED_RESULT; +- (void)scheduleBuffer:(AVAudioPCMBufferWrapper * _Nonnull)buffer completionHandler:(void (^ _Nonnull)(void))completionHandler; +- (void)scheduleFile:(AVAudioFileWrapper * _Nonnull)file at:(AVAudioTimeWrapper * _Nullable)when completionHandler:(void (^ _Nonnull)(void))completionHandler; +- (void)stop; +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper20AVAudioPlayerWrapper") +@interface AVAudioPlayerWrapper : NSObject +@property (nonatomic, copy) NSString * _Nullable currentDevice; +@property (nonatomic) NSTimeInterval currentTime; +@property (nonatomic, readonly) NSTimeInterval deviceCurrentTime; +@property (nonatomic, readonly) NSTimeInterval duration; +@property (nonatomic) BOOL enableRate; +@property (nonatomic, readonly, strong) AVAudioFormatWrapper * _Nonnull format; +@property (nonatomic) BOOL isMeteringEnabled; +@property (nonatomic, readonly) NSInteger numberOfChannels; +@property (nonatomic) NSInteger numberOfLoops; +@property (nonatomic) float pan; +@property (nonatomic, readonly) BOOL isPlaying; +@property (nonatomic) float rate; +@property (nonatomic, readonly, copy) NSURL * _Nullable url; +@property (nonatomic) float volume; +- (nullable instancetype)initWithContentsOf:(NSURL * _Nonnull)url error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER; +- (nullable instancetype)initWithContentsOf:(NSURL * _Nonnull)url fileTypeHint:(NSString * _Nullable)utiString error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER; +- (float)averagePowerForChannel:(NSInteger)channelNumber SWIFT_WARN_UNUSED_RESULT; +- (void)pause; +- (float)peakPowerForChannel:(NSInteger)channelNumber SWIFT_WARN_UNUSED_RESULT; +- (BOOL)play SWIFT_WARN_UNUSED_RESULT; +- (BOOL)playAtTime:(NSTimeInterval)time SWIFT_WARN_UNUSED_RESULT; +- (BOOL)prepareToPlay SWIFT_WARN_UNUSED_RESULT; +- (void)setVolume:(float)volume fadeDuration:(NSTimeInterval)duration; +- (void)stop; +- (void)updateMeters; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper22AVAudioRecorderWrapper") +@interface AVAudioRecorderWrapper : NSObject +@property (nonatomic, readonly) NSTimeInterval currentTime; +@property (nonatomic, readonly) NSTimeInterval deviceCurrentTime; +@property (nonatomic, readonly, strong) AVAudioFormatWrapper * _Nonnull format; +@property (nonatomic) BOOL isMeteringEnabled; +@property (nonatomic, readonly) BOOL isRecording; +@property (nonatomic, readonly, copy) NSURL * _Nonnull url; +- (nullable instancetype)initWithUrl:(NSURL * _Nonnull)url format:(AVAudioFormatWrapper * _Nonnull)format error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER; +- (float)averagePowerForChannel:(NSInteger)channelNumber SWIFT_WARN_UNUSED_RESULT; +- (BOOL)deleteRecording SWIFT_WARN_UNUSED_RESULT; +- (void)pause; +- (float)peakPowerForChannel:(NSInteger)channelNumber SWIFT_WARN_UNUSED_RESULT; +- (BOOL)prepareToRecord SWIFT_WARN_UNUSED_RESULT; +- (BOOL)record SWIFT_WARN_UNUSED_RESULT; +- (BOOL)recordAtTime:(NSTimeInterval)time SWIFT_WARN_UNUSED_RESULT; +- (BOOL)recordAtTime:(NSTimeInterval)time forDuration:(NSTimeInterval)duration SWIFT_WARN_UNUSED_RESULT; +- (BOOL)recordForDuration:(NSTimeInterval)duration SWIFT_WARN_UNUSED_RESULT; +- (void)stop; +- (void)updateMeters; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper28AVAudioRoutingArbiterWrapper") +@interface AVAudioRoutingArbiterWrapper : NSObject +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) AVAudioRoutingArbiterWrapper * _Nonnull shared;) ++ (AVAudioRoutingArbiterWrapper * _Nonnull)shared SWIFT_WARN_UNUSED_RESULT; +- (void)leave; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class AVMusicTrackWrapper; + +SWIFT_CLASS("_TtC15AVFAudioWrapper23AVAudioSequencerWrapper") +@interface AVAudioSequencerWrapper : NSObject +@property (nonatomic) NSTimeInterval currentPositionInBeats; +@property (nonatomic) NSTimeInterval currentPositionInSeconds; +@property (nonatomic, readonly) BOOL isPlaying; +@property (nonatomic) float rate; +@property (nonatomic, readonly, strong) AVMusicTrackWrapper * _Nonnull tempoTrack; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithAudioEngine:(AVAudioEngineWrapper * _Nonnull)engine OBJC_DESIGNATED_INITIALIZER; +- (AVMusicTrackWrapper * _Nonnull)createAndAppendTrack SWIFT_WARN_UNUSED_RESULT; +- (void)prepareToPlay; +- (BOOL)removeTrack:(AVMusicTrackWrapper * _Nonnull)track SWIFT_WARN_UNUSED_RESULT; +- (void)reverseEvents; +- (BOOL)startAndReturnError:(NSError * _Nullable * _Nullable)error; +- (void)stop; +- (BOOL)writeTo:(NSURL * _Nonnull)fileURL smpteResolution:(NSInteger)resolution replaceExisting:(BOOL)replace error:(NSError * _Nullable * _Nullable)error; +@end + + +SWIFT_CLASS("_TtCC15AVFAudioWrapper23AVAudioSequencerWrapper24InfoDictionaryKeyWrapper") +@interface InfoDictionaryKeyWrapper : NSObject +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull album;) ++ (InfoDictionaryKeyWrapper * _Nonnull)album SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull approximateDurationInSeconds;) ++ (InfoDictionaryKeyWrapper * _Nonnull)approximateDurationInSeconds SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull artist;) ++ (InfoDictionaryKeyWrapper * _Nonnull)artist SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull channelLayout;) ++ (InfoDictionaryKeyWrapper * _Nonnull)channelLayout SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull comments;) ++ (InfoDictionaryKeyWrapper * _Nonnull)comments SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull composer;) ++ (InfoDictionaryKeyWrapper * _Nonnull)composer SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull copyright;) ++ (InfoDictionaryKeyWrapper * _Nonnull)copyright SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull encodingApplication;) ++ (InfoDictionaryKeyWrapper * _Nonnull)encodingApplication SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull genre;) ++ (InfoDictionaryKeyWrapper * _Nonnull)genre SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull ISRC;) ++ (InfoDictionaryKeyWrapper * _Nonnull)ISRC SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull keySignature;) ++ (InfoDictionaryKeyWrapper * _Nonnull)keySignature SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull lyricist;) ++ (InfoDictionaryKeyWrapper * _Nonnull)lyricist SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull nominalBitRate;) ++ (InfoDictionaryKeyWrapper * _Nonnull)nominalBitRate SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull recordedDate;) ++ (InfoDictionaryKeyWrapper * _Nonnull)recordedDate SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull sourceBitDepth;) ++ (InfoDictionaryKeyWrapper * _Nonnull)sourceBitDepth SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull sourceEncoder;) ++ (InfoDictionaryKeyWrapper * _Nonnull)sourceEncoder SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull subTitle;) ++ (InfoDictionaryKeyWrapper * _Nonnull)subTitle SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull tempo;) ++ (InfoDictionaryKeyWrapper * _Nonnull)tempo SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull timeSignature;) ++ (InfoDictionaryKeyWrapper * _Nonnull)timeSignature SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull title;) ++ (InfoDictionaryKeyWrapper * _Nonnull)title SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull trackNumber;) ++ (InfoDictionaryKeyWrapper * _Nonnull)trackNumber SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) InfoDictionaryKeyWrapper * _Nonnull year;) ++ (InfoDictionaryKeyWrapper * _Nonnull)year SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)initWithRawValue:(NSString * _Nonnull)rawValue OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper38AVAudioSessionActivationOptionsWrapper") +@interface AVAudioSessionActivationOptionsWrapper : NSObject +@property (nonatomic, readonly) BOOL isEmpty; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper22AVAudioSinkNodeWrapper") +@interface AVAudioSinkNodeWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper24AVAudioSourceNodeWrapper") +@interface AVAudioSourceNodeWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper18AVAudioTimeWrapper") +@interface AVAudioTimeWrapper : NSObject +@property (nonatomic, readonly) BOOL isHostTimeValid; +@property (nonatomic, readonly) double sampleRate; +@property (nonatomic, readonly) BOOL isSampleTimeValid; +- (AVAudioTimeWrapper * _Nullable)extrapolateTimeFromAnchor:(AVAudioTimeWrapper * _Nonnull)anchorTime SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper34AVAudioUnitComponentManagerWrapper") +@interface AVAudioUnitComponentManagerWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper27AVAudioUnitComponentWrapper") +@interface AVAudioUnitComponentWrapper : NSObject +@property (nonatomic, readonly, copy) NSURL * _Nullable componentURL; +@property (nonatomic, readonly) BOOL hasCustomView; +@property (nonatomic, readonly) BOOL hasMIDIInput; +@property (nonatomic, readonly) BOOL hasMIDIOutput; +@property (nonatomic, readonly, copy) NSURL * _Nullable iconURL; +@property (nonatomic, readonly, copy) NSString * _Nonnull localizedTypeName; +@property (nonatomic, readonly, copy) NSString * _Nonnull manufacturerName; +@property (nonatomic, readonly, copy) NSString * _Nonnull name; +@property (nonatomic, readonly) BOOL passesAUVal; +@property (nonatomic, readonly) BOOL isSandboxSafe; +@property (nonatomic, readonly, copy) NSString * _Nonnull typeName; +@property (nonatomic, readonly) NSInteger version; +@property (nonatomic, readonly, copy) NSString * _Nonnull versionString; +- (BOOL)supportsNumberInputChannels:(NSInteger)numInputChannels outputChannels:(NSInteger)numOutputChannels SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper23AVAudioUnitDelayWrapper") +@interface AVAudioUnitDelayWrapper : NSObject +@property (nonatomic) NSTimeInterval delayTime; +@property (nonatomic) float feedback; +@property (nonatomic) float lowPassCutoff; +@property (nonatomic) float wetDryMix; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper28AVAudioUnitDistortionWrapper") +@interface AVAudioUnitDistortionWrapper : NSObject +@property (nonatomic) float preGain; +@property (nonatomic) float wetDryMix; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper36AVAudioUnitEQFilterParametersWrapper") +@interface AVAudioUnitEQFilterParametersWrapper : NSObject +@property (nonatomic) float bandwidth; +@property (nonatomic) BOOL bypass; +@property (nonatomic) float frequency; +@property (nonatomic) float gain; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper20AVAudioUnitEQWrapper") +@interface AVAudioUnitEQWrapper : NSObject +@property (nonatomic) float globalGain; +- (nonnull instancetype)initWithNumberOfBands:(NSInteger)numberOfBands OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper24AVAudioUnitEffectWrapper") +@interface AVAudioUnitEffectWrapper : NSObject +@property (nonatomic) BOOL bypass; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper27AVAudioUnitGeneratorWrapper") +@interface AVAudioUnitGeneratorWrapper : NSObject +@property (nonatomic) BOOL bypass; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper32AVAudioUnitMIDIInstrumentWrapper") +@interface AVAudioUnitMIDIInstrumentWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper24AVAudioUnitReverbWrapper") +@interface AVAudioUnitReverbWrapper : NSObject +@property (nonatomic) float wetDryMix; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper25AVAudioUnitSamplerWrapper") +@interface AVAudioUnitSamplerWrapper : NSObject +@property (nonatomic) float globalTuning; +@property (nonatomic) float masterGain; +@property (nonatomic) float overallGain; +@property (nonatomic) float stereoPan; +- (BOOL)loadInstrumentAt:(NSURL * _Nonnull)instrumentURL error:(NSError * _Nullable * _Nullable)error; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper28AVAudioUnitTimeEffectWrapper") +@interface AVAudioUnitTimeEffectWrapper : NSObject +@property (nonatomic) BOOL bypass; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper27AVAudioUnitTimePitchWrapper") +@interface AVAudioUnitTimePitchWrapper : NSObject +@property (nonatomic) float overlap; +@property (nonatomic) float pitch; +@property (nonatomic) float rate; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper27AVAudioUnitVarispeedWrapper") +@interface AVAudioUnitVarispeedWrapper : NSObject +@property (nonatomic) float rate; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper18AVAudioUnitWrapper") +@interface AVAudioUnitWrapper : NSObject +@property (nonatomic, readonly, copy) NSString * _Nonnull manufacturerName; +@property (nonatomic, readonly, copy) NSString * _Nonnull name; +@property (nonatomic, readonly) NSInteger version; +- (BOOL)loadPresetAt:(NSURL * _Nonnull)url error:(NSError * _Nullable * _Nullable)error; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper59AVAudioVoiceProcessingOtherAudioDuckingConfigurationWrapper") +@interface AVAudioVoiceProcessingOtherAudioDuckingConfigurationWrapper : NSObject +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper28AVExtendedNoteOnEventWrapper") +@interface AVExtendedNoteOnEventWrapper : NSObject +@property (nonatomic) float midiNote; +@property (nonatomic) float velocity; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper27AVExtendedTempoEventWrapper") +@interface AVExtendedTempoEventWrapper : NSObject +@property (nonatomic) double tempo; +- (nonnull instancetype)initWithTempo:(double)tempo OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper25AVMIDIChannelEventWrapper") +@interface AVMIDIChannelEventWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper33AVMIDIChannelPressureEventWrapper") +@interface AVMIDIChannelPressureEventWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper31AVMIDIControlChangeEventWrapper") +@interface AVMIDIControlChangeEventWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper22AVMIDIMetaEventWrapper") +@interface AVMIDIMetaEventWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper22AVMIDINoteEventWrapper") +@interface AVMIDINoteEventWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper27AVMIDIPitchBendEventWrapper") +@interface AVMIDIPitchBendEventWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper19AVMIDIPlayerWrapper") +@interface AVMIDIPlayerWrapper : NSObject +@property (nonatomic) NSTimeInterval currentPosition; +@property (nonatomic, readonly) NSTimeInterval duration; +@property (nonatomic, readonly) BOOL isPlaying; +@property (nonatomic) float rate; +- (nullable instancetype)initWithContentsOf:(NSURL * _Nonnull)inURL soundBankURL:(NSURL * _Nullable)bankURL error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER; +- (void)prepareToPlay; +- (void)stop; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper30AVMIDIPolyPressureEventWrapper") +@interface AVMIDIPolyPressureEventWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper31AVMIDIProgramChangeEventWrapper") +@interface AVMIDIProgramChangeEventWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper23AVMIDISysexEventWrapper") +@interface AVMIDISysexEventWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper19AVMusicEventWrapper") +@interface AVMusicEventWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper33AVMusicSequenceLoadOptionsWrapper") +@interface AVMusicSequenceLoadOptionsWrapper : NSObject +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) AVMusicSequenceLoadOptionsWrapper * _Nonnull smf_ChannelsToTracks;) ++ (AVMusicSequenceLoadOptionsWrapper * _Nonnull)smf_ChannelsToTracks SWIFT_WARN_UNUSED_RESULT; +@property (nonatomic, readonly) BOOL isEmpty; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper19AVMusicTrackWrapper") +@interface AVMusicTrackWrapper : NSObject +@property (nonatomic, strong) AVAudioUnitWrapper * _Nullable destinationAudioUnit; +@property (nonatomic) NSTimeInterval lengthInSeconds; +@property (nonatomic) BOOL isLoopingEnabled; +@property (nonatomic) BOOL isMuted; +@property (nonatomic) NSInteger numberOfLoops; +@property (nonatomic) BOOL isSoloed; +@property (nonatomic, readonly) NSInteger timeResolution; +@property (nonatomic) BOOL usesAutomatedParameters; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper23AVMusicUserEventWrapper") +@interface AVMusicUserEventWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper23AVParameterEventWrapper") +@interface AVParameterEventWrapper : NSObject +@property (nonatomic) float value; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper30AVSpeechSynthesisMarkerWrapper") +@interface AVSpeechSynthesisMarkerWrapper : NSObject +@property (nonatomic, copy) NSString * _Nonnull bookmarkName; +@property (nonatomic) NSInteger byteSampleOffset; +@property (nonatomic, copy) NSString * _Nonnull phoneme; +- (nonnull instancetype)initWithBookmarkName:(NSString * _Nonnull)mark atByteSampleOffset:(NSInteger)byteSampleOffset OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithPhonemeString:(NSString * _Nonnull)phoneme atByteSampleOffset:(NSInteger)byteSampleOffset OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class AVSpeechSynthesisProviderRequestWrapper; + +SWIFT_CLASS("_TtC15AVFAudioWrapper41AVSpeechSynthesisProviderAudioUnitWrapper") +@interface AVSpeechSynthesisProviderAudioUnitWrapper : NSObject +- (void)cancelSpeechRequest; +- (void)synthesizeSpeechRequest:(AVSpeechSynthesisProviderRequestWrapper * _Nonnull)speechRequest; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class AVSpeechSynthesisProviderVoiceWrapper; + +SWIFT_CLASS("_TtC15AVFAudioWrapper39AVSpeechSynthesisProviderRequestWrapper") +@interface AVSpeechSynthesisProviderRequestWrapper : NSObject +@property (nonatomic, readonly, copy) NSString * _Nonnull ssmlRepresentation; +@property (nonatomic, readonly, strong) AVSpeechSynthesisProviderVoiceWrapper * _Nonnull voice; +- (nonnull instancetype)initWithSsmlRepresentation:(NSString * _Nonnull)text voice:(AVSpeechSynthesisProviderVoiceWrapper * _Nonnull)voice OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper37AVSpeechSynthesisProviderVoiceWrapper") +@interface AVSpeechSynthesisProviderVoiceWrapper : NSObject +@property (nonatomic) NSInteger age; +@property (nonatomic, readonly, copy) NSString * _Nonnull identifier; +@property (nonatomic, readonly, copy) NSString * _Nonnull name; +@property (nonatomic, copy) NSString * _Nonnull version; ++ (void)updateSpeechVoices; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class TraitsWrapper; + +SWIFT_CLASS("_TtC15AVFAudioWrapper29AVSpeechSynthesisVoiceWrapper") +@interface AVSpeechSynthesisVoiceWrapper : NSObject +@property (nonatomic, readonly, copy) NSString * _Nonnull identifier; +@property (nonatomic, readonly, copy) NSString * _Nonnull language; +@property (nonatomic, readonly, copy) NSString * _Nonnull name; +@property (nonatomic, readonly, strong) TraitsWrapper * _Nonnull voiceTraits; +- (nullable instancetype)initWithIdentifier:(NSString * _Nonnull)identifier OBJC_DESIGNATED_INITIALIZER; +- (nullable instancetype)initWithLanguage:(NSString * _Nullable)languageCode OBJC_DESIGNATED_INITIALIZER; ++ (NSString * _Nonnull)currentLanguageCode SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtCC15AVFAudioWrapper29AVSpeechSynthesisVoiceWrapper13TraitsWrapper") +@interface TraitsWrapper : NSObject +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) TraitsWrapper * _Nonnull isNoveltyVoice;) ++ (TraitsWrapper * _Nonnull)isNoveltyVoice SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) TraitsWrapper * _Nonnull isPersonalVoice;) ++ (TraitsWrapper * _Nonnull)isPersonalVoice SWIFT_WARN_UNUSED_RESULT; +@property (nonatomic, readonly) BOOL isEmpty; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +@class AVSpeechUtteranceWrapper; + +SWIFT_CLASS("_TtC15AVFAudioWrapper26AVSpeechSynthesizerWrapper") +@interface AVSpeechSynthesizerWrapper : NSObject +@property (nonatomic, readonly) BOOL isPaused; +@property (nonatomic, readonly) BOOL isSpeaking; +- (BOOL)continueSpeaking SWIFT_WARN_UNUSED_RESULT; +- (void)speak:(AVSpeechUtteranceWrapper * _Nonnull)utterance; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper24AVSpeechUtteranceWrapper") +@interface AVSpeechUtteranceWrapper : NSObject +@property (nonatomic) float pitchMultiplier; +@property (nonatomic) NSTimeInterval postUtteranceDelay; +@property (nonatomic) NSTimeInterval preUtteranceDelay; +@property (nonatomic) BOOL prefersAssistiveTechnologySettings; +@property (nonatomic) float rate; +@property (nonatomic, readonly, copy) NSString * _Nonnull speechString; +@property (nonatomic, strong) AVSpeechSynthesisVoiceWrapper * _Nullable voice; +@property (nonatomic) float volume; +- (nullable instancetype)initWithSsmlRepresentation:(NSString * _Nonnull)string OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithString:(NSString * _Nonnull)string OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +SWIFT_CLASS("_TtC15AVFAudioWrapper14GlobalsWrapper") +@interface GlobalsWrapper : NSObject +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioBitRateStrategy_ConstantWrapper;) ++ (NSString * _Nonnull)AVAudioBitRateStrategy_ConstantWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioBitRateStrategy_LongTermAverageWrapper;) ++ (NSString * _Nonnull)AVAudioBitRateStrategy_LongTermAverageWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioBitRateStrategy_VariableWrapper;) ++ (NSString * _Nonnull)AVAudioBitRateStrategy_VariableWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioBitRateStrategy_VariableConstrainedWrapper;) ++ (NSString * _Nonnull)AVAudioBitRateStrategy_VariableConstrainedWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioFileTypeKeyWrapper;) ++ (NSString * _Nonnull)AVAudioFileTypeKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioSessionInterruptionWasSuspendedKeyWrapper;) ++ (NSString * _Nonnull)AVAudioSessionInterruptionWasSuspendedKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioUnitManufacturerNameAppleWrapper;) ++ (NSString * _Nonnull)AVAudioUnitManufacturerNameAppleWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioUnitTypeEffectWrapper;) ++ (NSString * _Nonnull)AVAudioUnitTypeEffectWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioUnitTypeFormatConverterWrapper;) ++ (NSString * _Nonnull)AVAudioUnitTypeFormatConverterWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioUnitTypeGeneratorWrapper;) ++ (NSString * _Nonnull)AVAudioUnitTypeGeneratorWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioUnitTypeMIDIProcessorWrapper;) ++ (NSString * _Nonnull)AVAudioUnitTypeMIDIProcessorWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioUnitTypeMixerWrapper;) ++ (NSString * _Nonnull)AVAudioUnitTypeMixerWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioUnitTypeMusicDeviceWrapper;) ++ (NSString * _Nonnull)AVAudioUnitTypeMusicDeviceWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioUnitTypeMusicEffectWrapper;) ++ (NSString * _Nonnull)AVAudioUnitTypeMusicEffectWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioUnitTypeOfflineEffectWrapper;) ++ (NSString * _Nonnull)AVAudioUnitTypeOfflineEffectWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioUnitTypeOutputWrapper;) ++ (NSString * _Nonnull)AVAudioUnitTypeOutputWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVAudioUnitTypePannerWrapper;) ++ (NSString * _Nonnull)AVAudioUnitTypePannerWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVChannelLayoutKeyWrapper;) ++ (NSString * _Nonnull)AVChannelLayoutKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVEncoderAudioQualityForVBRKeyWrapper;) ++ (NSString * _Nonnull)AVEncoderAudioQualityForVBRKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVEncoderAudioQualityKeyWrapper;) ++ (NSString * _Nonnull)AVEncoderAudioQualityKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVEncoderBitDepthHintKeyWrapper;) ++ (NSString * _Nonnull)AVEncoderBitDepthHintKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVEncoderBitRateKeyWrapper;) ++ (NSString * _Nonnull)AVEncoderBitRateKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVEncoderBitRatePerChannelKeyWrapper;) ++ (NSString * _Nonnull)AVEncoderBitRatePerChannelKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVEncoderBitRateStrategyKeyWrapper;) ++ (NSString * _Nonnull)AVEncoderBitRateStrategyKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVFormatIDKeyWrapper;) ++ (NSString * _Nonnull)AVFormatIDKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVLinearPCMBitDepthKeyWrapper;) ++ (NSString * _Nonnull)AVLinearPCMBitDepthKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVLinearPCMIsBigEndianKeyWrapper;) ++ (NSString * _Nonnull)AVLinearPCMIsBigEndianKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVLinearPCMIsFloatKeyWrapper;) ++ (NSString * _Nonnull)AVLinearPCMIsFloatKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVLinearPCMIsNonInterleavedWrapper;) ++ (NSString * _Nonnull)AVLinearPCMIsNonInterleavedWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVNumberOfChannelsKeyWrapper;) ++ (NSString * _Nonnull)AVNumberOfChannelsKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVSampleRateConverterAlgorithmKeyWrapper;) ++ (NSString * _Nonnull)AVSampleRateConverterAlgorithmKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVSampleRateConverterAlgorithm_MasteringWrapper;) ++ (NSString * _Nonnull)AVSampleRateConverterAlgorithm_MasteringWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVSampleRateConverterAlgorithm_MinimumPhaseWrapper;) ++ (NSString * _Nonnull)AVSampleRateConverterAlgorithm_MinimumPhaseWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVSampleRateConverterAlgorithm_NormalWrapper;) ++ (NSString * _Nonnull)AVSampleRateConverterAlgorithm_NormalWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVSampleRateConverterAudioQualityKeyWrapper;) ++ (NSString * _Nonnull)AVSampleRateConverterAudioQualityKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVSampleRateKeyWrapper;) ++ (NSString * _Nonnull)AVSampleRateKeyWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVSpeechSynthesisIPANotationAttributeWrapper;) ++ (NSString * _Nonnull)AVSpeechSynthesisIPANotationAttributeWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull AVSpeechSynthesisVoiceIdentifierAlexWrapper;) ++ (NSString * _Nonnull)AVSpeechSynthesisVoiceIdentifierAlexWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) float AVSpeechUtteranceDefaultSpeechRateWrapper;) ++ (float)AVSpeechUtteranceDefaultSpeechRateWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) float AVSpeechUtteranceMaximumSpeechRateWrapper;) ++ (float)AVSpeechUtteranceMaximumSpeechRateWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) float AVSpeechUtteranceMinimumSpeechRateWrapper;) ++ (float)AVSpeechUtteranceMinimumSpeechRateWrapper SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) double AVMusicTimeStampEndOfTrackWrapper;) ++ (double)AVMusicTimeStampEndOfTrackWrapper SWIFT_WARN_UNUSED_RESULT; ++ (AVAudio3DAngularOrientationWrapper * _Nonnull)AVAudioMake3DAngularOrientationWrapper:(float)yaw :(float)pitch :(float)roll SWIFT_WARN_UNUSED_RESULT; ++ (AVAudio3DPointWrapper * _Nonnull)AVAudioMake3DPointWrapper:(float)x :(float)y :(float)z SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#if defined(__cplusplus) +#endif +#pragma clang diagnostic pop +#endif diff --git a/pkgs/swiftgen/test/integration/temp/classes.h b/pkgs/swiftgen/test/integration/temp/classes.h new file mode 100644 index 0000000000..0276179bd0 --- /dev/null +++ b/pkgs/swiftgen/test/integration/temp/classes.h @@ -0,0 +1,326 @@ +// Generated by Apple Swift version 6.0.3 effective-5.10 (swiftlang-6.0.3.1.10 clang-1600.0.30.1) +#ifndef CLASSES_SWIFT_H +#define CLASSES_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#include +#include +#include +#include +#else +#include +#include +#include +#include +#endif +#if defined(__cplusplus) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module" +#if defined(__arm64e__) && __has_include() +# include +#else +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-macro-identifier" +# ifndef __ptrauth_swift_value_witness_function_pointer +# define __ptrauth_swift_value_witness_function_pointer(x) +# endif +# ifndef __ptrauth_swift_class_method_pointer +# define __ptrauth_swift_class_method_pointer(x) +# endif +#pragma clang diagnostic pop +#endif +#pragma clang diagnostic pop +#endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif +#if !defined(SWIFT_RUNTIME_NAME) +# if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# else +# define SWIFT_RUNTIME_NAME(X) +# endif +#endif +#if !defined(SWIFT_COMPILE_NAME) +# if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# else +# define SWIFT_COMPILE_NAME(X) +# endif +#endif +#if !defined(SWIFT_METHOD_FAMILY) +# if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# else +# define SWIFT_METHOD_FAMILY(X) +# endif +#endif +#if !defined(SWIFT_NOESCAPE) +# if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +# else +# define SWIFT_NOESCAPE +# endif +#endif +#if !defined(SWIFT_RELEASES_ARGUMENT) +# if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# else +# define SWIFT_RELEASES_ARGUMENT +# endif +#endif +#if !defined(SWIFT_WARN_UNUSED_RESULT) +# if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# else +# define SWIFT_WARN_UNUSED_RESULT +# endif +#endif +#if !defined(SWIFT_NORETURN) +# if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +# else +# define SWIFT_NORETURN +# endif +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if !defined(SWIFT_DEPRECATED_OBJC) +# if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +# else +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# endif +#endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if !defined(SWIFT_INDIRECT_RESULT) +# define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result)) +#endif +#if !defined(SWIFT_CONTEXT) +# define SWIFT_CONTEXT __attribute__((swift_context)) +#endif +#if !defined(SWIFT_ERROR_RESULT) +# define SWIFT_ERROR_RESULT __attribute__((swift_error_result)) +#endif +#if defined(__cplusplus) +# define SWIFT_NOEXCEPT noexcept +#else +# define SWIFT_NOEXCEPT +#endif +#if !defined(SWIFT_C_INLINE_THUNK) +# if __has_attribute(always_inline) +# if __has_attribute(nodebug) +# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug)) +# else +# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) +# endif +# else +# define SWIFT_C_INLINE_THUNK inline +# endif +#endif +#if defined(_WIN32) +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport) +#endif +#else +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +# define SWIFT_IMPORT_STDLIB_SYMBOL +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(objc_modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +@import ObjectiveC; +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="classes",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) +@class TestOtherClass; + +SWIFT_CLASS("_TtC7classes9TestClass") +@interface TestClass : NSObject +- (TestOtherClass * _Nonnull)myMethod SWIFT_WARN_UNUSED_RESULT; ++ (TestClass * _Nonnull)create SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + + +SWIFT_CLASS("_TtC7classes14TestOtherClass") +@interface TestOtherClass : NSObject +- (NSInteger)times10WithX:(NSInteger)x SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#if defined(__cplusplus) +#endif +#pragma clang diagnostic pop +#endif diff --git a/pkgs/swiftgen/test/integration/temp/classes_output.dart b/pkgs/swiftgen/test/integration/temp/classes_output.dart new file mode 100644 index 0000000000..ab70b9acc1 --- /dev/null +++ b/pkgs/swiftgen/test/integration/temp/classes_output.dart @@ -0,0 +1,434 @@ +// Copyright (c) 2025, 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. + +// ignore_for_file: always_specify_types +// ignore_for_file: camel_case_types +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: unnecessary_non_null_assertion +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// coverage:ignore-file + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +// ignore_for_file: type=lint +import 'dart:ffi' as ffi; +import 'package:objective_c/objective_c.dart' as objc; + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ) +>() +external ffi.Pointer _classes_protocolTrampoline_1mbt9g9( + ffi.Pointer target, + ffi.Pointer arg0, +); + +late final _class_TestClass = objc.getClass("classes.TestClass"); +late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:"); +final _objc_msgSend_19nvye5 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + >() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(); +late final _class_TestOtherClass = objc.getClass("classes.TestOtherClass"); +late final _sel_times10WithX_ = objc.registerName("times10WithX:"); +final _objc_msgSend_12hwf9n = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Long Function( + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ) + > + >() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ) + >(); +typedef instancetype = ffi.Pointer; +typedef Dartinstancetype = objc.ObjCObjectBase; +late final _sel_init = objc.registerName("init"); +final _objc_msgSend_151sglz = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ) + > + >() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ) + >(); +late final _sel_new = objc.registerName("new"); +late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); +final _objc_msgSend_1cwp428 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + >() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(); +late final _sel_alloc = objc.registerName("alloc"); +late final _sel_self = objc.registerName("self"); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, +) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer arg0) + > + >() + .asFunction< + ffi.Pointer Function(ffi.Pointer) + >()(arg0); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline) + .cast(); +ffi.Pointer +_ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, +) => + (objc.getBlockClosure(block) + as ffi.Pointer Function(ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. +abstract final class ObjCBlock_objcObjCObject_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer) + > + castFromPointer( + ffi.Pointer pointer, { + bool retain = false, + bool release = false, + }) => + objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer) + >(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer) + > + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer arg0) + > + > + ptr, + ) => + objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer) + >( + objc.newPointerBlock( + _ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable, + ptr.cast(), + ), + retain: false, + release: true, + ); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer) + > + fromFunction( + objc.ObjCObjectBase Function(ffi.Pointer) fn, { + bool keepIsolateAlive = true, + }) => + objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer) + >( + objc.newClosureBlock( + _ObjCBlock_objcObjCObject_ffiVoid_closureCallable, + (ffi.Pointer arg0) => fn(arg0).ref.retainAndAutorelease(), + keepIsolateAlive, + ), + retain: false, + release: true, + ); +} + +/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. +extension ObjCBlock_objcObjCObject_ffiVoid_CallExtension + on + objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer) + > { + objc.ObjCObjectBase call(ffi.Pointer arg0) => objc.ObjCObjectBase( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0, + ) + > + >() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ) + >()(ref.pointer, arg0), + retain: true, + release: true, + ); +} + +late final _sel_retain = objc.registerName("retain"); +late final _sel_autorelease = objc.registerName("autorelease"); + +/// TestOtherClass +class TestOtherClass extends objc.NSObject { + TestOtherClass._( + ffi.Pointer pointer, { + bool retain = false, + bool release = false, + }) : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [TestOtherClass] that points to the same underlying object as [other]. + TestOtherClass.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [TestOtherClass] that wraps the given raw object pointer. + TestOtherClass.castFromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [TestOtherClass]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_TestOtherClass, + ); + } + + /// times10WithX: + int times10WithX(int x) { + return _objc_msgSend_12hwf9n(this.ref.pointer, _sel_times10WithX_, x); + } + + /// init + TestOtherClass init() { + objc.checkOsVersionInternal( + 'TestOtherClass.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final _ret = _objc_msgSend_151sglz( + this.ref.retainAndReturnPointer(), + _sel_init, + ); + return TestOtherClass.castFromPointer(_ret, retain: false, release: true); + } + + /// new + static TestOtherClass new$() { + final _ret = _objc_msgSend_151sglz(_class_TestOtherClass, _sel_new); + return TestOtherClass.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static TestOtherClass allocWithZone(ffi.Pointer zone) { + final _ret = _objc_msgSend_1cwp428( + _class_TestOtherClass, + _sel_allocWithZone_, + zone, + ); + return TestOtherClass.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static TestOtherClass alloc() { + final _ret = _objc_msgSend_151sglz(_class_TestOtherClass, _sel_alloc); + return TestOtherClass.castFromPointer(_ret, retain: false, release: true); + } + + /// self + TestOtherClass self$1() { + final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); + return TestOtherClass.castFromPointer(_ret, retain: true, release: true); + } + + /// retain + TestOtherClass retain() { + final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); + return TestOtherClass.castFromPointer(_ret, retain: true, release: true); + } + + /// autorelease + TestOtherClass autorelease() { + final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); + return TestOtherClass.castFromPointer(_ret, retain: true, release: true); + } + + /// Returns a new instance of TestOtherClass constructed with the default `new` method. + factory TestOtherClass() => new$(); +} + +late final _sel_myMethod = objc.registerName("myMethod"); +late final _sel_create = objc.registerName("create"); + +/// TestClass +class TestClass extends objc.NSObject { + TestClass._( + ffi.Pointer pointer, { + bool retain = false, + bool release = false, + }) : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [TestClass] that points to the same underlying object as [other]. + TestClass.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [TestClass] that wraps the given raw object pointer. + TestClass.castFromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [TestClass]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_TestClass, + ); + } + + /// myMethod + TestOtherClass myMethod() { + final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_myMethod); + return TestOtherClass.castFromPointer(_ret, retain: true, release: true); + } + + /// create + static TestClass create() { + final _ret = _objc_msgSend_151sglz(_class_TestClass, _sel_create); + return TestClass.castFromPointer(_ret, retain: true, release: true); + } + + /// init + TestClass init() { + objc.checkOsVersionInternal( + 'TestClass.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final _ret = _objc_msgSend_151sglz( + this.ref.retainAndReturnPointer(), + _sel_init, + ); + return TestClass.castFromPointer(_ret, retain: false, release: true); + } + + /// new + static TestClass new$() { + final _ret = _objc_msgSend_151sglz(_class_TestClass, _sel_new); + return TestClass.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static TestClass allocWithZone(ffi.Pointer zone) { + final _ret = _objc_msgSend_1cwp428( + _class_TestClass, + _sel_allocWithZone_, + zone, + ); + return TestClass.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static TestClass alloc() { + final _ret = _objc_msgSend_151sglz(_class_TestClass, _sel_alloc); + return TestClass.castFromPointer(_ret, retain: false, release: true); + } + + /// self + TestClass self$1() { + final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); + return TestClass.castFromPointer(_ret, retain: true, release: true); + } + + /// retain + TestClass retain() { + final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); + return TestClass.castFromPointer(_ret, retain: true, release: true); + } + + /// autorelease + TestClass autorelease() { + final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); + return TestClass.castFromPointer(_ret, retain: true, release: true); + } + + /// Returns a new instance of TestClass constructed with the default `new` method. + factory TestClass() => new$(); +} diff --git a/pkgs/swiftgen/test/integration/temp/classes_output.m b/pkgs/swiftgen/test/integration/temp/classes_output.m new file mode 100644 index 0000000000..7417ad582b --- /dev/null +++ b/pkgs/swiftgen/test/integration/temp/classes_output.m @@ -0,0 +1,59 @@ +#include +#import +#import +#import "classes.h" + +#if !__has_feature(objc_arc) +#error "This file must be compiled with ARC enabled" +#endif + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundeclared-selector" + +typedef struct { + int64_t version; + void* (*newWaiter)(void); + void (*awaitWaiter)(void*); + void* (*currentIsolate)(void); + void (*enterIsolate)(void*); + void (*exitIsolate)(void); + int64_t (*getMainPortId)(void); + bool (*getCurrentThreadOwnsIsolate)(int64_t); +} DOBJC_Context; + +id objc_retainBlock(id); + +#define BLOCKING_BLOCK_IMPL(ctx, BLOCK_SIG, INVOKE_DIRECT, INVOKE_LISTENER) \ + assert(ctx->version >= 1); \ + void* targetIsolate = ctx->currentIsolate(); \ + int64_t targetPort = ctx->getMainPortId == NULL ? 0 : ctx->getMainPortId(); \ + return BLOCK_SIG { \ + void* currentIsolate = ctx->currentIsolate(); \ + bool mayEnterIsolate = \ + currentIsolate == NULL && \ + ctx->getCurrentThreadOwnsIsolate != NULL && \ + ctx->getCurrentThreadOwnsIsolate(targetPort); \ + if (currentIsolate == targetIsolate || mayEnterIsolate) { \ + if (mayEnterIsolate) { \ + ctx->enterIsolate(targetIsolate); \ + } \ + INVOKE_DIRECT; \ + if (mayEnterIsolate) { \ + ctx->exitIsolate(); \ + } \ + } else { \ + void* waiter = ctx->newWaiter(); \ + INVOKE_LISTENER; \ + ctx->awaitWaiter(waiter); \ + } \ + }; + + +typedef id (^ProtocolTrampoline)(void * sel); +__attribute__((visibility("default"))) __attribute__((used)) +id _classes_protocolTrampoline_1mbt9g9(id target, void * sel) { + return ((ProtocolTrampoline)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel); +} +#undef BLOCKING_BLOCK_IMPL + +#pragma clang diagnostic pop