Skip to content

Commit fd36ce8

Browse files
committed
feat: add multi-isolate for delegate callback.
feat: support xcframework
1 parent 7f6b275 commit fd36ce8

File tree

31 files changed

+772
-257
lines changed

31 files changed

+772
-257
lines changed

dart_native/.vscode/launch.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
// 使用 IntelliSense 了解相关属性。
3+
// 悬停以查看现有属性的描述。
4+
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "dart_native",
9+
"request": "launch",
10+
"type": "dart"
11+
},
12+
{
13+
"name": "dart_native (profile mode)",
14+
"request": "launch",
15+
"type": "dart",
16+
"flutterMode": "profile"
17+
},
18+
{
19+
"name": "example",
20+
"cwd": "example",
21+
"request": "launch",
22+
"type": "dart"
23+
},
24+
{
25+
"name": "example (profile mode)",
26+
"cwd": "example",
27+
"request": "launch",
28+
"type": "dart",
29+
"flutterMode": "profile"
30+
}
31+
]
32+
}

dart_native/example/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ EXTERNAL SOURCES:
2323

2424
SPEC CHECKSUMS:
2525
CocoaLumberjack: e8955b9d337ac307103b0a34fd141c32f27e53c5
26-
dart_native: e10848b23206739fc16a2455f41847418a8ceb3d
26+
dart_native: 5de43456852385997b9b29dbf40f85d82c265e1a
2727
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
2828

2929
PODFILE CHECKSUM: f10e42e188a012076f9d5e111f499229a501832a

dart_native/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 82 additions & 82 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>PreviewsEnabled</key>
6+
<false/>
7+
</dict>
8+
</plist>

dart_native/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1200"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -27,6 +27,8 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
3032
<MacroExpansion>
3133
<BuildableReference
3234
BuildableIdentifier = "primary"
@@ -36,14 +38,13 @@
3638
ReferencedContainer = "container:Runner.xcodeproj">
3739
</BuildableReference>
3840
</MacroExpansion>
39-
<Testables>
40-
</Testables>
41+
<AdditionalOptions>
42+
</AdditionalOptions>
4143
</TestAction>
4244
<LaunchAction
4345
buildConfiguration = "Debug"
4446
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4547
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
46-
enableASanStackUseAfterReturn = "YES"
4748
launchStyle = "0"
4849
useCustomWorkingDirectory = "NO"
4950
ignoresPersistentStateOnLaunch = "NO"
@@ -60,6 +61,8 @@
6061
ReferencedContainer = "container:Runner.xcodeproj">
6162
</BuildableReference>
6263
</BuildableProductRunnable>
64+
<AdditionalOptions>
65+
</AdditionalOptions>
6366
</LaunchAction>
6467
<ProfileAction
6568
buildConfiguration = "Profile"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>PreviewsEnabled</key>
6+
<false/>
7+
</dict>
8+
</plist>

dart_native/ios/Classes/DNBlockWrapper.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ - (void)dealloc {
153153
}
154154
}
155155
free(_typeEncodings);
156-
NotifyDeallocToDart(_sequence, _dartPort);
156+
NotifyDeallocToDart((intptr_t)_sequence, _dartPort);
157157
}
158158

159159
- (void)initBlockWithError:(out NSError **)error {

dart_native/ios/Classes/DNError.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77

88
#import <Foundation/Foundation.h>
9+
#import "DNMacro.h"
910

1011
#define DN_ERROR(errorCode, desc, ...) \
1112
if (error) { \
@@ -27,16 +28,6 @@ typedef NS_ERROR_ENUM(DNErrorDomain, DNErrorCode) {
2728
DNCreateBlockError, // creating block fail.
2829
};
2930

30-
static NSError * DNErrorWithUnderlyingError(NSError *error, NSError *underlyingError) {
31-
if (!error) {
32-
return underlyingError;
33-
}
34-
if (!underlyingError || error.userInfo[NSUnderlyingErrorKey]) {
35-
return error;
36-
}
37-
NSMutableDictionary *mutableUserInfo = [error.userInfo mutableCopy];
38-
mutableUserInfo[NSUnderlyingErrorKey] = underlyingError;
39-
return [NSError errorWithDomain:error.domain code:error.code userInfo:mutableUserInfo];
40-
}
31+
DN_EXTERN NSError *DNErrorWithUnderlyingError(NSError *error, NSError *underlyingError);
4132

4233
NS_ASSUME_NONNULL_END

dart_native/ios/Classes/DNError.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,15 @@
1313

1414
/// MARK: Error
1515
NSString * const DNErrorDomain = @"com.dartnative.bridge";
16+
17+
NSError *DNErrorWithUnderlyingError(NSError *error, NSError *underlyingError) {
18+
if (!error) {
19+
return underlyingError;
20+
}
21+
if (!underlyingError || error.userInfo[NSUnderlyingErrorKey]) {
22+
return error;
23+
}
24+
NSMutableDictionary *mutableUserInfo = [error.userInfo mutableCopy];
25+
mutableUserInfo[NSUnderlyingErrorKey] = underlyingError;
26+
return [NSError errorWithDomain:error.domain code:error.code userInfo:mutableUserInfo];
27+
}

0 commit comments

Comments
 (0)