File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
ReleaseTooling/Sources/ZipBuilder Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -635,6 +635,34 @@ struct FrameworkBuilder {
635
635
" \( framework) : \( error) " )
636
636
}
637
637
638
+ // Move any privacy manifest-containing resource bundles into the
639
+ // platform framework.
640
+ try ? fileManager. contentsOfDirectory (
641
+ at: frameworkPath. deletingLastPathComponent ( ) ,
642
+ includingPropertiesForKeys: nil
643
+ )
644
+ . filter { $0. pathExtension == " bundle " }
645
+ // TODO(ncooke3): Once the zip is built with Xcode 15, the following
646
+ // `filter` can be removed. The following block exists to preserve
647
+ // how resources (e.g. like FIAM's) are packaged for use in Xcode 14.
648
+ . filter { bundleURL in
649
+ let dirEnum = fileManager. enumerator ( atPath: bundleURL. path)
650
+ var containsPrivacyManifest = false
651
+ while let relativeFilePath = dirEnum? . nextObject ( ) as? String {
652
+ if relativeFilePath. hasSuffix ( " PrivacyInfo.xcprivacy " ) {
653
+ containsPrivacyManifest = true
654
+ break
655
+ }
656
+ }
657
+ return containsPrivacyManifest
658
+ }
659
+ // Bundles are moved rather than copied to prevent them from being
660
+ // packaged in a `Resources` directory at the root of the xcframework.
661
+ . forEach { try ! fileManager. moveItem (
662
+ at: $0,
663
+ to: platformFrameworkDir. appendingPathComponent ( $0. lastPathComponent)
664
+ ) }
665
+
638
666
// Headers from slice
639
667
do {
640
668
let headersSrc : URL = frameworkPath. appendingPathComponent ( " Headers " )
You can’t perform that action at this time.
0 commit comments