Regroup targets

Prefix "internal" modules with underscore.
This commit is contained in:
Davide De Rosa 2021-10-29 23:21:52 +02:00
parent 0978b973eb
commit 92fd620771
77 changed files with 66 additions and 70 deletions

View File

@ -11,20 +11,16 @@ let package = Package(
products: [ products: [
// Products define the executables and libraries a package produces, and make them visible to other packages. // Products define the executables and libraries a package produces, and make them visible to other packages.
.library( .library(
name: "TunnelKitCore", name: "TunnelKit",
targets: ["TunnelKitCore"] targets: [
"TunnelKitCore",
"TunnelKitAppExtension",
"TunnelKitManager"
]
), ),
.library( .library(
name: "TunnelKitAppExtension", name: "TunnelKitIKE",
targets: ["TunnelKitAppExtension"] targets: ["TunnelKitIKE"]
),
.library(
name: "TunnelKitManager",
targets: ["TunnelKitManager"]
),
.library(
name: "TunnelKitNative",
targets: ["TunnelKitNative"]
), ),
.library( .library(
name: "TunnelKitOpenVPN", name: "TunnelKitOpenVPN",
@ -47,11 +43,11 @@ let package = Package(
.target( .target(
name: "TunnelKitCore", name: "TunnelKitCore",
dependencies: [ dependencies: [
"InternalUtils", "_TunnelKitUtils",
"TunnelKitCoreObjC", "_TunnelKitCoreObjC",
"SwiftyBeaver"]), "SwiftyBeaver"]),
.target( .target(
name: "TunnelKitCoreObjC", name: "_TunnelKitCoreObjC",
dependencies: []), dependencies: []),
.target( .target(
name: "TunnelKitAppExtension", name: "TunnelKitAppExtension",
@ -63,7 +59,7 @@ let package = Package(
dependencies: [ dependencies: [
"TunnelKitCore"]), "TunnelKitCore"]),
.target( .target(
name: "TunnelKitNative", name: "TunnelKitIKE",
dependencies: [ dependencies: [
"TunnelKitCore", "TunnelKitCore",
"TunnelKitManager"]), "TunnelKitManager"]),
@ -71,13 +67,13 @@ let package = Package(
name: "TunnelKitOpenVPN", name: "TunnelKitOpenVPN",
dependencies: [ dependencies: [
"TunnelKitCore", "TunnelKitCore",
"TunnelKitOpenVPNObjC", "_TunnelKitOpenVPNObjC",
"TunnelKitAppExtension", "TunnelKitAppExtension",
"TunnelKitManager"]), "TunnelKitManager"]),
.target( .target(
name: "TunnelKitOpenVPNObjC", name: "_TunnelKitOpenVPNObjC",
dependencies: [ dependencies: [
"TunnelKitCoreObjC", "_TunnelKitCoreObjC",
"openssl-apple"]), "openssl-apple"]),
.target( .target(
name: "TunnelKitLZO", name: "TunnelKitLZO",
@ -88,20 +84,20 @@ let package = Package(
"lib/README.LZO" "lib/README.LZO"
]), ]),
.target( .target(
name: "InternalUtils", name: "_TunnelKitUtils",
dependencies: []), dependencies: []),
.testTarget( .testTarget(
name: "TunnelKitCoreTests", name: "TunnelKitCoreTests",
dependencies: [ dependencies: [
"TunnelKitCore", "TunnelKitCore",
"TunnelKitCoreObjC" "_TunnelKitCoreObjC"
]), ]),
.testTarget( .testTarget(
name: "TunnelKitOpenVPNTests", name: "TunnelKitOpenVPNTests",
dependencies: [ dependencies: [
"TunnelKitCoreTests", "TunnelKitCoreTests",
"TunnelKitOpenVPN", "TunnelKitOpenVPN",
"TunnelKitOpenVPNObjC", "_TunnelKitOpenVPNObjC",
"TunnelKitLZO" "TunnelKitLZO"
], ],
resources: [ resources: [

View File

@ -24,7 +24,7 @@
// //
import Foundation import Foundation
import TunnelKitCoreObjC import _TunnelKitCoreObjC
extension Error { extension Error {
public func isTunnelKitError() -> Bool { public func isTunnelKitError() -> Bool {

View File

@ -36,8 +36,8 @@
import Foundation import Foundation
import Security.SecRandom import Security.SecRandom
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import InternalUtils import _TunnelKitUtils
/// :nodoc: /// :nodoc:
public enum SecureRandomError: Error { public enum SecureRandomError: Error {

View File

@ -35,7 +35,7 @@
// //
import Foundation import Foundation
import TunnelKitCoreObjC import _TunnelKitCoreObjC
public func Z() -> ZeroingData { public func Z() -> ZeroingData {
return ZeroingData() return ZeroingData()

View File

@ -1 +1 @@
../../TunnelKitCoreObjC/include/Errors.h ../../_TunnelKitCoreObjC/include/Errors.h

View File

@ -27,7 +27,7 @@ import Foundation
import NetworkExtension import NetworkExtension
import TunnelKitCore import TunnelKitCore
import TunnelKitAppExtension import TunnelKitAppExtension
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
class NETCPLink: LinkInterface { class NETCPLink: LinkInterface {
private let impl: NWTCPConnection private let impl: NWTCPConnection

View File

@ -38,9 +38,9 @@ import Foundation
import NetworkExtension import NetworkExtension
import SwiftyBeaver import SwiftyBeaver
import TunnelKitCore import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitAppExtension import TunnelKitAppExtension
import InternalUtils import _TunnelKitUtils
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -42,7 +42,7 @@ import SystemConfiguration.CaptiveNetwork
import CoreWLAN import CoreWLAN
#endif #endif
import TunnelKitCore import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitAppExtension import TunnelKitAppExtension
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -37,8 +37,8 @@
import Foundation import Foundation
import SwiftyBeaver import SwiftyBeaver
import TunnelKitCore import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -24,7 +24,7 @@
// //
import Foundation import Foundation
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
extension OpenVPN { extension OpenVPN {

View File

@ -24,7 +24,7 @@
// //
import Foundation import Foundation
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
extension OpenVPN { extension OpenVPN {

View File

@ -26,8 +26,8 @@
import Foundation import Foundation
import SwiftyBeaver import SwiftyBeaver
import TunnelKitCore import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import InternalUtils import _TunnelKitUtils
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -26,8 +26,8 @@
import Foundation import Foundation
import SwiftyBeaver import SwiftyBeaver
import TunnelKitCore import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -26,8 +26,8 @@
import Foundation import Foundation
import SwiftyBeaver import SwiftyBeaver
import TunnelKitCore import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -36,8 +36,8 @@
import Foundation import Foundation
import TunnelKitCore import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
extension CoreConfiguration { extension CoreConfiguration {
struct OpenVPN { struct OpenVPN {

View File

@ -35,7 +35,7 @@
// //
import Foundation import Foundation
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
extension OpenVPN { extension OpenVPN {

View File

@ -36,8 +36,8 @@
import Foundation import Foundation
import TunnelKitCore import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
extension OpenVPN { extension OpenVPN {
class EncryptionBridge { class EncryptionBridge {

View File

@ -25,8 +25,8 @@
import Foundation import Foundation
import TunnelKitCore import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
/// Container for OpenVPN classes. /// Container for OpenVPN classes.
public class OpenVPN { public class OpenVPN {

View File

@ -37,8 +37,8 @@
import Foundation import Foundation
import SwiftyBeaver import SwiftyBeaver
import TunnelKitCore import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -36,8 +36,8 @@
import Foundation import Foundation
import TunnelKitCore import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
/// :nodoc: /// :nodoc:
extension ControlPacket { extension ControlPacket {

View File

@ -37,8 +37,8 @@
import Foundation import Foundation
import SwiftyBeaver import SwiftyBeaver
import TunnelKitCore import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -25,7 +25,7 @@
import Foundation import Foundation
import TunnelKitCore import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
extension OpenVPN { extension OpenVPN {

View File

@ -24,7 +24,7 @@
// //
import XCTest import XCTest
import TunnelKitCoreObjC import _TunnelKitCoreObjC
class RoutingTests: XCTestCase { class RoutingTests: XCTestCase {

View File

@ -25,7 +25,7 @@
import XCTest import XCTest
@testable import TunnelKitCore @testable import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitLZO import TunnelKitLZO
class CompressionTests: XCTestCase { class CompressionTests: XCTestCase {

View File

@ -25,9 +25,9 @@
import XCTest import XCTest
@testable import TunnelKitCore @testable import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
@testable import TunnelKitOpenVPN @testable import TunnelKitOpenVPN
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
class ControlChannelTests: XCTestCase { class ControlChannelTests: XCTestCase {
private let hex = "634a4d2d459d606c8e6abbec168fdcd1871462eaa2eaed84c8f403bdf8c7da737d81b5774cc35fe0a42b38aa053f1335fd4a22d721880433bbb20ae1f2d88315b2d186b3b377685506fa39d85d38da16c2ecc0d631bda64f9d8f5a8d073f18aab97ade23e49ea9e7de86784d1ed5fa356df5f7fa1d163e5537efa8d4ba61239dc301a9aa55de0e06e33a7545f7d0cc153405576464ba92942dafa5fb79c7a60663ff1e7da3122ae09d4561653bef3eeb312ad68b191e2f94cbcf4e21caff0b59f8be86567bd21787070c2dc10a8baf7e87ce2e07d7d7de25ead11bd6d6e6ec030c0a3fd50d2d0ca3c0378022bb642e954868d7b93e18a131ecbb12b0bbedb1ce" private let hex = "634a4d2d459d606c8e6abbec168fdcd1871462eaa2eaed84c8f403bdf8c7da737d81b5774cc35fe0a42b38aa053f1335fd4a22d721880433bbb20ae1f2d88315b2d186b3b377685506fa39d85d38da16c2ecc0d631bda64f9d8f5a8d073f18aab97ade23e49ea9e7de86784d1ed5fa356df5f7fa1d163e5537efa8d4ba61239dc301a9aa55de0e06e33a7545f7d0cc153405576464ba92942dafa5fb79c7a60663ff1e7da3122ae09d4561653bef3eeb312ad68b191e2f94cbcf4e21caff0b59f8be86567bd21787070c2dc10a8baf7e87ce2e07d7d7de25ead11bd6d6e6ec030c0a3fd50d2d0ca3c0378022bb642e954868d7b93e18a131ecbb12b0bbedb1ce"

View File

@ -36,8 +36,8 @@
import XCTest import XCTest
@testable import TunnelKitCore @testable import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
class DataPathEncryptionTests: XCTestCase { class DataPathEncryptionTests: XCTestCase {
private let cipherKey = try! SecureRandom.safeData(length: 32) private let cipherKey = try! SecureRandom.safeData(length: 32)

View File

@ -37,7 +37,7 @@
import XCTest import XCTest
@testable import TunnelKitCore @testable import TunnelKitCore
@testable import TunnelKitOpenVPN @testable import TunnelKitOpenVPN
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
import TunnelKitCoreTests import TunnelKitCoreTests
class DataPathPerformanceTests: XCTestCase { class DataPathPerformanceTests: XCTestCase {

View File

@ -36,8 +36,8 @@
import XCTest import XCTest
@testable import TunnelKitCore @testable import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
import TunnelKitCoreTests import TunnelKitCoreTests
class EncryptionPerformanceTests: XCTestCase { class EncryptionPerformanceTests: XCTestCase {

View File

@ -36,9 +36,9 @@
import XCTest import XCTest
@testable import TunnelKitCore @testable import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitOpenVPN import TunnelKitOpenVPN
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
class EncryptionTests: XCTestCase { class EncryptionTests: XCTestCase {
private var cipherEncKey: ZeroingData! private var cipherEncKey: ZeroingData!

View File

@ -36,7 +36,7 @@
import XCTest import XCTest
@testable import TunnelKitCore @testable import TunnelKitCore
@testable import TunnelKitCoreObjC @testable import _TunnelKitCoreObjC
import TunnelKitCoreTests import TunnelKitCoreTests
class LinkTests: XCTestCase { class LinkTests: XCTestCase {

View File

@ -25,7 +25,7 @@
import XCTest import XCTest
@testable import TunnelKitCore @testable import TunnelKitCore
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
class PacketTests: XCTestCase { class PacketTests: XCTestCase {

View File

@ -36,8 +36,8 @@
import Foundation import Foundation
@testable import TunnelKitCore @testable import TunnelKitCore
import TunnelKitCoreObjC import _TunnelKitCoreObjC
import TunnelKitOpenVPNObjC import _TunnelKitOpenVPNObjC
extension Encrypter { extension Encrypter {
func encryptData(_ data: Data, flags: UnsafePointer<CryptoFlags>?) throws -> Data { func encryptData(_ data: Data, flags: UnsafePointer<CryptoFlags>?) throws -> Data {