@@ -664,14 +664,17 @@ struct ZipBuilder {
664664
665665 // Create the temporary directory we'll be storing the build/assembled frameworks in, and remove
666666 // the Resources directory if it already exists.
667- let tempDir = fileManager. temporaryDirectory ( withName: " all_frameworks " )
667+ let binaryZipDir = fileManager. temporaryDirectory ( withName: " binary_zip " )
668+ let binaryCarthageDir = fileManager. temporaryDirectory ( withName: " binary_carthage " )
668669 do {
669- try fileManager. createDirectory ( at: tempDir,
670+ try fileManager. createDirectory ( at: binaryZipDir,
671+ withIntermediateDirectories: true ,
672+ attributes: nil )
673+ try fileManager. createDirectory ( at: binaryCarthageDir,
670674 withIntermediateDirectories: true ,
671675 attributes: nil )
672676 } catch {
673- fatalError ( " Cannot create temporary directory to store frameworks from the " +
674- " full build: \( error) " )
677+ fatalError ( " Cannot create temporary directory to store binary frameworks: \( error) " )
675678 }
676679
677680 // Loop through each pod folder and check if the frameworks already exist, or they need to be
@@ -710,19 +713,27 @@ struct ZipBuilder {
710713 // Copy each of the frameworks to a known temporary directory and store the location.
711714 for framework in podInfo. binaryFrameworks {
712715 // Copy it to the temporary directory and save it to our list of frameworks.
713- let copiedLocation = tempDir. appendingPathComponent ( framework. lastPathComponent)
716+ let zipLocation = binaryZipDir. appendingPathComponent ( framework. lastPathComponent)
717+ let carthageLocation =
718+ binaryCarthageDir. appendingPathComponent ( framework. lastPathComponent)
714719
715720 // Remove the framework if it exists since it could be out of date.
716- fileManager. removeIfExists ( at: copiedLocation)
721+ fileManager. removeIfExists ( at: zipLocation)
722+ fileManager. removeIfExists ( at: carthageLocation)
717723 do {
718- try fileManager. copyItem ( at: framework, to: copiedLocation)
724+ try fileManager. copyItem ( at: framework, to: zipLocation)
725+ try fileManager. copyItem ( at: framework, to: carthageLocation)
719726 } catch {
720- fatalError ( " Cannot copy framework at \( framework) to \( copiedLocation ) while " +
727+ fatalError ( " Cannot copy framework at \( framework) while " +
721728 " attempting to generate frameworks. \( error) " )
722729 }
723- frameworks. append ( copiedLocation)
724- // Same while both closed source and Carthage don't support xcframeworks.
725- carthageFrameworks. append ( copiedLocation)
730+ frameworks. append ( zipLocation)
731+
732+ CarthageUtils . generatePlistContents (
733+ forName: framework. lastPathComponent. components ( separatedBy: " . " ) . first!,
734+ to: carthageLocation
735+ )
736+ carthageFrameworks. append ( carthageLocation)
726737 }
727738 }
728739 toInstall [ podName] = frameworks
0 commit comments