Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pkgs/ffigen/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ analyzer:

# Exclude anything that uses package:objective_c, due to flutter dependency.
# https://github.com/dart-lang/native/issues/1068
- example/objective_c/**
- example/swift/**
- test_flutter/native_objc_test/**
- test/native_objc_test/**
language:
Expand Down
1 change: 0 additions & 1 deletion pkgs/ffigen/example/c_json/cjson_generated_bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

// ignore_for_file: camel_case_types, non_constant_identifier_names
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
Expand Down
2 changes: 0 additions & 2 deletions pkgs/ffigen/example/c_json/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@ preamble: |
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

// ignore_for_file: camel_case_types, non_constant_identifier_names
1 change: 0 additions & 1 deletion pkgs/ffigen/example/ffinative/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ 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.

// ignore_for_file: deprecated_member_use
functions:
symbol-address:
include:
Expand Down
2 changes: 0 additions & 2 deletions pkgs/ffigen/example/ffinative/lib/generated_bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// 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: deprecated_member_use

// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
Expand Down
2 changes: 0 additions & 2 deletions pkgs/ffigen/example/libclang-example/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,3 @@ preamble: |
// Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// ignore_for_file: camel_case_types, non_constant_identifier_names
2 changes: 0 additions & 2 deletions pkgs/ffigen/example/libclang-example/generated_bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// ignore_for_file: camel_case_types, non_constant_identifier_names

// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
Expand Down
9 changes: 1 addition & 8 deletions pkgs/ffigen/example/objective_c/avf_audio_bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@
// 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: camel_case_types
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: unused_element
// ignore_for_file: unused_field
// TODO(https://github.com/dart-lang/native/issues/2748): Remove this ignore.
// ignore_for_file: unused_import
// ignore_for_file: void_checks
// ignore_for_file: annotate_overrides
// ignore_for_file: no_leading_underscores_for_local_identifiers
// ignore_for_file: library_private_types_in_public_api

// AUTO GENERATED FILE, DO NOT EDIT.
//
Expand Down
9 changes: 1 addition & 8 deletions pkgs/ffigen/example/objective_c/generate_code.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,8 @@ final config = FfiGenerator(
// 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: camel_case_types
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: unused_element
// ignore_for_file: unused_field
// TODO(https://github.com/dart-lang/native/issues/2748): Remove this ignore.
// ignore_for_file: unused_import
// ignore_for_file: void_checks
// ignore_for_file: annotate_overrides
// ignore_for_file: no_leading_underscores_for_local_identifiers
// ignore_for_file: library_private_types_in_public_api
''',
),
);
Expand Down
7 changes: 4 additions & 3 deletions pkgs/ffigen/example/objective_c/play_audio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
// BSD-style license that can be found in the LICENSE file.

import 'dart:ffi';

import 'package:objective_c/objective_c.dart';
import 'avf_audio_bindings.dart';

// TODO(https://github.com/dart-lang/native/issues/1068): Remove this.
import '../../../objective_c/test/setup.dart' as objCSetup;
import '../../../objective_c/test/setup.dart' as objc_setup;
import 'avf_audio_bindings.dart';

const _dylibPath =
'/System/Library/Frameworks/AVFAudio.framework/Versions/Current/AVFAudio';

void main(List<String> args) async {
objCSetup.main([]);
objc_setup.main([]);
DynamicLibrary.open(_dylibPath);
for (final file in args) {
final fileStr = NSString(file);
Expand Down
1 change: 1 addition & 0 deletions pkgs/ffigen/example/objective_c/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ environment:
dependencies:
args: ^2.6.0
ffi: ^2.0.1
logging: ^1.3.0
objective_c: ^0.0.1

dev_dependencies:
Expand Down
2 changes: 0 additions & 2 deletions pkgs/ffigen/example/shared_bindings/ffigen_configs/a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ output: '../lib/generated/a_gen.dart'
headers:
entry-points:
- '../headers/a.h'
preamble: |
// ignore_for_file: non_constant_identifier_names, camel_case_types
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ import:
symbol-files:
# Both package Uri and file paths are supported here.
- 'package:shared_bindings/generated/base_symbols.yaml'
preamble: |
// ignore_for_file: non_constant_identifier_names, camel_case_types
2 changes: 0 additions & 2 deletions pkgs/ffigen/example/shared_bindings/ffigen_configs/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ output:
headers:
entry-points:
- '../headers/base.h'
preamble: |
// ignore_for_file: non_constant_identifier_names, camel_case_types
6 changes: 2 additions & 4 deletions pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// ignore_for_file: non_constant_identifier_names, camel_case_types

// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
Expand Down Expand Up @@ -122,7 +120,7 @@ enum BaseEnum {
static BaseEnum fromValue(int value) => switch (value) {
0 => BASE_ENUM_1,
1 => BASE_ENUM_2,
_ => throw ArgumentError("Unknown value for BaseEnum: $value"),
_ => throw ArgumentError('Unknown value for BaseEnum: $value'),
};
}

Expand All @@ -146,7 +144,7 @@ enum A_Enum {
static A_Enum fromValue(int value) => switch (value) {
0 => A_ENUM_1,
1 => A_ENUM_2,
_ => throw ArgumentError("Unknown value for A_Enum: $value"),
_ => throw ArgumentError('Unknown value for A_Enum: $value'),
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// ignore_for_file: non_constant_identifier_names, camel_case_types

// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// ignore_for_file: non_constant_identifier_names, camel_case_types

// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
Expand Down Expand Up @@ -70,7 +68,7 @@ enum BaseEnum {
static BaseEnum fromValue(int value) => switch (value) {
0 => BASE_ENUM_1,
1 => BASE_ENUM_2,
_ => throw ArgumentError("Unknown value for BaseEnum: $value"),
_ => throw ArgumentError('Unknown value for BaseEnum: $value'),
};
}

Expand Down
7 changes: 2 additions & 5 deletions pkgs/ffigen/example/swift/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,5 @@ 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.

// ignore_for_file: camel_case_types, non_constant_identifier_names
// ignore_for_file: unused_element, unused_field, return_of_invalid_type
// ignore_for_file: void_checks, annotate_overrides
// ignore_for_file: no_leading_underscores_for_local_identifiers
// ignore_for_file: library_private_types_in_public_api
// TODO(https://github.com/dart-lang/native/issues/2748): Remove this ignore.
// ignore_for_file: unused_import
7 changes: 4 additions & 3 deletions pkgs/ffigen/example/swift/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
// BSD-style license that can be found in the LICENSE file.

import 'dart:ffi';

import 'package:objective_c/objective_c.dart';
import 'swift_api_bindings.dart';

// TODO(https://github.com/dart-lang/native/issues/1068): Remove this.
import '../../../objective_c/test/setup.dart' as objCSetup;
import '../../../objective_c/test/setup.dart' as objc_setup;
import 'swift_api_bindings.dart';

void main() {
objCSetup.main([]);
objc_setup.main([]);

// TODO(https://github.com/dart-lang/ffigen/issues/443): Add a test for this.
DynamicLibrary.open('libswiftapi.dylib');
Expand Down
7 changes: 2 additions & 5 deletions pkgs/ffigen/example/swift/swift_api_bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
// 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: camel_case_types, non_constant_identifier_names
// ignore_for_file: unused_element, unused_field, return_of_invalid_type
// ignore_for_file: void_checks, annotate_overrides
// ignore_for_file: no_leading_underscores_for_local_identifiers
// ignore_for_file: library_private_types_in_public_api
// TODO(https://github.com/dart-lang/native/issues/2748): Remove this ignore.
// ignore_for_file: unused_import

// AUTO GENERATED FILE, DO NOT EDIT.
Copy link
Contributor Author

@goderbauer goderbauer Nov 5, 2025

Choose a reason for hiding this comment

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

(This comment is about the import on line 17, but github wouldn't let me comment on that line.)

Same problem here.

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// ignore_for_file: camel_case_types, non_constant_identifier_names

// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
Expand Down
2 changes: 0 additions & 2 deletions pkgs/ffigen/tool/libclang_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ preamble: |
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// ignore_for_file: camel_case_types, non_constant_identifier_names
enums:
include:
- CXChildVisitResult
Expand Down