diff --git a/.gitignore b/.gitignore index b07e3754f..9f0850be5 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ DerivedData extern/ *.pyc +.build \ No newline at end of file diff --git a/Package.swift b/Package.swift new file mode 100644 index 000000000..75d755e1b --- /dev/null +++ b/Package.swift @@ -0,0 +1,41 @@ +// swift-tools-version:5.3 +import PackageDescription + +let package = Package( + name: "SocketRocket", + platforms: [ + .iOS(.v11), + .macOS(.v10_13), + .tvOS(.v11) + ], + products: [ + .library( + name: "SocketRocket", + targets: ["SocketRocket"]), + ], + targets: [ + .target( + name: "SocketRocket", + path: "SocketRocket", + exclude: ["Resources"], // Исключите ненужные файлы или директории + sources: [".", "Internal"], // Указание исходных файлов + publicHeadersPath: "include", // Все публичные заголовки должны быть перемещены в 'include' + cSettings: [ + .headerSearchPath("."), + .headerSearchPath("Internal"), + .headerSearchPath("Internal/Delegate"), + .headerSearchPath("Internal/IOConsumer"), + .headerSearchPath("Internal/Proxy"), + .headerSearchPath("Internal/RunLoop"), + .headerSearchPath("Internal/Security"), + .headerSearchPath("Internal/Utilities") + ], + linkerSettings: [ + .linkedFramework("CFNetwork", .when(platforms: [.iOS, .tvOS])), + .linkedFramework("Security"), + .linkedFramework("CoreServices", .when(platforms: [.macOS])), + .linkedLibrary("icucore") + ] + ) + ] +) diff --git a/SocketRocket/Internal/Delegate/SRDelegateController.h b/SocketRocket/Internal/Delegate/SRDelegateController.h index 43634a120..a1a3adb99 100644 --- a/SocketRocket/Internal/Delegate/SRDelegateController.h +++ b/SocketRocket/Internal/Delegate/SRDelegateController.h @@ -9,7 +9,8 @@ #import -#import +// #import +#import "SRWebSocket.h" NS_ASSUME_NONNULL_BEGIN diff --git a/SocketRocket/Internal/NSRunLoop+SRWebSocketPrivate.h b/SocketRocket/Internal/NSRunLoop+SRWebSocketPrivate.h index 098f7a818..df51baa36 100644 --- a/SocketRocket/Internal/NSRunLoop+SRWebSocketPrivate.h +++ b/SocketRocket/Internal/NSRunLoop+SRWebSocketPrivate.h @@ -7,7 +7,7 @@ // of patent rights can be found in the PATENTS file in the same directory. // -#import - +// #import +#import "NSRunLoop+SRWebSocket.h" // Empty function that force links the object file for the category. extern void import_NSRunLoop_SRWebSocket(void); diff --git a/SocketRocket/Internal/NSURLRequest+SRWebSocketPrivate.h b/SocketRocket/Internal/NSURLRequest+SRWebSocketPrivate.h index b09dde420..290cd7749 100644 --- a/SocketRocket/Internal/NSURLRequest+SRWebSocketPrivate.h +++ b/SocketRocket/Internal/NSURLRequest+SRWebSocketPrivate.h @@ -7,7 +7,7 @@ // of patent rights can be found in the PATENTS file in the same directory. // -#import - +// #import +#import "NSURLRequest+SRWebSocket.h" // Empty function that force links the object file for the category. extern void import_NSURLRequest_SRWebSocket(void); diff --git a/SocketRocket/Internal/Security/SRPinningSecurityPolicy.h b/SocketRocket/Internal/Security/SRPinningSecurityPolicy.h index 0d498b211..af7b06110 100644 --- a/SocketRocket/Internal/Security/SRPinningSecurityPolicy.h +++ b/SocketRocket/Internal/Security/SRPinningSecurityPolicy.h @@ -9,7 +9,8 @@ #import -#import +// #import +#import "SRSecurityPolicy.h" NS_ASSUME_NONNULL_BEGIN diff --git a/TestChat/TCViewController.m b/TestChat/TCViewController.m index 1f79f7e55..3511b2d2c 100644 --- a/TestChat/TCViewController.m +++ b/TestChat/TCViewController.m @@ -9,7 +9,8 @@ #import "TCViewController.h" -#import +// #import +#import "SocketRocket.h" #import "TCChatCell.h" diff --git a/Tests/Operations/SRTWebSocketOperation.h b/Tests/Operations/SRTWebSocketOperation.h index c4d53c2c3..0d6fea3c0 100644 --- a/Tests/Operations/SRTWebSocketOperation.h +++ b/Tests/Operations/SRTWebSocketOperation.h @@ -9,7 +9,8 @@ // of patent rights can be found in the PATENTS file in the same directory. // -#import +// #import +#import "SRWebSocket.h" @interface SRTWebSocketOperation : NSOperation diff --git a/Tests/SRAutobahnTests.m b/Tests/SRAutobahnTests.m index cc9fc17f7..b6b3068f3 100644 --- a/Tests/SRAutobahnTests.m +++ b/Tests/SRAutobahnTests.m @@ -12,7 +12,8 @@ @import XCTest; @import ObjectiveC; -#import +// #import +#import "SRWebSocket.h" #import "SRTWebSocketOperation.h" #import "SRAutobahnOperation.h"