Skip to content

Commit f924e81

Browse files
authored
Abstract ViewEnvironment to shared framework (#185)
1 parent 0f7aca5 commit f924e81

File tree

9 files changed

+43
-2
lines changed

9 files changed

+43
-2
lines changed

Development.podspec

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Pod::Spec.new do |s|
1515
s.dependency 'WorkflowRxSwift'
1616
# s.dependency 'WorkflowCombine' # TODO: Disabled because app specs cannot increase the deployment target of the root
1717
# s.dependency 'WorkflowConcurrency' # TODO: Disabled because app specs cannot increase the deployment target of the root
18+
s.dependency 'ViewEnvironment'
1819

1920
s.source_files = 'Samples/Dummy.swift'
2021

Package.swift

+15-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ let package = Package(
7575
name: "WorkflowConcurrencyTesting",
7676
targets: ["WorkflowConcurrencyTesting"]
7777
),
78+
79+
// MARK: ViewEnvironment
80+
81+
.library(
82+
name: "ViewEnvironment",
83+
targets: ["ViewEnvironment"]
84+
),
7885
],
7986
dependencies: [
8087
.package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", from: "7.1.1"),
@@ -109,7 +116,7 @@ let package = Package(
109116

110117
.target(
111118
name: "WorkflowUI",
112-
dependencies: ["Workflow"],
119+
dependencies: ["Workflow", "ViewEnvironment"],
113120
path: "WorkflowUI/Sources"
114121
),
115122
.testTarget(
@@ -214,6 +221,13 @@ let package = Package(
214221
dependencies: ["WorkflowConcurrencyTesting"],
215222
path: "WorkflowConcurrency/TestingTests"
216223
),
224+
225+
// MARK: ViewEnvironment
226+
227+
.target(
228+
name: "ViewEnvironment",
229+
path: "ViewEnvironment/Sources"
230+
),
217231
],
218232
swiftLanguageVersions: [.v5]
219233
)

RELEASING.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For Squares, membership is managed through the `Workflow Swift Owners` registry
1717

1818
> ⚠️ [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:
1919
> ```bash
20-
> 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
20+
> 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 ViewEnvironment.podspec
2121
> ```
2222
> 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.
2323
> ```bash
@@ -40,6 +40,7 @@ For Squares, membership is managed through the `Workflow Swift Owners` registry
4040
bundle exec pod trunk push Workflow.podspec --synchronous
4141
bundle exec pod trunk push WorkflowTesting.podspec --synchronous
4242
bundle exec pod trunk push WorkflowReactiveSwift.podspec --synchronous
43+
bundle exec pod trunk push ViewEnvironment.podspec --synchronous
4344
bundle exec pod trunk push WorkflowUI.podspec --synchronous
4445
bundle exec pod trunk push WorkflowRxSwift.podspec --synchronous
4546
bundle exec pod trunk push WorkflowReactiveSwiftTesting.podspec --synchronous

Samples/Tutorial/Podfile

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ platform :ios, '11.0'
44
target 'Tutorial' do
55
pod 'Workflow', path: '../../Workflow.podspec', :testspecs => ['Tests']
66
pod 'WorkflowUI', path: '../../WorkflowUI.podspec', :testspecs => ['Tests']
7+
pod 'ViewEnvironment', path: '../../ViewEnvironment.podspec'
78
pod 'WorkflowReactiveSwift', path: '../../WorkflowReactiveSwift.podspec', :testspecs => ['Tests']
89
pod 'BackStackContainer', path: '../BackStackContainer/BackStackContainer.podspec'
910

ViewEnvironment.podspec

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require_relative('version')
2+
3+
Pod::Spec.new do |s|
4+
s.name = 'ViewEnvironment'
5+
s.version = WORKFLOW_VERSION
6+
s.summary = 'A collection of environment values propagated through a view hierarchy.'
7+
s.homepage = 'https://www.github.com/square/workflow-swift'
8+
s.license = 'Apache License, Version 2.0'
9+
s.author = 'Square'
10+
s.source = { :git => 'https://github.com/square/workflow-swift.git', :tag => "v#{s.version}" }
11+
12+
# 1.7 is needed for `swift_versions` support
13+
s.cocoapods_version = '>= 1.7.0'
14+
15+
s.swift_versions = ['5.0']
16+
s.ios.deployment_target = '11.0'
17+
s.osx.deployment_target = '10.13'
18+
19+
s.source_files = 'ViewEnvironment/Sources/**/*.swift'
20+
21+
s.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' }
22+
end

WorkflowUI.podspec

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Pod::Spec.new do |s|
1919
s.source_files = 'WorkflowUI/Sources/**/*.swift'
2020

2121
s.dependency 'Workflow', "#{s.version}"
22+
s.dependency 'ViewEnvironment', "#{s.version}"
2223

2324
s.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' }
2425

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@_exported import ViewEnvironment

0 commit comments

Comments
 (0)