Skip to content

Commit 18f9d4b

Browse files
committed
Add support for Swift Package Manager
Only `swift build` on macOS is supported atm. `swift test` and Linux platform are not supported yet.
1 parent 5d97c05 commit 18f9d4b

File tree

6 files changed

+36
-0
lines changed

6 files changed

+36
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ profile
1515
*.moved-aside
1616
PlaygroundUtility.remap
1717

18+
# SwiftPM
19+
.build
20+
21+
# Carthage
1822
Carthage/Build

.swift-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0-PREVIEW-4

Package.swift

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import PackageDescription
2+
3+
let excludes: [String]
4+
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
5+
excludes = [
6+
"Sources/Deprecations+Removals.swift",
7+
"Sources/ObjectiveCBridging.swift"
8+
]
9+
#else
10+
excludes = [
11+
"Sources/Deprecations+Removals.swift",
12+
"Sources/DynamicProperty.swift",
13+
"Sources/NSObject+KeyValueObserving.swift",
14+
"Sources/ObjectiveCBridging.swift"
15+
]
16+
#endif
17+
18+
let package = Package(
19+
name: "ReactiveCocoa",
20+
dependencies: [
21+
.Package(url: "https://github.com/antitypical/Result.git", "3.0.0-alpha.2")
22+
],
23+
exclude: excludes
24+
)

ReactiveCocoa/Swift/Deprecations+Removals.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Foundation
12
import enum Result.NoError
23

34
// MARK: Removed Types and APIs in ReactiveCocoa 5.0.

ReactiveCocoa/Swift/Lifetime.swift

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Foundation
12
import enum Result.NoError
23

34
/// Represents the lifetime of an object, and provides a hook to observe when
@@ -48,6 +49,8 @@ public final class Lifetime {
4849
}
4950
}
5051

52+
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
53+
5154
private var lifetimeKey: UInt8 = 0
5255
private var lifetimeTokenKey: UInt8 = 0
5356

@@ -70,3 +73,5 @@ extension NSObject {
7073
return lifetime
7174
}
7275
}
76+
77+
#endif

Sources

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ReactiveCocoa/Swift/

0 commit comments

Comments
 (0)