Skip to content

Commit b5133ad

Browse files
committed
Merge branch 'release/0.3.14'
2 parents 6eeb2d5 + 545b7f2 commit b5133ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+519
-261
lines changed

.github/workflows/dart.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: subosito/flutter-action@v1
1818
with:
1919
# same with pubspec.yaml
20-
flutter-version: "1.20.2"
20+
flutter-version: "1.22.3"
2121
- run: flutter pub get
2222
working-directory: dart_native
2323
- run: flutter test --no-pub test/

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: subosito/flutter-action@v1
1818
with:
1919
# same with pubspec.yaml
20-
flutter-version: "1.20.2"
20+
flutter-version: "1.22.3"
2121
- run: flutter pub get
2222
working-directory: dart_native/example
2323
- run: flutter analyze --no-pub --no-current-package lib/ test/

dart_native/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.14
2+
3+
* [Feature] Support `await/async` for methods on iOS.
4+
15
## 0.3.13
26

37
* [Fix] Memory leaks on Android.

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: 8150ab93e4e060c19e0e8fb3bf98bc970d097957
26+
dart_native: e10848b23206739fc16a2455f41847418a8ceb3d
2727
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
2828

2929
PODFILE CHECKSUM: f10e42e188a012076f9d5e111f499229a501832a

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
97C146EC1CF9000F007C117D /* Resources */,
160160
9705A1C41CF9048500538489 /* Embed Frameworks */,
161161
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
162-
BE5B22DFAAC4C980EE6298D0 /* [CP] Embed Pods Frameworks */,
162+
3199B333F30D678225AFDF10 /* [CP] Embed Pods Frameworks */,
163163
);
164164
buildRules = (
165165
);
@@ -240,53 +240,53 @@
240240
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
241241
showEnvVarsInLog = 0;
242242
};
243-
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
243+
3199B333F30D678225AFDF10 /* [CP] Embed Pods Frameworks */ = {
244244
isa = PBXShellScriptBuildPhase;
245245
buildActionMask = 2147483647;
246246
files = (
247247
);
248248
inputPaths = (
249+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
250+
"${PODS_ROOT}/../Flutter/Flutter.framework",
251+
"${PODS_ROOT}/../.symlinks/plugins/dart_native/ios/DartNative.framework",
249252
);
250-
name = "Thin Binary";
253+
name = "[CP] Embed Pods Frameworks";
251254
outputPaths = (
255+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
256+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DartNative.framework",
252257
);
253258
runOnlyForDeploymentPostprocessing = 0;
254259
shellPath = /bin/sh;
255-
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n";
260+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
261+
showEnvVarsInLog = 0;
256262
};
257-
9740EEB61CF901F6004384FC /* Run Script */ = {
263+
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
258264
isa = PBXShellScriptBuildPhase;
259265
buildActionMask = 2147483647;
260266
files = (
261267
);
262268
inputPaths = (
263269
);
264-
name = "Run Script";
270+
name = "Thin Binary";
265271
outputPaths = (
266272
);
267273
runOnlyForDeploymentPostprocessing = 0;
268274
shellPath = /bin/sh;
269-
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
275+
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n";
270276
};
271-
BE5B22DFAAC4C980EE6298D0 /* [CP] Embed Pods Frameworks */ = {
277+
9740EEB61CF901F6004384FC /* Run Script */ = {
272278
isa = PBXShellScriptBuildPhase;
273279
buildActionMask = 2147483647;
274280
files = (
275281
);
276282
inputPaths = (
277-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
278-
"${PODS_ROOT}/../Flutter/Flutter.framework",
279-
"${PODS_ROOT}/../.symlinks/plugins/dart_native/ios/DartNative.framework",
280283
);
281-
name = "[CP] Embed Pods Frameworks";
284+
name = "Run Script";
282285
outputPaths = (
283-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
284-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DartNative.framework",
285286
);
286287
runOnlyForDeploymentPostprocessing = 0;
287288
shellPath = /bin/sh;
288-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
289-
showEnvVarsInLog = 0;
289+
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
290290
};
291291
/* End PBXShellScriptBuildPhase section */
292292

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@
5959
ReferencedContainer = "container:Runner.xcodeproj">
6060
</BuildableReference>
6161
</BuildableProductRunnable>
62+
<AdditionalOptions>
63+
<AdditionalOption
64+
key = "NSZombieEnabled"
65+
value = "YES"
66+
isEnabled = "YES">
67+
</AdditionalOption>
68+
</AdditionalOptions>
6269
</LaunchAction>
6370
<ProfileAction
6471
buildConfiguration = "Profile"

dart_native/example/ios/Runner/RuntimeStub.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ - (void)fooStructDelegate:(id<SampleDelegate>)delegate {
257257
}
258258

259259
- (NSString *)fooNSString:(NSString *)str {
260-
DDLogInfo(@"%s arg: %@", __FUNCTION__, str);
260+
// DDLogInfo(@"%s arg: %@", __FUNCTION__, str);
261261
return @"test nsstring";
262262
}
263263

dart_native/example/lib/ios/ios_main.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class _IOSAppState extends State<IOSApp> {
3636
print(
3737
"Flutter Channel Cost: ${DateTime.now().millisecondsSinceEpoch - time}");
3838
time = DateTime.now().millisecondsSinceEpoch;
39-
4039
for (var i = 0; i < 10000; i++) {
4140
String _ = stub.fooNSString(testString);
4241
}

dart_native/example/lib/ios/runtimestub.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,12 @@ class RuntimeStub extends NSObject {
249249
return NSString.fromPointer(result).raw;
250250
}
251251

252+
Future<dynamic> fooNSStringAsync(String str) async {
253+
return performAsync(SEL('fooNSString:'), args: [str]).then((value) {
254+
return NSString.fromPointer(value.pointer).raw;
255+
});
256+
}
257+
252258
String fooNSMutableString(String str) {
253259
NSMutableString _str = NSMutableString(str);
254260
Pointer<Void> result =

dart_native/example/lib/ios/unit_test.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,13 @@ testIOS(RuntimeStub stub, DelegateStub delegate) {
143143
stub.fooWithOptions(TestOptions(TestOptionsOne | TestOptionsTwo));
144144
print('fooWithOptions result:$options');
145145

146-
NSObject currentThread = Class('NSThread')
147-
.perform(SEL('currentThread'), onQueue: DispatchQueue.global());
148-
NSObject description = currentThread.perform(SEL('description'));
149-
String threadResult = NSString.fromPointer(description.pointer).raw;
150-
print('currentThread: $threadResult');
146+
Class('NSThread')
147+
.performAsync(SEL('currentThread'), onQueue: DispatchQueue.global())
148+
.then((currentThread) {
149+
NSObject description = currentThread.perform(SEL('description'));
150+
String threadResult = NSString.fromPointer(description.pointer).raw;
151+
print('currentThread: $threadResult');
152+
});
151153

152154
NSNotificationCenter.defaultCenter.addObserver(
153155
delegate, delegate.handleNotification, 'SampleDartNotification', nil);

0 commit comments

Comments
 (0)