Skip to content
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

Add Swift Package Manager support #631

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// swift-tools-version:5.0
import PackageDescription

let package = Package(
name: "SocketRocket",
platforms: [
.iOS(.v9),
.macOS(.v10_10),
.tvOS(.v9),
],
products: [
.library(
name: "SocketRocket",
targets: ["SocketRocket"]),
],
dependencies: [],
targets: [
.target(
name: "SocketRocket",
path: "SocketRocket",
cSettings: [
.headerSearchPath("Internal/**"),
]),
]
)
4 changes: 4 additions & 0 deletions SocketRocket/Internal/Delegate/SRDelegateController.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

#import <Foundation/Foundation.h>

#if SWIFT_PACKAGE
#import "SRWebSocket.h"
#else
#import <SocketRocket/SRWebSocket.h>
#endif

NS_ASSUME_NONNULL_BEGIN

Expand Down
4 changes: 4 additions & 0 deletions SocketRocket/Internal/NSRunLoop+SRWebSocketPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
// of patent rights can be found in the PATENTS file in the same directory.
//

#if SWIFT_PACKAGE
#import "NSRunLoop+SRWebSocket.h"
#else
#import <SocketRocket/NSRunLoop+SRWebSocket.h>
#endif

// Empty function that force links the object file for the category.
extern void import_NSRunLoop_SRWebSocket(void);
4 changes: 4 additions & 0 deletions SocketRocket/Internal/NSURLRequest+SRWebSocketPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
// of patent rights can be found in the PATENTS file in the same directory.
//

#if SWIFT_PACKAGE
#import "NSURLRequest+SRWebSocket.h"
#else
#import <SocketRocket/NSURLRequest+SRWebSocket.h>
#endif

// Empty function that force links the object file for the category.
extern void import_NSURLRequest_SRWebSocket(void);
4 changes: 4 additions & 0 deletions SocketRocket/Internal/Security/SRPinningSecurityPolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

#import <Foundation/Foundation.h>

#if SWIFT_PACKAGE
#import "SRSecurityPolicy.h"
#else
#import <SocketRocket/SRSecurityPolicy.h>
#endif

NS_ASSUME_NONNULL_BEGIN

Expand Down
1 change: 1 addition & 0 deletions SocketRocket/include/NSRunLoop+SRWebSocket.h
1 change: 1 addition & 0 deletions SocketRocket/include/NSURLRequest+SRWebSocket.h
1 change: 1 addition & 0 deletions SocketRocket/include/SRSecurityPolicy.h
1 change: 1 addition & 0 deletions SocketRocket/include/SRWebSocket.h