Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 083fcfe

Browse files
committed
SPM
1 parent 799a0c3 commit 083fcfe

File tree

6 files changed

+78
-1
lines changed

6 files changed

+78
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
44

55
## Build generated
6+
.build
67
build/
78
DerivedData
89

@@ -30,6 +31,7 @@ vendor
3031
## Obj-C/Swift specific
3132
*.hmap
3233
*.ipa
34+
Package.resolved
3335

3436
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion
3537

.swiftlint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ excluded:
22
- Carthage
33
- Example/Pods
44
- vendor
5+
- .build/
56

67
disabled_rules:
78
- nesting

Example/RxWebSocket/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import UIKit
1414

1515
class ViewController: UIViewController {
1616

17-
// swiftlint:disable force_unwrapping
17+
// swiftlint:disable:next force_unwrapping
1818
private let socket = RxWebSocket(url: URL(string: "ws://echo.websocket.org")!)
1919
private let disposeBag = DisposeBag()
2020

Package.swift

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// swift-tools-version:4.0
2+
// swiftlint:disable:previous file_header
3+
4+
import PackageDescription
5+
6+
// swiftlint:disable:next explicit_top_level_acl
7+
let package = Package(
8+
name: "RxWebSocket",
9+
products: [
10+
.library(
11+
name: "RxWebSocket",
12+
targets: ["RxWebSocket"]
13+
)
14+
],
15+
dependencies: [
16+
.package(
17+
url: "https://github.com/ReactiveX/RxSwift.git",
18+
.upToNextMajor(from: "4.0.0")
19+
),
20+
.package(
21+
url: "https://github.com/daltoniam/Starscream.git",
22+
.upToNextMajor(from: "3.0.0")
23+
)
24+
],
25+
targets: [
26+
.target(
27+
name: "RxWebSocket",
28+
dependencies: ["RxSwift", "RxCocoa", "Starscream"],
29+
path: "Classes"
30+
),
31+
.testTarget(
32+
name: "RxWebSocketTests",
33+
dependencies: [
34+
"RxWebSocket",
35+
"RxSwift",
36+
"RxCocoa",
37+
"Starscream",
38+
"RxBlocking"
39+
],
40+
path: "RxWebSocketTests"
41+
)
42+
]
43+
)

fastlane/Fastfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ platform :ios do
3232
test
3333
tvOS
3434
macOS
35+
36+
# Package managers
3537
pod_lint
3638
carthage_lint
39+
spm
3740
end
3841

3942
desc "Runs all the tests"
@@ -181,6 +184,12 @@ platform :ios do
181184
)
182185
end
183186

187+
desc "Swift Package Manager compliance"
188+
lane :spm do
189+
sh "swift build"
190+
sh "swift test"
191+
end
192+
184193
after_all do |lane|
185194
begin
186195
sh "../server.sh stop"

install_dependencies.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ install_wstest() {
6363
verify "wstest"
6464
}
6565

66+
# Homebrew
67+
install_homebrew() {
68+
if [ ! $(which homebrew) ]; then
69+
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
70+
fi
71+
}
72+
6673
# Swiftlint
6774
install_swiftlint() {
6875
echo 'Installing swiftlint'
@@ -72,11 +79,25 @@ install_swiftlint() {
7279
return
7380
fi
7481

82+
install_homebrew
7583
exe brew install swiftlint
7684

7785
verify "swiftlint"
7886
}
7987

88+
# Carthage
89+
install_carthage() {
90+
echo 'Installing Carthage'
91+
92+
if [ $(which carthage) ]; then
93+
echo ' -> Carthage already installed'
94+
return
95+
fi
96+
97+
install_homebrew
98+
exe brew install carthage
99+
}
100+
80101
xcode_error() {
81102
if [[ ! -z "$XCODE_VERSION_MAJOR" ]]; then
82103
echo "$(pwd)/Classes/RxWebSocket.swift:$1: "
@@ -98,6 +119,7 @@ fi
98119
install_bundle
99120
install_wstest
100121
install_swiftlint
122+
install_carthage
101123
echo 'Success! All requirements are installed'
102124

103125
touch build/.deps

0 commit comments

Comments
 (0)