Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cordova/apple/ios): add mac catalyst support #1630

Merged
merged 77 commits into from
Aug 17, 2023
Merged

Conversation

sbruens
Copy link
Contributor

@sbruens sbruens commented May 9, 2023

No description provided.

@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Patch coverage has no change and project coverage change: +21% 🎉

Comparison is base (9875803) 15% compared to head (aa5bbcb) 36%.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1630     +/-   ##
========================================
+ Coverage      15%     36%    +21%     
========================================
  Files           6      45     +39     
  Lines         806    2749   +1943     
  Branches        0     312    +312     
========================================
+ Hits          121    1006    +885     
- Misses        685    1743   +1058     
Flag Coverage Δ
apple 15% <0%> (ø)
ios 15% <0%> (ø)
macos 15% <0%> (ø)
unittests 36% <0%> (+21%) ⬆️
www 45% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...ources/PacketTunnelProvider/PacketTunnelProvider.m 0% <0%> (ø)

... and 39 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added size/XXL and removed size/XL labels Jul 18, 2023
…ease.

Previously set it on the `Debug` build, but need to also set it on `Release` build.
…idge loads.

We'll need to re-use this bridge in the upcoming launcher, which should not add its own menu item to the status bar.
We set the launcher as a login item in Catalyst, and open the app if there Outline was connected at shutdown.
@sbruens sbruens requested a review from fortuna August 9, 2023 19:58
@sbruens sbruens requested a review from fortuna August 9, 2023 21:17
@daniellacosse daniellacosse linked an issue Aug 14, 2023 that may be closed by this pull request
@sbruens sbruens requested a review from fortuna August 15, 2023 01:46
Copy link
Collaborator

@fortuna fortuna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

@sbruens sbruens merged commit 6c3c63a into master Aug 17, 2023
15 of 16 checks passed
@sbruens sbruens deleted the sbruens/catalyst branch August 17, 2023 15:35
sbruens added a commit that referenced this pull request Aug 17, 2023
* Replace the `copy-www-build-step` script with build phases.

* Add Mac Catalyst as a destination.

* Update README to load xcworkspace from `./src/cordova/apple/` instead of `./platforms/ios/`.

* Set separate bundle identifier for the Mac app built with Mac Catalyst.

* Add `Package.resolved` back. It was likely accidentally removed in #1536.

* Update local storage source directory for UIWebView->WKWebView migration for catalyst.

* Pin `cordova-ios` dep to fix for splashscreen aspect ratio.

* Rename `Images.xcassets` to `Assets.xcassets`.

* Add the status bar button images.

* Use `LSUIElement` to indicate this is a background app and shouldn't appear in the Dock.

* Add an AppKit bridge and use it to create a status bar menu in catalyst.

* Re-open the application window when use selects "Open" command from the status menu.

* Stop any VPN connections on app termination.

* Use `clang-format` to format Objective-C files.

* Use `SwiftFormat` to format Swift files.

* Set separate bundle identifier for the Mac Catalyst app built for release.

Previously set it on the `Debug` build, but need to also set it on `Release` build.

* Configure the app window to be a specific size.

* Enable the embedded app launcher as a login item.

* Use the macos app group in `PacketTunnelProvider` when on Catalyst.

* Add some logs to the `OutlineStatusItemController` for easier debugging.

* Do not try and add a `StatusItemController` automatically on AppKitBridge loads.

We'll need to re-use this bridge in the upcoming launcher, which should not add its own menu item to the status bar.

* Ignore locally loaded XCFramework bundles.

* Add launcher to Catalyst.

We set the launcher as a login item in Catalyst, and open the app if there Outline was connected at shutdown.

* Run `clang-format` over `.m` files.

* Ensure Sentry logs the right app group on Catalyst.

* Run macos code on Catalyst in a few more places.

* Do not run some code for `macOS` on `Catalyst`.

* Add prefix to log message for consistency.

* Use the `NETunnelProviderManager` to determine whether Outline was connected and the launcher should launch the application.

* Automatic project data changes made by Xcode.

* Set miminum macos deployment target to 10.15.

* Set bundle ID for launcher to `launcher3`.

* Move `AppDelegate` logic to category extension instead of overwriting the `AppDelegate` file auto-generated by Cordova.

* Move Catalyst specific `AppDelegate` code to Swift.

* Use `SwiftFormat` to format Swift files.

* Replace `NSLog` with `DDLog`.

* Use `SwiftFormat` to format Swift files.

* Fix notifications for macos bundle and undo formatting to make the diff smaller.

* Remove local `Tun2socks.xcframework` which got accidentally committed.

* Undo README changes as they have already been updated in a previous PR.

* Move catalyst code into `OutlineAppleLib`.

* Remove reference to `OutlineLauncher`'s plist.

* Fix some bad merges.

* Remove an unnecessary `#if` guard.

* Add a TODO to i18n the menu strings, which will happen in a fast-follow.

* Review changes.

* More changes for review.

* Mark static function as public.

* More changes.

* Use enum instead of boolean to represent connection status.

* Clean up some entitlement changes that aren't actually needed.

* Undo some entitlement changes that were needed to create outgoing connections on macos.

* Remove a single unneeded entitlement.

* Only compile `OutlineCatalystApp` on Catalyst.

* Fix ios build.

* Add some method docs and change  methods to standalone functions where no state is needed.

* Remove unneeded `Sources` sections.

* Revert "Remove unneeded `Sources` sections."

This reverts commit 863ac93.

* Remove unneeded build phases.

* Remove seemingly unneeded info list items.

* Add the "compile sources" build phase back to the `AppKitBridge` bundle.

* Fix macos build.

* Move `OutlineCatalystApp` target into `OutlineAppleLib` product.

* Rely on `NSNotification` extension from `OutlineAppleLib`.

* Remove `Tun2socks` and `OutlineTunnel` dependency from launcher and add "compile sources" buildphase back in.

* Select "Optimize interface for Mac" at the project level for Mac Catalyst.

* Move much of the OutlinePlugin into a Swift package, leaving only Cordova-specific code in the plugin, renamed as `CDVOutline`.

* Move status menu assets into Swift package.

* No need to explicitly state resources for the Assets catalog as Xcode treats these as resources automatically.

* Update the macos client to use the renamed `CDVOutline` plugin.

* Revert `OutlinePlugin` changes and instead use a `NSNotification` target.

* `OutlineNotifications` to `OutlineNotification`.

* Add some TODOs.

* Remove unnecessary parameter.
@wangw469 wangw469 mentioned this pull request Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Outline logo and other UI elements look blurry
3 participants