Skip to content

Commit

Permalink
Replace Objective-C implemented delegates with Dart implementations (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
brianquinlan authored Oct 23, 2024
1 parent 5e2281e commit d921e48
Show file tree
Hide file tree
Showing 70 changed files with 62,039 additions and 83,234 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/cronet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ jobs:
verify:
name: Format & Analyze & Test
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
cronetHttpNoPlay: ['false', 'true']
defaults:
run:
working-directory: pkgs/cronet_http
steps:
- name: Delete unnecessary tools 🔧
uses: jlumbroso/free-disk-space@v1.3.1
with:
android: false # Don't remove Android tools
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/cupertino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ jobs:
run:
working-directory: pkgs/cupertino_http
strategy:
fail-fast: false
matrix:
# Test on the minimum supported flutter version and the latest
# version.
flutter-version: ["3.22.0", "any"]
flutter-version: ["3.24.0", "any"]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
Expand All @@ -50,9 +51,9 @@ jobs:
- uses: futureware-tech/simulator-action@bfa03d93ec9de6dacb0c5553bbf8da8afc6c2ee9
with:
os: iOS
os_version: '>=12.0'
os_version: '>=13.0'
- name: Run tests
run: |
cd example
flutter pub get
flutter test integration_test/main.dart
flutter test integration_test/main.dart --test-randomize-ordering-seed=random
252 changes: 75 additions & 177 deletions .github/workflows/dart.yml

Large diffs are not rendered by default.

115 changes: 113 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,119 @@
# Adapted from https://github.com/flutter/flutter/blob/master/.gitignore

# Miscellaneous
*.class
*.lock
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# Visual Studio Code related
.vscode/
.classpath
.project
.settings/
.vscode/*

# Don’t commit the following directories created by pub.
.dart_tool
# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
**/generated_plugin_registrant.dart
.packages
.pub-preload-cache/
.pub-cache/
.pub/
build/
flutter_*.png
linked_*.ds
unlinked.ds
unlinked_spec.ds
pubspec.lock
pubspec_overrides.yaml

# Android related
**/android/**/gradle-wrapper.jar
.gradle/
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
**/android/key.properties
*.jks

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/.last_build_id
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/ephemeral
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

# macOS
**/Flutter/ephemeral/
**/Pods/
**/macos/Flutter/GeneratedPluginRegistrant.swift
**/macos/Flutter/ephemeral
**/xcuserdata/

# Windows
**/windows/flutter/ephemeral/
**/windows/flutter/generated_plugin_registrant.cc
**/windows/flutter/generated_plugin_registrant.h
**/windows/flutter/generated_plugins.cmake

# Linux
**/linux/flutter/ephemeral/
**/linux/flutter/generated_plugin_registrant.cc
**/linux/flutter/generated_plugin_registrant.h
**/linux/flutter/generated_plugins.cmake

# Coverage
coverage/

# Symbols
app.*.symbols

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
!/dev/ci/**/Gemfile.lock
!.vscode/settings.json
4 changes: 1 addition & 3 deletions pkgs/cupertino_http/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# ffigen generated code
lib/src/native_cupertino_bindings.dart linguist-generated

# vendored Dart API code
src/dart-sdk/** linguist-vendored
darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m linguist-generated
21 changes: 20 additions & 1 deletion pkgs/cupertino_http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
## 1.5.2-wip
## 2.0.0-wip

* The behavior of `CupertinoClient` and `CupertinoWebSocket` has not changed.
* **Breaking:** `MutableURLRequest.httpBodyStream` now takes a `NSInputStream`
instead of a `Stream<List<int>>`.
* **Breaking:** The following enums/classes previous defined by
`package:cupertino_http` are now imported from `package:objective_c`:
* `NSData`
* `NSError`
* `NSHTTPCookieAcceptPolicy`
* `NSMutableData`
* `NSURLRequestCachePolicy`
* `NSURLRequestNetworkServiceType`
* `NSURLSessionMultipathServiceType`
* `NSURLSessionResponseDisposition`
* `NSURLSessionTaskState`
* `NSURLSessionWebSocketCloseCode`
* `NSURLSessionWebSocketMessageType`
* **Breaking:** `URLSession.dataTaskWithCompletionHandler` is no longer
supported for background sessions.

## 1.5.1

Expand Down
1 change: 0 additions & 1 deletion pkgs/cupertino_http/darwin/Classes/CUPHTTPClientDelegate.m

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion pkgs/cupertino_http/darwin/Classes/dart_api_dl.c

This file was deleted.

13 changes: 4 additions & 9 deletions pkgs/cupertino_http/darwin/cupertino_http.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ Pod::Spec.new do |s|
s.homepage = 'https://github.com/dart-lang/http/tree/master/pkgs/cupertino_http'
s.license = { :type => 'BSD', :file => '../LICENSE' }
s.author = { 'TODO' => 'use-valid-author' }
s.source = { :http => 'https://github.com/dart-lang/http/tree/master/pkgs/cupertino_http' }

# This will ensure the source files in Classes/ are included in the native
# builds of apps using this FFI plugin. Podspec does not support relative
# paths, so Classes contains a forwarder C file that relatively imports
# `../src/*` so that the C sources can be shared among all target platforms.
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.source_files = 'cupertino_http/Sources/cupertino_http/**/*'
s.ios.dependency 'Flutter'
s.osx.dependency 'FlutterMacOS'
s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.14'
s.requires_arc = []
s.ios.deployment_target = '13.0' # Required for NSURLSessionWebSocketDelegate.
s.osx.deployment_target = '10.15' # Required for NSURLSessionWebSocketDelegate.

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.0'
Expand Down
Loading

0 comments on commit d921e48

Please sign in to comment.