Modularization: Extract Tor into a separate module (#602)

* Extract Tor into a separate module

* Add Tor package as a dependency for iOS & macOS targets

* Move `tor-nolzma.xcframework` inside Tor

* Remove `libz` from Frameworks as its linked in Tor

* Remove stray `.gitkeep` from macOS target membership

* Fix missing import and access control for modularized Tor

- Add import Tor to NetworkActivationService
- Make TorManager.shutdownCompletely() public for external access

* Fix tor-nolzma.xcframework structure for Xcode builds

- Add missing Info.plist files to all framework slices
- Restructure macOS framework to use deep bundle format (Versions/)
- Keep iOS frameworks as shallow bundles (standard for iOS)

This fixes the Xcode build errors while maintaining SPM compatibility.

* Remove stale xcframework references from Xcode project

Xcode cleaned up old direct references to tor-nolzma.xcframework
since it's now managed internally by the Tor Swift package.

---------

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
Islam
2025-10-02 11:53:34 +02:00
committed by GitHub
co-authored by jack
parent 787386c66d
commit 3a35b3acc2
2271 changed files with 166 additions and 55 deletions
+3 -15
View File
@@ -16,6 +16,7 @@ let package = Package(
),
],
dependencies:[
.package(path: "localPackages/Tor"),
.package(path: "localPackages/BitLogger"),
.package(url: "https://github.com/21-DOT-DEV/swift-secp256k1", exact: "0.21.1")
],
@@ -25,8 +26,7 @@ let package = Package(
dependencies: [
.product(name: "P256K", package: "swift-secp256k1"),
.product(name: "BitLogger", package: "BitLogger"),
.target(name: "TorC"),
.target(name: "tor-nolzma")
.product(name: "Tor", package: "Tor")
],
path: "bitchat",
exclude: [
@@ -34,24 +34,12 @@ let package = Package(
"Assets.xcassets",
"bitchat.entitlements",
"bitchat-macOS.entitlements",
"LaunchScreen.storyboard",
"Services/Tor/C/"
"LaunchScreen.storyboard"
],
resources: [
.process("Localizable.xcstrings")
],
linkerSettings: [
.linkedLibrary("z")
]
),
.target(
name: "TorC",
path: "bitchat/Services/Tor/C"
),
.binaryTarget(
name: "tor-nolzma",
path: "Frameworks/tor-nolzma.xcframework"
),
.testTarget(
name: "bitchatTests",
dependencies: ["bitchat"],