Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into jquadri/exp-anyworkfl…
Browse files Browse the repository at this point in the history
…ow-workflow-conformance

* origin/main:
  Expose AnyScreen.wrappedScreen for inspection (#193)
  Improve introspection for SignalProducerWorkflow actions (#192)
  [release]: bump version to 2.2.0 & remove separate concurrency version (#191)
  [feat]: add runtime observation API (#168)
  [chore]: refactor some internal actions to use existential any (#190)
  [fix]: use weak reference to internal sinks when vending to clients (#189)
  [feat]: add primary associated types to more protocols (#188)
  [chore]: pre major version bump cleanup (#187)
  [chore]: bump minimum deployment & swift versions (#186)
  Abstract ViewEnvironment to shared framework (#185)
  • Loading branch information
jamieQ committed Feb 24, 2023
2 parents 67393fe + 99024b5 commit a4de618
Show file tree
Hide file tree
Showing 83 changed files with 1,742 additions and 536 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/swift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ jobs:
bundle exec pod gen Development.podspec
- name: Switch Xcode
run: sudo xcode-select -s /Applications/Xcode_13.3.1.app
run: sudo xcode-select -s /Applications/Xcode_14.2.0.app

- name: Build & Test
run: |
set -o pipefail && xcodebuild -workspace gen/Development/Development.xcworkspace -scheme ${{ matrix.scheme }} -destination platform\=iOS\ Simulator,OS\=15.4,name\=iPad\ Pro\ \(9.7-inch\) build test | xcpretty
set -o pipefail && xcodebuild -workspace gen/Development/Development.xcworkspace -scheme ${{ matrix.scheme }} -destination platform\=iOS\ Simulator,OS\=16.2,name\=iPad\ Pro\ \(9.7-inch\) build test | xcpretty
spm:
runs-on: macos-latest
Expand All @@ -54,7 +54,7 @@ jobs:
- uses: actions/checkout@v3

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

- name: Swift Package Manager - iOS
run: |
Expand All @@ -81,13 +81,13 @@ jobs:
bundle check || bundle install --path .bundle
- name: Switch Xcode
run: sudo xcode-select -s /Applications/Xcode_13.3.1.app
run: sudo xcode-select -s /Applications/Xcode_14.2.0.app

- name: Tutorial App
run: |
cd Samples/Tutorial
bundle exec pod install
set -o pipefail && xcodebuild -workspace Tutorial.xcworkspace -scheme Tutorial -destination platform\=iOS\ Simulator,OS\=15.4,name\=iPad\ Pro\ \(9.7-inch\) build test | xcpretty
set -o pipefail && xcodebuild -workspace Tutorial.xcworkspace -scheme Tutorial -destination platform\=iOS\ Simulator,OS\=16.2,name\=iPad\ Pro\ \(9.7-inch\) build test | xcpretty
documentation-lint:
runs-on: macos-latest
Expand All @@ -107,7 +107,7 @@ jobs:
brew install sourcedocs
- name: Switch Xcode
run: sudo xcode-select -s /Applications/Xcode_13.3.1.app
run: sudo xcode-select -s /Applications/Xcode_14.2.0.app

- name: Swiftdocs
run: |
Expand Down
112 changes: 55 additions & 57 deletions Development.podspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require_relative('version')

Pod::Spec.new do |s|
s.name = 'Development'
s.version = '0.1.0'
Expand All @@ -7,14 +9,15 @@ Pod::Spec.new do |s|
s.author = 'Square'
s.source = { :git => 'https://github.com/square/workflow-swift.git', :tag => "v#{s.version}" }

s.ios.deployment_target = '11.0'
s.swift_version = '5.0'
s.ios.deployment_target = WORKFLOW_IOS_DEPLOYMENT_TARGET
s.swift_version = WORKFLOW_SWIFT_VERSION
s.dependency 'Workflow'
s.dependency 'WorkflowUI'
s.dependency 'WorkflowReactiveSwift'
s.dependency 'WorkflowRxSwift'
# s.dependency 'WorkflowCombine' # TODO: Disabled because app specs cannot increase the deployment target of the root
# s.dependency 'WorkflowConcurrency' # TODO: Disabled because app specs cannot increase the deployment target of the root
s.dependency 'WorkflowCombine'
s.dependency 'WorkflowConcurrency'
s.dependency 'ViewEnvironment'

s.source_files = 'Samples/Dummy.swift'

Expand Down Expand Up @@ -44,17 +47,14 @@ Pod::Spec.new do |s|
test_spec.source_files = 'WorkflowTesting/Tests/**/*.swift'
end

# TODO: Disabled because app specs cannot increase the deployment target of the root
# To use, increase the deployment target of this spec to 13.0 or higher
#
# s.app_spec 'SampleSwiftUIApp' do |app_spec|
# app_spec.ios.deployment_target = '13.0'
# app_spec.dependency 'WorkflowSwiftUI'
# app_spec.pod_target_xcconfig = {
# 'IFNFOPLIST_FILE' => '${PODS_ROOT}/../Samples/SampleSwiftUIApp/SampleSwiftUIApp/Configuration/Info.plist'
# }
# app_spec.source_files = 'SampleSwiftUIApp/SampleSwiftUIApp/**/*.swift'
# end
s.app_spec 'SampleSwiftUIApp' do |app_spec|
app_spec.ios.deployment_target = WORKFLOW_IOS_DEPLOYMENT_TARGET
app_spec.dependency 'WorkflowSwiftUI'
app_spec.pod_target_xcconfig = {
'IFNFOPLIST_FILE' => '${PODS_ROOT}/../Samples/SampleSwiftUIApp/SampleSwiftUIApp/Configuration/Info.plist'
}
app_spec.source_files = 'Samples/SampleSwiftUIApp/SampleSwiftUIApp/**/*.swift'
end

s.app_spec 'SampleTicTacToe' do |app_spec|
app_spec.source_files = 'Samples/TicTacToe/Sources/**/*.swift'
Expand Down Expand Up @@ -145,48 +145,46 @@ Pod::Spec.new do |s|
test_spec.dependency 'WorkflowRxSwiftTesting'
end

# TODO: Disabled because app specs cannot increase the deployment target of the root
# To use, increase the deployment target of this spec to 13.0 or higher
# s.app_spec 'WorkflowCombineSampleApp' do |app_spec|
# app_spec.source_files = 'Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/**/*.swift'
# end
#
# s.test_spec 'WorkflowCombineSampleAppTests' do |test_spec|
# test_spec.dependency 'Development/WorkflowCombineSampleApp'
# test_spec.dependency 'WorkflowTesting'
# test_spec.requires_app_host = true
# test_spec.app_host_name = 'Development/WorkflowCombineSampleApp'
# test_spec.source_files = 'Samples/WorkflowCombineSampleApp/WorkflowCombineSampleAppUnitTests/**/*.swift'
# end

# s.test_spec 'WorkflowCombineTests' do |test_spec|
# test_spec.requires_app_host = true
# test_spec.source_files = 'WorkflowCombine/Tests/**/*.swift'
# test_spec.framework = 'XCTest'
# test_spec.dependency 'WorkflowTesting'
# test_spec.dependency 'WorkflowCombineTesting'
# end

# s.test_spec 'WorkflowCombineTestingTests' do |test_spec|
# test_spec.requires_app_host = true
# test_spec.source_files = 'WorkflowCombine/TestingTests/**/*.swift'
# test_spec.framework = 'XCTest'
# test_spec.dependency 'WorkflowTesting'
# test_spec.dependency 'WorkflowCombineTesting'
# end
s.app_spec 'WorkflowCombineSampleApp' do |app_spec|
app_spec.source_files = 'Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/**/*.swift'
end

s.test_spec 'WorkflowCombineSampleAppTests' do |test_spec|
test_spec.dependency 'Development/WorkflowCombineSampleApp'
test_spec.dependency 'WorkflowTesting'
test_spec.requires_app_host = true
test_spec.app_host_name = 'Development/WorkflowCombineSampleApp'
test_spec.source_files = 'Samples/WorkflowCombineSampleApp/WorkflowCombineSampleAppUnitTests/**/*.swift'
end

s.test_spec 'WorkflowCombineTests' do |test_spec|
test_spec.requires_app_host = true
test_spec.source_files = 'WorkflowCombine/Tests/**/*.swift'
test_spec.framework = 'XCTest'
test_spec.dependency 'WorkflowTesting'
test_spec.dependency 'WorkflowCombineTesting'
end

s.test_spec 'WorkflowCombineTestingTests' do |test_spec|
test_spec.requires_app_host = true
test_spec.source_files = 'WorkflowCombine/TestingTests/**/*.swift'
test_spec.framework = 'XCTest'
test_spec.dependency 'WorkflowTesting'
test_spec.dependency 'WorkflowCombineTesting'
end

# s.test_spec 'WorkflowConcurrencyTests' do |test_spec|
# test_spec.requires_app_host = true
# test_spec.source_files = 'WorkflowConcurrency/Tests/**/*.swift'
# test_spec.framework = 'XCTest'
# test_spec.dependency 'WorkflowTesting'
# end
s.test_spec 'WorkflowConcurrencyTests' do |test_spec|
test_spec.requires_app_host = true
test_spec.source_files = 'WorkflowConcurrency/Tests/**/*.swift'
test_spec.framework = 'XCTest'
test_spec.dependency 'WorkflowTesting'
end

# s.test_spec 'WorkflowConcurrencyTestingTests' do |test_spec|
# test_spec.requires_app_host = true
# test_spec.source_files = 'WorkflowConcurrency/TestingTests/**/*.swift'
# test_spec.framework = 'XCTest'
# test_spec.dependency 'WorkflowTesting'
# test_spec.dependency 'WorkflowConcurrencyTesting'
# end
s.test_spec 'WorkflowConcurrencyTestingTests' do |test_spec|
test_spec.requires_app_host = true
test_spec.source_files = 'WorkflowConcurrency/TestingTests/**/*.swift'
test_spec.framework = 'XCTest'
test_spec.dependency 'WorkflowTesting'
test_spec.dependency 'WorkflowConcurrencyTesting'
end
end
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ source 'https://rubygems.org'
gem 'cocoapods-trunk', '>=1.6.0'
gem 'cocoapods'

# Need it for Ruby 3.0 support and no release has happened yet
gem 'cocoapods-disable-podfile-validations', :git => 'https://github.com/segiddins/cocoapods-disable-podfile-validations.git', :ref => '55598d677fa995be496a47b810f4f9dce732b169'
gem 'cocoapods-generate'
13 changes: 3 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
GIT
remote: https://github.com/segiddins/cocoapods-disable-podfile-validations.git
revision: 55598d677fa995be496a47b810f4f9dce732b169
ref: 55598d677fa995be496a47b810f4f9dce732b169
specs:
cocoapods-disable-podfile-validations (0.1.1)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -52,9 +45,10 @@ GEM
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-disable-podfile-validations (0.2.0)
cocoapods-downloader (1.6.3)
cocoapods-generate (2.2.2)
cocoapods-disable-podfile-validations (~> 0.1.1)
cocoapods-generate (2.2.3)
cocoapods-disable-podfile-validations (>= 0.1.1, < 0.3.0)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
Expand Down Expand Up @@ -101,7 +95,6 @@ PLATFORMS

DEPENDENCIES
cocoapods
cocoapods-disable-podfile-validations!
cocoapods-generate
cocoapods-trunk (>= 1.6.0)

Expand Down
24 changes: 19 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// swift-tools-version:5.2
// swift-tools-version:5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Workflow",
platforms: [
.iOS("11.0"),
.macOS("10.13"),
.iOS("14.0"),
.macOS("10.15"),
],
products: [
// MARK: Workflow
Expand Down Expand Up @@ -75,11 +75,18 @@ let package = Package(
name: "WorkflowConcurrencyTesting",
targets: ["WorkflowConcurrencyTesting"]
),

// MARK: ViewEnvironment

.library(
name: "ViewEnvironment",
targets: ["ViewEnvironment"]
),
],
dependencies: [
.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")),
.package(url: "https://github.com/nicklockwood/SwiftFormat", exact: "0.44.14"),
],
targets: [
// MARK: Workflow
Expand Down Expand Up @@ -109,7 +116,7 @@ let package = Package(

.target(
name: "WorkflowUI",
dependencies: ["Workflow"],
dependencies: ["Workflow", "ViewEnvironment"],
path: "WorkflowUI/Sources"
),
.testTarget(
Expand Down Expand Up @@ -214,6 +221,13 @@ let package = Package(
dependencies: ["WorkflowConcurrencyTesting"],
path: "WorkflowConcurrency/TestingTests"
),

// MARK: ViewEnvironment

.target(
name: "ViewEnvironment",
path: "ViewEnvironment/Sources"
),
],
swiftLanguageVersions: [.v5]
)
10 changes: 2 additions & 8 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ For Squares, membership is managed through the `Workflow Swift Owners` registry

> ⚠️ [Optional] To avoid possible headaches when publishing podspecs, validation can be performed before updating the Workflow version number(s). To do this, run the following in the root directory of this repo:
> ```bash
> bundle exec pod lib lint Workflow.podspec WorkflowTesting.podspec WorkflowReactiveSwift.podspec WorkflowUI.podspec WorkflowRxSwift.podspec WorkflowReactiveSwiftTesting.podspec WorkflowRxSwiftTesting.podspec WorkflowSwiftUI.podspec WorkflowCombine.podspec WorkflowCombineTesting.podspec
> ```
> And then run a similar command to check the `WorkflowConcurrency*` libraries. These specs will fail default validation as their version differs from the git tag used, so run the command with the `--allow-warnings` option, and check that only that warning is produced.
> ```bash
> bundle exec pod lib lint WorkflowConcurrency.podspec WorkflowConcurrencyTesting.podspec --allow-warnings
> bundle exec pod lib lint Workflow.podspec ViewEnvironment.podspec WorkflowTesting.podspec WorkflowReactiveSwift.podspec WorkflowUI.podspec WorkflowRxSwift.podspec WorkflowReactiveSwiftTesting.podspec WorkflowRxSwiftTesting.podspec WorkflowSwiftUI.podspec WorkflowCombine.podspec WorkflowCombineTesting.podspec WorkflowConcurrency.podspec WorkflowConcurrencyTesting.podspec
> ```
1. Update `VERSION` file based on [`semver`](https://semver.org/).
Expand All @@ -40,16 +36,14 @@ For Squares, membership is managed through the `Workflow Swift Owners` registry
bundle exec pod trunk push Workflow.podspec --synchronous
bundle exec pod trunk push WorkflowTesting.podspec --synchronous
bundle exec pod trunk push WorkflowReactiveSwift.podspec --synchronous
bundle exec pod trunk push ViewEnvironment.podspec --synchronous
bundle exec pod trunk push WorkflowUI.podspec --synchronous
bundle exec pod trunk push WorkflowRxSwift.podspec --synchronous
bundle exec pod trunk push WorkflowReactiveSwiftTesting.podspec --synchronous
bundle exec pod trunk push WorkflowRxSwiftTesting.podspec --synchronous
bundle exec pod trunk push WorkflowSwiftUI.podspec --synchronous
bundle exec pod trunk push WorkflowCombine.podspec --synchronous
bundle exec pod trunk push WorkflowCombineTesting.podspec --synchronous
# Note: If the following fail due to a validation warning about their version number not matching the git tag,
# it is safe to ignore, and publish anyway by adding the `--allow-warnings` option to the command.
bundle exec pod trunk push WorkflowConcurrency.podspec --synchronous
bundle exec pod trunk push WorkflowConcurrencyTesting.podspec --synchronous
```
Expand Down
4 changes: 2 additions & 2 deletions Samples/AlertContainer/AlertContainer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Pod::Spec.new do |s|
# 1.7 is needed for `swift_versions` support
s.cocoapods_version = '>= 1.7.0'

s.swift_versions = ['5.0']
s.ios.deployment_target = '11.0'
s.swift_versions = [WORKFLOW_SWIFT_VERSION]
s.ios.deployment_target = WORKFLOW_IOS_DEPLOYMENT_TARGET

s.source_files = 'Sources/**/*.swift'

Expand Down
4 changes: 2 additions & 2 deletions Samples/BackStackContainer/BackStackContainer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Pod::Spec.new do |s|
# 1.7 is needed for `swift_versions` support
s.cocoapods_version = '>= 1.7.0'

s.swift_versions = ['5.0']
s.ios.deployment_target = '11.0'
s.swift_versions = [WORKFLOW_SWIFT_VERSION]
s.ios.deployment_target = WORKFLOW_IOS_DEPLOYMENT_TARGET

s.source_files = 'Sources/**/*.{swift}'

Expand Down
4 changes: 2 additions & 2 deletions Samples/ModalContainer/ModalContainer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Pod::Spec.new do |s|
# 1.7 is needed for `swift_versions` support
s.cocoapods_version = '>= 1.7.0'

s.swift_versions = ['5.0']
s.ios.deployment_target = '11.0'
s.swift_versions = [WORKFLOW_SWIFT_VERSION]
s.ios.deployment_target = WORKFLOW_IOS_DEPLOYMENT_TARGET

s.source_files = 'Sources/**/*.swift'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,8 @@ internal final class ModalContainerViewController<ModalScreen: Screen>: ScreenVi

setNeedsStatusBarAppearanceUpdate()

if #available(iOS 11.0, *) {
setNeedsUpdateOfHomeIndicatorAutoHidden()
setNeedsUpdateOfScreenEdgesDeferringSystemGestures()
}
setNeedsUpdateOfHomeIndicatorAutoHidden()
setNeedsUpdateOfScreenEdgesDeferringSystemGestures()

// Set the topmost screen to be the accessibility modal
presentedScreens.last?.viewController.view.accessibilityViewIsModal = true
Expand Down
2 changes: 1 addition & 1 deletion Samples/SampleApp/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project 'SampleApp.xcodeproj'
platform :ios, '9.3'
platform :ios, '14.0'

target 'SampleApp' do
pod 'Workflow', path: '../../Workflow.podspec', :testspecs => ['Tests']
Expand Down
2 changes: 1 addition & 1 deletion Samples/SampleSwiftUIApp/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project 'SampleSwiftUIApp.xcodeproj'
platform :ios, '13'
platform :ios, '14.0'

target 'SampleSwiftUIApp' do
pod 'Workflow', path: '../../Workflow.podspec', :testspecs => ['Tests']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ internal final class SplitScreenContainerViewController<LeadingScreenType: Scree

private extension UIViewController {
var isLayoutDirectionRightToLeft: Bool {
if #available(iOS 10.0, *) {
return traitCollection.layoutDirection == .rightToLeft
} else {
return UIView.userInterfaceLayoutDirection(for: view.semanticContentAttribute) == .rightToLeft
}
return traitCollection.layoutDirection == .rightToLeft
}
}
Loading

0 comments on commit a4de618

Please sign in to comment.