-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
chore(cordova/apple): move tun2socks and other dependencies into local swift package #1536
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exciting!
@@ -5,17 +5,17 @@ | |||
"kind" : "remoteSourceControl", | |||
"location" : "https://github.com/CocoaLumberjack/CocoaLumberjack", | |||
"state" : { | |||
"revision" : "80ada1f753b0d53d9b57c465936a7c4169375002", | |||
"version" : "3.7.4" | |||
"revision" : "0188d31089b5881a269e01777be74c7316924346", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's revert this for now. No need to upgrade the dependencies. It's already an intrusive change.
5F7F90AE0E924FD7B065C415 /* CDVStatusBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 0394302BA6114B2AB648D4FF /* CDVStatusBar.m */; }; | ||
6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */; }; | ||
7213383E07114591931284F8 /* OutlineConnectivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 119806AF98394D7D8749BB30 /* OutlineConnectivity.swift */; }; | ||
F693A5582965FE3800079DBD /* OutlineTun2Socks in Frameworks */ = {isa = PBXBuildFile; productRef = F693A5572965FE3800079DBD /* OutlineTun2Socks */; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should happen to macos too.
It can be in another PR, but we should make sure it works, in case we need a different approach.
src/cordova/apple/xcode/ios/Outline.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you are getting a build error. Strangely enough, it's only on iOS, not macOS.
@@ -0,0 +1,9 @@ | |||
.DS_Store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed even without the project?
@@ -0,0 +1,22 @@ | |||
// swift-tools-version: 5.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I think you need to downgrade this to 5.6 to fix the build.
#include "VpnExtension-Swift.h" | ||
@import Tun2socks; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised this doesn't break macOS.
Should we update the macOS project in this PR as well? I'd expect the same project change. Might be easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good - should I delete the third party Tun2socks directory then as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it makes it clear we are not using it anymore. It seems you already did it!
#include "VpnExtension-Swift.h" | ||
@import Tun2socks; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it makes it clear we are not using it anymore. It seems you already did it!
* 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.
* 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.
This PR packages the Outline Tun2Socks binary into a Swift package target so that we can depend on the frameworks through SPM.