From 3c5bb800bf21fd5c881ac0b9ee57fa8475d3b248 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Mon, 8 Jan 2024 23:13:02 +0100 Subject: [PATCH] Revert license header change in test --- .github/workflows/ffigen.yml | 6 ++-- .../ffinative/lib/generated_bindings.dart | 27 +++++++---------- pkgs/ffigen/lib/src/code_generator/func.dart | 1 - .../ffigen/lib/src/code_generator/global.dart | 1 - .../lib/src/code_generator/library.dart | 15 +++++++--- pkgs/ffigen/lib/src/code_generator/utils.dart | 4 --- .../ffigen/lib/src/code_generator/writer.dart | 15 ++++++++++ .../code_generator_test.dart | 30 ++++++++++--------- .../_expected_boolean_dartbool_bindings.dart | 2 +- .../_expected_constant_bindings.dart | 2 +- .../_expected_enumclass_bindings.dart | 2 +- .../_expected_function_bindings.dart | 2 +- ..._expected_function_ffiNative_bindings.dart | 5 +++- .../_expected_function_n_struct_bindings.dart | 2 +- .../_expected_global_bindings.dart | 2 +- .../_expected_global_native_bindings.dart | 5 +++- ...internal_conflict_resolution_bindings.dart | 2 +- .../_expected_native_symbol_bindings.dart | 2 +- .../_expected_packed_structs_bindings.dart | 2 +- .../_expected_sort_bindings_bindings.dart | 2 +- .../_expected_struct_bindings.dart | 2 +- .../_expected_typealias_bindings.dart | 2 +- .../_expected_unions_bindings.dart | 2 +- .../decl_symbol_address_collision_test.dart | 11 ++----- ...ecl_symbol_address_collision_bindings.dart | 4 --- 25 files changed, 79 insertions(+), 71 deletions(-) diff --git a/.github/workflows/ffigen.yml b/.github/workflows/ffigen.yml index ab75de5eb..4c290e779 100644 --- a/.github/workflows/ffigen.yml +++ b/.github/workflows/ffigen.yml @@ -57,7 +57,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: - sdk: dev #3.2.0 + sdk: dev #3.3.0 - name: Install dependencies run: dart pub get - name: Install libclang-14-dev @@ -78,7 +78,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: - sdk: dev #3.2.0 + sdk: dev #3.3.0 - name: Install dependencies run: dart pub get - name: Build test dylib and bindings @@ -111,7 +111,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: - sdk: dev #3.2.0 + sdk: dev #3.3.0 - name: Install dependencies run: dart pub get - name: Build test dylib and bindings diff --git a/pkgs/ffigen/example/ffinative/lib/generated_bindings.dart b/pkgs/ffigen/example/ffinative/lib/generated_bindings.dart index 485ce23c1..39e098469 100644 --- a/pkgs/ffigen/example/ffinative/lib/generated_bindings.dart +++ b/pkgs/ffigen/example/ffinative/lib/generated_bindings.dart @@ -8,61 +8,56 @@ // // Generated by `package:ffigen`. // ignore_for_file: type=lint +@ffi.DefaultAsset('package:ffinative_example/generated_bindings.dart') +library; + import 'dart:ffi' as ffi; import '' as self; /// Adds 2 integers. -@ffi.Native( - assetId: 'package:ffinative_example/generated_bindings.dart') +@ffi.Native() external int sum( int a, int b, ); /// Subtracts 2 integers. -@ffi.Native( - assetId: 'package:ffinative_example/generated_bindings.dart') +@ffi.Native() external int subtract( int a, int b, ); /// Multiplies 2 integers, returns pointer to an integer,. -@ffi.Native Function(ffi.Int, ffi.Int)>( - assetId: 'package:ffinative_example/generated_bindings.dart') +@ffi.Native Function(ffi.Int, ffi.Int)>() external ffi.Pointer multiply( int a, int b, ); /// Divides 2 integers, returns pointer to a float. -@ffi.Native Function(ffi.Int, ffi.Int)>( - assetId: 'package:ffinative_example/generated_bindings.dart') +@ffi.Native Function(ffi.Int, ffi.Int)>() external ffi.Pointer divide( int a, int b, ); /// Divides 2 floats, returns a pointer to double. -@ffi.Native Function(ffi.Float, ffi.Float)>( - assetId: 'package:ffinative_example/generated_bindings.dart') +@ffi.Native Function(ffi.Float, ffi.Float)>() external ffi.Pointer dividePrecision( double a, double b, ); -@ffi.Native( - assetId: 'package:ffinative_example/generated_bindings.dart') +@ffi.Native() external int log_level; @ffi.Array.multi([5]) -@ffi.Native>( - assetId: 'package:ffinative_example/generated_bindings.dart') +@ffi.Native>() external ffi.Array array; /// Version of the native C library -@ffi.Native>( - assetId: 'package:ffinative_example/generated_bindings.dart') +@ffi.Native>() external final ffi.Pointer library_version; const addresses = _SymbolAddresses(); diff --git a/pkgs/ffigen/lib/src/code_generator/func.dart b/pkgs/ffigen/lib/src/code_generator/func.dart index c7f84ba28..1c518f9f6 100644 --- a/pkgs/ffigen/lib/src/code_generator/func.dart +++ b/pkgs/ffigen/lib/src/code_generator/func.dart @@ -152,7 +152,6 @@ ${makeNativeAnnotation( nativeType: cType, dartName: nativeFuncName, nativeSymbolName: originalName, - assetId: ffiNativeConfig.assetId, isLeaf: isLeaf, )} external $ffiReturnType $nativeFuncName($ffiArgDeclString); diff --git a/pkgs/ffigen/lib/src/code_generator/global.dart b/pkgs/ffigen/lib/src/code_generator/global.dart index f33576574..439a2f326 100644 --- a/pkgs/ffigen/lib/src/code_generator/global.dart +++ b/pkgs/ffigen/lib/src/code_generator/global.dart @@ -57,7 +57,6 @@ class Global extends LookUpBinding { ..writeln(makeNativeAnnotation( w, nativeType: cType, - assetId: nativeConfig.assetId, dartName: globalVarName, nativeSymbolName: originalName, isLeaf: false, diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index 41774e62f..60ad7c3ff 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -56,14 +56,20 @@ class Library { // Seperate bindings which require lookup. final lookupBindings = []; final nativeBindings = []; + FfiNativeConfig? nativeConfig; for (final binding in this.bindings.whereType()) { - final usesLookup = switch (binding) { - Func() => !binding.ffiNativeConfig.enabled, - Global() => !binding.nativeConfig.enabled, - _ => true, + final nativeConfigForBinding = switch (binding) { + Func() => binding.ffiNativeConfig, + Global() => binding.nativeConfig, + _ => null, }; + // At the moment, all bindings share their native config. + nativeConfig ??= nativeConfigForBinding; + + final usesLookup = + nativeConfigForBinding == null || !nativeConfigForBinding.enabled; (usesLookup ? lookupBindings : nativeBindings).add(binding); } final noLookUpBindings = @@ -72,6 +78,7 @@ class Library { _writer = Writer( lookUpBindings: lookupBindings, ffiNativeBindings: nativeBindings, + nativeAssetId: nativeConfig?.assetId, noLookUpBindings: noLookUpBindings, className: name, classDocComment: description, diff --git a/pkgs/ffigen/lib/src/code_generator/utils.dart b/pkgs/ffigen/lib/src/code_generator/utils.dart index 4b1f6b674..4bad8e3dd 100644 --- a/pkgs/ffigen/lib/src/code_generator/utils.dart +++ b/pkgs/ffigen/lib/src/code_generator/utils.dart @@ -88,16 +88,12 @@ String makeNativeAnnotation( required String? nativeType, required String dartName, required String nativeSymbolName, - String? assetId, bool isLeaf = false, }) { final args = <(String, String)>[]; if (dartName != nativeSymbolName) { args.add(('symbol', '"$nativeSymbolName"')); } - if (assetId != null) { - args.add(('assetId', "'$assetId'")); - } if (isLeaf) { args.add(('isLeaf', 'true')); } diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 77a69da04..8193de1c0 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -23,6 +23,9 @@ class Writer { /// Holds bindings which don't lookup symbols. final List noLookUpBindings; + /// The default asset id to use for [ffiNativeBindings]. + final String? nativeAssetId; + /// Manages the `_SymbolAddress` class. final symbolAddressWriter = SymbolAddressWriter(); @@ -99,6 +102,7 @@ class Writer { required this.ffiNativeBindings, required this.noLookUpBindings, required String className, + required this.nativeAssetId, Set? additionalImports, this.classDocComment, this.header, @@ -224,6 +228,17 @@ class Writer { result.write(makeDoc('ignore_for_file: type=lint')); } + // If there are any @Native bindings, the file needs to have an + // `@DefaultAsset` annotation for the symbols to resolve properly. This + // avoids duplicating the asset on every element. + // Since the annotation goes on a `library;` directive, it needs to appear + // before other definitions in the file. + if (ffiNativeBindings.isNotEmpty && nativeAssetId != null) { + result + ..writeln("@$ffiLibraryPrefix.DefaultAsset('$nativeAssetId')") + ..writeln('library;\n'); + } + /// Write [lookUpBindings]. if (lookUpBindings.isNotEmpty) { // Write doc comment for wrapper class. diff --git a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart index dcf74431e..c9de2e13a 100644 --- a/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart +++ b/pkgs/ffigen/test/code_generator_tests/code_generator_test.dart @@ -11,28 +11,30 @@ import '../test_utils.dart'; void main() { const licenseHeader = ''' -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. '''; group('code_generator: ', () { @isTestGroup - void withAndWithoutNative(String description, void Function(bool) runTest) { + void withAndWithoutNative( + String description, void Function(FfiNativeConfig) runTest) { group(description, () { - test('without Native', () => runTest(false)); - test('with Native', () => runTest(true)); + test('without Native', () => runTest(FfiNativeConfig(enabled: false))); + test('with Native', + () => runTest(FfiNativeConfig(enabled: true, assetId: 'test'))); }); } withAndWithoutNative('Function Binding (primitives, pointers)', - (enableFfiNative) { + (nativeConfig) { final library = Library( name: 'Bindings', header: licenseHeader, bindings: [ Func( - ffiNativeConfig: FfiNativeConfig(enabled: enableFfiNative), + ffiNativeConfig: nativeConfig, name: 'noParam', dartDoc: 'Just a test function\nheres another line', returnType: NativeType( @@ -40,7 +42,7 @@ void main() { ), ), Func( - ffiNativeConfig: FfiNativeConfig(enabled: enableFfiNative), + ffiNativeConfig: nativeConfig, name: 'withPrimitiveParam', parameters: [ Parameter( @@ -61,7 +63,7 @@ void main() { ), ), Func( - ffiNativeConfig: FfiNativeConfig(enabled: enableFfiNative), + ffiNativeConfig: nativeConfig, name: 'withPointerParam', parameters: [ Parameter( @@ -90,7 +92,7 @@ void main() { ), ), Func( - ffiNativeConfig: FfiNativeConfig(enabled: enableFfiNative), + ffiNativeConfig: nativeConfig, isLeaf: true, name: 'leafFunc', dartDoc: 'A function with isLeaf: true', @@ -109,7 +111,8 @@ void main() { ], ); - _matchLib(library, enableFfiNative ? 'function_ffiNative' : 'function'); + _matchLib( + library, nativeConfig.enabled ? 'function_ffiNative' : 'function'); }); test('Struct Binding (primitives, pointers)', () { @@ -254,12 +257,11 @@ void main() { }); withAndWithoutNative('global (primitives, pointers, pointer to struct)', - (enableNative) { + (nativeConfig) { final structSome = Struct( name: 'Some', ); final emptyGlobalStruct = Struct(name: 'EmptyStruct'); - final nativeConfig = FfiNativeConfig(enabled: enableNative); final library = Library( name: 'Bindings', @@ -290,7 +292,7 @@ void main() { NativeType( SupportedNativeType.Float, ), - useArrayType: enableNative, + useArrayType: nativeConfig.enabled, ), constant: true, ), @@ -310,7 +312,7 @@ void main() { ), ], ); - _matchLib(library, enableNative ? 'global_native' : 'global'); + _matchLib(library, nativeConfig.enabled ? 'global_native' : 'global'); }); test('constant', () { diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index 733fb53f8..f379c7b7d 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart index 100fb8dae..b47cf7041 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_constant_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart index 7b554ae00..80820af15 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_enumclass_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart index ebc80340e..886f28499 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_ffiNative_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_ffiNative_bindings.dart index 0133bcea3..e77b71487 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_ffiNative_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_ffiNative_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. @@ -6,6 +6,9 @@ // // Generated by `package:ffigen`. // ignore_for_file: type=lint +@ffi.DefaultAsset('test') +library; + import 'dart:ffi' as ffi; /// Just a test function diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart index c80b68006..c8680a848 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart index 90198df49..066f9ee0b 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_native_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_native_bindings.dart index 807504e4e..601c079d5 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_native_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_global_native_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. @@ -6,6 +6,9 @@ // // Generated by `package:ffigen`. // ignore_for_file: type=lint +@ffi.DefaultAsset('test') +library; + import 'dart:ffi' as ffi; @ffi.Native() diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart index 7530c379c..af97952ad 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_native_symbol_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_native_symbol_bindings.dart index 133853eb1..234cf2c96 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_native_symbol_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_native_symbol_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart index 7a3beb65e..5c1b17a5b 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_packed_structs_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart index 0c0e863dd..1e9d1dc11 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart index 8f2a742d4..aa862baa7 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_struct_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart index b3edfe5cc..0e1662da5 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. diff --git a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart index a6ebc33bc..1d000e5c4 100644 --- a/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart +++ b/pkgs/ffigen/test/code_generator_tests/expected_bindings/_expected_unions_bindings.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. diff --git a/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart index 1ee01ae85..0280732ba 100644 --- a/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart +++ b/pkgs/ffigen/test/collision_tests/decl_symbol_address_collision_test.dart @@ -9,20 +9,13 @@ import '../test_utils.dart'; late Library actual; void main() { - const licenseHeader = ''' -// 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. - -// ignore_for_file: unused_element, camel_case_types, non_constant_identifier_names -'''; - group('decl_symbol_address_collision_test', () { setUpAll(() { logWarnings(Level.SEVERE); actual = Library( name: 'Bindings', - header: licenseHeader, + header: + '// ignore_for_file: unused_element, camel_case_types, non_constant_identifier_names\n', bindings: [ Struct(name: 'addresses'), Struct(name: '_SymbolAddresses'), diff --git a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart index 0bd74d6f4..0d5473f94 100644 --- a/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart +++ b/pkgs/ffigen/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart @@ -1,7 +1,3 @@ -// 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. - // ignore_for_file: unused_element, camel_case_types, non_constant_identifier_names // AUTO GENERATED FILE, DO NOT EDIT.