Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from johnbona/feature/swift-pm
Browse files Browse the repository at this point in the history
Support Swift Package Manager
  • Loading branch information
pixelspark authored Sep 14, 2016
2 parents 1ebf8bd + ecb0013 commit 307d060
Show file tree
Hide file tree
Showing 22 changed files with 652 additions and 50 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.DS_Store
/.build
/Packages
Rethink.xcodeproj/project.xcworkspace/xcuserdata
Rethink.xcodeproj/xcuserdata
10 changes: 10 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import PackageDescription

let package = Package(
name: "Rethink",
targets: [
Target(name: "Rethink", dependencies: ["GCDAsyncSocket", "SCRAM"]),
Target(name: "GCDAsyncSocket"),
Target(name: "SCRAM")
]
)
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,28 @@ The driver is written for Swift 3. The last version working in Swift 2.2 can be

### Installation

Drag Rethink.xcodeproj into your own project, then add Rethink.framework as dependency (build targets) and link to it.
#### Swift Package Manager (SPM)

You can install the driver using Swift Package Manager by adding the following line to your ```Package.swift``` as a dependency:

```
.Package(url: "https://github.com/pixelspark/rethink-swift.git", majorVersion: 1)
```

To use the driver in an Xcode project, generate an Xcode project file using SPM:
```
swift package generate-xcodeproj
```
Open the Xcode project file and open the .xcconfig file located under the Config folder and add the following Objective-C build settings:
```
CLANG_ENABLE_MODULES = YES
CLANG_ENABLE_OBJC_ARC = YES
HEADER_SEARCH_PATHS = $(inherited) "$(SRCROOT)/Packages/**"
```

#### Manual

Drag Rethink.xcodeproj into your own project, then add Rethink or Rethink iOS as dependency (build targets) and link to it.
You should then be able to simply 'import Rethink' from Swift code.

### License
Expand Down
605 changes: 560 additions & 45 deletions Rethink.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "9D490845-C9AB-4999-8F49-108ED1CB5EBC",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"B4ECFDB54DAEDE750287282DDD72484BDC32C452" : "Rethink\/",
"B4ECFDB54DAEDE750287282DDD72484BDC32C452" : "rethink-swift\/",
"A5F18CC216C059F29632AA08FA9E5DF3898315E3" : ".."
},
"DVTSourceControlWorkspaceBlueprintNameKey" : "Rethink",
Expand Down
File renamed without changes.
26 changes: 26 additions & 0 deletions Sources/GCDAsyncSocket/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Pixelspark. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE. **/
import Foundation
import GCDAsyncSocket
import SCRAM

public class ReConnection: NSObject, GCDAsyncSocketDelegate {
public let url: URL
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions Rethink/ReSocket.swift → Sources/Rethink/ReSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE. **/
import Foundation
import GCDAsyncSocket

internal enum ReSocketState {
case unconnected
Expand Down
3 changes: 0 additions & 3 deletions Rethink/Rethink.h → Sources/Rethink/Rethink.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@

FOUNDATION_EXPORT double RethinkVersionNumber;
FOUNDATION_EXPORT const unsigned char RethinkVersionString[];

#import "GCDAsyncSocket.h"
#import "SCRAM.h"
File renamed without changes.
26 changes: 26 additions & 0 deletions Sources/SCRAM/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Pixelspark. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import XCTest
import Rethink
import SCRAM

class RethinkTests: XCTestCase {
private func asyncTest(_ block: (_ callback: @escaping () -> ()) -> ()) {
Expand Down

0 comments on commit 307d060

Please sign in to comment.