@@ -55,16 +55,8 @@ struct FrameworkBuilder {
55
55
setCarthage: Bool ,
56
56
podInfo: CocoaPodUtils . PodInfo ) -> ( [ URL ] , URL ? ) {
57
57
let fileManager = FileManager . default
58
- let outputDir = fileManager. temporaryDirectory ( withName: " frameworks_being_built " )
59
58
let logsDir = logsOutputDir ?? fileManager. temporaryDirectory ( withName: " build_logs " )
60
59
do {
61
- // Remove the compiled frameworks directory, this isn't the cache we're using.
62
- if fileManager. directoryExists ( at: outputDir) {
63
- try fileManager. removeItem ( at: outputDir)
64
- }
65
-
66
- try fileManager. createDirectory ( at: outputDir, withIntermediateDirectories: true )
67
-
68
60
// Create our logs directory if it doesn't exist.
69
61
if !fileManager. directoryExists ( at: logsDir) {
70
62
try fileManager. createDirectory ( at: logsDir, withIntermediateDirectories: true )
@@ -74,13 +66,12 @@ struct FrameworkBuilder {
74
66
}
75
67
76
68
if dynamicFrameworks {
77
- return ( buildDynamicFrameworks ( withName: framework, logsDir: logsDir, outputDir : outputDir ) ,
69
+ return ( buildDynamicFrameworks ( withName: framework, logsDir: logsDir) ,
78
70
nil )
79
71
} else {
80
72
return buildStaticFrameworks (
81
73
withName: framework,
82
74
logsDir: logsDir,
83
- outputDir: outputDir,
84
75
setCarthage: setCarthage,
85
76
podInfo: podInfo
86
77
)
@@ -312,8 +303,7 @@ struct FrameworkBuilder {
312
303
/// - Parameter logsDir: The path to the directory to place build logs.
313
304
/// - Returns: A path to the newly compiled frameworks (with any included Resources embedded).
314
305
private func buildDynamicFrameworks( withName framework: String ,
315
- logsDir: URL ,
316
- outputDir: URL ) -> [ URL ] {
306
+ logsDir: URL ) -> [ URL ] {
317
307
// xcframework doesn't lipo things together but accepts fat frameworks for one target.
318
308
// We group architectures here to deal with this fact.
319
309
var thinFrameworks = [ URL] ( )
@@ -340,7 +330,6 @@ struct FrameworkBuilder {
340
330
/// - Returns: A path to the newly compiled framework, and the Resource URL.
341
331
private func buildStaticFrameworks( withName framework: String ,
342
332
logsDir: URL ,
343
- outputDir: URL ,
344
333
setCarthage: Bool ,
345
334
podInfo: CocoaPodUtils . PodInfo ) -> ( [ URL ] , URL ) {
346
335
// Build every architecture and save the locations in an array to be assembled.
@@ -350,13 +339,6 @@ struct FrameworkBuilder {
350
339
// Create the framework directory in the filesystem for the thin archives to go.
351
340
let fileManager = FileManager . default
352
341
let frameworkName = FrameworkBuilder . frameworkBuildName ( framework)
353
- let frameworkDir = outputDir. appendingPathComponent ( " \( frameworkName) .framework " )
354
- do {
355
- try fileManager. createDirectory ( at: frameworkDir, withIntermediateDirectories: true )
356
- } catch {
357
- fatalError ( " Could not create framework directory while building framework \( frameworkName) . " +
358
- " \( error) " )
359
- }
360
342
361
343
guard let anyPlatform = targetPlatforms. first,
362
344
let archivePath = slicedFrameworks [ anyPlatform] else {
@@ -410,7 +392,6 @@ struct FrameworkBuilder {
410
392
let moduleMapContents = moduleMapContentsTemplate. get ( umbrellaHeader: umbrellaHeader)
411
393
let frameworks = groupFrameworks ( withName: frameworkName,
412
394
isCarthage: setCarthage,
413
- fromFolder: frameworkDir,
414
395
slicedFrameworks: slicedFrameworks,
415
396
moduleMapContents: moduleMapContents)
416
397
@@ -542,18 +523,13 @@ struct FrameworkBuilder {
542
523
/// Groups slices for each platform into a minimal set of frameworks.
543
524
/// - Parameter withName: The framework name.
544
525
/// - Parameter isCarthage: Name the temp directory differently for Carthage.
545
- /// - Parameter fromFolder: The almost complete framework folder. Includes Headers, Info.plist,
546
- /// and Resources.
547
526
/// - Parameter slicedFrameworks: All the frameworks sliced by platform.
548
527
/// - Parameter moduleMapContents: Module map contents for all frameworks in this pod.
549
528
private func groupFrameworks( withName framework: String ,
550
529
isCarthage: Bool ,
551
- fromFolder: URL ,
552
530
slicedFrameworks: [ TargetPlatform : URL ] ,
553
531
moduleMapContents: String ) -> ( [ URL ] ) {
554
532
let fileManager = FileManager . default
555
-
556
- // Create a `.framework` for each of the thinArchives using the `fromFolder` as the base.
557
533
let platformFrameworksDir = fileManager. temporaryDirectory (
558
534
withName: isCarthage ? " carthage_frameworks " : " platform_frameworks "
559
535
)
0 commit comments