mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
246643fe55
Swift 6 doesn't allow importing executable targets. So we need to move testable logic into a framework.
29 lines
796 B
Swift
29 lines
796 B
Swift
import Foundation
|
|
|
|
extension ProcessInfo {
|
|
var isLikelyXcodeCloudEnvironment: Bool {
|
|
// https://developer.apple.com/documentation/xcode/environment-variable-reference
|
|
let requiredKeys: Set = [
|
|
"CI",
|
|
"CI_BUILD_ID",
|
|
"CI_BUILD_NUMBER",
|
|
"CI_BUNDLE_ID",
|
|
"CI_COMMIT",
|
|
"CI_DERIVED_DATA_PATH",
|
|
"CI_PRODUCT",
|
|
"CI_PRODUCT_ID",
|
|
"CI_PRODUCT_PLATFORM",
|
|
"CI_PROJECT_FILE_PATH",
|
|
"CI_START_CONDITION",
|
|
"CI_TEAM_ID",
|
|
"CI_WORKFLOW",
|
|
"CI_WORKSPACE",
|
|
"CI_XCODE_PROJECT",
|
|
"CI_XCODE_SCHEME",
|
|
"CI_XCODEBUILD_ACTION",
|
|
]
|
|
|
|
return requiredKeys.isSubset(of: environment.keys)
|
|
}
|
|
}
|