-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
build: define build path structure in BuildSystemProvider.Kind #8298
base: main
Are you sure you want to change the base?
build: define build path structure in BuildSystemProvider.Kind #8298
Conversation
There are a few places that check the BuildSystemProvider.Kind is Xcode to determine the build directory structure. With the upcoming Swift Build integration, which uses the "Xcode path" structure, we would need to update all instances to check the two build system provider kinds. Add an extension on the BuildSystemProvider.Kind that create a boolean variable `useXcodeBuildEngine`, which determines whether the build system should use the xcode path structure or not. In addition, update the code that requires a "isXcodeBuildSystemEnabled" to return this build system provider variable. This will hopefully help address swiftlang#8272 when swiftlang#8271, where it adds `case .swiftbuild: return true` to the `useXcodeBuildEngine`
87d8887
to
a926008
Compare
@swift-ci please test |
@@ -168,6 +168,14 @@ public struct BuildSystemProvider { | |||
} | |||
} | |||
|
|||
extension BuildSystemProvider.Kind { | |||
public var useXcodeBuildEngine: Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be spelled as usesXcodeBuildEngine
to conform to the API Design Guidelines: https://www.swift.org/documentation/api-design-guidelines/#strive-for-fluent-usage
Uses of Boolean methods and properties should read as assertions about the receiver when the use is nonmutating, e.g.
x.isEmpty
,line1.intersects(line2)
.
public var useXcodeBuildEngine: Bool { | |
public var usesXcodeBuildEngine: Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if usesXcodeBuildEngine
is more readable than == .xcode
. If this were more than an enum with two cases (or there were plans to make it more complex in the future), one might argue that the check is complex enough, but for an enum as trivial as this I don't see much benefit.
There are a few places that check the BuildSystemProvider.Kind is Xcode to determine the build directory structure. With the upcoming Swift Build integration, which uses the "Xcode path" structure, we would need to update all instances to check the two build system provider kinds.
Add an extension on the BuildSystemProvider.Kind that create a boolean variable
useXcodeBuildEngine
, which determines whether the build system should use the xcode path structure or not. In addition, update the code that requires a "isXcodeBuildSystemEnabled" to return this build system provider variable.This will hopefully help address #8272 when #8271 is merged and added
case .swiftbuild: return true
to theuseXcodeBuildEngine