Make privacy manifest Apple-only via new resources target; add visionOS/macCatalyst

- Introduce CryptoSwiftResources target holding PrivacyInfo.xcprivacy.
- Conditionally depend on it for Apple platforms (iOS, macOS, tvOS, watchOS,
  macCatalyst, visionOS).
- Avoid SwiftPM resource bundle accessor and Foundation on non-Apple platforms.
- Add placeholder source to satisfy SwiftPM and move PrivacyInfo to new target.
This commit is contained in:
Marcin Krzyzanowski
2026-04-22 00:19:36 +02:00
parent 7351b5c2da
commit 17e6b20276
3 changed files with 34 additions and 1 deletions
+18 -1
View File
@@ -2,6 +2,15 @@
import PackageDescription
let applePlatforms: [Platform] = [
.iOS,
.macOS,
.tvOS,
.watchOS,
.macCatalyst,
.custom("visionos")
]
let package = Package(
name: "CryptoSwift",
platforms: [
@@ -14,7 +23,15 @@ let package = Package(
)
],
targets: [
.target(name: "CryptoSwift", resources: [.copy("PrivacyInfo.xcprivacy")]),
// Keep the privacy manifest out of non-Apple builds so SwiftPM doesn't pull in
// Foundation just to synthesize a resource bundle accessor.
.target(name: "CryptoSwiftResources", resources: [.copy("PrivacyInfo.xcprivacy")]),
.target(
name: "CryptoSwift",
dependencies: [
.target(name: "CryptoSwiftResources", condition: .when(platforms: applePlatforms))
]
),
.testTarget(name: "CryptoSwiftTests", dependencies: ["CryptoSwift"])
],
swiftLanguageVersions: [.v5]
+16
View File
@@ -0,0 +1,16 @@
//
// CryptoSwift
//
// Copyright (C) 2014-2025 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
// This software is provided 'as-is', without any express or implied warranty.
//
// In no event will the authors be held liable for any damages arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
//
// - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
// - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
// - This notice may not be removed or altered from any source or binary distribution.
//
// Intentionally empty. SwiftPM requires at least one source file for a Swift target.