File tree 4 files changed +15
-10
lines changed
ffigen/lib/src/code_generator 4 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,15 @@ import 'writer.dart';
9
9
class LibraryImport {
10
10
final String name;
11
11
final String _importPath;
12
- final String ? importPathWhenImportedByPackageObjC;
12
+ final String ? _importPathWhenImportedByPackageObjC;
13
+
13
14
String prefix;
14
15
15
16
LibraryImport (this .name, this ._importPath,
16
- {this .importPathWhenImportedByPackageObjC})
17
- : prefix = name;
17
+ {String ? importPathWhenImportedByPackageObjC})
18
+ : _importPathWhenImportedByPackageObjC =
19
+ importPathWhenImportedByPackageObjC,
20
+ prefix = name;
18
21
19
22
@override
20
23
bool operator == (other) {
@@ -24,9 +27,11 @@ class LibraryImport {
24
27
@override
25
28
int get hashCode => name.hashCode;
26
29
30
+ // The import path, which may be different if this library is being imported
31
+ // into package:objective_c's generated code.
27
32
String importPath (bool generateForPackageObjectiveC) {
28
33
if (! generateForPackageObjectiveC) return _importPath;
29
- return importPathWhenImportedByPackageObjC ?? _importPath;
34
+ return _importPathWhenImportedByPackageObjC ?? _importPath;
30
35
}
31
36
}
32
37
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ include: package:flutter_lints/flutter.yaml
2
2
3
3
analyzer :
4
4
exclude :
5
- - tool/extra_methods.dart
5
+ - tool/data/ extra_methods.dart
6
6
language :
7
7
strict-casts : true
8
8
strict-inference : true
Original file line number Diff line number Diff line change 1
- // Copyright (c) 2022 , the Dart project authors. Please see the AUTHORS file
1
+ // Copyright (c) 2024 , the Dart project authors. Please see the AUTHORS file
2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
- // Extra methods inserted into NSString by generate_code.dart.
5
+ // Extra methods inserted into NSString by tool/ generate_code.dart.
6
6
class NSString extends NSObject {
7
7
factory NSString (String str) {
8
8
final cstr = str.toNativeUtf16 ();
Original file line number Diff line number Diff line change 2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
- // Runs the ffigen configs, then merges extra_methods.dart into the Objective C
6
- // bindings.
5
+ // Runs the ffigen configs, then merges tool/data/ extra_methods.dart into the
6
+ // Objective C bindings.
7
7
8
8
// ignore_for_file: avoid_print
9
9
@@ -15,7 +15,7 @@ const cConfig = 'ffigen_c.yaml';
15
15
const objcConfig = 'ffigen_objc.yaml' ;
16
16
const cBindings = 'lib/src/c_bindings_generated.dart' ;
17
17
const objcBindings = 'lib/src/objective_c_bindings_generated.dart' ;
18
- const extraMethodsFile = 'tool/extra_methods.dart' ;
18
+ const extraMethodsFile = 'tool/data/ extra_methods.dart' ;
19
19
20
20
void dartCmd (List <String > args) {
21
21
final exec = Platform .resolvedExecutable;
You can’t perform that action at this time.
0 commit comments