Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bkhouri
Copy link
Contributor

@bkhouri bkhouri commented Feb 19, 2025

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 the useXcodeBuildEngine

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`
@bkhouri bkhouri force-pushed the t/main/gh8272_rdar_144023142_partial_fix branch from 87d8887 to a926008 Compare February 20, 2025 04:58
@bkhouri bkhouri requested a review from cmcgee1024 February 20, 2025 04:59
@bkhouri
Copy link
Contributor Author

bkhouri commented Feb 20, 2025

@swift-ci please test

@bkhouri bkhouri enabled auto-merge (squash) February 20, 2025 16:25
@@ -168,6 +168,14 @@ public struct BuildSystemProvider {
}
}

extension BuildSystemProvider.Kind {
public var useXcodeBuildEngine: Bool {
Copy link
Contributor

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).

Suggested change
public var useXcodeBuildEngine: Bool {
public var usesXcodeBuildEngine: Bool {

Copy link
Contributor

@MaxDesiatov MaxDesiatov left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants