Skip to content

Commit 1bcb45c

Browse files
authored
[objective_c] Various small fixes (#2768)
1 parent 28b7c5f commit 1bcb45c

File tree

15 files changed

+70
-12
lines changed

15 files changed

+70
-12
lines changed

pkgs/ffigen/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 20.1.0
2+
3+
- Add `xcodeUri`, `iosSdkUri`, and `macSdkUri`, to mirror `xcodePath`,
4+
`iosSdkPath`, and `macSdkPath`.
5+
- Export some missing elements from the config API.
6+
17
## 20.0.0
28

39
- __Breaking change__: Completely rewrite the public Dart API for FFIgen.

pkgs/ffigen/lib/ffigen.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ export 'src/config_provider.dart'
1818
show
1919
BindingStyle,
2020
Categories,
21+
CommentLength,
22+
CommentStyle,
2123
CommentType,
2224
CompoundDependencies,
2325
Declaration,
2426
DynamicLibraryBindings,
27+
EnumStyle,
2528
Enums,
2629
ExternalVersions,
2730
FfiGenerator,
@@ -42,9 +45,13 @@ export 'src/config_provider.dart'
4245
Unions,
4346
UnnamedEnums,
4447
VarArgFunction,
48+
Version,
4549
Versions,
4650
YamlConfig,
4751
defaultCompilerOpts,
4852
iosSdkPath,
53+
iosSdkUri,
4954
macSdkPath,
50-
xcodePath;
55+
macSdkUri,
56+
xcodePath,
57+
xcodeUri;

pkgs/ffigen/lib/src/config_provider.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ library;
88
export 'config_provider/config.dart';
99
export 'config_provider/config_types.dart';
1010
export 'config_provider/path_finder.dart';
11-
export 'config_provider/utils.dart' show iosSdkPath, macSdkPath, xcodePath;
11+
export 'config_provider/utils.dart'
12+
show iosSdkPath, iosSdkUri, macSdkPath, macSdkUri, xcodePath, xcodeUri;
1213
export 'config_provider/yaml_config.dart';

pkgs/ffigen/lib/src/config_provider/config_types.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import '../code_generator.dart';
1515
import 'config.dart';
1616
import 'path_finder.dart';
1717

18+
export 'package:pub_semver/pub_semver.dart' show Version;
19+
1820
enum Language { c, objc }
1921

2022
class CommentType {

pkgs/ffigen/lib/src/config_provider/spec_utils.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'package:glob/glob.dart';
99
import 'package:logging/logging.dart';
1010
import 'package:package_config/package_config.dart';
1111
import 'package:path/path.dart' as p;
12-
import 'package:pub_semver/pub_semver.dart';
1312
import 'package:quiver/pattern.dart' as quiver;
1413
import 'package:yaml/yaml.dart';
1514

pkgs/ffigen/lib/src/config_provider/utils.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,18 @@ String get iosSdkPath => _iosSdk.value;
6262
///
6363
/// This is the result of the command `xcrun --show-sdk-path --sdk macosx`.
6464
String get macSdkPath => _macSdk.value;
65+
66+
/// The directory where Xcode's APIs are installed.
67+
///
68+
/// This is the result of the command `xcode-select -p`.
69+
Uri get xcodeUri => Uri.directory(xcodePath);
70+
71+
/// The directory within [xcodePath] where the iOS SDK is installed.
72+
///
73+
/// This is the result of the command `xcrun --show-sdk-path --sdk iphoneos`.
74+
Uri get iosSdkUri => Uri.directory(iosSdkPath);
75+
76+
/// The directory within [xcodePath] where the macOS SDK is installed.
77+
///
78+
/// This is the result of the command `xcrun --show-sdk-path --sdk macosx`.
79+
Uri get macSdkUri => Uri.directory(macSdkPath);

pkgs/ffigen/lib/src/header_parser/sub_parsers/api_availability.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'dart:ffi';
66

77
import 'package:ffi/ffi.dart';
88
import 'package:meta/meta.dart';
9-
import 'package:pub_semver/pub_semver.dart';
109

1110
import '../../config_provider/config_types.dart';
1211
import '../../context.dart';

pkgs/ffigen/lib/src/header_parser/utils.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'dart:ffi';
66

77
import 'package:ffi/ffi.dart';
88
import 'package:logging/logging.dart';
9-
import 'package:pub_semver/pub_semver.dart';
109

1110
import '../code_generator.dart';
1211
import '../config_provider/config_types.dart';

pkgs/ffigen/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# BSD-style license that can be found in the LICENSE file.
44

55
name: ffigen
6-
version: 20.0.0
6+
version: 20.1.0-dev
77
description: >
88
Generator for FFI bindings, using LibClang to parse C, Objective-C, and Swift
99
files.

pkgs/ffigen/test/large_integration_tests/large_objc_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import 'package:ffigen/ffigen.dart';
1616
import 'package:ffigen/src/code_generator/utils.dart';
1717
import 'package:logging/logging.dart';
1818
import 'package:path/path.dart' as path;
19-
import 'package:pub_semver/pub_semver.dart';
2019
import 'package:test/test.dart';
2120

2221
import '../test_utils.dart';

0 commit comments

Comments
 (0)