Skip to content

Commit 11f33ed

Browse files
committed
Upstream: Log a deprecated API warning for use of the UIRequiresFullScreen info.plist key when linked on or after v26 releases
rdar://142654612
1 parent 17b53a4 commit 11f33ed

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,35 +1451,49 @@ public final class InfoPlistProcessorTaskAction: TaskAction
14511451
case iOS
14521452
case tvOS
14531453
case watchOS
1454+
case visionOS = "xrOS" // must be "xrOS" as it's compared against Platform.familyName
14541455
}
14551456

14561457
/// The values of the key that are deprecated, if only specific values are deprecated. `nil` indicates the key as a whole is deprecated.
14571458
let values: [PropertyListItem]?
14581459

1459-
/// An infix to display in the "use (alternative) instead" portion of the deprecation message.
1460-
let alternate: String
1460+
enum MoreInfo {
1461+
/// An infix to display in the "use (alternative) instead" portion of the deprecation message.
1462+
case alternate(String)
1463+
1464+
case ignored(String)
1465+
}
1466+
1467+
let moreInfo: MoreInfo
14611468

14621469
/// Mapping of platforms and the version of that platform beginning in which the deprecation warning should be shown.
14631470
///
14641471
/// If the version is empty, the warning will always be shown for that platform.
14651472
/// If there is no version value present for a platform at all, no warning will ever be shown for that platform.
14661473
let deprecationVersions: [DeprecationPlatform: Version]
14671474

1468-
init(values: [PropertyListItem]? = nil, alternate: String, deprecationVersions: [DeprecationPlatform: Version]) {
1475+
init(values: [PropertyListItem]? = nil, moreInfo: MoreInfo, deprecationVersions: [DeprecationPlatform: Version]) {
14691476
self.values = values
1470-
self.alternate = alternate
1477+
self.moreInfo = moreInfo
14711478
self.deprecationVersions = deprecationVersions
14721479
}
14731480
}
14741481

14751482
let plistKeyDeprecationInfo: [PropertyListKeyPath: DeprecationInfo] = [
1476-
"UILaunchImages": .init(alternate: "launch storyboards", deprecationVersions: [.iOS: Version(), .tvOS: Version(13)]),
1477-
"CLKComplicationSupportedFamilies": .init(alternate: "the ClockKit complications API", deprecationVersions: [.watchOS: Version(7)]),
1478-
PropertyListKeyPath(.dict(.equal("NSAppTransportSecurity")), .dict(.equal("NSExceptionDomains")), .dict(.any), .any(.equal("NSExceptionMinimumTLSVersion"))): .init(values: [.plString("TLSv1.0"), .plString("TLSv1.1")], alternate: "TLSv1.2 or TLSv1.3", deprecationVersions: [
1483+
"UILaunchImages": .init(moreInfo: .alternate("launch storyboards"), deprecationVersions: [.iOS: Version(), .tvOS: Version(13)]),
1484+
"CLKComplicationSupportedFamilies": .init(moreInfo: .alternate("the ClockKit complications API"), deprecationVersions: [.watchOS: Version(7)]),
1485+
PropertyListKeyPath(.dict(.equal("NSAppTransportSecurity")), .dict(.equal("NSExceptionDomains")), .dict(.any), .any(.equal("NSExceptionMinimumTLSVersion"))): .init(values: [.plString("TLSv1.0"), .plString("TLSv1.1")], moreInfo: .alternate("TLSv1.2 or TLSv1.3"), deprecationVersions: [
14791486
.macOS: Version(12),
14801487
.iOS: Version(15),
14811488
.tvOS: Version(15),
14821489
.watchOS: Version(8)
1490+
]),
1491+
"UIRequiresFullScreen": .init(moreInfo: .ignored("See the UIRequiresFullScreen documentation for more details."), deprecationVersions: [
1492+
.macOS: Version(16),
1493+
.iOS: Version(19),
1494+
.tvOS: Version(19),
1495+
.watchOS: Version(12),
1496+
.visionOS: Version(3),
14831497
])
14841498
]
14851499

@@ -1497,11 +1511,19 @@ public final class InfoPlistProcessorTaskAction: TaskAction
14971511
prefixPart = "'\(item.actualKeyPath.joined(separator: "' => '"))'"
14981512
}
14991513

1514+
let suffixPart: String
1515+
switch info.moreInfo {
1516+
case let .alternate(alternate):
1517+
suffixPart = ", use \(alternate) instead."
1518+
case let .ignored(ignored):
1519+
suffixPart = " and will be ignored in a future release. \(ignored)"
1520+
}
1521+
15001522
let message: String
15011523
if deprecationVersion > Version() {
1502-
message = "\(prefixPart) has been deprecated starting in \(context.platform?.familyDisplayName ?? "") \(deprecationVersion.canonicalDeploymentTargetForm.description), use \(info.alternate) instead."
1524+
message = "\(prefixPart) has been deprecated starting in \(context.platform?.familyDisplayName ?? "") \(deprecationVersion.canonicalDeploymentTargetForm.description)\(suffixPart)"
15031525
} else {
1504-
message = "\(prefixPart) has been deprecated, use \(info.alternate) instead."
1526+
message = "\(prefixPart) has been deprecated\(suffixPart)"
15051527
}
15061528

15071529
if let deploymentTarget = deploymentTarget, deploymentTarget >= deprecationVersion {

0 commit comments

Comments
 (0)