@@ -277,15 +277,12 @@ struct FrameworkBuilder {
277
277
}
278
278
279
279
// TODO: Automatically get the right name.
280
- /// The dynamic framework name is different from the pod name when the module_name
280
+ /// The module name is different from the pod name when the module_name
281
281
/// specifier is used in the podspec.
282
282
///
283
- /// - Parameter framework: The name of the framework to be built.
284
- /// - Returns: The corresponding dynamic framework name.
285
- private func frameworkBuildName( _ framework: String ) -> String {
286
- if !dynamicFrameworks {
287
- return framework
288
- }
283
+ /// - Parameter framework: The name of the pod to be built.
284
+ /// - Returns: The corresponding framework/module name.
285
+ private static func frameworkBuildName( _ framework: String ) -> String {
289
286
switch framework {
290
287
case " PromisesObjC " :
291
288
return " FBLPromises "
@@ -311,10 +308,12 @@ struct FrameworkBuilder {
311
308
var thinFrameworks = [ URL] ( )
312
309
for targetPlatform in TargetPlatform . allCases {
313
310
let buildDir = projectDir. appendingPathComponent ( targetPlatform. buildName)
314
- let slicedFramework = buildSlicedFramework ( withName: framework,
315
- targetPlatform: targetPlatform,
316
- buildDir: buildDir,
317
- logRoot: logsDir)
311
+ let slicedFramework = buildSlicedFramework (
312
+ withName: FrameworkBuilder . frameworkBuildName ( framework) ,
313
+ targetPlatform: targetPlatform,
314
+ buildDir: buildDir,
315
+ logRoot: logsDir
316
+ )
318
317
thinFrameworks. append ( slicedFramework)
319
318
}
320
319
return thinFrameworks
@@ -339,18 +338,19 @@ struct FrameworkBuilder {
339
338
340
339
// Create the framework directory in the filesystem for the thin archives to go.
341
340
let fileManager = FileManager . default
342
- let frameworkDir = outputDir. appendingPathComponent ( " \( framework) .framework " )
341
+ let frameworkName = FrameworkBuilder . frameworkBuildName ( framework)
342
+ let frameworkDir = outputDir. appendingPathComponent ( " \( frameworkName) .framework " )
343
343
do {
344
344
try fileManager. createDirectory ( at: frameworkDir, withIntermediateDirectories: true )
345
345
} catch {
346
- fatalError ( " Could not create framework directory while building framework \( framework ) . " +
346
+ fatalError ( " Could not create framework directory while building framework \( frameworkName ) . " +
347
347
" \( error) " )
348
348
}
349
349
350
350
// Find the location of the public headers, any platform will do.
351
351
guard let anyPlatform = targetPlatforms. first,
352
352
let archivePath = slicedFrameworks [ anyPlatform] else {
353
- fatalError ( " Could not get a path to an archive to fetch headers in \( framework ) . " )
353
+ fatalError ( " Could not get a path to an archive to fetch headers in \( frameworkName ) . " )
354
354
}
355
355
356
356
// Get the framework Headers directory. On macOS, it's a symbolic link.
@@ -401,7 +401,7 @@ struct FrameworkBuilder {
401
401
" \( headersDestination) : \( error) " )
402
402
}
403
403
// Add an Info.plist. Required by Carthage and SPM binary xcframeworks.
404
- CarthageUtils . generatePlistContents ( forName: framework ,
404
+ CarthageUtils . generatePlistContents ( forName: frameworkName ,
405
405
withVersion: podInfo. version,
406
406
to: frameworkDir)
407
407
@@ -417,10 +417,10 @@ struct FrameworkBuilder {
417
417
framework] )
418
418
419
419
guard let moduleMapContentsTemplate = podInfo. moduleMapContents else {
420
- fatalError ( " Module map contents missing for framework \( framework ) " )
420
+ fatalError ( " Module map contents missing for framework \( frameworkName ) " )
421
421
}
422
422
let moduleMapContents = moduleMapContentsTemplate. get ( umbrellaHeader: umbrellaHeader)
423
- let frameworks = groupFrameworks ( withName: framework ,
423
+ let frameworks = groupFrameworks ( withName: frameworkName ,
424
424
isCarthage: setCarthage,
425
425
fromFolder: frameworkDir,
426
426
slicedFrameworks: slicedFrameworks,
@@ -650,7 +650,8 @@ struct FrameworkBuilder {
650
650
frameworks: [ URL ] ,
651
651
xcframeworksDir: URL ,
652
652
resourceContents: URL ? ) -> URL {
653
- let xcframework = xcframeworksDir. appendingPathComponent ( name + " .xcframework " )
653
+ let xcframework = xcframeworksDir
654
+ . appendingPathComponent ( frameworkBuildName ( name) + " .xcframework " )
654
655
655
656
// The arguments for the frameworks need to be separated.
656
657
var frameworkArgs : [ String ] = [ ]
0 commit comments