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

Use Combine instead of OpenCombine where possible #39

Merged
merged 1 commit into from
Jul 12, 2020
Merged
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
14 changes: 10 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
// swift-tools-version:5.2
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let openCombineProduct: Target.Dependency = .product(
name: "OpenCombine",
package: "OpenCombine",
condition: .when(platforms: [.linux])
)

let package = Package(
name: "carton",
platforms: [.macOS(.v10_15)],
Expand Down Expand Up @@ -31,7 +37,7 @@ let package = Package(
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
.product(name: "Vapor", package: "vapor"),
"CartonHelpers",
"OpenCombine",
openCombineProduct,
"SwiftToolchain",
]
),
Expand All @@ -41,15 +47,15 @@ let package = Package(
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
"CartonHelpers",
"OpenCombine",
openCombineProduct,
]
),
.target(
name: "CartonHelpers",
dependencies: [
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
"OpenCombine",
openCombineProduct,
]
),
// This target is used only for release automation tasks and
Expand Down
70 changes: 70 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// swift-tools-version:5.2
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "carton",
platforms: [.macOS(.v10_15)],
dependencies: [
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.1.1"),
.package(
url: "https://github.com/apple/swift-argument-parser",
.upToNextMinor(from: "0.2.0")
),
.package(
url: "https://github.com/apple/swift-tools-support-core.git",
.upToNextMinor(from: "0.1.3")
),
.package(url: "https://github.com/OpenCombine/OpenCombine.git", from: "0.10.0"),
.package(url: "https://github.com/vapor/vapor.git", .upToNextMinor(from: "4.5.0")),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module
// or a test suite. Targets can depend on other targets in this package, and on
// products in packages which this package depends on.
.target(
name: "carton",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
.product(name: "Vapor", package: "vapor"),
"CartonHelpers",
"OpenCombine",
"SwiftToolchain",
]
),
.target(
name: "SwiftToolchain",
dependencies: [
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
"CartonHelpers",
"OpenCombine",
]
),
.target(
name: "CartonHelpers",
dependencies: [
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
"OpenCombine",
]
),
// This target is used only for release automation tasks and
// should not be installed by `carton` users.
.target(
name: "carton-release",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
]
),
.testTarget(
name: "CartonTests",
dependencies: ["carton"]
),
]
)
4 changes: 4 additions & 0 deletions Sources/CartonHelpers/ProcessRunner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

import Dispatch
import Foundation
#if canImport(Combine)
import Combine
#else
import OpenCombine
#endif
import TSCBasic

struct ProcessRunnerError: Error, CustomStringConvertible {
Expand Down
4 changes: 4 additions & 0 deletions Sources/SwiftToolchain/ProgressAnimation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if canImport(Combine)
import Combine
#else
import OpenCombine
#endif
import TSCBasic
import TSCUtility

Expand Down
4 changes: 4 additions & 0 deletions Sources/SwiftToolchain/ToolchainManagement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
import AsyncHTTPClient
import CartonHelpers
import Foundation
#if canImport(Combine)
import Combine
#else
import OpenCombine
#endif
import TSCBasic
import TSCUtility

Expand Down
4 changes: 4 additions & 0 deletions Sources/carton/Combine/Watcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if canImport(Combine)
import Combine
#else
import OpenCombine
#endif
import TSCBasic
import TSCUtility

Expand Down
4 changes: 4 additions & 0 deletions Sources/carton/Commands/Dev.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

import ArgumentParser
import Foundation
#if canImport(Combine)
import Combine
#else
import OpenCombine
#endif
import SwiftToolchain
import TSCBasic

Expand Down
4 changes: 4 additions & 0 deletions Sources/carton/Commands/Test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
// limitations under the License.

import ArgumentParser
#if canImport(Combine)
import Combine
#else
import OpenCombine
#endif
import TSCBasic

private let dependency = Dependency(
Expand Down
4 changes: 4 additions & 0 deletions Sources/carton/Server/Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
// limitations under the License.

import CartonHelpers
#if canImport(Combine)
import Combine
#else
import OpenCombine
#endif
import TSCBasic
import Vapor

Expand Down