Skip to content

Commit a353ec9

Browse files
authored
Merge pull request #1448 from willpaceley/willpaceley/nsviewgesturerecognizerisexclusive-build-setting
Add INFOPLIST_KEY_NSViewGestureRecognizerIsExclusive build setting
2 parents 861411f + f22ad17 commit a353ec9

4 files changed

Lines changed: 21 additions & 5 deletions

File tree

Sources/SWBCore/Settings/BuiltinMacros.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,6 +1354,7 @@ public final class BuiltinMacros {
13541354
public static let INFOPLIST_KEY_LSUIElement = BuiltinMacros.declareBooleanMacro("INFOPLIST_KEY_LSUIElement")
13551355
public static let INFOPLIST_KEY_NSMainNibFile = BuiltinMacros.declareStringMacro("INFOPLIST_KEY_NSMainNibFile")
13561356
public static let INFOPLIST_KEY_NSMainStoryboardFile = BuiltinMacros.declareStringMacro("INFOPLIST_KEY_NSMainStoryboardFile")
1357+
public static let INFOPLIST_KEY_NSViewGestureRecognizerIsExclusive = BuiltinMacros.declareBooleanMacro("INFOPLIST_KEY_NSViewGestureRecognizerIsExclusive")
13571358

13581359
// Info.plist Keys - iOS and Derived Platforms
13591360
public static let INFOPLIST_KEY_UILaunchScreen_Generation = BuiltinMacros.declareBooleanMacro("INFOPLIST_KEY_UILaunchScreen_Generation")
@@ -2679,6 +2680,7 @@ public final class BuiltinMacros {
26792680
INFOPLIST_KEY_LSUIElement,
26802681
INFOPLIST_KEY_NSMainNibFile,
26812682
INFOPLIST_KEY_NSMainStoryboardFile,
2683+
INFOPLIST_KEY_NSViewGestureRecognizerIsExclusive,
26822684

26832685
// Info.plist Keys - iOS and Derived Platforms
26842686
INFOPLIST_KEY_UILaunchScreen_Generation,

Sources/SWBCore/Specs/CoreBuildSystem.xcspec

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4432,6 +4432,16 @@ When this setting is enabled:
44324432
DisplayName = "AppKit Main Storyboard File Base Name";
44334433
Description = "When `GENERATE_INFOPLIST_FILE` is enabled, sets the value of the [NSMainStoryboardFile](https://developer.apple.com/documentation/bundleresources/information-property-list/nsmainstoryboardfile) key in the `Info.plist` file to the value of this build setting.";
44344434
},
4435+
{
4436+
Name = INFOPLIST_KEY_NSViewGestureRecognizerIsExclusive;
4437+
Type = Boolean;
4438+
Category = "Info.plist Values";
4439+
ConditionFlavors = (
4440+
sdk,
4441+
);
4442+
DisplayName = "View Gesture Recognizer Is Exclusive";
4443+
Description = "When `GENERATE_INFOPLIST_FILE` is enabled, sets the value of the [NSViewGestureRecognizerIsExclusive](https://developer.apple.com/documentation/bundleresources/information-property-list/nsviewgesturerecognizerisexclusive) key in the `Info.plist` file to the value of this build setting.";
4444+
},
44354445

44364446
// Info.plist Keys - iOS and Derived Platforms
44374447
{

Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ public final class InfoPlistProcessorTaskAction: TaskAction
755755
"LSUIElement",
756756
"NSMainNibFile",
757757
"NSMainStoryboardFile",
758+
"NSViewGestureRecognizerIsExclusive",
758759

759760
// iOS and Derived
760761

Tests/SWBCoreTests/SpecRegistryTests.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ import SWBUtil
313313
let unreachableURLs: [(String, String)]
314314
#if canImport(Darwin)
315315
if checkInfoPlistKeyURLReachability {
316-
unreachableURLs = try await withThrowingTaskGroup(of: (String, String).self) { group in
316+
unreachableURLs = try await withThrowingTaskGroup(of: (String, String)?.self) { group in
317317
for keyName in Set(infoPlistKeyOptions.map({ $0.name.hasPrefix("INFOPLIST_KEY_") ? String($0.name.dropFirst("INFOPLIST_KEY_".count)) : (legacyKeyMappings[$0.name] ?? $0.name) })).sorted() {
318318
switch keyName {
319319
case "UISupportedInterfaceOrientations_iPhone", "UISupportedInterfaceOrientations_iPad":
@@ -322,9 +322,12 @@ import SWBUtil
322322
case "UIApplicationSceneManifest_Generation", "UILaunchScreen_Generation":
323323
// These map to UIApplicationSceneManifest and UILaunchScreen, which are dictionaries.
324324
continue
325-
case "MetalCaptureEnabled", "NSBluetoothWhileInUseUsageDescription", "NSFileProviderPresenceUsageDescription", "NSFocusStatusUsageDescription", "NSSystemExtensionUsageDescription", "NSVoIPUsageDescription", "OSBundleUsageDescription":
325+
case "MetalCaptureEnabled", "NSBluetoothWhileInUseUsageDescription", "NSFileProviderPresenceUsageDescription":
326326
// rdar://91269820 (Missing documentation for some Info.plist keys which are directly supported by Xcode)
327327
continue
328+
case "WKSupportsLiveActivityLaunchAttributeTypes":
329+
// rdar://179234654 (Missing documentation for WKSupportsLiveActivityLaunchAttributeTypes Info.plist key)
330+
continue
328331
default:
329332
break
330333
}
@@ -334,14 +337,14 @@ import SWBUtil
334337
group.addTask {
335338
let (_, response) = try await URLSession.shared.data(from: #require(URL(string: url)))
336339
guard let response = response as? HTTPURLResponse, response.statusCode == 200 else {
337-
throw StubError.error("Network failure")
340+
return (String(keyName), url)
338341
}
339342

340-
return (String(keyName), url)
343+
return nil
341344
}
342345
}
343346

344-
return try await group.collect()
347+
return try await group.collect().compactMap { $0 }
345348
}
346349
} else {
347350
unreachableURLs = []

0 commit comments

Comments
 (0)