Skip to content

Start sectioning off ReactiveSwift #177

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

Merged
merged 9 commits into from
Jan 10, 2023
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
3 changes: 3 additions & 0 deletions .github/workflows/swift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Switch Xcode
run: sudo xcode-select -s /Applications/Xcode_13.3.1.app

- name: Swift Package Manager - iOS
run: |
xcodebuild -scheme "Workflow-Package" test -destination "name=iPhone 11"
Expand Down
115 changes: 89 additions & 26 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@ let package = Package(
.macOS("10.13"),
],
products: [
// MARK: Workflow

.library(
name: "Workflow",
targets: ["Workflow"]
),
.library(
name: "WorkflowTesting",
targets: ["WorkflowTesting"]
),

// MARK: WorkflowUI

.library(
name: "WorkflowUI",
targets: ["WorkflowUI"]
Expand All @@ -22,26 +31,42 @@ let package = Package(
name: "WorkflowSwiftUI",
targets: ["WorkflowSwiftUI"]
),

// MARK: WorkflowReactiveSwift

.library(
name: "WorkflowReactiveSwift",
targets: ["WorkflowReactiveSwift"]
),
.library(
name: "WorkflowCombine",
targets: ["WorkflowCombine"]
name: "WorkflowReactiveSwiftTesting",
targets: ["WorkflowReactiveSwiftTesting"]
),

// MARK: WorkflowRxSwift

.library(
name: "WorkflowTesting",
targets: ["WorkflowTesting"]
name: "WorkflowRxSwift",
targets: ["WorkflowRxSwift"]
),
.library(
name: "WorkflowReactiveSwiftTesting",
targets: ["WorkflowReactiveSwiftTesting"]
name: "WorkflowRxSwiftTesting",
targets: ["WorkflowRxSwiftTesting"]
),

// MARK: WorkflowCombine

.library(
name: "WorkflowCombine",
targets: ["WorkflowCombine"]
),
.library(
name: "WorkflowCombineTesting",
targets: ["WorkflowCombineTesting"]
),

// MARK: WorkflowConcurrency

.library(
name: "WorkflowConcurrency",
targets: ["WorkflowConcurrency"]
Expand All @@ -52,10 +77,13 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", from: "6.3.0"),
.package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", from: "7.1.1"),
.package(url: "https://github.com/ReactiveX/RxSwift.git", from: "6.2.0"),
.package(url: "https://github.com/nicklockwood/SwiftFormat", .exact("0.44.14")),
],
targets: [
// MARK: Workflow

.target(
name: "Workflow",
dependencies: ["ReactiveSwift"],
Expand All @@ -66,11 +94,19 @@ let package = Package(
dependencies: ["Workflow"],
path: "Workflow/Tests"
),
.target(
name: "WorkflowTesting",
dependencies: ["Workflow"],
path: "WorkflowTesting/Sources"
),
.testTarget(
name: "WorkflowTestingTests",
dependencies: ["WorkflowTesting"],
path: "WorkflowTesting/Tests"
),

// MARK: WorkflowUI

.target(
name: "WorkflowUI",
dependencies: ["Workflow"],
Expand All @@ -83,9 +119,12 @@ let package = Package(
),
.target(
name: "WorkflowSwiftUI",
dependencies: ["ReactiveSwift", "Workflow"],
dependencies: ["Workflow"],
path: "WorkflowSwiftUI/Sources"
),

// MARK: WorkflowReactiveSwift

.target(
name: "WorkflowReactiveSwift",
dependencies: ["ReactiveSwift", "Workflow"],
Expand All @@ -97,40 +136,64 @@ let package = Package(
path: "WorkflowReactiveSwift/Tests"
),
.target(
name: "WorkflowCombine",
dependencies: ["Workflow"],
path: "WorkflowCombine/Sources"
name: "WorkflowReactiveSwiftTesting",
dependencies: ["WorkflowReactiveSwift", "WorkflowTesting"],
path: "WorkflowReactiveSwift/Testing"
),
.testTarget(
name: "WorkflowCombineTests",
dependencies: ["WorkflowCombineTesting"],
path: "WorkflowCombine/Tests"
name: "WorkflowReactiveSwiftTestingTests",
dependencies: ["WorkflowReactiveSwiftTesting"],
path: "WorkflowReactiveSwift/TestingTests"
),

// MARK: WorkflowRxSwift

.target(
name: "WorkflowRxSwift",
dependencies: ["RxSwift", "Workflow"],
path: "WorkflowRxSwift/Sources"
),
.testTarget(
name: "WorkflowCombineTestingTests",
dependencies: ["WorkflowCombineTesting"],
path: "WorkflowCombine/TestingTests"
name: "WorkflowRxSwiftTests",
dependencies: ["WorkflowRxSwiftTesting", "WorkflowReactiveSwift"],
path: "WorkflowRxSwift/Tests"
),
.target(
name: "WorkflowTesting",
dependencies: ["Workflow"],
path: "WorkflowTesting/Sources"
name: "WorkflowRxSwiftTesting",
dependencies: ["WorkflowRxSwift", "WorkflowTesting"],
path: "WorkflowRxSwift/Testing"
),
.testTarget(
name: "WorkflowRxSwiftTestingTests",
dependencies: ["WorkflowRxSwiftTesting"],
path: "WorkflowRxSwift/TestingTests"
),

// MARK: WorkflowCombine

.target(
name: "WorkflowReactiveSwiftTesting",
dependencies: ["WorkflowReactiveSwift", "WorkflowTesting"],
path: "WorkflowReactiveSwift/Testing"
name: "WorkflowCombine",
dependencies: ["Workflow"],
path: "WorkflowCombine/Sources"
),
.testTarget(
name: "WorkflowReactiveSwiftTestingTests",
dependencies: ["WorkflowReactiveSwiftTesting"],
path: "WorkflowReactiveSwift/TestingTests"
name: "WorkflowCombineTests",
dependencies: ["WorkflowCombineTesting"],
path: "WorkflowCombine/Tests"
),
.target(
name: "WorkflowCombineTesting",
dependencies: ["WorkflowCombine", "WorkflowTesting"],
path: "WorkflowCombine/Testing"
),
.testTarget(
name: "WorkflowCombineTestingTests",
dependencies: ["WorkflowCombineTesting"],
path: "WorkflowCombine/TestingTests"
),

// MARK: WorkflowConcurrency

.target(
name: "WorkflowConcurrency",
dependencies: ["Workflow"],
Expand Down
12 changes: 2 additions & 10 deletions Workflow/Sources/DispatchQueue+Workflow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,8 @@
*/

import Foundation
import ReactiveSwift

extension DispatchQueue {
static let workflowExecution: DispatchQueue = .main
}

extension QueueScheduler {
static let workflowExecution: QueueScheduler = QueueScheduler(
qos: .userInteractive,
name: "com.squareup.workflow",
targeting: DispatchQueue.workflowExecution
)
@_spi(WorkflowInternals)
public static let workflowExecution: DispatchQueue = .main
}
2 changes: 1 addition & 1 deletion Workflow/Sources/RenderContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import ReactiveSwift
import Foundation

/// `RenderContext` is the composition point for the workflow tree.
///
Expand Down
28 changes: 28 additions & 0 deletions WorkflowReactiveSwift/Sources/QueueScheduler+Workflow.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2023 Square Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import Foundation
import ReactiveSwift

@_spi(WorkflowInternals) import Workflow

extension QueueScheduler {
static let workflowExecution: QueueScheduler = QueueScheduler(
qos: .userInteractive,
name: "com.squareup.workflow",
targeting: DispatchQueue.workflowExecution
)
}