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

fix: correct typos in a bunch of variables #209

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/SWBCore/BuildRuleCondition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ public final class BuildRuleFileNameCondition: BuildRuleCondition {
/// Evaluates the condition against the candidate, returning a `.normal` match priority level if its file name matches any of the patterns, or `.none` if there is no match.
public func match(_ candidate: FileToBuild, _ scope: MacroEvaluationScope) -> BuildRuleConditionMatchPriority {
for namePattern in namePatterns {
let evalutedNamePattern = scope.evaluate(namePattern)
let evaluatedNamePattern = scope.evaluate(namePattern)
do {
if try fnmatch(pattern: evalutedNamePattern, input: candidate.absolutePath.str) {
if try fnmatch(pattern: evaluatedNamePattern, input: candidate.absolutePath.str) {
return .normal
}
} catch {
Expand Down
16 changes: 8 additions & 8 deletions Sources/SWBCore/DependencyResolution.swift
Original file line number Diff line number Diff line change
Expand Up @@ -739,19 +739,19 @@ extension SpecializationParameters {
let shouldImposePlatform = settings.enableTargetPlatformSpecialization

var imposedSupportedPlatforms: [String]?
let specializatonIsSupported: Bool
let specializationIsSupported: Bool
if let specializedSupportedPlatforms = specialization.supportedPlatforms {
// If `SDKROOT` is automatic, specialize supported platforms, but only if there is a non-empty intersection with the current value.
specializatonIsSupported = !Set(supportedPlatforms).intersection(specializedSupportedPlatforms).isEmpty
imposedSupportedPlatforms = specializatonIsSupported && shouldImposePlatform ? specialization.supportedPlatforms : nil
specializationIsSupported = !Set(supportedPlatforms).intersection(specializedSupportedPlatforms).isEmpty
imposedSupportedPlatforms = specializationIsSupported && shouldImposePlatform ? specialization.supportedPlatforms : nil
} else {
imposedSupportedPlatforms = nil
specializatonIsSupported = false
specializationIsSupported = false
}

let imposedPlatform: Platform?
if shouldImposePlatform {
if specializatonIsSupported {
if specializationIsSupported {
imposedPlatform = specialization.platform
} else {
// There may be an existing `SUPPORTED_PLATFORMS` override in the parameters passed down by the client, so we want to make sure to provide our own, even if it might not be strictly necessary.
Expand Down Expand Up @@ -798,7 +798,7 @@ extension SpecializationParameters {
// iOS targets get SUPPORTS_MACCATALYST by default, but SDKROOT=auto targets get an inconsistent view.

let isHostTool = settings.productType?.conformsTo(identifier: "com.apple.product-type.tool.host-build") == true
if specializatonIsSupported && !isHostTool {
if specializationIsSupported && !isHostTool {
imposedSdkVariant = specialization.sdkVariant ?? imposedPlatform?.defaultSDKVariant
} else {
imposedSdkVariant = imposedPlatform?.defaultSDKVariant
Expand All @@ -814,7 +814,7 @@ extension SpecializationParameters {
let initialFilteredSpecialization = SpecializationParameters(source: .synthesized, platform: imposedPlatform, sdkVariant: imposedSdkVariant, supportedPlatforms: imposedSupportedPlatforms, toolchain: nil, canonicalNameSuffix: nil)
let initialSettings = buildRequestContext.getCachedSettings(initialFilteredSpecialization.imposed(on: parameters, workspaceContext: workspaceContext), target: forTarget)
let specializationSDKOptions = initialSettings.globalScope.evaluate(BuiltinMacros.SPECIALIZATION_SDK_OPTIONS)
if specializatonIsSupported {
if specializationIsSupported {
// If specialization explicitly requires public, but the target itself requires internal, emit an error.
if let sdkSuffixFromSpecialization = specialization.canonicalNameSuffix, sdkSuffixFromSpecialization.isEmpty, !specializationSDKOptions.isEmpty {
let specializationSuffix: String
Expand Down Expand Up @@ -869,7 +869,7 @@ extension SpecializationParameters {

// If we are imposing a platform, we also need to impose the toolchain, but skip it if the explicit setting already matches what we would impose.
let imposedToolchain: [String]?
if shouldImposePlatform && specializatonIsSupported {
if shouldImposePlatform && specializationIsSupported {
let specializationWithoutToolchainImposition = SpecializationParameters(source: .synthesized, platform: imposedPlatform, sdkVariant: imposedSdkVariant, supportedPlatforms: imposedSupportedPlatforms, toolchain: nil, canonicalNameSuffix: imposedCanonicalNameSuffix)
let settingsWithToolchainImposition = buildRequestContext.getCachedSettings(specializationWithoutToolchainImposition.imposed(on: parameters, workspaceContext: workspaceContext), target: forTarget)
let configuredToolchains = settingsWithToolchainImposition.toolchains.map({ $0.identifier })
Expand Down