@@ -40,7 +40,8 @@ enum CocoaPodUtils {
40
40
}
41
41
42
42
/// Information associated with an installed pod.
43
- struct PodInfo {
43
+ /// This is a class so that moduleMapContents can be updated via reference.
44
+ class PodInfo {
44
45
/// The version of the generated pod.
45
46
let version : String
46
47
@@ -49,6 +50,36 @@ enum CocoaPodUtils {
49
50
50
51
/// The location of the pod on disk.
51
52
let installedLocation : URL
53
+
54
+ /// Source pod flag.
55
+ let isSourcePod : Bool
56
+
57
+ /// Binary frameworks in this pod.
58
+ let binaryFrameworks : [ URL ]
59
+
60
+ /// The contents of the module map for all frameworks associated with the pod.
61
+ var moduleMapContents : String
62
+
63
+ init ( version: String , dependencies: [ String ] , installedLocation: URL ) {
64
+ self . version = version
65
+ self . dependencies = dependencies
66
+ self . installedLocation = installedLocation
67
+ moduleMapContents = " "
68
+
69
+ // Get all the frameworks contained in this directory.
70
+ var binaryFrameworks : [ URL ] = [ ]
71
+ if installedLocation != LaunchArgs . shared. localPodspecPath {
72
+ do {
73
+ binaryFrameworks = try FileManager . default. recursivelySearch ( for: . frameworks,
74
+ in: installedLocation)
75
+ } catch {
76
+ fatalError ( " Cannot search for .framework files in Pods directory " +
77
+ " \( installedLocation) : \( error) " )
78
+ }
79
+ }
80
+ self . binaryFrameworks = binaryFrameworks
81
+ isSourcePod = binaryFrameworks == [ ]
82
+ }
52
83
}
53
84
54
85
/// Executes the `pod cache clean --all` command to remove any cached CocoaPods.
@@ -314,9 +345,11 @@ enum CocoaPodUtils {
314
345
""" // Explicit newline above to ensure it's included in the String.
315
346
}
316
347
348
+ if LaunchArgs . shared. dynamic {
349
+ podfile += " use_frameworks! \n "
350
+ }
317
351
// Include the minimum iOS version.
318
352
podfile += """
319
- use_frameworks!
320
353
platform :ios, ' \( LaunchArgs . shared. minimumIOSVersion) '
321
354
target 'FrameworkMaker' do \n
322
355
"""
0 commit comments