Skip to content

Commit

Permalink
bring "CX_CONTINUOUS_INTEGRATION" back
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxiu committed Nov 8, 2019
1 parent f0501b7 commit d5c34e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer
CX_COMBINE_IMPLEMENTATION: ${{ matrix.combine_impl }}
CX_CONTINUOUS_INTEGRATION: "YES"
steps:
- uses: actions/checkout@v1
- name: Swift Version
Expand Down
14 changes: 8 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,14 @@ extension Optional where Wrapped: RangeReplaceableCollection {
import Foundation

let env = ProcessInfo.processInfo.environment
let key = "CX_COMBINE_IMPLEMENTATION"
var combineImp = env[key].flatMap(CombineImplementation.init) ?? .default
let impkey = "CX_COMBINE_IMPLEMENTATION"
let isCIKey = "CX_CONTINUOUS_INTEGRATION"

// uncommenet the following line if you want to test against combine
//combineImp = .combine
var combineImp = env[impkey].flatMap(CombineImplementation.init) ?? .default
var isCI = env[isCIKey] != nil

// uncommenet the following two lines if you want to test against combine
//combineImp = .combine; isCI = true

package.dependencies.append(contentsOf: combineImp.extraPackageDependencies)

Expand All @@ -123,7 +126,6 @@ for target in package.targets where target.isTest || target.name == "CXTestUtili
target.swiftSettings.append(contentsOf: combineImp.swiftSettings)
}

if combineImp == .combine {
if combineImp == .combine && isCI {
package.platforms = [.macOS("10.15"), .iOS("13.0"), .tvOS("13.0"), .watchOS("6.0")]
}

0 comments on commit d5c34e5

Please sign in to comment.