2021-11-06 10:37:26 +00:00
|
|
|
// swift-tools-version:5.3
|
2021-10-25 14:27:27 +00:00
|
|
|
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
|
|
|
|
|
|
|
import PackageDescription
|
|
|
|
|
|
|
|
let package = Package(
|
|
|
|
name: "TunnelKit",
|
|
|
|
platforms: [
|
2021-12-01 12:54:00 +00:00
|
|
|
.iOS(.v12), .macOS(.v10_15)
|
2021-10-25 14:27:27 +00:00
|
|
|
],
|
|
|
|
products: [
|
|
|
|
// Products define the executables and libraries a package produces, and make them visible to other packages.
|
|
|
|
.library(
|
2021-10-29 21:21:52 +00:00
|
|
|
name: "TunnelKit",
|
2021-11-07 20:54:05 +00:00
|
|
|
targets: ["TunnelKit"]
|
2021-10-25 14:27:27 +00:00
|
|
|
),
|
|
|
|
.library(
|
2021-10-29 21:21:52 +00:00
|
|
|
name: "TunnelKitIKE",
|
|
|
|
targets: ["TunnelKitIKE"]
|
2021-10-25 14:27:27 +00:00
|
|
|
),
|
|
|
|
.library(
|
|
|
|
name: "TunnelKitOpenVPN",
|
|
|
|
targets: ["TunnelKitOpenVPN"]
|
|
|
|
),
|
2021-11-07 20:54:05 +00:00
|
|
|
.library(
|
|
|
|
name: "TunnelKitOpenVPNAppExtension",
|
|
|
|
targets: ["TunnelKitOpenVPNAppExtension"]
|
|
|
|
),
|
2021-12-01 12:54:00 +00:00
|
|
|
.library(
|
|
|
|
name: "TunnelKitWireGuard",
|
|
|
|
targets: ["TunnelKitWireGuard"]
|
|
|
|
),
|
|
|
|
.library(
|
|
|
|
name: "TunnelKitWireGuardAppExtension",
|
|
|
|
targets: ["TunnelKitWireGuardAppExtension"]
|
|
|
|
),
|
2021-10-25 14:27:27 +00:00
|
|
|
.library(
|
|
|
|
name: "TunnelKitLZO",
|
|
|
|
targets: ["TunnelKitLZO"]
|
|
|
|
)
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
// Dependencies declare other packages that this package depends on.
|
|
|
|
// .package(url: /* package url */, from: "1.0.0"),
|
|
|
|
.package(url: "https://github.com/SwiftyBeaver/SwiftyBeaver", from: "1.9.0"),
|
2021-12-01 12:54:00 +00:00
|
|
|
.package(url: "https://github.com/passepartoutvpn/openssl-apple", from: "1.1.11200"),
|
|
|
|
.package(name: "WireGuardKit", url: "https://git.zx2c4.com/wireguard-apple", .exact("1.0.15-26"))
|
2021-10-25 14:27:27 +00:00
|
|
|
],
|
|
|
|
targets: [
|
|
|
|
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
|
|
|
|
// Targets can depend on other targets in this package, and on products in packages this package depends on.
|
2021-11-07 20:54:05 +00:00
|
|
|
.target(
|
|
|
|
name: "TunnelKit",
|
|
|
|
dependencies: [
|
|
|
|
"TunnelKitCore",
|
|
|
|
"TunnelKitManager"
|
|
|
|
]
|
|
|
|
),
|
2021-10-25 14:27:27 +00:00
|
|
|
.target(
|
|
|
|
name: "TunnelKitCore",
|
|
|
|
dependencies: [
|
2021-11-07 20:54:05 +00:00
|
|
|
"__TunnelKitUtils",
|
|
|
|
"CTunnelKitCore",
|
|
|
|
"SwiftyBeaver"
|
|
|
|
]),
|
2021-10-25 14:27:27 +00:00
|
|
|
.target(
|
2021-11-07 20:54:05 +00:00
|
|
|
name: "TunnelKitManager",
|
|
|
|
dependencies: [
|
2021-11-23 11:20:47 +00:00
|
|
|
"SwiftyBeaver"
|
2021-11-07 20:54:05 +00:00
|
|
|
]),
|
2021-10-25 14:27:27 +00:00
|
|
|
.target(
|
|
|
|
name: "TunnelKitAppExtension",
|
|
|
|
dependencies: [
|
2021-11-23 11:20:47 +00:00
|
|
|
"TunnelKitCore"
|
2021-11-07 20:54:05 +00:00
|
|
|
]),
|
2021-10-25 14:27:27 +00:00
|
|
|
.target(
|
2021-10-29 21:21:52 +00:00
|
|
|
name: "TunnelKitIKE",
|
2021-10-25 14:27:27 +00:00
|
|
|
dependencies: [
|
2021-11-07 20:54:05 +00:00
|
|
|
"TunnelKitManager"
|
|
|
|
]),
|
2021-10-25 14:27:27 +00:00
|
|
|
.target(
|
|
|
|
name: "TunnelKitOpenVPN",
|
2021-11-07 20:54:05 +00:00
|
|
|
dependencies: [
|
|
|
|
"TunnelKitOpenVPNCore",
|
|
|
|
"TunnelKitOpenVPNManager"
|
|
|
|
]),
|
|
|
|
//
|
|
|
|
.target(
|
|
|
|
name: "TunnelKitOpenVPNCore",
|
2021-10-25 14:27:27 +00:00
|
|
|
dependencies: [
|
|
|
|
"TunnelKitCore",
|
2021-11-07 20:54:05 +00:00
|
|
|
"CTunnelKitOpenVPNCore",
|
|
|
|
"CTunnelKitOpenVPNProtocol" // FIXME: remove dependency on TLSBox
|
|
|
|
]),
|
|
|
|
.target(
|
|
|
|
name: "TunnelKitOpenVPNManager",
|
|
|
|
dependencies: [
|
|
|
|
"TunnelKitManager",
|
|
|
|
"TunnelKitOpenVPNCore"
|
|
|
|
]),
|
|
|
|
.target(
|
|
|
|
name: "TunnelKitOpenVPNProtocol",
|
|
|
|
dependencies: [
|
|
|
|
"TunnelKitOpenVPNCore",
|
|
|
|
"CTunnelKitOpenVPNProtocol"
|
|
|
|
]),
|
2021-10-25 14:27:27 +00:00
|
|
|
.target(
|
2021-11-07 20:54:05 +00:00
|
|
|
name: "TunnelKitOpenVPNAppExtension",
|
2021-10-25 14:27:27 +00:00
|
|
|
dependencies: [
|
2021-11-07 20:54:05 +00:00
|
|
|
"TunnelKitAppExtension",
|
|
|
|
"TunnelKitOpenVPNCore",
|
|
|
|
"TunnelKitOpenVPNManager",
|
|
|
|
"TunnelKitOpenVPNProtocol"
|
|
|
|
]),
|
2021-12-01 12:54:00 +00:00
|
|
|
//
|
|
|
|
.target(
|
|
|
|
name: "TunnelKitWireGuard",
|
|
|
|
dependencies: [
|
|
|
|
"TunnelKitWireGuardCore",
|
|
|
|
"TunnelKitWireGuardManager"
|
|
|
|
]),
|
|
|
|
.target(
|
|
|
|
name: "TunnelKitWireGuardCore",
|
|
|
|
dependencies: [
|
|
|
|
"WireGuardKit"
|
|
|
|
]),
|
|
|
|
.target(
|
|
|
|
name: "TunnelKitWireGuardManager",
|
|
|
|
dependencies: [
|
|
|
|
"TunnelKitManager",
|
|
|
|
"TunnelKitWireGuardCore"
|
|
|
|
]),
|
|
|
|
.target(
|
|
|
|
name: "TunnelKitWireGuardAppExtension",
|
|
|
|
dependencies: [
|
|
|
|
"TunnelKitWireGuardCore",
|
|
|
|
"TunnelKitWireGuardManager"
|
|
|
|
]),
|
2021-10-25 14:27:27 +00:00
|
|
|
.target(
|
|
|
|
name: "TunnelKitLZO",
|
|
|
|
dependencies: [],
|
|
|
|
exclude: [
|
|
|
|
"lib/COPYING",
|
|
|
|
"lib/Makefile",
|
2021-11-04 16:31:19 +00:00
|
|
|
"lib/README.LZO",
|
|
|
|
"lib/testmini.c"
|
2021-10-25 14:27:27 +00:00
|
|
|
]),
|
2021-11-07 20:54:05 +00:00
|
|
|
//
|
|
|
|
.target(
|
|
|
|
name: "CTunnelKitCore",
|
|
|
|
dependencies: []),
|
|
|
|
.target(
|
|
|
|
name: "CTunnelKitOpenVPNCore",
|
|
|
|
dependencies: []),
|
|
|
|
.target(
|
|
|
|
name: "CTunnelKitOpenVPNProtocol",
|
|
|
|
dependencies: [
|
|
|
|
"CTunnelKitCore",
|
|
|
|
"CTunnelKitOpenVPNCore",
|
2021-11-24 15:40:19 +00:00
|
|
|
"openssl-apple"
|
2021-11-07 20:54:05 +00:00
|
|
|
]),
|
2021-10-25 14:27:27 +00:00
|
|
|
.target(
|
2021-11-07 20:54:05 +00:00
|
|
|
name: "__TunnelKitUtils",
|
2021-10-25 14:27:27 +00:00
|
|
|
dependencies: []),
|
2021-11-07 20:54:05 +00:00
|
|
|
//
|
2021-10-25 14:27:27 +00:00
|
|
|
.testTarget(
|
|
|
|
name: "TunnelKitCoreTests",
|
|
|
|
dependencies: [
|
2021-11-02 21:52:47 +00:00
|
|
|
"TunnelKitCore"
|
2021-10-25 14:27:27 +00:00
|
|
|
]),
|
|
|
|
.testTarget(
|
|
|
|
name: "TunnelKitOpenVPNTests",
|
|
|
|
dependencies: [
|
2021-11-07 20:54:05 +00:00
|
|
|
"TunnelKitOpenVPNCore",
|
|
|
|
"TunnelKitOpenVPNAppExtension",
|
2021-10-25 14:27:27 +00:00
|
|
|
"TunnelKitLZO"
|
|
|
|
],
|
|
|
|
resources: [
|
|
|
|
.process("Resources")
|
|
|
|
]),
|
|
|
|
.testTarget(
|
|
|
|
name: "TunnelKitLZOTests",
|
|
|
|
dependencies: [
|
2021-11-02 21:52:47 +00:00
|
|
|
"TunnelKitCore",
|
2021-10-25 14:27:27 +00:00
|
|
|
"TunnelKitLZO"
|
|
|
|
]),
|
|
|
|
]
|
|
|
|
)
|