@@ -335,18 +335,22 @@ struct ZipBuilder {
335
335
/// - frameworkLocations: A dictionary containing the pod name as the key and a location to
336
336
/// the compiled frameworks.
337
337
/// - ignoreFrameworks: A list of Pod
338
+ /// - Returns: The filenames of the frameworks that were copied.
338
339
/// - Throws: Various FileManager errors in case the copying fails, or an error if the framework
339
340
// doesn't exist in `frameworkLocations`.
340
341
private func copyFrameworks( fromPods installedPods: [ CocoaPodUtils . PodInfo ] ,
341
342
toDirectory dir: URL ,
342
343
frameworkLocations: [ String : [ URL ] ] ,
343
344
podsToIgnore: [ String ] ,
344
- foldersToIgnore: [ String ] ) throws {
345
+ foldersToIgnore: [ String ] ) throws -> [ String ] {
345
346
let fileManager = FileManager . default
346
347
if !fileManager. directoryExists ( at: dir) {
347
348
try fileManager. createDirectory ( at: dir, withIntermediateDirectories: false , attributes: nil )
348
349
}
349
350
351
+ // Keep track of the names of the frameworks copied over.
352
+ var copiedFrameworkNames : [ String ] = [ ]
353
+
350
354
// Loop through each InstalledPod item and get the name so we can fetch the framework and copy
351
355
// it to the destination directory.
352
356
for pod in installedPods {
@@ -375,8 +379,11 @@ struct ZipBuilder {
375
379
376
380
let destination = dir. appendingPathComponent ( frameworkName)
377
381
try fileManager. copyItem ( at: framework, to: destination)
382
+ copiedFrameworkNames. append ( frameworkName. replacingOccurrences ( of: " .framework " , with: " " ) )
378
383
}
379
384
}
385
+
386
+ return copiedFrameworkNames
380
387
}
381
388
382
389
/// Copies required files from the Firebase pod (i.e. `Firebase.h`, `module.modulemap`, etc) into
@@ -525,14 +532,12 @@ struct ZipBuilder {
525
532
let installedPods = CocoaPodUtils . installPods ( [ pod] , inDir: projectDir, customSpecRepos: customSpecRepos)
526
533
// Copy the frameworks into the proper product directory.
527
534
let productDir = rootZipDir. appendingPathComponent ( pod. rawValue)
528
- try copyFrameworks ( fromPods: installedPods,
529
- toDirectory: productDir,
530
- frameworkLocations: builtFrameworks,
531
- podsToIgnore: podsToIgnore,
532
- foldersToIgnore: pod. duplicateFrameworksToRemove ( ) )
533
-
534
- // Return the names of all the installed frameworks.
535
- let namedFrameworks = installedPods. map { $0. name }
535
+ let namedFrameworks = try copyFrameworks ( fromPods: installedPods,
536
+ toDirectory: productDir,
537
+ frameworkLocations: builtFrameworks,
538
+ podsToIgnore: podsToIgnore,
539
+ foldersToIgnore: pod. duplicateFrameworksToRemove ( ) )
540
+
536
541
let copiedFrameworks = namedFrameworks. filter {
537
542
// Only return the frameworks that aren't contained in the "podsToIgnore" array, aren't an
538
543
// interop framework (since they don't compile to frameworks), or the Firebase pod itself.
0 commit comments