Skip to content

Commit e37093f

Browse files
authored
Upgrade to package:objective_c` 4.0 (#1406)
1 parent e509abb commit e37093f

File tree

9 files changed

+29541
-22462
lines changed

9 files changed

+29541
-22462
lines changed

pkgs/cupertino_http/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.2-wip
2+
3+
* Upgrade to `package:objective_c` 4.0.
4+
15
## 2.0.1
26

37
* Fix a [bug](https://github.com/dart-lang/http/issues/1398) where

pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m

Lines changed: 121 additions & 75 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.m

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,3 @@ _DidFinish adaptFinishWithLock(_DidFinishWithLock block) {
1010
[lock unlock];
1111
};
1212
}
13-
14-
void doNotCall() {
15-
// TODO(https://github.com/dart-lang/native/issues/1672): Remove
16-
// when fixed.
17-
// Force the protocol information to be available at runtime.
18-
@protocol (NSURLSessionDataDelegate);
19-
@protocol (NSURLSessionDownloadDelegate);
20-
@protocol (NSURLSessionWebSocketDelegate);
21-
}

pkgs/cupertino_http/example/integration_test/utils_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ void main() {
3636
test('non-string value', () {
3737
final d = objc.NSMutableDictionary.new1()
3838
..setObject_forKey_(
39-
objc.NSNumber.numberWithInteger_(5), 'key'.toNSString());
39+
objc.NSNumberCreation.numberWithInteger_(5), 'key'.toNSString());
4040
expect(() => stringNSDictionaryToMap(d), throwsUnsupportedError);
4141
});
4242

4343
test('non-string key', () {
4444
final d = objc.NSMutableDictionary.new1()
4545
..setObject_forKey_(
46-
'value'.toNSString(), objc.NSNumber.numberWithInteger_(5));
46+
'value'.toNSString(), objc.NSNumberCreation.numberWithInteger_(5));
4747
expect(() => stringNSDictionaryToMap(d), throwsUnsupportedError);
4848
});
4949
});

pkgs/cupertino_http/example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dev_dependencies:
3131
http_profile: ^0.1.0
3232
integration_test:
3333
sdk: flutter
34-
objective_c: ^3.0.0
34+
objective_c: ^4.0.0
3535
test: ^1.21.1
3636
web_socket_conformance_tests:
3737
path: ../../web_socket_conformance_tests/

pkgs/cupertino_http/ffigen.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ preamble: |
3131
// ignore_for_file: return_of_invalid_type
3232
objc-interfaces:
3333
include:
34+
- 'NSCondition'
3435
- 'NSHTTPURLResponse'
3536
- 'NSMutableURLRequest'
3637
- 'NSOperationQueue'
@@ -43,6 +44,11 @@ objc-interfaces:
4344
- 'NSURLSessionTask'
4445
- 'NSURLSessionWebSocketMessage'
4546
- 'NSURLSessionWebSocketTask'
47+
objc-protocols:
48+
include:
49+
- 'NSURLSessionDataDelegate'
50+
- 'NSURLSessionDownloadDelegate'
51+
- 'NSURLSessionWebSocketDelegate'
4652
comments:
4753
style: any
4854
length: full

pkgs/cupertino_http/lib/src/cupertino_api.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ class URLSession extends _ObjectHolder<ncb.NSURLSession> {
939939
.registerName('URLSession:downloadTask:didFinishDownloadingToURL:');
940940
final signature = objc.getProtocolMethodSignature(
941941
downloadDelegate, didFinishDownloadingToURL,
942-
isRequired: true, isInstanceMethod: true);
942+
isRequired: true, isInstanceMethod: true)!;
943943
protoBuilder.implementMethod(didFinishDownloadingToURL, signature,
944944
linkedLibs.adaptFinishWithLock(asyncFinishDownloading));
945945
}

0 commit comments

Comments
 (0)